~fioan89/slidewall/quickly_trunk

« back to all changes in this revision

Viewing changes to slidewall_lib/PreferencesDialog.py

  • Committer: fioan89 at gmail
  • Date: 2013-06-09 18:13:43 UTC
  • Revision ID: fioan89@gmail.com-20130609181343-jc472vs3si41y2h0
Fix wallbase.cc plus vladstudio analog clocks.

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
# Copyright (C) 2012 fioan89@gmail.com <fioan89@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.
 
7
 
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.
 
12
 
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/>.
 
15
### END LICENSE
 
16
 
 
17
### DO NOT EDIT THIS FILE ###
 
18
 
 
19
"""this dialog adjusts values in gsettings
 
20
"""
 
21
 
 
22
from gi.repository import Gtk # pylint: disable=E0611
 
23
import logging
 
24
logger = logging.getLogger('slidewall_lib')
 
25
 
 
26
from . helpers import get_builder, show_uri, get_help_uri
 
27
 
 
28
class PreferencesDialog(Gtk.Dialog):
 
29
    __gtype_name__ = "PreferencesDialog"
 
30
 
 
31
    def __new__(cls):
 
32
        """Special static method that's automatically called by Python when 
 
33
        constructing a new instance of this class.
 
34
        
 
35
        Returns a fully instantiated PreferencesDialog object.
 
36
        """
 
37
        builder = get_builder('PreferencesSlidewallDialog')
 
38
        new_object = builder.get_object("preferences_slidewall_dialog")
 
39
        new_object.finish_initializing(builder)
 
40
        return new_object
 
41
 
 
42
    def finish_initializing(self, builder):
 
43
        """Called while initializing this instance in __new__
 
44
 
 
45
        finish_initalizing should be called after parsing the ui definition
 
46
        and creating a PreferencesDialog object with it in order to
 
47
        finish initializing the start of the new PerferencesSlidewallDialog
 
48
        instance.
 
49
        
 
50
        Put your initialization code in here and leave __init__ undefined.
 
51
        """
 
52
 
 
53
        # Get a reference to the builder and set up the signals.
 
54
        self.builder = builder
 
55
        self.ui = builder.get_ui(self, True)
 
56
 
 
57
        # code for other initialization actions should be added here
 
58
 
 
59
    def on_btn_close_clicked(self, widget, data=None):
 
60
        self.destroy()
 
61
 
 
62
    def on_btn_help_clicked(self, widget, data=None):
 
63
        show_uri(self, "ghelp:%s" % get_help_uri('preferences'))
 
64