Exemple #1
0
    def __init__(self, MainWindow=None, Daemon=None, Parent=None):
        """
            @MainWindow:
                must be a OpenlhServer.ui.main.Manager object
        """
        self.daemon = Daemon
        self.mainwindow = MainWindow

        self.xml = get_gtk_builder('plugins')
        self.dialog = self.xml.get_object('dialog')
        self.treeview = self.xml.get_object('treeview')

        self.title = self.xml.get_object('title')
        self.description = self.xml.get_object('description')
        self.author = self.xml.get_object('author')
        self.copyright = self.xml.get_object('copyright')
        self.site = self.xml.get_object('site')
        self.preferences_button = self.xml.get_object('preferences_button')

        #TreeView Model: plugin name, activated, Description
        self.ListStore = gtk.ListStore(gobject.TYPE_STRING,
                                       gobject.TYPE_BOOLEAN,
                                       gobject.TYPE_STRING)

        #Columns
        #Enabled
        crt = gtk.CellRendererToggle()
        crt.set_property('activatable', True)
        crt.connect('toggled', self.on_enabled_toggled, self.ListStore)

        column = gtk.TreeViewColumn(_("Enabled"), crt, active=1)
        column.set_reorderable(False)
        column.set_clickable(False)
        column.set_resizable(False)
        column.set_expand(False)

        self.treeview.append_column(column)

        #Plugin Name
        column = gtk.TreeViewColumn(_("Plugin"),
                                    gtk.CellRendererText(),
                                    text=2)
        column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        column.set_reorderable(True)
        column.set_clickable(True)
        column.set_sort_column_id(2)
        column.set_resizable(True)
        column.set_expand(True)

        self.treeview.append_column(column)

        self.treeview.set_model(self.ListStore)

        self.xml.connect_signals(self)

        if Parent:
            self.dialog.set_transient_for(Parent)
Exemple #2
0
    def __init__(self, MainWindow=None, Daemon=None, Parent=None):
        """
            @MainWindow:
                must be a OpenlhServer.ui.main.Manager object
        """
        self.daemon = Daemon
        self.mainwindow = MainWindow
        
        self.xml = get_gtk_builder('plugins')
        self.dialog = self.xml.get_object('dialog')
        self.treeview = self.xml.get_object('treeview')
        
        self.title = self.xml.get_object('title')
        self.description = self.xml.get_object('description')
        self.author = self.xml.get_object('author')
        self.copyright = self.xml.get_object('copyright')
        self.site = self.xml.get_object('site')
        self.preferences_button = self.xml.get_object('preferences_button')
        
        #TreeView Model: plugin name, activated, Description
        self.ListStore = gtk.ListStore(gobject.TYPE_STRING,
                                       gobject.TYPE_BOOLEAN,
                                       gobject.TYPE_STRING)
        
        #Columns
        #Enabled
        crt = gtk.CellRendererToggle()
        crt.set_property('activatable', True)
        crt.connect('toggled', self.on_enabled_toggled, self.ListStore)

        column = gtk.TreeViewColumn(_("Enabled"), crt, active=1)
        column.set_reorderable(False)
        column.set_clickable(False)
        column.set_resizable(False)
        column.set_expand(False)
        
        self.treeview.append_column(column)
        
        #Plugin Name
        column = gtk.TreeViewColumn(_("Plugin"), gtk.CellRendererText(), text=2)
        column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
        column.set_reorderable(True)
        column.set_clickable(True)
        column.set_sort_column_id(2)
        column.set_resizable(True)
        column.set_expand(True)
        
        self.treeview.append_column(column)
        
        self.treeview.set_model(self.ListStore)
        
        self.xml.connect_signals(self)
        
        if Parent:
            self.dialog.set_transient_for(Parent)
Exemple #3
0
    def __init__(self, title=None, Parent=None):

        self.conf_client = get_default_client()

        self.xml = get_gtk_builder('prefs')
        self.prefs = self.xml.get_object('prefs')

        self.background_chooser = image_chooser_button()
        self.logo_chooser = image_chooser_button()

        background_chooser_btn = self.background_chooser.get_children()[0]
        logo_chooser_btn = self.logo_chooser.get_children()[0]

        background_chooser_btn.connect('focus-in-event',
                                       self.background_chooser_focus)
        background_chooser_btn.connect('focus-out-event',
                                       self.background_chooser_focus)

        logo_chooser_btn.connect('focus-in-event', self.logo_chooser_focus)
        logo_chooser_btn.connect('focus-out-event', self.logo_chooser_focus)

        self.xml.get_object('lock_box').attach(self.background_chooser,
                                               1,
                                               2,
                                               0,
                                               1,
                                               xoptions=gtk.FILL | gtk.EXPAND,
                                               xpadding=0,
                                               ypadding=0)

        self.xml.get_object('lock_box').attach(self.logo_chooser,
                                               1,
                                               2,
                                               1,
                                               2,
                                               xoptions=gtk.FILL | gtk.EXPAND,
                                               xpadding=0,
                                               ypadding=0)

        self.background_chooser.connect('file-activated', self.file_activated)

        self.background_chooser.show()
        self.logo_chooser.show()

        self.get_configs()

        if Parent:
            self.prefs.set_transient_for(Parent)

        if title:
            self.prefs.set_title(title)

        self.xml.connect_signals(self)
Exemple #4
0
 def __init__(self, title=None, Parent=None):
     
     self.conf_client = get_default_client()
             
     self.xml = get_gtk_builder('prefs')
     self.prefs = self.xml.get_object('prefs')
     
     self.background_chooser = image_chooser_button()
     self.logo_chooser = image_chooser_button()
     
     background_chooser_btn = self.background_chooser.get_children()[0]
     logo_chooser_btn = self.logo_chooser.get_children()[0]
     
     background_chooser_btn.connect('focus-in-event',
                                    self.background_chooser_focus)
     background_chooser_btn.connect('focus-out-event',
                                    self.background_chooser_focus)
     
     logo_chooser_btn.connect('focus-in-event', self.logo_chooser_focus)
     logo_chooser_btn.connect('focus-out-event', self.logo_chooser_focus)
     
     self.xml.get_object('lock_box').attach(self.background_chooser, 1, 2, 0, 1,
                 xoptions=gtk.FILL|gtk.EXPAND, xpadding=0, ypadding=0)
     
     self.xml.get_object('lock_box').attach(self.logo_chooser, 1, 2, 1, 2,
                 xoptions=gtk.FILL|gtk.EXPAND, xpadding=0, ypadding=0)
     
     self.background_chooser.connect('file-activated', self.file_activated)
     
     self.background_chooser.show()
     self.logo_chooser.show()
     
     self.get_configs()
     
     if Parent:
         self.prefs.set_transient_for(Parent)
     
     if title:
         self.prefs.set_title(title)
     
     self.xml.connect_signals(self)