diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 21:38:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 21:38:38 +0000 |
commit | 2e2851dc13d73352530dd4495c7e05603b2e520d (patch) | |
tree | 622b9cd8e5d32091c9aa9e4937b533975a40356c /deluge/plugins/Label/deluge_label/gtkui/label_config.py | |
parent | Initial commit. (diff) | |
download | deluge-upstream.tar.xz deluge-upstream.zip |
Adding upstream version 2.1.2~dev0+20240219.upstream/2.1.2_dev0+20240219upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/plugins/Label/deluge_label/gtkui/label_config.py')
-rw-r--r-- | deluge/plugins/Label/deluge_label/gtkui/label_config.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/deluge/plugins/Label/deluge_label/gtkui/label_config.py b/deluge/plugins/Label/deluge_label/gtkui/label_config.py new file mode 100644 index 0000000..26c827e --- /dev/null +++ b/deluge/plugins/Label/deluge_label/gtkui/label_config.py @@ -0,0 +1,58 @@ +# +# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com> +# +# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with +# the additional special exception to link portions of this program with the OpenSSL library. +# See LICENSE for more details. +# + +import logging + +from gi.repository.Gtk import Builder + +from deluge.ui.client import client + +from ..common import get_resource + +log = logging.getLogger(__name__) + + +class LabelConfig: + """ + there used to be some options here... + """ + + def __init__(self, plugin): + self.plugin = plugin + + def load(self): + log.debug('Adding Label Preferences page') + builder = Builder() + builder.add_from_file(get_resource('label_pref.ui')) + + self.plugin.add_preferences_page( + _('Label'), builder.get_object('label_prefs_box') + ) + self.plugin.register_hook('on_show_prefs', self.load_settings) + self.plugin.register_hook('on_apply_prefs', self.on_apply_prefs) + + self.load_settings() + + def unload(self): + self.plugin.remove_preferences_page(_('Label')) + self.plugin.deregister_hook('on_apply_prefs', self.on_apply_prefs) + self.plugin.deregister_hook('on_show_prefs', self.load_settings) + + def load_settings(self, widget=None, data=None): + client.label.get_config().addCallback(self.cb_global_options) + + def cb_global_options(self, options): + log.debug('options=%s', options) + + # for id in self.chk_ids: + # self.glade.get_widget(id).set_active(bool(options[id])) + + def on_apply_prefs(self): + options = {} + # update options dict here. + client.label.set_config(options) |