~allison/ubuntu-app-review-board/dostuff

« back to all changes in this revision

Viewing changes to dostuff/PreferencesDostuffDialog.py

  • Committer: Luca Marchetti
  • Date: 2012-07-09 13:35:39 UTC
  • Revision ID: ximilian@gmail.com-20120709133539-m4p5kh2jr0tylgdx
commit before release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
 
### BEGIN LICENSE
3
 
# This file is in the public domain
4
 
### END LICENSE
5
 
 
6
 
# This is your preferences dialog.
7
 
#
8
 
# Define your preferences in
9
 
# data/glib-2.0/schemas/net.launchpad.dostuff.gschema.xml
10
 
# See http://developer.gnome.org/gio/stable/GSettings.html for more info.
11
 
 
12
 
from gi.repository import Gio # pylint: disable=E0611
13
 
 
14
 
import gettext
15
 
from gettext import gettext as _
16
 
gettext.textdomain('dostuff')
17
 
 
18
 
import logging
19
 
logger = logging.getLogger('dostuff')
20
 
 
21
 
from dostuff_lib.PreferencesDialog import PreferencesDialog
22
 
 
23
 
class PreferencesDostuffDialog(PreferencesDialog):
24
 
    __gtype_name__ = "PreferencesDostuffDialog"
25
 
 
26
 
    def finish_initializing(self, builder): # pylint: disable=E1002
27
 
        """Set up the preferences dialog"""
28
 
        super(PreferencesDostuffDialog, self).finish_initializing(builder)
29
 
 
30
 
        # Bind each preference widget to gsettings
31
 
        settings = Gio.Settings("net.launchpad.dostuff")
32
 
        widget = self.builder.get_object('example_entry')
33
 
        settings.bind("example", widget, "text", Gio.SettingsBindFlags.DEFAULT)
34
 
 
35
 
        # Code for other initialization actions should be added here.