1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# This file is in the public domain
6
# This is your preferences dialog.
8
# Define your preferences dictionary in the __init__.main() function.
9
# The widget names in the PreferencesTestProjectDialog.ui
10
# file need to correspond to the keys in the preferences dictionary.
12
# Each preference also need to be defined in the 'widget_methods' map below
13
# to show up in the dialog itself. Provide three bits of information:
14
# 1) The first entry is the method on the widget that grabs a value from the
16
# 2) The second entry is the method on the widget that sets the widgets value
17
# from a stored preference.
18
# 3) The third entry is a signal the widget will send when the contents have
19
# been changed by the user. The preferences dictionary is always up to
20
# date and will signal the rest of the application about these changes.
21
# The values will be saved to desktopcouch when the application closes.
23
# TODO: replace widget_methods with your own values
27
'example_entry': ['get_text', 'set_text', 'changed'],
31
from gettext import gettext as _
32
gettext.textdomain('ua0')
35
logger = logging.getLogger('ua0')
37
from ua0_lib.PreferencesDialog import PreferencesDialog
39
class PreferencesUa0Dialog(PreferencesDialog):
40
__gtype_name__ = "PreferencesUa0Dialog"
42
def finish_initializing(self, builder): # pylint: disable=E1002
43
"""Set up the preferences dialog"""
44
super(PreferencesUa0Dialog, self).finish_initializing(builder)
46
# populate the dialog from the preferences dictionary
47
# using the methods from widget_methods
48
self.widget_methods = widget_methods
49
self.set_widgets_from_preferences() # pylint: disable=E1101
51
# Code for other initialization actions should be added here.