Added option for downloadview placement.
This commit is contained in:
parent
425cffc2f7
commit
2fa66ba250
@ -235,6 +235,11 @@ def data(readonly=False):
|
|||||||
SettingValue(typ.Perc(), '100%'),
|
SettingValue(typ.Perc(), '100%'),
|
||||||
"The default zoom level."),
|
"The default zoom level."),
|
||||||
|
|
||||||
|
('downloads-at-top',
|
||||||
|
SettingValue(typ.Bool(), 'true'),
|
||||||
|
"Whether to show downloaded files at top, "
|
||||||
|
"false will show at bottom."),
|
||||||
|
|
||||||
('message-timeout',
|
('message-timeout',
|
||||||
SettingValue(typ.Int(), '2000'),
|
SettingValue(typ.Int(), '2000'),
|
||||||
"Time (in ms) to show messages in the statusbar for."),
|
"Time (in ms) to show messages in the statusbar for."),
|
||||||
|
@ -90,19 +90,12 @@ class MainWindow(QWidget):
|
|||||||
self._vbox.setContentsMargins(0, 0, 0, 0)
|
self._vbox.setContentsMargins(0, 0, 0, 0)
|
||||||
self._vbox.setSpacing(0)
|
self._vbox.setSpacing(0)
|
||||||
|
|
||||||
log.init.debug("Initializing downloads...")
|
if config.get('ui', 'downloads-at-top'):
|
||||||
download_manager = downloads.DownloadManager(self.win_id, self)
|
self._init_downloadview()
|
||||||
objreg.register('download-manager', download_manager, scope='window',
|
self._init_tabbed_browser()
|
||||||
window=self.win_id)
|
else:
|
||||||
|
self._init_tabbed_browser()
|
||||||
self._downloadview = downloadview.DownloadView(self.win_id)
|
self._init_downloadview()
|
||||||
self._vbox.addWidget(self._downloadview)
|
|
||||||
self._downloadview.show()
|
|
||||||
|
|
||||||
self._tabbed_browser = tabbedbrowser.TabbedBrowser(self.win_id)
|
|
||||||
objreg.register('tabbed-browser', self._tabbed_browser, scope='window',
|
|
||||||
window=self.win_id)
|
|
||||||
self._vbox.addWidget(self._tabbed_browser)
|
|
||||||
|
|
||||||
# We need to set an explicit parent for StatusBar because it does some
|
# We need to set an explicit parent for StatusBar because it does some
|
||||||
# show/hide magic immediately which would mean it'd show up as a
|
# show/hide magic immediately which would mean it'd show up as a
|
||||||
@ -142,6 +135,22 @@ class MainWindow(QWidget):
|
|||||||
if section == 'completion' and option in ('height', 'shrink'):
|
if section == 'completion' and option in ('height', 'shrink'):
|
||||||
self.resize_completion()
|
self.resize_completion()
|
||||||
|
|
||||||
|
def _init_downloadview(self):
|
||||||
|
log.init.debug("Initializing downloads...")
|
||||||
|
download_manager = downloads.DownloadManager(self.win_id, self)
|
||||||
|
objreg.register('download-manager', download_manager, scope='window',
|
||||||
|
window=self.win_id)
|
||||||
|
|
||||||
|
self._downloadview = downloadview.DownloadView(self.win_id)
|
||||||
|
self._vbox.addWidget(self._downloadview)
|
||||||
|
self._downloadview.show()
|
||||||
|
|
||||||
|
def _init_tabbed_browser(self):
|
||||||
|
self._tabbed_browser = tabbedbrowser.TabbedBrowser(self.win_id)
|
||||||
|
objreg.register('tabbed-browser', self._tabbed_browser, scope='window',
|
||||||
|
window=self.win_id)
|
||||||
|
self._vbox.addWidget(self._tabbed_browser)
|
||||||
|
|
||||||
def _load_state_geometry(self):
|
def _load_state_geometry(self):
|
||||||
"""Load the geometry from the state file."""
|
"""Load the geometry from the state file."""
|
||||||
state_config = objreg.get('state-config')
|
state_config = objreg.get('state-config')
|
||||||
|
Loading…
Reference in New Issue
Block a user