~cm-t/dash-privacy-interface/quickly_trunk

« back to all changes in this revision

Viewing changes to dash_privacy_interface_lib/PreferencesDialog.py

  • Committer: cm-t arudy
  • Date: 2012-10-20 07:41:01 UTC
  • Revision ID: arudy@ubuntu-fr.org-20121020074101-4p8s40qzefe66cuo
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
# Copyright (C) 
 
4
# ubuntu-fr <LoCo Team> 
 
5
# kanor <Romain DUBREIL> <contact@kanor.fr>
 
6
# cm-t <Rudy ANDRÉ> <arudy@ubuntu-fr.org>
 
7
# olive <Olivier FRAYSSE> <olive@picapo.org>
 
8
# quesh <Frédéric MANDE> <quesh@quesh.fr>
 
9
# This program is free software: you can redistribute it and/or modify it 
 
10
# under the terms of the GNU General Public License version 3, as published 
 
11
# by the Free Software Foundation.
 
12
 
13
# This program is distributed in the hope that it will be useful, but 
 
14
# WITHOUT ANY WARRANTY; without even the implied warranties of 
 
15
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
 
16
# PURPOSE.  See the GNU General Public License for more details.
 
17
 
18
# You should have received a copy of the GNU General Public License along 
 
19
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
### END LICENSE
 
21
 
 
22
### DO NOT EDIT THIS FILE ###
 
23
 
 
24
"""this dialog adjusts values in gsettings
 
25
"""
 
26
 
 
27
from gi.repository import Gtk # pylint: disable=E0611
 
28
import logging
 
29
logger = logging.getLogger('dash_privacy_interface_lib')
 
30
 
 
31
from . helpers import get_builder, show_uri, get_help_uri
 
32
 
 
33
class PreferencesDialog(Gtk.Dialog):
 
34
    __gtype_name__ = "PreferencesDialog"
 
35
 
 
36
    def __new__(cls):
 
37
        """Special static method that's automatically called by Python when 
 
38
        constructing a new instance of this class.
 
39
        
 
40
        Returns a fully instantiated PreferencesDialog object.
 
41
        """
 
42
        builder = get_builder('PreferencesDashPrivacyInterfaceDialog')
 
43
        new_object = builder.get_object("preferences_dash_privacy_interface_dialog")
 
44
        new_object.finish_initializing(builder)
 
45
        return new_object
 
46
 
 
47
    def finish_initializing(self, builder):
 
48
        """Called while initializing this instance in __new__
 
49
 
 
50
        finish_initalizing should be called after parsing the ui definition
 
51
        and creating a PreferencesDialog object with it in order to
 
52
        finish initializing the start of the new PerferencesDashPrivacyInterfaceDialog
 
53
        instance.
 
54
        
 
55
        Put your initialization code in here and leave __init__ undefined.
 
56
        """
 
57
 
 
58
        # Get a reference to the builder and set up the signals.
 
59
        self.builder = builder
 
60
        self.ui = builder.get_ui(self, True)
 
61
 
 
62
        # code for other initialization actions should be added here
 
63
 
 
64
    def on_btn_close_clicked(self, widget, data=None):
 
65
        self.destroy()
 
66
 
 
67
    def on_btn_help_clicked(self, widget, data=None):
 
68
        show_uri(self, "ghelp:%s" % get_help_uri('preferences'))
 
69