Example #1
0
    def __init__(self, *args, **kwargs):

        self.profiles = []
        self._mode = MODE_NORMAL

        ConfigurationDialog.__init__(self, title='Configuration', *args, **kwargs)
        self.add_events(self._new_events)

        self.interface = gtk.Builder()
        self.interface.add_from_file(joindir(__file__, 'interface/profiles.ui'))

        self.profile_box_edit = self.interface.get_object('profile_box_edit')
        self.profile_entry = self.interface.get_object('profile_entry')
        self.profile_save = self.interface.get_object('profile_save')
        self.profile_cancel = self.interface.get_object('profile_cancel')

        self.profile_box_normal = self.interface.get_object('profile_box_normal')
        self.profile_selector = self.interface.get_object('profile_selector')
        self.profile_add = self.interface.get_object('profile_add')
        self.profile_remove = self.interface.get_object('profile_remove')

        self.profiles_storage = self.interface.get_object('profiles_storage')

        self.profile_selector.connect('changed', self.on_profile_changed)
        self.profile_entry.connect('activate', self.change_mode)
        self.profile_entry.connect('activate', self.on_new_profile_added)
        self.profile_add.connect('clicked', self.change_mode)
        self.profile_save.connect('clicked', self.change_mode)
        self.profile_save.connect('clicked', self.on_new_profile_added)
        self.profile_cancel.connect('clicked', self.change_mode)
        self.profile_remove.connect('clicked', self.on_remove_profile)

        self.alignment = gtk.Alignment(1, 0.5, 1, 1)
        self.alignment.add(self.profile_box_normal)

        self.layout.pack_start(self.alignment, False, False, 0)
        self.layout.reorder_child(self.alignment, 0)
Example #2
0
 def run(self):
     ConfigurationDialog.run(self)
     self.dialog.destroy()