Exemplo n.º 1
0
    def finish_initializing(self, builder):
        """Called when we're finished initializing.

        finish_initalizing should be called after parsing the ui definition
        and creating a MeliaPanelDialog object with it in order to
        finish initializing the start of the new MeliaPanelDialog
        instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self)
        
       
        preferences.db_connect()
        preferences.load()

        if preferences['panel_transparent']:
            #self.widgefy(self)
            self.widgefy(self.ui.melia_panel_dialog)
            self.widgefy(self.ui.hbox1)
            self.widgefy(self.ui.hbox3)
            self.widgefy(self.ui.hbox4)
            self.widgefy(self.ui.dashbutton)
            #self.widgefy(self.ui.layout3)
            #self.widgefy(self.ui.layout4)
            self.widgefy(self.ui.layout1)
            self.widgefy(self.ui.hbox2)
            self.widgefy(self.ui.indicator_panel)
            self.widgefy(self.ui.layout8)
            self.widgefy(self.ui.layout7)
            self.widgefy(self.ui.notification_box)
            self.widgefy(self.ui.notification_area)
            #self.widgefy(self.ui.layout2)
        
        self.left_button = None 
        self.active_indicator = None  
        self.indicators = [] 
        
        ## SET UP THE NOTIFICATION AREA
        self.ui.notification_mi = gtk.ImageMenuItem()
        self.ui.notification_area.append(self.ui.notification_mi)
        self.ui.notification_area.show_all()
        
        ##

        for indicator in preferences['indicators']:
            #try:
                i = my_import('indicators.' + indicator)
                if hasattr(i, 'menu'): 
                    menu = i.menu()
                    self.ui.indicator_panel.add(menu)
                    print menu
                    #self.ui.indicator_panel.add(btn)
                    self.indicators.append(menu)
                else: logger.warn('Indicator %s does not appear to have a menu' % indicator)
            #except: logger.warn('Failed to load indicator: %s' % indicator)
            
        
        self.ui.indicator_panel.show_all()
        self.move(0, 0)
Exemplo n.º 2
0
    def finish_initializing(self, builder):
        """Called when we're finished initializing.

        finish_initalizing should be called after parsing the ui definition
        and creating a MeliaPanelDialog object with it in order to
        finish initializing the start of the new MeliaPanelDialog
        instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self)

        preferences.db_connect()
        preferences.load()

        if preferences['panel_transparent']:
            #self.widgefy(self)
            self.widgefy(self.ui.melia_panel_dialog)
            self.widgefy(self.ui.hbox1)
            self.widgefy(self.ui.hbox3)
            self.widgefy(self.ui.hbox4)
            self.widgefy(self.ui.dashbutton)
            #self.widgefy(self.ui.layout3)
            #self.widgefy(self.ui.layout4)
            self.widgefy(self.ui.layout1)
            self.widgefy(self.ui.hbox2)
            self.widgefy(self.ui.indicator_panel)
            self.widgefy(self.ui.layout8)
            self.widgefy(self.ui.layout7)
            self.widgefy(self.ui.notification_box)
            self.widgefy(self.ui.notification_area)
            #self.widgefy(self.ui.layout2)

        self.left_button = None
        self.active_indicator = None
        self.indicators = []

        ## SET UP THE NOTIFICATION AREA
        self.ui.notification_mi = gtk.ImageMenuItem()
        self.ui.notification_area.append(self.ui.notification_mi)
        self.ui.notification_area.show_all()

        ##

        for indicator in preferences['indicators']:
            #try:
            i = my_import('indicators.' + indicator)
            if hasattr(i, 'menu'):
                menu = i.menu()
                self.ui.indicator_panel.add(menu)
                print menu
                #self.ui.indicator_panel.add(btn)
                self.indicators.append(menu)
            else:
                logger.warn('Indicator %s does not appear to have a menu' %
                            indicator)
        #except: logger.warn('Failed to load indicator: %s' % indicator)

        self.ui.indicator_panel.show_all()
        self.move(0, 0)
Exemplo n.º 3
0
    def finish_initializing(self, builder):  # pylint: disable=E1002
        """Set up the preferences dialog"""
        super(PreferencesMeliaDialog, self).finish_initializing(builder)

        preferences.db_connect()
        preferences.load()

        # populate the dialog from the preferences dictionary
        # using the methods from widget_methods
        self.widget_methods = widget_methods
        self.set_widgets_from_preferences()  # pylint: disable=E1101

        # Code for other initialization actions should be added here.

        # set up the combobox objects
        self.ui.liststore1.append(("vertical",))
        self.ui.liststore1.append(("horizontal",))
        self.ui.orientation.set_model(self.ui.liststore1)
        self.ui.orientation.show_all()

        self.ui.liststore2.append(("new",))
        self.ui.liststore2.append(("old",))
        self.ui.button_style.set_model(self.ui.liststore2)
        self.ui.button_style.show_all()

        self.ui.launcher_height.set_adjustment(gtk.Adjustment(0, 0, self.get_screen().get_height(), 1))
        self.ui.launcher_width.set_adjustment(gtk.Adjustment(0, 0, self.get_screen().get_width(), 1))

        for i in preferences["indicators"]:
            # self.ui.liststore3.append(('hello',))
            ""
        self.ui.treeview1.set_model(self.ui.liststore3)
Exemplo n.º 4
0
    def finish_initializing(self, builder):
        """Called when we're finished initializing.

        finish_initalizing should be called after parsing the ui definition
        and creating a MeliaDashboardDialog object with it in order to
        finish initializing the start of the new MeliaDashboardDialog
        instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self)
        
        self.ui.entry1.connect('changed', self.search)
        
        self.set_size_request(int(self.get_screen().get_width() - preferences['launcher_width']), int(self.get_screen().get_height() - preferences['top_panel_height']))
        
        bus = dbus.SessionBus()
        
        preferences.db_connect()
        preferences.load()
        
        if bus.request_name('org.freedesktop.Tracker1') == dbus.bus.REQUEST_NAME_REPLY_IN_QUEUE:
            tracker_object = bus.get_object('org.freedesktop.Tracker1', '/org/freedesktop/Tracker1/Resources')
            self.tracker = dbus.Interface(tracker_object, 'org.freedesktop.Tracker1.Resources') 
        else:
            logger.warn('Could not connect to Tracker')
            self.loaded = False
            return 
			
        self.split     = split
		self.quote     = quote
		self.splittype = splittype
		
		# save the default buttons to a list so they can be hidden and easily restored after searches
		self.default_buttons = [self.ui.media_apps_button, self.ui.internet_apps_button, self.ui.more_apps_button, self.ui.find_files_button, self.ui.firefox_button, self.ui.shotwell_button, self.ui.evolution_button, self.ui.banshee_button]
		# create an empty list for clearing other buttons
		self.current_buttons = []
		
		gtk.timeout_add(5, self.init_bottom_toolbar)
		
		#self.parent.launcher_index = []
		gtk.timeout_add(5, self.index_launchers)
		self.ui.entry1.set_activates_default(True)
Exemplo n.º 5
0
    def finish_initializing(self, builder):  # pylint: disable=E1002
        """Set up the preferences dialog"""
        super(PreferencesMeliaDialog, self).finish_initializing(builder)

        preferences.db_connect()
        preferences.load()

        # populate the dialog from the preferences dictionary
        # using the methods from widget_methods
        self.widget_methods = widget_methods
        self.set_widgets_from_preferences()  # pylint: disable=E1101

        # Code for other initialization actions should be added here.

        # set up the combobox objects
        self.ui.liststore1.append(('vertical', ))
        self.ui.liststore1.append(('horizontal', ))
        self.ui.orientation.set_model(self.ui.liststore1)
        self.ui.orientation.show_all()

        self.ui.liststore2.append(('new', ))
        self.ui.liststore2.append(('old', ))
        self.ui.button_style.set_model(self.ui.liststore2)
        self.ui.button_style.show_all()

        self.ui.launcher_height.set_adjustment(
            gtk.Adjustment(0, 0,
                           self.get_screen().get_height(), 1))
        self.ui.launcher_width.set_adjustment(
            gtk.Adjustment(0, 0,
                           self.get_screen().get_width(), 1))

        for i in preferences['indicators']:
            #self.ui.liststore3.append(('hello',))
            ''
        self.ui.treeview1.set_model(self.ui.liststore3)