2
# Copyright (C) 2012 <De Gaetano Andrea> <dega1999@yahoo.com>
3
# This program is free software: you can redistribute it and/or modify it
4
# under the terms of the GNU General Public License version 3, as published
5
# by the Free Software Foundation.
7
# This program is distributed in the hope that it will be useful, but
8
# WITHOUT ANY WARRANTY; without even the implied warranties of
9
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
10
# PURPOSE. See the GNU General Public License for more details.
12
# You should have received a copy of the GNU General Public License along
13
# with this program. If not, see <http://www.gnu.org/licenses/>.
16
"""this dialog adjusts values in gsettings
19
from gi.repository import Gtk # pylint: disable=E0611
21
logger = logging.getLogger('protoborsa_lib')
23
from . helpers import get_builder, show_uri, get_help_uri
25
class PreferencesDialog(Gtk.Dialog):
26
__gtype_name__ = "PreferencesDialog"
29
"""Special static method that's automatically called by Python when
30
constructing a new instance of this class.
32
Returns a fully instantiated PreferencesDialog object.
34
builder = get_builder('PreferencesProtoborsaDialog')
35
new_object = builder.get_object("preferences_protoborsa_dialog")
36
new_object.finish_initializing(builder)
39
def finish_initializing(self, builder):
40
"""Called while initializing this instance in __new__
42
finish_initalizing should be called after parsing the ui definition
43
and creating a PreferencesDialog object with it in order to
44
finish initializing the start of the new PerferencesProtoborsaDialog
47
Put your initialization code in here and leave __init__ undefined.
50
# Get a reference to the builder and set up the signals.
51
self.builder = builder
52
self.ui = builder.get_ui(self, True)
54
# code for other initialization actions should be added here
56
def on_btn_close_clicked(self, widget, data=None):
59
def on_btn_help_clicked(self, widget, data=None):
60
show_uri(self, "ghelp:%s" % get_help_uri('preferences'))