diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py index b93d89a45..a409cfcce 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py @@ -25,12 +25,12 @@ class CorePlugin(PluginInitBase): super(CorePlugin, self).__init__(plugin_name) -class GtkUIPlugin(PluginInitBase): +class Gtk3UIPlugin(PluginInitBase): def __init__(self, plugin_name): from .gtkui import GtkUI as _pluginCls self._plugin_cls = _pluginCls - super(GtkUIPlugin, self).__init__(plugin_name) + super(Gtk3UIPlugin, self).__init__(plugin_name) class WebUIPlugin(PluginInitBase): diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.ui b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.ui index e6ba56f4a..28be8b8f2 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.ui +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.ui @@ -1,6 +1,6 @@ - + -1 diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.ui b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.ui index c60e10f36..52aa4709e 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.ui +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.ui @@ -1,9 +1,12 @@ + - - + False + + + True diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py index 99a70c04f..6942996e1 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py @@ -17,14 +17,21 @@ from __future__ import unicode_literals import logging import os -import gtk +import gi # isort:skip (Required before Gtk import). +gi.require_version('Gtk', '3.0') # NOQA: E402 + +# isort:imports-thirdparty +from gi.repository import Gtk + +# isort:imports-firstparty import deluge.common import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client -from deluge.ui.gtkui import dialogs +from deluge.ui.gtk3 import dialogs +# isort:imports-localfolder from .common import get_resource log = logging.getLogger(__name__) @@ -47,14 +54,15 @@ class OptionsDialog(object): ] def __init__(self): - self.accounts = gtk.ListStore(str) - self.labels = gtk.ListStore(str) + log.critical('I') + self.accounts = Gtk.ListStore(str) + self.labels = Gtk.ListStore(str) self.core_config = {} def show(self, options=None, watchdir_id=None): if options is None: options = {} - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('autoadd_options.ui')) self.builder.connect_signals( { @@ -103,7 +111,7 @@ class OptionsDialog(object): self.accounts.clear() self.labels.clear() combobox = self.builder.get_object('OwnerCombobox') - combobox_render = gtk.CellRendererText() + combobox_render = Gtk.CellRendererText() combobox.pack_start(combobox_render, True) combobox.add_attribute(combobox_render, 'text', 0) combobox.set_model(self.accounts) @@ -413,10 +421,11 @@ class OptionsDialog(object): return options -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): + log.critical('A') - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('config.ui')) self.builder.connect_signals(self) self.opts_dialog = OptionsDialog() @@ -434,15 +443,15 @@ class GtkUI(GtkPluginBase): self.watchdirs = {} vbox = self.builder.get_object('watchdirs_vbox') - sw = gtk.ScrolledWindow() - sw.set_shadow_type(gtk.SHADOW_ETCHED_IN) - sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + sw = Gtk.ScrolledWindow() + sw.set_shadow_type(Gtk.ShadowType.ETCHED_IN) + sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) vbox.pack_start(sw, True, True, 0) self.store = self.create_model() - self.treeView = gtk.TreeView(self.store) + self.treeView = Gtk.TreeView(self.store) self.treeView.connect('cursor-changed', self.on_listitem_activated) self.treeView.connect('row-activated', self.on_edit_button_clicked) self.treeView.set_rules_hint(True) @@ -464,7 +473,7 @@ class GtkUI(GtkPluginBase): ) def create_model(self): - store = gtk.ListStore(str, bool, str, str) + store = Gtk.ListStore(str, bool, str, str) for watchdir_id, watchdir in self.watchdirs.items(): store.append( [ @@ -477,29 +486,29 @@ class GtkUI(GtkPluginBase): return store def create_columns(self, treeview): - renderer_toggle = gtk.CellRendererToggle() - column = gtk.TreeViewColumn( + renderer_toggle = Gtk.CellRendererToggle() + column = Gtk.TreeViewColumn( _('Active'), renderer_toggle, activatable=1, active=1 ) column.set_sort_column_id(1) treeview.append_column(column) - tt = gtk.Tooltip() + tt = Gtk.Tooltip() tt.set_text(_('Double-click to toggle')) treeview.set_tooltip_cell(tt, None, None, renderer_toggle) - renderertext = gtk.CellRendererText() - column = gtk.TreeViewColumn(_('Owner'), renderertext, text=2) + renderertext = Gtk.CellRendererText() + column = Gtk.TreeViewColumn(_('Owner'), renderertext, text=2) column.set_sort_column_id(2) treeview.append_column(column) - tt2 = gtk.Tooltip() + tt2 = Gtk.Tooltip() tt2.set_text(_('Double-click to edit')) treeview.set_has_tooltip(True) - renderertext = gtk.CellRendererText() - column = gtk.TreeViewColumn(_('Path'), renderertext, text=3) + renderertext = Gtk.CellRendererText() + column = Gtk.TreeViewColumn(_('Path'), renderertext, text=3) column.set_sort_column_id(3) treeview.append_column(column) - tt2 = gtk.Tooltip() + tt2 = Gtk.Tooltip() tt2.set_text(_('Double-click to edit')) treeview.set_has_tooltip(True) diff --git a/deluge/plugins/AutoAdd/setup.py b/deluge/plugins/AutoAdd/setup.py index 56a9b5bad..2fe68efb6 100644 --- a/deluge/plugins/AutoAdd/setup.py +++ b/deluge/plugins/AutoAdd/setup.py @@ -18,7 +18,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'AutoAdd' __author__ = 'Chase Sterling, Pedro Algarvio' __author_email__ = 'chase.sterling@gmail.com, pedro@algarvio.me' -__version__ = '1.7' +__version__ = '1.8' __url__ = 'http://dev.deluge-torrent.org/wiki/Plugins/AutoAdd' __license__ = 'GPLv3' __description__ = 'Monitors folders for .torrent files.' @@ -42,8 +42,8 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] - %s = deluge.plugins.%s:GtkUIPlugin + [deluge.plugin.gtk3ui] + %s = deluge.plugins.%s:Gtk3UIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin """ diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.ui b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.ui index ac5da9db7..e8b48c363 100644 --- a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.ui +++ b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.ui @@ -1,6 +1,6 @@ - + 1 diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py index ad73a45e6..24f7060fd 100644 --- a/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py +++ b/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py @@ -12,19 +12,26 @@ from __future__ import unicode_literals import logging from datetime import datetime -import gtk +import gi # isort:skip (Required before Gtk import). +gi.require_version('Gtk', '3.0') # NOQA: E402 + +# isort:imports-thirdparty +from gi.repository import Gtk + +# isort:imports-firstparty import deluge.common import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client +# isort:imports-localfolder from . import common log = logging.getLogger(__name__) -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): log.debug('Blocklist GtkUI enable..') self.plugin = component.get('PluginManager') @@ -151,7 +158,7 @@ class GtkUI(GtkPluginBase): def load_preferences_page(self): """Initializes the preferences page and adds it to the preferences dialog""" # Load the preferences page - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(common.get_resource('blocklist_pref.ui')) self.whitelist_frame = self.builder.get_object('whitelist_frame') @@ -203,12 +210,12 @@ class GtkUI(GtkPluginBase): treeview_selection.connect( 'changed', self.on_whitelist_treeview_selection_changed ) - self.whitelist_model = gtk.ListStore(str, bool) - renderer = gtk.CellRendererText() + self.whitelist_model = Gtk.ListStore(str, bool) + renderer = Gtk.CellRendererText() renderer.connect('edited', self.on_cell_edited, self.whitelist_model) renderer.set_data('ip', 0) - column = gtk.TreeViewColumn('IPs', renderer, text=0, editable=1) + column = Gtk.TreeViewColumn('IPs', renderer, text=0, editable=1) column.set_expand(True) self.whitelist_treeview.append_column(column) self.whitelist_treeview.set_model(self.whitelist_model) diff --git a/deluge/plugins/Blocklist/setup.py b/deluge/plugins/Blocklist/setup.py index 6d7f01253..1d21847d8 100644 --- a/deluge/plugins/Blocklist/setup.py +++ b/deluge/plugins/Blocklist/setup.py @@ -12,7 +12,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Blocklist' __author__ = 'John Garland' __author_email__ = 'johnnybg+deluge@gmail.com' -__version__ = '1.3' +__version__ = '1.4' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Download and import IP blocklists' @@ -35,7 +35,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.ui b/deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.ui index 646d87a71..cd9b4d4c0 100644 --- a/deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.ui +++ b/deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.ui @@ -1,6 +1,6 @@ - + diff --git a/deluge/plugins/Execute/deluge/plugins/execute/gtkui.py b/deluge/plugins/Execute/deluge/plugins/execute/gtkui.py index a2b4f5f68..04bb06862 100644 --- a/deluge/plugins/Execute/deluge/plugins/execute/gtkui.py +++ b/deluge/plugins/Execute/deluge/plugins/execute/gtkui.py @@ -11,16 +11,21 @@ from __future__ import unicode_literals import logging -import gtk +import gi # isort:skip (Required before Gtk import). +gi.require_version('Gtk', '3.0') # NOQA: E402 + +# isort:imports-thirdparty +from gi.repository import Gtk + +# isort:imports-firstparty import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client +# isort:imports-localfolder from . import common -# Relative import - log = logging.getLogger(__name__) EXECUTE_ID = 0 @@ -42,13 +47,13 @@ class ExecutePreferences(object): def load(self): log.debug('Adding Execute Preferences page') - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(common.get_resource('execute_prefs.ui')) self.builder.connect_signals(self) events = self.builder.get_object('event_combobox') - store = gtk.ListStore(str, str) + store = Gtk.ListStore(str, str) for event in EVENTS: event_label = EVENT_MAP[event] store.append((event_label, event)) @@ -78,17 +83,17 @@ class ExecutePreferences(object): def add_command(self, command_id, event, command): log.debug('Adding command `%s`', command_id) vbox = self.builder.get_object('commands_vbox') - hbox = gtk.HBox(False, 5) + hbox = Gtk.HBox(False, 5) hbox.set_name(command_id + '_' + event) - label = gtk.Label(EVENT_MAP[event]) - entry = gtk.Entry() + label = Gtk.Label(EVENT_MAP[event]) + entry = Gtk.Entry() entry.set_text(command) - button = gtk.Button() + button = Gtk.Button() button.set_name('remove_%s' % command_id) button.connect('clicked', self.on_remove_button_clicked) - img = gtk.Image() - img.set_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_BUTTON) + img = Gtk.Image() + img.set_from_stock(Gtk.STOCK_REMOVE, Gtk.IconSize.BUTTON) button.set_image(img) hbox.pack_start(label, False, False) @@ -137,7 +142,7 @@ class ExecutePreferences(object): for child in children: command_id, event = child.get_name().split('_') for widget in child.get_children(): - if isinstance(widget, gtk.Entry): + if isinstance(widget, Gtk.Entry): command = widget.get_text() client.execute.save_command(command_id, event, command) @@ -150,7 +155,7 @@ class ExecutePreferences(object): self.remove_command(command_id) -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): self.plugin = component.get('PluginManager') self.preferences = ExecutePreferences(self.plugin) diff --git a/deluge/plugins/Execute/setup.py b/deluge/plugins/Execute/setup.py index 5bee45635..d2156a8df 100644 --- a/deluge/plugins/Execute/setup.py +++ b/deluge/plugins/Execute/setup.py @@ -12,7 +12,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Execute' __author__ = 'Damien Churchill' __author_email__ = 'damoxc@gmail.com' -__version__ = '1.2' +__version__ = '1.3' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Plugin to execute a command upon an event' @@ -34,7 +34,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.ui b/deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.ui index 1652980eb..040e3d0e7 100644 --- a/deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.ui +++ b/deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.ui @@ -1,6 +1,6 @@ - + False diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py b/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py index aaae29a93..113b33f6d 100644 --- a/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py +++ b/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py @@ -15,20 +15,27 @@ from __future__ import unicode_literals import logging -import gtk +import gi # isort:skip (Required before Gtk import). +gi.require_version('Gtk', '3.0') # NOQA: E402 + +# isort:imports-thirdparty +from gi.repository import Gtk + +# isort:imports-firstparty import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client +# isort:imports-localfolder from .common import get_resource log = logging.getLogger(__name__) -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('extractor_prefs.ui')) component.get('Preferences').add_page( diff --git a/deluge/plugins/Extractor/setup.py b/deluge/plugins/Extractor/setup.py index 7426c690a..dded10238 100644 --- a/deluge/plugins/Extractor/setup.py +++ b/deluge/plugins/Extractor/setup.py @@ -16,7 +16,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Extractor' __author__ = 'Andrew Resch' __author_email__ = 'andrewresch@gmail.com' -__version__ = '0.6' +__version__ = '0.7' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Extract files upon torrent completion' @@ -47,7 +47,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_add.ui b/deluge/plugins/Label/deluge/plugins/label/data/label_add.ui index 1e46cfcae..886150317 100644 --- a/deluge/plugins/Label/deluge/plugins/label/data/label_add.ui +++ b/deluge/plugins/Label/deluge/plugins/label/data/label_add.ui @@ -1,6 +1,6 @@ - + False @@ -25,7 +25,6 @@ gtk-cancel - False True True True @@ -41,7 +40,6 @@ gtk-ok - False True True True diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_options.ui b/deluge/plugins/Label/deluge/plugins/label/data/label_options.ui index 883476115..54949a759 100644 --- a/deluge/plugins/Label/deluge/plugins/label/data/label_options.ui +++ b/deluge/plugins/Label/deluge/plugins/label/data/label_options.ui @@ -1,6 +1,6 @@ - + -1 @@ -59,7 +59,6 @@ gtk-cancel - False True True True @@ -75,7 +74,6 @@ gtk-ok - False True True True @@ -379,7 +377,6 @@ Apply per torrent max settings: - False True True False @@ -432,7 +429,6 @@ Auto Managed - False True True False @@ -446,7 +442,6 @@ Stop seed at ratio: - False True True False @@ -462,7 +457,6 @@ Remove at ratio - False True True False @@ -529,7 +523,6 @@ Apply Queue settings: - False True True False @@ -573,7 +566,6 @@ Move completed to: - False True True False @@ -631,7 +623,6 @@ Apply folder settings: - False True True False @@ -711,7 +702,6 @@ Automatically apply label: - False True True False diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_pref.ui b/deluge/plugins/Label/deluge/plugins/label/data/label_pref.ui index 4123f33da..04a892357 100644 --- a/deluge/plugins/Label/deluge/plugins/label/data/label_pref.ui +++ b/deluge/plugins/Label/deluge/plugins/label/data/label_pref.ui @@ -1,6 +1,6 @@ - + False diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py b/deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py index 7d205b0fe..eeaeadcc8 100644 --- a/deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py +++ b/deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py @@ -12,7 +12,7 @@ from __future__ import unicode_literals import logging from deluge import component # for systray -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from . import label_config, sidebar_menu, submenu @@ -25,7 +25,7 @@ def cell_data_label(column, cell, model, row, data): cell.set_property('text', str(model.get_value(row, data))) -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def start(self): if self.label_menu: self.label_menu.on_show() diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py b/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py index 507be5afa..b1bf56de6 100644 --- a/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py +++ b/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py @@ -11,7 +11,7 @@ from __future__ import unicode_literals import logging -from gtk import Builder +from gi.repository.Gtk import Builder from deluge.ui.client import client diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py b/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py index 04df45ae0..1fb9ce39c 100644 --- a/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py +++ b/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py @@ -12,11 +12,18 @@ from __future__ import unicode_literals import logging -import gtk +import gi # isort:skip (Required before Gtk import). +gi.require_version('Gtk', '3.0') # NOQA: E402 + +# isort:imports-thirdparty +from gi.repository import Gtk + +# isort:imports-firstparty import deluge.component as component from deluge.ui.client import client +# isort:imports-localfolder from ..common import get_resource log = logging.getLogger(__name__) @@ -33,12 +40,12 @@ class LabelSidebarMenu(object): self.items = [] # add items, in reverse order, because they are prepended. - sep = gtk.SeparatorMenuItem() + sep = Gtk.SeparatorMenuItem() self.items.append(sep) self.menu.prepend(sep) - self._add_item('options', _('Label _Options'), gtk.STOCK_PREFERENCES) - self._add_item('remove', _('_Remove Label'), gtk.STOCK_REMOVE) - self._add_item('add', _('_Add Label'), gtk.STOCK_ADD) + self._add_item('options', _('Label _Options'), Gtk.STOCK_PREFERENCES) + self._add_item('remove', _('_Remove Label'), Gtk.STOCK_REMOVE) + self._add_item('add', _('_Add Label'), Gtk.STOCK_ADD) self.menu.show_all() # dialogs: @@ -52,7 +59,7 @@ class LabelSidebarMenu(object): id is automatically-added as self.item_ """ func = getattr(self, 'on_%s' % item_id) - item = gtk.ImageMenuItem(stock) + item = Gtk.ImageMenuItem(stock) item.get_children()[0].set_label(label) item.connect('activate', func) self.menu.prepend(item) @@ -106,7 +113,7 @@ class AddDialog(object): pass def show(self): - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('label_add.ui')) self.dialog = self.builder.get_object('dlg_label_add') self.dialog.set_transient_for(component.get('MainWindow').window) @@ -161,7 +168,7 @@ class OptionsDialog(object): def show(self, label): self.label = label - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('label_options.ui')) self.dialog = self.builder.get_object('dlg_label_options') self.dialog.set_transient_for(component.get('MainWindow').window) diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py b/deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py index fb0474f4d..b2df91fcd 100644 --- a/deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py +++ b/deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py @@ -12,7 +12,7 @@ from __future__ import unicode_literals import logging -import gtk +from gi.repository.Gtk import Menu, MenuItem from deluge import component # for systray from deluge.ui.client import client @@ -29,11 +29,11 @@ NO_LABEL = _('No Label') del _ -class LabelMenu(gtk.MenuItem): +class LabelMenu(MenuItem): def __init__(self): - gtk.MenuItem.__init__(self, _('Label')) + MenuItem.__init__(self, _('Label')) - self.sub_menu = gtk.Menu() + self.sub_menu = Menu() self.set_submenu(self.sub_menu) self.items = [] @@ -52,9 +52,9 @@ class LabelMenu(gtk.MenuItem): self.sub_menu.remove(child) for label in [NO_LABEL] + list(labels): if label == NO_LABEL: - item = gtk.MenuItem(_(NO_LABEL)) + item = MenuItem(_(NO_LABEL)) else: - item = gtk.MenuItem(label.replace('_', '__')) + item = MenuItem(label.replace('_', '__')) item.connect('activate', self.on_select_label, label) self.sub_menu.append(item) self.show_all() diff --git a/deluge/plugins/Label/setup.py b/deluge/plugins/Label/setup.py index c20705a69..a6907563b 100644 --- a/deluge/plugins/Label/setup.py +++ b/deluge/plugins/Label/setup.py @@ -12,7 +12,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Label' __author__ = 'Martijn Voncken' __author_email__ = 'mvoncken@gmail.com' -__version__ = '0.2' +__version__ = '0.3' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Allows labels to be assigned to torrents' @@ -38,7 +38,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py b/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py index f61649dbe..ad6931a6a 100644 --- a/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py +++ b/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py @@ -23,7 +23,7 @@ from twisted.internet import defer import deluge.common import deluge.component as component import deluge.configmanager -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client from .common import CustomNotifications, get_resource @@ -245,9 +245,9 @@ class GtkUiNotifications(CustomNotifications): return title, message -class GtkUI(GtkPluginBase, GtkUiNotifications): +class GtkUI(Gtk3PluginBase, GtkUiNotifications): def __init__(self, plugin_name): - GtkPluginBase.__init__(self, plugin_name) + Gtk3PluginBase.__init__(self, plugin_name) GtkUiNotifications.__init__(self) def enable(self): diff --git a/deluge/plugins/Notifications/setup.py b/deluge/plugins/Notifications/setup.py index b24178047..c96999c98 100755 --- a/deluge/plugins/Notifications/setup.py +++ b/deluge/plugins/Notifications/setup.py @@ -17,7 +17,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Notifications' __author__ = 'Pedro Algarvio' __author_email__ = 'pedro@algarvio.me' -__version__ = '0.2' +__version__ = '0.3' __url__ = 'http://dev.deluge-torrent.org/' __license__ = 'GPLv3' __description__ = 'Plugin which provides notifications to Deluge.' @@ -46,7 +46,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py b/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py index 2525a5f9e..8aa68b345 100644 --- a/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py +++ b/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py @@ -18,7 +18,7 @@ import logging import gtk import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client from .common import get_resource @@ -167,7 +167,7 @@ class SchedulerSelectWidget(gtk.DrawingArea): self.hover_point = [-1, -1] -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): self.create_prefs_page() diff --git a/deluge/plugins/Scheduler/setup.py b/deluge/plugins/Scheduler/setup.py index 16fadd067..4d62051fe 100644 --- a/deluge/plugins/Scheduler/setup.py +++ b/deluge/plugins/Scheduler/setup.py @@ -16,7 +16,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Scheduler' __author__ = 'Andrew Resch' __author_email__ = 'andrewresch@gmail.com' -__version__ = '0.2' +__version__ = '0.3' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Schedule limits on a per-hour per-day basis.' @@ -38,7 +38,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Stats/deluge/plugins/stats/data/config.ui b/deluge/plugins/Stats/deluge/plugins/stats/data/config.ui index 68958c15a..25fc029db 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/data/config.ui +++ b/deluge/plugins/Stats/deluge/plugins/stats/data/config.ui @@ -1,6 +1,6 @@ - + False @@ -28,7 +28,6 @@ 15 - False True True True @@ -68,7 +67,6 @@ - False True True True @@ -110,7 +108,6 @@ - False True True True @@ -138,7 +135,6 @@ - False True True True @@ -190,7 +186,6 @@ - False True True True @@ -206,7 +201,6 @@ - False True True True @@ -236,7 +230,6 @@ - False True True True diff --git a/deluge/plugins/Stats/deluge/plugins/stats/graph.py b/deluge/plugins/Stats/deluge/plugins/stats/graph.py index d0d1e83c6..847c253d1 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/graph.py +++ b/deluge/plugins/Stats/deluge/plugins/stats/graph.py @@ -20,7 +20,7 @@ import logging import math import time -import cairo +from gi.repository import cairo log = logging.getLogger(__name__) diff --git a/deluge/plugins/Stats/deluge/plugins/stats/gtkui.py b/deluge/plugins/Stats/deluge/plugins/stats/gtkui.py index f7083773e..75e30150e 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/gtkui.py +++ b/deluge/plugins/Stats/deluge/plugins/stats/gtkui.py @@ -16,34 +16,39 @@ from __future__ import division, unicode_literals import logging -import gtk +from gi.repository import Gtk +from gi.repository.Gdk import RGBA import deluge from deluge import component from deluge.common import fspeed -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client -from deluge.ui.gtkui.torrentdetails import Tab +from deluge.ui.gtk3.torrentdetails import Tab from .common import get_resource from .graph import Graph, size_formatter_scale log = logging.getLogger(__name__) +# Gdk.RGBA textual spec +RED = 'rgb(255,0,0)' +GREEN = 'rgb(0,128,0)' +BLUE = 'rgb(0,0,255)' +DARKRED = 'rgb(139,0,0)' +ORANGE = 'rgb(255,165,0)' + DEFAULT_CONF = { - 'version': 1, + 'version': 2, 'colors': { - 'bandwidth_graph': { - 'upload_rate': str(gtk.gdk.Color('blue')), - 'download_rate': str(gtk.gdk.Color('green')), - }, + 'bandwidth_graph': {'upload_rate': BLUE, 'download_rate': GREEN}, 'connections_graph': { - 'dht_nodes': str(gtk.gdk.Color('orange')), - 'dht_cache_nodes': str(gtk.gdk.Color('blue')), - 'dht_torrents': str(gtk.gdk.Color('green')), - 'num_connections': str(gtk.gdk.Color('darkred')), + 'dht_nodes': ORANGE, + 'dht_cache_nodes': BLUE, + 'dht_torrents': GREEN, + 'num_connections': DARKRED, }, - 'seeds_graph': {'num_peers': str(gtk.gdk.Color('blue'))}, + 'seeds_graph': {'num_peers': BLUE}, }, } @@ -71,20 +76,18 @@ def fspeed_shortform(value): return fspeed(value, shortform=True) -def gtk_to_graph_color(color): - """Turns a gtk.gdk.Color into a tuple with range 0-1 as used by the graph""" - gtk_color = gtk.gdk.Color(color) - red = gtk_color.red / 65535 - green = gtk_color.green / 65535 - blue = gtk_color.blue / 65535 - return (red, green, blue) +def text_to_rgba(color): + """Turns a Color into a tuple with range 0-1 as used by the graph""" + color_rgba = RGBA() + color_rgba.parse(color) + return color_rgba class GraphsTab(Tab): def __init__(self, colors): super(GraphsTab, self).__init__() - builder = gtk.Builder() + builder = Gtk.Builder() builder.add_from_file(get_resource('tabs.ui')) self.window = builder.get_object('graph_tab') self.notebook = builder.get_object('graph_notebook') @@ -97,13 +100,13 @@ class GraphsTab(Tab): self.colors = colors self.bandwidth_graph = builder.get_object('bandwidth_graph') - self.bandwidth_graph.connect('expose_event', self.graph_expose) + self.bandwidth_graph.connect('draw', self.on_graph_draw) self.connections_graph = builder.get_object('connections_graph') - self.connections_graph.connect('expose_event', self.graph_expose) + self.connections_graph.connect('draw', self.on_graph_draw) self.seeds_graph = builder.get_object('seeds_graph') - self.seeds_graph.connect('expose_event', self.graph_expose) + self.seeds_graph.connect('draw', self.on_graph_draw) self.notebook.connect('switch-page', self._on_notebook_switch_page) @@ -115,26 +118,20 @@ class GraphsTab(Tab): self.intervals = None self.intervals_combo = builder.get_object('combo_intervals') - cell = gtk.CellRendererText() + cell = Gtk.CellRendererText() self.intervals_combo.pack_start(cell, True) self.intervals_combo.set_cell_data_func(cell, neat_time) self.intervals_combo.connect('changed', self._on_selected_interval_changed) self.update_intervals() - def graph_expose(self, widget, event): - context = self.graph_widget.window.cairo_create() - # set a clip region - context.rectangle( - event.area.x, event.area.y, event.area.width, event.area.height - ) - context.clip() + def on_graph_draw(self, widget, context): self.graph.draw_to_context( context, - self.graph_widget.allocation.width, - self.graph_widget.allocation.height, + self.graph_widget.get_allocated_width(), + self.graph_widget.get_allocated_height(), ) # Do not propagate the event - return False + return True def update(self): d1 = client.stats.get_stats(list(self.graph.stat_info), self.selected_interval) @@ -161,12 +158,12 @@ class GraphsTab(Tab): self.graph.add_stat( 'download_rate', label='Download Rate', - color=gtk_to_graph_color(colors['download_rate']), + color=text_to_rgba(colors['download_rate']), ) self.graph.add_stat( 'upload_rate', label='Upload Rate', - color=gtk_to_graph_color(colors['upload_rate']), + color=text_to_rgba(colors['upload_rate']), ) self.graph.set_left_axis( formatter=fspeed_shortform, min=10240, formatter_scale=size_formatter_scale @@ -178,14 +175,10 @@ class GraphsTab(Tab): g = Graph() self.graph = g colors = self.colors['connections_graph'] - g.add_stat('dht_nodes', color=gtk_to_graph_color(colors['dht_nodes'])) - g.add_stat( - 'dht_cache_nodes', color=gtk_to_graph_color(colors['dht_cache_nodes']) - ) - g.add_stat('dht_torrents', color=gtk_to_graph_color(colors['dht_torrents'])) - g.add_stat( - 'num_connections', color=gtk_to_graph_color(colors['num_connections']) - ) + g.add_stat('dht_nodes', color=text_to_rgba(colors['dht_nodes'])) + g.add_stat('dht_cache_nodes', color=text_to_rgba(colors['dht_cache_nodes'])) + g.add_stat('dht_torrents', color=text_to_rgba(colors['dht_torrents'])) + g.add_stat('num_connections', color=text_to_rgba(colors['num_connections'])) g.set_left_axis(formatter=int_str, min=10) def select_seeds_graph(self): @@ -193,7 +186,7 @@ class GraphsTab(Tab): self.graph_widget = self.seeds_graph self.graph = Graph() colors = self.colors['seeds_graph'] - self.graph.add_stat('num_peers', color=gtk_to_graph_color(colors['num_peers'])) + self.graph.add_stat('num_peers', color=text_to_rgba(colors['num_peers'])) self.graph.set_left_axis(formatter=int_str, min=10) def set_colors(self, colors): @@ -204,7 +197,7 @@ class GraphsTab(Tab): ) def _on_intervals_changed(self, intervals): - liststore = gtk.ListStore(int) + liststore = Gtk.ListStore(int) for inter in intervals: liststore.append([inter]) self.intervals_combo.set_model(liststore) @@ -236,14 +229,14 @@ class GraphsTab(Tab): return True -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): log.debug('Stats plugin enable called') self.config = deluge.configmanager.ConfigManager( - 'stats.gtkui.conf', DEFAULT_CONF + 'stats.gtk3ui.conf', DEFAULT_CONF ) - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('config.ui')) component.get('Preferences').add_page( @@ -277,9 +270,9 @@ class GtkUI(GtkPluginBase): for graph, colors in self.config['colors'].items(): gtkconf[graph] = {} for value, color in colors.items(): + color_btn = self.builder.get_object('%s_%s_color' % (graph, value)) try: - color_btn = self.builder.get_object('%s_%s_color' % (graph, value)) - gtkconf[graph][value] = str(color_btn.get_color()) + gtkconf[graph][value] = color_btn.get_color().to_string() except Exception: gtkconf[graph][value] = DEFAULT_CONF['colors'][graph][value] self.config['colors'] = gtkconf @@ -293,9 +286,9 @@ class GtkUI(GtkPluginBase): for value, color in colors.items(): try: color_btn = self.builder.get_object('%s_%s_color' % (graph, value)) - color_btn.set_color(gtk.gdk.Color(color)) - except Exception: - log.debug('Unable to set %s %s %s', graph, value, color) + color_btn.set_rgba(text_to_rgba(color)) + except Exception as ex: + log.debug('Unable to set %s %s %s: %s', graph, value, color, ex) client.stats.get_config().addCallback(self.cb_get_config) def cb_get_config(self, config): diff --git a/deluge/plugins/Stats/setup.py b/deluge/plugins/Stats/setup.py index a3eeb9769..65d36941e 100644 --- a/deluge/plugins/Stats/setup.py +++ b/deluge/plugins/Stats/setup.py @@ -17,7 +17,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Stats' __author__ = 'Ian Martin' __author_email__ = 'ianmartin@cantab.net' -__version__ = '0.3.2' +__version__ = '0.4' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Display stats graphs' @@ -42,7 +42,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py b/deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py index 1be3faef7..c54bca46f 100644 --- a/deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py +++ b/deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py @@ -17,13 +17,13 @@ from __future__ import unicode_literals import logging import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client log = logging.getLogger(__name__) -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): self.core = client.toggle self.plugin = component.get('PluginManager') diff --git a/deluge/plugins/Toggle/setup.py b/deluge/plugins/Toggle/setup.py index 3dcf83f4d..54d9ee228 100644 --- a/deluge/plugins/Toggle/setup.py +++ b/deluge/plugins/Toggle/setup.py @@ -17,7 +17,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'Toggle' __author__ = 'John Garland' __author_email__ = 'johnnybg+deluge@gmail.com' -__version__ = '0.3' +__version__ = '0.4' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Toggles the session' @@ -39,7 +39,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.web] %s = deluge.plugins.%s:WebUIPlugin diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/data/config.ui b/deluge/plugins/WebUi/deluge/plugins/webui/data/config.ui index 04b73ecdf..101f60d0c 100644 --- a/deluge/plugins/WebUi/deluge/plugins/webui/data/config.ui +++ b/deluge/plugins/WebUi/deluge/plugins/webui/data/config.ui @@ -1,6 +1,6 @@ - + 99999 diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py b/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py index f72769868..3697a1d00 100644 --- a/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py +++ b/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py @@ -15,10 +15,10 @@ from __future__ import unicode_literals import logging -import gtk +from gi.repository import Gtk import deluge.component as component -from deluge.plugins.pluginbase import GtkPluginBase +from deluge.plugins.pluginbase import Gtk3PluginBase from deluge.ui.client import client from .common import get_resource @@ -26,9 +26,9 @@ from .common import get_resource log = logging.getLogger(__name__) -class GtkUI(GtkPluginBase): +class GtkUI(Gtk3PluginBase): def enable(self): - self.builder = gtk.Builder() + self.builder = Gtk.Builder() self.builder.add_from_file(get_resource('config.ui')) component.get('Preferences').add_page( @@ -80,14 +80,14 @@ class GtkUI(GtkPluginBase): vbox = self.builder.get_object('prefs_box') - hbox = gtk.HBox() - icon = gtk.image_new_from_stock( - gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_SMALL_TOOLBAR + hbox = Gtk.HBox() + icon = Gtk.image_new_from_stock( + Gtk.STOCK_DIALOG_ERROR, Gtk.IconSize.SMALL_TOOLBAR ) icon.set_padding(5, 5) - hbox.pack_start(icon, False, False) + hbox.pack_start(icon, False, False, 0) - label = gtk.Label( + label = Gtk.Label( _( 'The Deluge web interface is not installed, ' 'please install the\ninterface and try again' @@ -95,7 +95,7 @@ class GtkUI(GtkPluginBase): ) label.set_alignment(0, 0.5) label.set_padding(5, 5) - hbox.pack_start(label) + hbox.pack_start(label, False, False, 0) vbox.pack_start(hbox, False, False, 10) vbox.reorder_child(hbox, 0) diff --git a/deluge/plugins/WebUi/setup.py b/deluge/plugins/WebUi/setup.py index 646467882..3c110c8ed 100644 --- a/deluge/plugins/WebUi/setup.py +++ b/deluge/plugins/WebUi/setup.py @@ -16,7 +16,7 @@ from setuptools import find_packages, setup __plugin_name__ = 'WebUi' __author__ = 'Damien Churchill' __author_email__ = 'damoxc@gmail.com' -__version__ = '0.1' +__version__ = '0.2' __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Allows starting the web interface within the daemon.' @@ -38,7 +38,7 @@ setup( entry_points=""" [deluge.plugin.core] %s = deluge.plugins.%s:CorePlugin - [deluge.plugin.gtkui] + [deluge.plugin.gtk3ui] %s = deluge.plugins.%s:GtkUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 2), diff --git a/deluge/plugins/pluginbase.py b/deluge/plugins/pluginbase.py index 4ae268d68..a17ae2d81 100644 --- a/deluge/plugins/pluginbase.py +++ b/deluge/plugins/pluginbase.py @@ -47,16 +47,16 @@ class CorePluginBase(PluginBase): super(CorePluginBase, self).disable() -class GtkPluginBase(PluginBase): +class Gtk3PluginBase(PluginBase): def __init__(self, plugin_name): - super(GtkPluginBase, self).__init__('GtkPlugin.' + plugin_name) - log.debug('GtkPlugin initialized..') + super(Gtk3PluginBase, self).__init__('Gtk3Plugin.' + plugin_name) + log.debug('Gtk3Plugin initialized..') def enable(self): - super(GtkPluginBase, self).enable() + super(Gtk3PluginBase, self).enable() def disable(self): - super(GtkPluginBase, self).disable() + super(Gtk3PluginBase, self).disable() class WebPluginBase(PluginBase): diff --git a/deluge/ui/gtk3/pluginmanager.py b/deluge/ui/gtk3/pluginmanager.py index 75a62f825..d60f8d390 100644 --- a/deluge/ui/gtk3/pluginmanager.py +++ b/deluge/ui/gtk3/pluginmanager.py @@ -24,7 +24,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase, component.Compon component.Component.__init__(self, 'PluginManager') self.config = ConfigManager('gtk3ui.conf') deluge.pluginmanagerbase.PluginManagerBase.__init__( - self, 'gtk3ui.conf', 'deluge.plugin.gtk3' + self, 'gtk3ui.conf', 'deluge.plugin.gtk3ui' ) self.hooks = {'on_apply_prefs': [], 'on_show_prefs': []}