1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# Copyright (C) 2012 Phoenix87 <phoenix1987@gmail.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 is your preferences dialog.
19
# Define your preferences dictionary in the __init__.main() function.
20
# The widget names in the PreferencesTestProjectDialog.ui
21
# file need to correspond to the keys in the preferences dictionary.
23
# Each preference also need to be defined in the 'widget_methods' map below
24
# to show up in the dialog itself. Provide three bits of information:
25
# 1) The first entry is the method on the widget that grabs a value from the
27
# 2) The second entry is the method on the widget that sets the widgets value
28
# from a stored preference.
29
# 3) The third entry is a signal the widget will send when the contents have
30
# been changed by the user. The preferences dictionary is always up to
31
# date and will signal the rest of the application about these changes.
32
# The values will be saved to desktopcouch when the application closes.
34
# TODO: replace widget_methods with your own values
38
'chk_convert': ['get_active', 'set_active', 'toggled'],
42
from gettext import gettext as _
43
gettext.textdomain('gtumbler')
46
logger = logging.getLogger('gtumbler')
48
from gtumbler_lib.PreferencesDialog import PreferencesDialog
50
class PreferencesGtumblerDialog(PreferencesDialog):
51
__gtype_name__ = "PreferencesGtumblerDialog"
53
def finish_initializing(self, builder): # pylint: disable=E1002
54
"""Set up the preferences dialog"""
55
super(PreferencesGtumblerDialog, self).finish_initializing(builder)
57
# populate the dialog from the preferences dictionary
58
# using the methods from widget_methods
59
self.widget_methods = widget_methods
60
self.set_widgets_from_preferences() # pylint: disable=E1101
62
# Code for other initialization actions should be added here.