Пример #1
0
 def check_gconf_options(self):
     menuicon = gconf_get("/desktop/gnome/interface/menus_have_icons")
     btnicon = gconf_get("/desktop/gnome/interface/buttons_have_icons")
     homeicon = gconf_get("/apps/nautilus/desktop/home_icon_visible")
     compicon = gconf_get("/apps/nautilus/desktop/computer_icon_visible")
     trashicon = gconf_get("/apps/nautilus/desktop/trash_icon_visible")
     neticon = gconf_get("/apps/nautilus/desktop/network_icon_visible")
     volicon = gconf_get("/apps/nautilus/desktop/volumes_visible")
     if menuicon:
         self.menuhaveicon_checkbox.set_active(1)
     if btnicon:
         self.btnhaveicon_checkbox.set_active(1)
     if homeicon:
         self.home_visible_checkbox.set_active(1)
     if trashicon:
         self.trash_visible_checkbox.set_active(1)
     if neticon:
         self.network_visible_checkbox.set_active(1)
     if volicon:
         self.volumes_visible_checkbox.set_active(1)
     if compicon:
         self.computer_visible_checkbox.set_active(1)
Пример #2
0
    def __init__(self,gladexml,icon_dict):
        #Load api icon
        self.icon_dict = icon_dict
        self.gclient = gconf.client_get_default()
        self.iconsTheme_save = gconf_get("/desktop/gnome/interface/icon_theme")
        ## load widget
        self.w_status_bar = gladexml.get_widget("statusbar")

        self.icons_page_img = gladexml.get_widget("icons_page_img")
        self.icons_page_img.set_from_file(config.img_path+"/iconspack.png")
        self.icons_page_label = gladexml.get_widget("icons_page_label")
        self.icons_page_label.set_text(_("Icons:\nManage and install your icons themes"))

        self.wl_icon_gest = gladexml.get_widget("icons_gest_label")
        self.wl_icon_gest.set_text(_("Available themes list"))

        self.progress_box = gladexml.get_widget("progress_box")
        self.progress_text = gladexml.get_widget("progress_box_text")

        self.main_progressbar = gladexml.get_widget("main_progressbar")

        self.statbar = gladexml.get_widget("statusbar")

        ## setup the iconview
        self.model = gtk.ListStore(str,gtk.gdk.Pixbuf, str, str, str, str, str, str)
        self.w_iconview = gtk.IconView(model=self.model)
        self.w_iconview.set_pixbuf_column(1)
        self.w_iconview.set_text_column(0)
        self.w_iconview.set_columns(0)
        self.w_iconview.set_item_width(150)
        self.w_iconview.set_selection_mode('single')
        self.w_iconview.set_reorderable(1)
        ## add the iconview
        self.w_viewer = gladexml.get_widget("icons_viewer")
        self.w_viewer.add(self.w_iconview)
        self.list_icon_themes()

        self.w_applybtn =  gladexml.get_widget("icons_gest_applybtn")


        #Mettre ça dans un objet fenétre principal
        self.decoration_page_img = gladexml.get_widget("decoration_page_img")
        self.decoration_page_desc = gladexml.get_widget("decoration_page_desc")
        img_path = os.path.join(config.exec_path,"/img/iconspack.png")
        if os.path.exists(img_path):
            self.decoration_page_img.set_from_file(img_path)
        self.decoration_page_desc.set_text(_("Icons:\nManage and install your icons themes..."))

        ## gconf and panel icons
        self.icon_panel_combobox = gladexml.get_widget("icon_panel_combobox")
        self.icon_panel_apply_btn = gladexml.get_widget("icon_panel_apply_btn")
        self.menuhaveicon_checkbox = gladexml.get_widget("icon_menuicons_select")
        self.btnhaveicon_checkbox = gladexml.get_widget("icon_btnicons_select")
        self.home_visible_checkbox = gladexml.get_widget("home_icon")
        self.computer_visible_checkbox = gladexml.get_widget("computer_icon")
        self.trash_visible_checkbox = gladexml.get_widget("trash_icon")
        self.network_visible_checkbox = gladexml.get_widget("network_icon")
        self.volumes_visible_checkbox = gladexml.get_widget("volumes_icon")
        ## initialize checkboxes
        self.check_gconf_options()

        ## panel icons
        self.panel_icon_dic = {}
        self.icon_panel_model = gtk.ListStore(str,gtk.gdk.Pixbuf,str)
        self.list_panel_icons()

        self.panelTree = gtk.TreeView()
        self.icon_panel_combobox.set_model(self.icon_panel_model)
        px = gtk.CellRendererPixbuf()
        text = gtk.CellRendererText()

        #Pack the cell renderer into the combobox.
        self.icon_panel_combobox.pack_start(px, False)
        self.icon_panel_combobox.pack_start(text, False)

        #Use the add_attribute method to specify which column in the model the
        self.icon_panel_combobox.add_attribute(px, "pixbuf", 1)
        #Do the same for CellRendererText()
        self.icon_panel_combobox.add_attribute(text, "text", 0)

        self.panel_icon_combo = ComboBox(self.icon_panel_combobox)
        self.get_active_panel_icon()

        ##load signal
        dic = {"on_icons_gest_addbtn_clicked" : self.action_add,
               "on_icons_gest_applybtn_clicked" : self.action_apply,
               "on_icons_gest_delbtn_clicked" : self.action_delete,
               "on_icon_panel_apply_btn_clicked" : self.apply_panel_icon,
               "on_icon_menuicons_select_toggled" : self.set_gconf_options,
               "on_icon_btnicons_select_toggled" : self.set_gconf_options,
               "on_panel_icon_addbtn_clicked" : self.add_panel_icon,
               "on_panel_icon_delbtn_clicked" : self.del_panel_icon,
               "on_computer_icon_toggled" : self.set_gconf_options,
               "on_home_icon_toggled" : self.set_gconf_options,
               "on_trash_icon_toggled" : self.set_gconf_options,
               "on_network_icon_toggled" : self.set_gconf_options,
               "on_volumes_icon_toggled" : self.set_gconf_options,
               }
        self.w_iconview.connect('selection_changed',self.action_get_model)
        self.w_iconview.connect('button-press-event',self.treeview_clicked)
        gladexml.signal_autoconnect(dic)