~ubuntu-app-review-contributors/ubuntu-app-reviews/01

« back to all changes in this revision

Viewing changes to build/lib.linux-i686-2.7/protoborsa_lib/PreferencesDialog.py

  • Committer: crazycoder
  • Date: 2012-07-08 11:12:14 UTC
  • Revision ID: crazycoder@gmail.com-20120708111214-40dyl3gv8dlsp4pt
quickly saved

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
### BEGIN LICENSE
2
 
# Copyright (C) 2012 <De Gaetano Andrea> <dega1999@yahoo.com>
3
 
# This program is free software: you can redistribute it and/or modify it 
4
 
# under the terms of the GNU General Public License version 3, as published 
5
 
# by the Free Software Foundation.
6
 
7
 
# This program is distributed in the hope that it will be useful, but 
8
 
# WITHOUT ANY WARRANTY; without even the implied warranties of 
9
 
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
10
 
# PURPOSE.  See the GNU General Public License for more details.
11
 
12
 
# You should have received a copy of the GNU General Public License along 
13
 
# with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 
### END LICENSE
15
 
 
16
 
"""this dialog adjusts values in gsettings
17
 
"""
18
 
 
19
 
from gi.repository import Gtk # pylint: disable=E0611
20
 
import logging
21
 
logger = logging.getLogger('protoborsa_lib')
22
 
 
23
 
from . helpers import get_builder, show_uri, get_help_uri
24
 
 
25
 
class PreferencesDialog(Gtk.Dialog):
26
 
    __gtype_name__ = "PreferencesDialog"
27
 
 
28
 
    def __new__(cls):
29
 
        """Special static method that's automatically called by Python when 
30
 
        constructing a new instance of this class.
31
 
        
32
 
        Returns a fully instantiated PreferencesDialog object.
33
 
        """
34
 
        builder = get_builder('PreferencesProtoborsaDialog')
35
 
        new_object = builder.get_object("preferences_protoborsa_dialog")
36
 
        new_object.finish_initializing(builder)
37
 
        return new_object
38
 
 
39
 
    def finish_initializing(self, builder):
40
 
        """Called while initializing this instance in __new__
41
 
 
42
 
        finish_initalizing should be called after parsing the ui definition
43
 
        and creating a PreferencesDialog object with it in order to
44
 
        finish initializing the start of the new PerferencesProtoborsaDialog
45
 
        instance.
46
 
        
47
 
        Put your initialization code in here and leave __init__ undefined.
48
 
        """
49
 
 
50
 
        # Get a reference to the builder and set up the signals.
51
 
        self.builder = builder
52
 
        self.ui = builder.get_ui(self, True)
53
 
 
54
 
        # code for other initialization actions should be added here
55
 
 
56
 
    def on_btn_close_clicked(self, widget, data=None):
57
 
        self.destroy()
58
 
 
59
 
    def on_btn_help_clicked(self, widget, data=None):
60
 
        show_uri(self, "ghelp:%s" % get_help_uri('preferences'))
61