1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# Copyright (C) 2012 Sandy Walsh <sandy@darksecretsoftware.com>
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License version 3, as published
6
# by the Free Software Foundation.
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranties of
10
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
# PURPOSE. See the GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License along
14
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
"""this dialog adjusts values in gsettings
20
from gi.repository import Gtk # pylint: disable=E0611
22
logger = logging.getLogger('darksecret_lib')
24
from . helpers import get_builder, show_uri, get_help_uri
26
class PreferencesDialog(Gtk.Dialog):
27
__gtype_name__ = "PreferencesDialog"
30
"""Special static method that's automatically called by Python when
31
constructing a new instance of this class.
33
Returns a fully instantiated PreferencesDialog object.
35
builder = get_builder('PreferencesDarksecretDialog')
36
new_object = builder.get_object("preferences_darksecret_dialog")
37
new_object.finish_initializing(builder)
40
def finish_initializing(self, builder):
41
"""Called while initializing this instance in __new__
43
finish_initalizing should be called after parsing the ui definition
44
and creating a PreferencesDialog object with it in order to
45
finish initializing the start of the new PerferencesDarksecretDialog
48
Put your initialization code in here and leave __init__ undefined.
51
# Get a reference to the builder and set up the signals.
52
self.builder = builder
53
self.ui = builder.get_ui(self, True)
55
# code for other initialization actions should be added here
57
def on_btn_close_clicked(self, widget, data=None):
60
def on_btn_help_clicked(self, widget, data=None):
61
show_uri(self, "ghelp:%s" % get_help_uri('preferences'))