This commit is contained in:
Florian Bruhin 2016-10-28 11:31:39 +02:00
parent 5ebaddfaf2
commit a87e46101c
3 changed files with 7 additions and 8 deletions

View File

@ -119,7 +119,7 @@ def create_full_filename(basename, filename):
return None return None
def ask_for_filename(suggested_filename, win_id, *, parent=None, def ask_for_filename(suggested_filename, *, parent=None,
prompt_download_directory=None): prompt_download_directory=None):
"""Prepare a question for a download-path. """Prepare a question for a download-path.
@ -133,7 +133,6 @@ def ask_for_filename(suggested_filename, win_id, *, parent=None,
Args: Args:
suggested_filename: The "default"-name that is pre-entered as path. suggested_filename: The "default"-name that is pre-entered as path.
win_id: The window where the question will be asked.
parent: The parent of the question (a QObject). parent: The parent of the question (a QObject).
prompt_download_directory: If this is something else than None, it prompt_download_directory: If this is something else than None, it
will overwrite the will overwrite the
@ -954,7 +953,7 @@ class DownloadManager(QObject):
# Neither filename nor fileobj were given, prepare a question # Neither filename nor fileobj were given, prepare a question
filename, q = ask_for_filename( filename, q = ask_for_filename(
suggested_filename, self._win_id, parent=self, suggested_filename, parent=self,
prompt_download_directory=prompt_download_directory, prompt_download_directory=prompt_download_directory,
) )

View File

@ -27,8 +27,7 @@ import sip
from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QTimer, QDir, QModelIndex, from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QTimer, QDir, QModelIndex,
QItemSelectionModel, QObject) QItemSelectionModel, QObject)
from PyQt5.QtWidgets import (QWidget, QGridLayout, QVBoxLayout, QLineEdit, from PyQt5.QtWidgets import (QWidget, QGridLayout, QVBoxLayout, QLineEdit,
QLabel, QWidgetItem, QFileSystemModel, QTreeView, QLabel, QFileSystemModel, QTreeView, QSizePolicy)
QSizePolicy)
from qutebrowser.config import style from qutebrowser.config import style
from qutebrowser.utils import usertypes, log, utils, qtutils, objreg, message from qutebrowser.utils import usertypes, log, utils, qtutils, objreg, message
@ -82,7 +81,8 @@ class PromptQueue(QObject):
_question: The current Question object if we're handling a question. _question: The current Question object if we're handling a question.
Signals: Signals:
show_prompts: Emitted with a Question object when prompts should be shown. show_prompts: Emitted with a Question object when prompts should be
shown.
""" """
show_prompts = pyqtSignal(usertypes.Question) show_prompts = pyqtSignal(usertypes.Question)
@ -395,7 +395,6 @@ class PromptContainer(QWidget):
pass pass
class LineEdit(QLineEdit): class LineEdit(QLineEdit):
"""A line edit used in prompts.""" """A line edit used in prompts."""
@ -774,6 +773,7 @@ class AlertPrompt(_BasePrompt):
def init(): def init():
"""Initialize global prompt objects."""
global prompt_queue global prompt_queue
prompt_queue = PromptQueue() prompt_queue = PromptQueue()
objreg.register('prompt-queue', prompt_queue) # for commands objreg.register('prompt-queue', prompt_queue) # for commands

View File

@ -26,7 +26,7 @@ import traceback
from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtCore import pyqtSignal, QObject
from qutebrowser.utils import usertypes, log, objreg, utils from qutebrowser.utils import usertypes, log, utils
def _log_stack(typ, stack): def _log_stack(typ, stack):