Merge branch 'Carpetsmoker-save-fifo'
This commit is contained in:
commit
c32d80c7bc
@ -296,10 +296,10 @@ class DownloadItem(QObject):
|
||||
else:
|
||||
self.set_fileobj(fileobj)
|
||||
|
||||
def _ask_overwrite_question(self):
|
||||
def _ask_confirm_question(self, msg):
|
||||
"""Create a Question object to be asked."""
|
||||
q = usertypes.Question(self)
|
||||
q.text = self._filename + " already exists. Overwrite? (y/n)"
|
||||
q.text = msg + ' (N/y)'
|
||||
q.mode = usertypes.PromptMode.yesno
|
||||
q.answered_yes.connect(self._create_fileobj)
|
||||
q.answered_no.connect(functools.partial(self.cancel, False))
|
||||
@ -452,7 +452,14 @@ class DownloadItem(QObject):
|
||||
if os.path.isfile(self._filename):
|
||||
# The file already exists, so ask the user if it should be
|
||||
# overwritten.
|
||||
self._ask_overwrite_question()
|
||||
txt = self._filename + " already exists. Overwrite?"
|
||||
self._ask_confirm_question(txt)
|
||||
# FIFO, device node, etc. Make sure we want to do this
|
||||
elif (os.path.exists(self._filename) and not
|
||||
os.path.isdir(self._filename)):
|
||||
txt = (self._filename + " already exists and is a special file. "
|
||||
"Write to this?")
|
||||
self._ask_confirm_question(txt)
|
||||
else:
|
||||
self._create_fileobj()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user