예제 #1
0
파일: usbsw.py 프로젝트: Mrmohanak/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw,_('USB Mode Switch'),'net',90)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        b=Gtk.Button(_('Remove all applied methods'))
        b.connect('clicked',self.remove_applied)
        hb.pack_start(b,False,False,2)

        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        self.k_ls=Gtk.ComboBoxText()
        self.k_ls.connect('changed', self.update_methods)
        hb.pack_start(Gtk.Label(_('Device ID:')),False,False,2)
        hb.pack_start(self.k_ls,False,False,2)
        b=Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked',self.refresh)
        hb.pack_start(b,False,False,2)
        self.parse_conf()
            
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        self.m_ls=Gtk.ComboBoxText()
        self.m_ls.connect('changed', self.update_desc)
        hb.pack_start(Gtk.Label(_('Switch method:')),False,False,2)
        hb.pack_start(self.m_ls,False,False,2)
        
        b=Gtk.Button(_("apply now"))
        b.connect('clicked',self.apply_now)
        hb.pack_start(b,False,False,2)
        b=Gtk.Button(_("always apply this method automatically"))
        b.connect('clicked',self.always_apply)
        hb.pack_start(b,False,False,2)
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        self.desc=Gtk.Label("%s: %s" % (_('Method details'),_('N/A')))
        hb.pack_start(self.desc,False,False,2)
        self.refresh()
예제 #2
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)

        self.base = dnf.Base()
        self.base.read_all_repos()
        self.allrepos = self.base.repos.all()

        self.count = 0
        self.hbox = Gtk.HBox(spacing=20)
        self.add(self.hbox)
        self.vbox1 = Gtk.VBox()
        self.vbox2 = Gtk.VBox()
        self.grid = Gtk.Grid(row_homogeneous=True)
        self.vbox2.pack_start(self.grid, True, True, 0)
        self.hbox.pack_start(self.vbox1, True, True, 0)
        self.hbox.pack_start(self.vbox2, True, True, 0)
        self.name_label = Gtk.Label(_("<b>Name</b>"), use_markup=True)
        self.vbox1.pack_start(self.name_label, True, True, 0)
        self.execute_label = Gtk.Label(_("<b>Switch</b>"), use_markup=True)
        self.grid.attach(self.execute_label, 0, self.count, 1, 1)
        self.count += 1

        for repo in self.allrepos:
            self.name = Gtk.Label(repo.name)
            if not repo.enabled:
                self.switch = Gtk.Switch()
            else:
                self.switch = Gtk.Switch()
                self.switch.set_active(True)

            self.switch.connect("state-set", self.__enable_or_disable,
                                repo.hawkey_repo.name)
            self.vbox1.pack_start(self.name, True, True, 0)
            self.grid.attach(self.switch, 0, self.count, 1, 1)
            self.count += 1
예제 #3
0
파일: modem.py 프로젝트: Mrmohanak/occ
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     hb.pack_start(Gtk.Label(description), False, False, 2)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     hb.pack_start(
         InstallOrInactive(self, _("Install slmodem driver"),
                           _("slmodem driver is installed"),
                           _('driver for some software modems'),
                           ['kmod-slmodem']), False, False, 2)
     self.sl_service = Gtk.CheckButton(_("Start slmodem daemon on boot"))
     self.__sl_service_internal = False
     self.sl_service.set_active(chkconfig(5, 'slmodem'))
     self.sl_service.connect('toggled', self.sl_service_cb)
     hb.pack_start(self.sl_service, False, False, 2)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     self.interface_ls = Gtk.ComboBoxText()
     self.interface_ls.append_text("alsa")
     self.interface_ls.append_text("slamr")
     self.interface_ls.append_text("slusb")
     self.interface_ls.set_active(0)
     hb.pack_start(self.interface_ls, False, False, 2)
     b = Gtk.Button(stock=Gtk.STOCK_APPLY)
     b.connect('clicked', self.interface_cb)
     hb.pack_start(b, False, False, 2)
예제 #4
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     p = os.path.expanduser('~/.fonts/')
     if not os.path.exists(p): os.mkdir(p)
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     l = Gtk.Label(description)
     h.pack_start(l, False, False, 2)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     self.files = Gtk.ListStore(str, str, float, int,
                                str)  # fn, basename, percent, pulse, label
     self.files_ls = Gtk.TreeView(self.files)
     scroll = Gtk.ScrolledWindow()
     scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.ALWAYS)
     scroll.add(self.files_ls)
     scroll.set_size_request(-1, 200)
     h.pack_start(scroll, True, True, 2)
     self.__init_list()
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     b = Gtk.Button(stock=Gtk.STOCK_CLEAR)
     b.connect('clicked', lambda *args: self.files.clear())
     h.pack_start(b, False, False, 2)
     b = Gtk.Button(stock=Gtk.STOCK_CONVERT)
     b.connect('clicked', self.convert_cb)
     h.pack_start(b, False, False, 2)
     h.pack_start(
         InstallOrInactive(self, _("Install FontForge"),
                           _("FontForge is installed"),
                           _("FontForge is a font editing tool"),
                           ['fontforge']), False, False, 2)
예제 #5
0
파일: legacy-fonts.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     p=os.path.expanduser('~/.fonts/')
     if not os.path.exists(p): os.mkdir(p)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     l=Gtk.Label(description)
     h.pack_start(l,False,False,2)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     self.files = Gtk.ListStore(str,str,float,int,str) # fn, basename, percent, pulse, label
     self.files_ls=Gtk.TreeView(self.files)
     scroll=Gtk.ScrolledWindow()
     scroll.set_policy(Gtk.PolicyType.NEVER,Gtk.PolicyType.ALWAYS)
     scroll.add(self.files_ls)
     scroll.set_size_request(-1,200)
     h.pack_start(scroll,True,True,2)
     self.__init_list()
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     b=Gtk.Button(stock=Gtk.STOCK_CLEAR)
     b.connect('clicked', lambda *args: self.files.clear())
     h.pack_start(b,False,False,2)
     b=Gtk.Button(stock=Gtk.STOCK_CONVERT)
     b.connect('clicked', self.convert_cb)
     h.pack_start(b,False,False,2)
     h.pack_start(InstallOrInactive(self, _("Install FontForge"), _("FontForge is installed"), _("FontForge is a font editing tool"), ['fontforge']),False,False,2)
예제 #6
0
파일: dm.py 프로젝트: Mrmohanak/occ
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,6)
     l=Gtk.Label(description) # using discription here 
     #l.set_line_wrap(True)
     hb.pack_start(l,False,False,2)
     hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
     self.dm_ls=['gdm','kdm','wdm','xdm', 'lxdm']
     self.dm_ls=filter(lambda i: os.path.exists('/usr/sbin/'+i) or os.path.exists('/usr/bin/'+i),self.dm_ls)
     self.dm=Gtk.ComboBoxText()
     for i in self.dm_ls: self.dm.append_text(i)
     self.dm.set_active(self.get_current())
     hb.pack_start(Gtk.Label(_("Available display managers:")),False,False,2)
     hb.pack_start(self.dm,False,False,2)
     b=Gtk.Button(_("save change"))
     b.connect('clicked',self.set_dm)
     hb.pack_start(b,False,False,2)
     hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
     b=Gtk.Button(_('Enable Automatic Login as this user'))
     b.connect('clicked',self.autologin_cb)
     hb.pack_start(b,False,False,2)
     b=Gtk.Button(_('Disable Automatic Login'))
     b.connect('clicked',self.no_autologin_cb)
     hb.pack_start(b,False,False,2)
예제 #7
0
파일: net-adv.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)     
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,6)
        l=Gtk.Label(description)
        hb.pack_start(l, False,False,2)

        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        hb.pack_start(LaunchOrInstall(self, _('Configure firewall'), '/usr/bin/system-config-firewall',pkgs=['system-config-filewall']),False,False,0)

        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        l=Gtk.Label(_("""Samba is used to share folders and printers in LAN"""))
        hb.pack_start(l, False,False,2)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        if not self.is_smb_on():
            b=Gtk.Button(_("Start samba on boot"))
            b.connect('clicked', self.smb_service_on)
            hb.pack_start(b,False,False,0)
        hb.pack_start(LaunchOrInstall(self, _('Create or modify shares'), '/usr/bin/system-config-samba',pkgs=['system-config-samba']),False,False,0)
        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        self.ushare=Gtk.CheckButton(_('Allow unprivileged users to create shares'))
        self.ushare.set_active(self.is_ushare())
        hb.pack_start(self.ushare,False,False,0)
        b=Gtk.Button(stock=Gtk.STOCK_APPLY)
        b.connect('clicked', self.ushare_cb)
        hb.pack_start(b,False,False,0)
예제 #8
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 6)
        l = Gtk.Label(description)
        hb.pack_start(l, False, False, 2)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(
            LaunchOrInstall(self,
                            _('Connection Editor'),
                            '/usr/bin/nm-connection-editor',
                            pkgs=['NetworkManager-gnome']), False, False, 0)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        l = Gtk.Label(
            _("""The legacy Network Configuration tool can give you more detailed privileged control over your network.\nIf you have used it please click "Suggest" button"""
              ))
        hb.pack_start(l, False, False, 2)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(
            LaunchOrInstall(self,
                            _('Network Configuration'),
                            '/usr/bin/system-control-network',
                            pkgs=['system-config-network']), False, False, 0)
        b = Gtk.Button(_('Suggest'))
        b.connect('clicked', self.suggest_cb)
        hb.pack_start(b, False, False, 0)
예제 #9
0
파일: snd.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        self.__hda_verb_needed=None
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
        hb.pack_start(Gtk.Label(_("Warning: using headphone at high volume may harm your ears.")),False,False,2)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
        b=Gtk.Button(_("volume up!"))
        hb.pack_start(b,False,False,2)
        b.connect('clicked',self.vol_up_cb)
        hb.pack_start(LaunchOrInstall(self, _("Simple gnome mixer"), '/usr/bin/gnome-volume-control', ['gnome-media']),False,False,2)
        hb.pack_start(LaunchOrInstall(self, _("Advanced mixer"), '/usr/bin/gst-mixer', ['gst-mixer']),False,False,2)

        e=self.is_hda_verb_needed()
        s=[]
        if e: s.append(_("You may need to use HDA fix from advanced options below."))

        if s:
            hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
            hb.pack_start(Gtk.Label("\n".join(s)),False,False,2)

        hb.pack_start(Gtk.VBox(False,2),False,False,2)
        self.advanced=Gtk.Expander()
        self.advanced.set_label(_("Advanced options"))
        vb.pack_start(self.advanced,True,True,2)
        vb=Gtk.VBox(False,2)
        self.advanced.add(vb)
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        hb.pack_start(Gtk.Label(_("HDA fix for Acer Aspire 8920G:")),False,False,2)
        b=Gtk.Button(_("apply now"))
        b.connect('clicked', self.hda_verb_now)
        hb.pack_start(b,False,False,2)
        b=Gtk.Button(_("enable at boot"))
        b.connect('clicked', self.hda_verb_at_boot)
        hb.pack_start(b,False,False,2)
        b=Gtk.Button(_("remove from boot"))
        b.connect('clicked', self.remove_from_boot)
        hb.pack_start(b,False,False,2)
        
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        hb.pack_start(Gtk.Label(_("By default sound works in time-based scheduling which consumes less power and CPU load.\nBut some drivers have a problem with time mode.\nIf you experience skipping in sound you may disable this feature.")),False,False,2)
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        self.tbs=Gtk.CheckButton(_("Time-based scheduling"))
        hb.pack_start(self.tbs,False,False,2)
        b=Gtk.Button(stock=Gtk.STOCK_APPLY)
        b.connect('clicked', self.tbs_cb)
        hb.pack_start(b,False,False,2)
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        hb.pack_start(Gtk.Label(_("If you have disabled time-based scheduling and the sound still skips, try setting realtime scheduling.")),False,False,2)
        hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
        self.rt_b=Gtk.CheckButton(_("Realtime scheduling"))
        hb.pack_start(self.rt_b,False,False,2)
        b=Gtk.Button(stock=Gtk.STOCK_APPLY)
        b.connect('clicked', self.rt_cb)
        hb.pack_start(b,False,False,2)
        self.set_checkbox()
        self.advanced.set_expanded(e)
예제 #10
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.__lock = True
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 0)
        b = Gtk.Button(_('Filter sites with explicit contents'))
        b.connect(
            'clicked', lambda b: run_in_bg(
                'xdg-open https://addons.mozilla.org/en-US/firefox/addon/1803')
        )
        hb.pack_start(b, False, False, 0)

        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 0)
        b = Gtk.CheckButton(_('Block ads and spyware sites'))
        b.set_active(os.path.exists(self.__blocked_f))
        b.connect('toggled', self.__block_cb)
        hb.pack_start(b, False, False, 0)
        hb.pack_start(
            LaunchFileButton(_('View blocked sites list'),
                             self.__blocked_ls_f), False, False, 0)
        b = Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked', self.__refresh_cb)
        b.set_tooltip_text(_('connect to ojuba.org to get the updated list'))
        hb.pack_start(b, False, False, 0)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 0)
        b = Gtk.CheckButton(_('Block sites in your personal black list'))
        b.set_active(os.path.exists(self.__blacklist_f))
        b.connect('toggled', self.__personal_list_cb)
        hb.pack_start(b, False, False, 0)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 0)
        self.__p = p = Gtk.TextView()
        s = Gtk.ScrolledWindow()
        evb = Gtk.VBox(False, 0)
        evb.pack_start(
            Gtk.Label(
                "Edit your list of banned sites (delimited by spaces and newlines, no commas)"
            ), False, False, 0)
        e = Gtk.Expander()
        e.set_label(_("Personal black list"))
        hb.pack_start(e, True, True, 6)

        e.add(evb)
        evb.pack_start(s, False, False, 6)
        s.add(p)
        hb = Gtk.HBox(False, 0)
        evb.pack_start(hb, False, False, 0)
        b = Gtk.Button(stock=Gtk.STOCK_SAVE)
        b.connect('clicked', self.__save_personal_list_cb)
        hb.pack_start(b, False, False, 0)
        self.__load__personal_list()
        self.__lock = False
예제 #11
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     hb=Gtk.HBox(False,0)
     #hb.pack_start(Gtk.Image.new_from_icon_name('gnome-control-center', Gtk.IconSize.BUTTON),False,False,0)
     #hb.pack_start(LaunchOrInstall(self,_('GNOME Control Center'),'/usr/bin/gnome-control-center',['control-center']),False,False,0)
     hb.pack_start(LaunchButton(_('GNOME Control Center'),'/usr/bin/gnome-control-center',icon='gnome-control-center'),False,False,0)
     hb.pack_start(LaunchButton(_('GNOME Menu Editor'),'/usr/bin/alacarte',icon='alacarte'),False,False,0)
     vb.pack_start(hb,False,False,6)
예제 #12
0
파일: printers.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     self.__hda_verb_needed=None
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
     b=LaunchOrInstall(self,_('Configure printers'),'/usr/bin/system-config-printer',['system-config-printer'])
     hb.pack_start(b,False,False,2); hb=Gtk.HBox(False,2); vb.pack_start(hb,True,True,2)
     b=InstallOrInactive(self, _("Install support for non-standard printers (GDI or winprinters)"), _("extra packages are already installed"), _("Install foo2* packages"), ["foo2qpdl", "foo2hiperc", "foo2lava", "foo2hp", "foo2slx", "foo2xqx", "foo2zjs"])
     hb.pack_start(b,False,False,2)
예제 #13
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     shell_ver=ccw.installed_info('gnome-shell')
     if not shell_ver or not ccw.GSettings:
         creatVBox(self, ccw, description, resetBtton=False) 
         return
     self.l_shell_ver=shell_ver['version']
     self.s_shell_ver='.'.join(self.l_shell_ver.split('.')[:2])
     self.key='enabled-extensions'
     self.dirs=['/usr/share/gnome-shell/extensions/','/home/ehab/.local/share/gnome-shell/extensions']
     self.extensions={}
     self.GS=None
     creatVBox(self, ccw, description, self.GioSettings, resetBtton=False) 
예제 #14
0
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.location=os.path.dirname(os.path.abspath(__file__))[:-7]+"icons/"
        self.desktop=os.getenv("XDG_CURRENT_DESKTOP")
        
        self.gif_image=random.choice(["%stuxtricks.gif"%self.location,"%spanguin_bird_flying_red_animation_clipart.GIF"%self.location])
        
        self.desktop_cc={"GNOME"      :["Gnome","/usr/bin/gnome-control-center"],
                         "KDE"        :["Kde","/usr/bin/systemsettings5"] ,
                         "XFCE"       :["Xfce","/usr/bin/xfce4-settings-manager"] ,
                         "X-LXQt"     :["Lxqt","/usr/bin/lxqt-config"] ,
                         "X-Cinnamon" :["Cinnamon","/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py"] ,
                         "MATE"       :["Mate","/usr/bin/mate-control-center"] ,
                         "X-Hawaii"   :["Hawaii","/usr/bin/hawaii-system-preferences"]
                         } 
        
        self.lxde_cc=[ ["Customize Look and Feel","/usr/bin/lxappearance"] ,["Default Applications","/usr/bin/lxsession-default-apps"],["Desktop Session Settings","/usr/bin/lxsession-edit"] ,["Display Settings","/usr/bin/lxrandr"],["Windows Manager Configuration","/usr/bin/obconf"],["Input Device Preferences","/usr/bin/lxinput"]]
        
        vb=Gtk.VBox(False,2)
        self.add(vb)
        hb=Gtk.HBox(False,5)
        vb.pack_start(hb,True,True,10)
        vb1=Gtk.VBox(False,10)
        hb.pack_start(vb1,True,True,10)
        
        pixbuf=GdkPixbuf.PixbufAnimation.new_from_file(self.gif_image)
        image=Gtk.Image.new_from_animation(pixbuf)
        vb1.pack_start(image,True,True,0)
            
        if self.desktop=="":
            if os.getenv("DESKTOP_SESSION")=="/usr/share/xsessions/openbox":
                vb1.pack_start(LaunchButton(_('Openbox Manager Configuration'),'/usr/bin/obconf'),False,False,5)
            else:
                pass
        
        elif self.desktop=="LXDE":
            for i in self.lxde_cc:
                vb1.pack_start(LaunchButton(_(i[0]) , i[1] ) ,True,True,0)

        
        elif self.desktop=="GNOME":
            vb1.pack_start(LaunchButton(_('%s Control Center' %self.desktop_cc[ self.desktop ] [0] ),self.desktop_cc[ self.desktop ] [1]),True,True,0)
            
            if os.path.exists("/usr/bin/gnome-tweak-tool"):
                vb1.pack_start(LaunchButton(_('Gnome Tweak Tool'),'/usr/bin/gnome-tweak-tool'),False,False,5)
                vb.pack_start(hb,False,False,6)
        
        else:
            vb1.pack_start(LaunchButton(_('%s Control Center' %self.desktop_cc[ self.desktop ] [0] ),self.desktop_cc[ self.desktop ] [1]),True,True,0)
예제 #15
0
파일: samples.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.load()
     vb=Gtk.VBox(False,2)
     self.add(vb)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     l=Gtk.Label(_('ojuba is shipped with samples. You may find an icon to samples on your desktop.'))
     h.pack_start(l,False,False,2)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     b=Gtk.Button(_("Remove samples icon"))
     b.connect('clicked', self.rm_samples)
     h.pack_start(b,False,False,2)
     b=Gtk.Button(_("Recreate samples icon"))
     b.connect('clicked', self.mk_samples)
     h.pack_start(b,False,False,2)
예제 #16
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     shell_ver = ccw.installed_info('gnome-shell')
     if not shell_ver or not ccw.GSettings:
         creatVBox(self, ccw, description, resetBtton=False)
         return
     self.l_shell_ver = shell_ver['version']
     self.s_shell_ver = '.'.join(self.l_shell_ver.split('.')[:2])
     self.key = 'enabled-extensions'
     self.dirs = [
         '/usr/share/gnome-shell/extensions/',
         '/home/ehab/.local/share/gnome-shell/extensions'
     ]
     self.extensions = {}
     self.GS = None
     creatVBox(self, ccw, description, self.GioSettings, resetBtton=False)
예제 #17
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     hb = Gtk.HBox(False, 0)
     vb.pack_start(hb, False, False, 0)
     hb.pack_start(Gtk.Label(_('Graphical Boot:')), False, False, 0)
     self.__vga_ls = Gtk.ComboBoxText()
     #self.__vga_ls.append_text(_('Default'))
     for i in self.resolutions_ls:
         self.__vga_ls.append_text(i)
     self.__vga_ls.set_active(0)
     hb.pack_start(self.__vga_ls, False, False, 0)
     b = Gtk.Button(stock=Gtk.STOCK_APPLY)
     b.connect('clicked', self.__apply_cb)
     hb.pack_start(b, False, False, 0)
예제 #18
0
파일: boot-options.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     hb=Gtk.HBox(False,0)
     vb.pack_start(hb,False,False,0)
     hb.pack_start(Gtk.Label(_('Graphical Boot:')),False,False,0)
     self.__vga_ls=Gtk.ComboBoxText()
     #self.__vga_ls.append_text(_('Default'))
     for i in self.resolutions_ls:
         self.__vga_ls.append_text(i)
     self.__vga_ls.set_active(0)
     hb.pack_start(self.__vga_ls,False,False,0)
     b=Gtk.Button(stock=Gtk.STOCK_APPLY)
     b.connect('clicked', self.__apply_cb)
     hb.pack_start(b,False,False,0)
예제 #19
0
파일: block-hosts.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.__lock=True
        vb=Gtk.VBox(False,2)
        self.add(vb)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,0)
        b=Gtk.Button(_('Filter sites with explicit contents'))
        b.connect('clicked', lambda b: run_in_bg('xdg-open https://addons.mozilla.org/en-US/firefox/addon/1803'))
        hb.pack_start(b,False,False,0)

        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,0)
        b=Gtk.CheckButton(_('Block ads and spyware sites'))
        b.set_active(os.path.exists(self.__blocked_f))
        b.connect('toggled', self.__block_cb)
        hb.pack_start(b,False,False,0)
        hb.pack_start(LaunchFileButton(_('View blocked sites list'),self.__blocked_ls_f),False,False,0)
        b=Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked', self.__refresh_cb)
        b.set_tooltip_text(_('connect to ojuba.org to get the updated list'))
        hb.pack_start(b,False,False,0)
        hb=Gtk.HBox(False,0)
        vb.pack_start(hb,False,False,0)
        b=Gtk.CheckButton(_('Block sites in your personal black list'))
        b.set_active(os.path.exists(self.__blacklist_f))
        b.connect('toggled', self.__personal_list_cb)
        hb.pack_start(b,False,False,0)
        hb=Gtk.HBox(False,0)
        vb.pack_start(hb,False,False,0)
        self.__p=p=Gtk.TextView()
        s=Gtk.ScrolledWindow()
        evb=Gtk.VBox(False,0)
        evb.pack_start(Gtk.Label("Edit your list of banned sites (delimited by spaces and newlines, no commas)"),False,False,0)
        e=Gtk.Expander()
        e.set_label(_("Personal black list"))
        hb.pack_start(e,True,True,6)
        
        e.add(evb)
        evb.pack_start(s,False,False,6)
        s.add(p)
        hb=Gtk.HBox(False,0)
        evb.pack_start(hb,False,False,0)
        b=Gtk.Button(stock=Gtk.STOCK_SAVE)
        b.connect('clicked', self.__save_personal_list_cb)
        hb.pack_start(b,False,False,0)
        self.__load__personal_list()
        self.__lock=False
예제 #20
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     self.l=Gtk.Label()
     h.pack_start(self.l,False,False,0)
     hb=Gtk.HBox(False,2)
     vb.pack_start(hb,False,False,0)
     #hb.pack_start(Gtk.VBox(False,0),True,True,6)
     self.r=Gtk.Button(stock=Gtk.STOCK_REFRESH)
     self.r.connect('clicked',self.__update)
     hb.pack_start(self.r,False,False,6)
     hb.pack_start(LaunchOrInstall(self,_('Details'),'/usr/bin/hardinfo',['hardinfo']),False,False,0)
     b=Gtk.Button(_('Update PCI ID database'))
     b.connect('clicked', self.__update_pciid_cb)
     hb.pack_start(b,False,False,0)
     self.__update()
예제 #21
0
파일: old-os.py 프로젝트: Mrmohanak/occ
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, _('Installed systems:'), 'boot', 40)
        vb = Gtk.VBox(False, 2)
        self.add(vb)

        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        l = Gtk.Label(
            _("This section will help you to search your plugged disks \nfor installed system and add them to grub menu"
              ))
        h.pack_start(l, False, False, 2)

        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        self.apply_b = b = Gtk.Button(
            _('Find and add installed systems to grub menu'))
        b.connect('clicked', self.apply_cb)
        h.pack_start(b, False, False, 2)
예제 #22
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.load()
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     l = Gtk.Label(
         _('ojuba is shipped with samples. You may find an icon to samples on your desktop.'
           ))
     h.pack_start(l, False, False, 2)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     b = Gtk.Button(_("Remove samples icon"))
     b.connect('clicked', self.rm_samples)
     h.pack_start(b, False, False, 2)
     b = Gtk.Button(_("Recreate samples icon"))
     b.connect('clicked', self.mk_samples)
     h.pack_start(b, False, False, 2)
예제 #23
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb = Gtk.VBox(False,2)
     self.add(vb)
     h = Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     l = Gtk.Label(_('Select the default system language'))
     h.pack_start(l,False,False,2)
     h = Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     self.ar_b = b = Gtk.Button("العربية")
     b.connect('clicked', self.set_lang, "ar_EG.utf8")
     h.pack_start(b,False,False,2)
     self.fr_b = b = Gtk.Button("Français")
     b.connect('clicked', self.set_lang, "fr_FR.utf8")
     h.pack_start(b,False,False,2)
     self.en_b = b = Gtk.Button("English")
     b.connect('clicked', self.set_lang)
     h.pack_start(b,False,False,2)
     #h.pack_start(LaunchOrInstall(self, _('Other Language'), lang_fn, ['system-config-language']), False, False, 0)
     self.get_lang()
예제 #24
0
파일: oldrpms.py 프로젝트: ojuba-org/occ
 def __init__(self,ccw):
     self.ts = rpm_TransactionSet()
     self.ts.setVSFlags(rpm_RPMVSF_NOSIGNATURES)
     # will be used to save 450 MB avaliable after copying
     self.LFREE = 450*1024*1024
     
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     l=Gtk.Label(description)
     h.pack_start(l,False,False,2)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     self.ccw.rm_old_rpms_b=b=Gtk.Button(_('Remove old RPM files'))
     b.connect('clicked', self.rm_rpms_cb)
     h.pack_start(b, False,False,2)
     self.ccw.cp_new_rpms_b=b=Gtk.Button(_('Backup new RPM files'))
     b.connect('clicked', self.cp_rpms_cb)
     h.pack_start(b, False,False,2)
예제 #25
0
파일: fonts.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        h=Gtk.HBox(False,2); vb.pack_start(h,True,True,6)
        l=Gtk.Label(description)
        h.pack_start(l,False,False,2)
        h=Gtk.HBox(False,2); vb.pack_start(h,True,True,6)
        p=os.path.expanduser('~/.fonts/')
        if not os.path.exists(p): os.mkdir(p)
        h.pack_start(LaunchFileManager(_("Personal fonts folder"), os.path.expanduser('~/.fonts/'),stock=Gtk.STOCK_SELECT_FONT),False,False,2)

        #b=Gtk.Button(_("System fonts folder"))
        #b.connect('clicked',self.__sys_fonts_cb)
        #h.pack_start(b,False,False,2)
        
        b=NiceButton(_("Import fonts from another installed OS"),stock=Gtk.STOCK_CONVERT)
        b.connect('clicked',self.import_fonts)
        h.pack_start(b,False,False,2)
예제 #26
0
파일: oldrpms.py 프로젝트: Mrmohanak/occ
    def __init__(self, ccw):
        self.ts = rpm_TransactionSet()
        self.ts.setVSFlags(rpm_RPMVSF_NOSIGNATURES)
        # will be used to save 450 MB avaliable after copying
        self.LFREE = 450 * 1024 * 1024

        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        l = Gtk.Label(description)
        h.pack_start(l, False, False, 2)
        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        self.ccw.rm_old_rpms_b = b = Gtk.Button(_('Remove old RPM files'))
        b.connect('clicked', self.rm_rpms_cb)
        h.pack_start(b, False, False, 2)
        self.ccw.cp_new_rpms_b = b = Gtk.Button(_('Backup new RPM files'))
        b.connect('clicked', self.cp_rpms_cb)
        h.pack_start(b, False, False, 2)
예제 #27
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     self.l = Gtk.Label()
     h.pack_start(self.l, False, False, 0)
     hb = Gtk.HBox(False, 2)
     vb.pack_start(hb, False, False, 0)
     #hb.pack_start(Gtk.VBox(False,0),True,True,6)
     self.r = Gtk.Button(stock=Gtk.STOCK_REFRESH)
     self.r.connect('clicked', self.__update)
     hb.pack_start(self.r, False, False, 6)
     hb.pack_start(
         LaunchOrInstall(self, _('Details'), '/usr/bin/hardinfo',
                         ['hardinfo']), False, False, 0)
     b = Gtk.Button(_('Update PCI ID database'))
     b.connect('clicked', self.__update_pciid_cb)
     hb.pack_start(b, False, False, 0)
     self.__update()
예제 #28
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     l = Gtk.Label(_('Select the default system language'))
     h.pack_start(l, False, False, 2)
     h = Gtk.HBox(False, 2)
     vb.pack_start(h, False, False, 6)
     self.ar_b = b = Gtk.Button("العربية")
     b.connect('clicked', self.set_lang, "ar_EG.utf8")
     h.pack_start(b, False, False, 2)
     self.fr_b = b = Gtk.Button("Frensh")
     b.connect('clicked', self.set_lang, "fr_FR.utf8")
     h.pack_start(b, False, False, 2)
     self.en_b = b = Gtk.Button("English")
     b.connect('clicked', self.set_lang)
     h.pack_start(b, False, False, 2)
     #h.pack_start(LaunchOrInstall(self, _('Other Language'), lang_fn, ['system-config-language']), False, False, 0)
     self.get_lang()
예제 #29
0
파일: kernel.py 프로젝트: Mrmohanak/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        self.__k_r=os.uname()[2]
        if self.__k_r.endswith('.PAE'): self.__kernel='kernel-PAE'
        else: self.__kernel='kernel'
        
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        l=Gtk.Label(description)
        h.pack_start(l, False,False,2)
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        b=Gtk.Button(_("Keep only one kernel"))
        b.set_sensitive(self.__count_kernels()>1)
        b.connect('clicked', self.__one_kernel)
        h.pack_start(b, False,False,2)
        if os.uname()[4]!='x86_64':
            h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
            l=Gtk.Label(_('A typical kernel can deal with up to 4GB of RAM.\nPAE kernels can deal with much much more than that.'))
            h.pack_start(l,False,False,2)
            h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
            b=InstallOrInactive(self, _("Install PAE kernel"),_("PAE kernel is installed"), _('kernel which supports larger memory'), ['kernel-PAE'])
            h.pack_start(b, False,False,2)

        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        l=Gtk.Label()
        l.set_markup(_("There are two types of drivers: <i>kmods</i> and <i><b>a</b>kmods</i>.\nAlthough <b>akmod</b> drivers requires: more disk space for the development dependencies,\nthey will automatically generate drivers for\nnewly-installed kernels without breaking the dependency.\nWe strongly recommend that you use <b>akmod</b>."))
        h.pack_start(l, False,False,2)
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        b=Gtk.Button(_("Install corresponding akmods for installed kmods"))
        b.connect('clicked',self.__akmods_cb)
        h.pack_start(b,False,False,2)
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        l=Gtk.Label(_("Developers need kernel documentation and kernel development tools"))
        h.pack_start(l, False,False,2)
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        b=InstallOrInactive(self, _("Install kernel documentation"),_("kernel documentation is already installed"),_('Kernel documentation'),["kernel-doc"])
        h.pack_start(b, False,False,2)
        b=InstallOrInactive(self, _("Install kernel development tools"),_("kernel development package is already installed"),_('needed for building kernel module'),[self.__kernel+"-devel"])
        h.pack_start(b, False,False,2)
예제 #30
0
 def __init__(self, ccw):
     self.__hda_verb_needed = None
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     hb = Gtk.HBox(False, 2)
     vb.pack_start(hb, True, True, 2)
     b = LaunchOrInstall(self, _('Configure printers'),
                         '/usr/bin/system-config-printer',
                         ['system-config-printer'])
     hb.pack_start(b, False, False, 2)
     hb = Gtk.HBox(False, 2)
     vb.pack_start(hb, True, True, 2)
     b = InstallOrInactive(
         self,
         _("Install support for non-standard printers (GDI or winprinters)"
           ), _("extra packages are already installed"),
         _("Install foo2* packages"), [
             "foo2qpdl", "foo2hiperc", "foo2lava", "foo2hp", "foo2slx",
             "foo2xqx", "foo2zjs"
         ])
     hb.pack_start(b, False, False, 2)
예제 #31
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb = Gtk.VBox(False, 2)
        self.add(vb)

        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        l = Gtk.Label(description)
        h.pack_start(l, False, False, 2)

        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        m = InstallOrInactive(
            self, _("Install os prober"), _("os prober is installed"),
            _('package detects other OSes available on a system'),
            ['os-prober'])
        h.pack_start(m, False, False, 2)
        self.apply_b = b = Gtk.Button(
            _('Find and add installed systems to grub menu'))
        b.set_sensitive(not m.get_sensitive())
        b.connect('clicked', self.apply_cb)
        h.pack_start(b, False, False, 2)
예제 #32
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.tdir=self.get_repo_path_cb()
     vb=Gtk.VBox(False,2)
     self.add(vb)
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     l=Gtk.Label(description)
     h.pack_start(l,False,False,2)
     
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     b=Gtk.Button(_('Change directory'))
     b.connect('clicked', self.ch_dir_cb)
     h.pack_start(b, False,False,2)
     l=Gtk.Label(_("Repository directory:"))
     h.pack_start(l,False,False,2)
     self.repo_dir_l = l = Gtk.Label(self.tdir)
     h.pack_start(l,False,False,2)
     
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     self.gen_info_c = c = Gtk.CheckButton(_("Generate local repository informations"))
     #c.set_active(True)
     c.connect("toggled", self.ch_apply_b_sens)
     h.pack_start(c, False,False,2)
     self.write_config_c = c = Gtk.CheckButton(_("Write local repository configuration"))
     #c.set_active(True)
     c.connect("toggled", self.ch_apply_b_sens)
     h.pack_start(c, False,False,2)
     
     h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
     self.apply_b = b = Gtk.Button(_('Create local repository'))
     b.connect('clicked', self.apply_cb)
     h.pack_start(b, False,False,2)
     self.ch_apply_b_sens()
     
     self.rm_repo_b = b = Gtk.Button(_('Remove local repository'))
     b.connect('clicked', self.rm_repo_cb)
     h.pack_end(b, False,False,2)
     self.ch_rm_repo_b_sens()
예제 #33
0
파일: modem.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     vb=Gtk.VBox(False,2)
     self.add(vb)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     hb.pack_start(Gtk.Label(description),False,False,2)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     hb.pack_start(InstallOrInactive(self, _("Install slmodem driver"),_("slmodem driver is installed"), _('driver for some software modems'), ['kmod-slmodem']),False,False,2)
     self.sl_service=Gtk.CheckButton(_("Start slmodem daemon on boot"))
     self.__sl_service_internal=False
     self.sl_service.set_active(chkconfig(5,'slmodem'))
     self.sl_service.connect('toggled', self.sl_service_cb)
     hb.pack_start(self.sl_service,False,False,2)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     self.interface_ls=Gtk.ComboBoxText()
     self.interface_ls.append_text("alsa")
     self.interface_ls.append_text("slamr")
     self.interface_ls.append_text("slusb")
     self.interface_ls.set_active(0)
     hb.pack_start(self.interface_ls,False,False,2)
     b=Gtk.Button(stock=Gtk.STOCK_APPLY)
     b.connect('clicked',self.interface_cb)
     hb.pack_start(b,False,False,2)
예제 #34
0
파일: net.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)     
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,6)
        l=Gtk.Label(description)
        hb.pack_start(l, False,False,2)

        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        hb.pack_start(LaunchOrInstall(self, _('Connection Editor'), '/usr/bin/nm-connection-editor',pkgs=['NetworkManager-gnome']),False,False,0)


        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        l=Gtk.Label(_("""The legacy Network Configuration tool can give you more detailed privileged control over your network.\nIf you have used it please click "Suggest" button"""))
        hb.pack_start(l, False,False,2)
        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        hb.pack_start(LaunchOrInstall(self, _('Network Configuration'), '/usr/bin/system-control-network',pkgs=['system-config-network']),False,False,0)
        b=Gtk.Button(_('Suggest'))
        b.connect('clicked',self.suggest_cb)
        hb.pack_start(b,False,False,0)
예제 #35
0
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)

	self.base=dnf.Base()
	self.base.read_all_repos()
	self.allrepos=self.base.repos.all()
	
        self.count=0
        self.hbox=Gtk.HBox(spacing=20)
        self.add(self.hbox)
        self.vbox1=Gtk.VBox()
        self.vbox2=Gtk.VBox()
        self.grid=Gtk.Grid(row_homogeneous=True)
        self.vbox2.pack_start(self.grid,True,True,0)
        self.hbox.pack_start(self.vbox1,True,True,0)
        self.hbox.pack_start(self.vbox2,True,True,0)
        self.name_label=Gtk.Label(_("<b>Name</b>"),use_markup=True)
        self.vbox1.pack_start(self.name_label,True,True,0)
        self.execute_label=Gtk.Label(_("<b>Switch</b>"),use_markup=True)
        self.grid.attach(self.execute_label,0,self.count,1,1)
        self.count+=1
        
        
        
        
        for repo in self.allrepos:
            self.name=Gtk.Label(repo.name)
            if not repo.enabled:
                self.switch=Gtk.Switch()
            else:
                self.switch=Gtk.Switch()
                self.switch.set_active(True)
            
            self.switch.connect("state-set",self.__enable_or_disable,repo.hawkey_repo.name)
            self.vbox1.pack_start(self.name,True,True,0)
            self.grid.attach(self.switch,0,self.count,1,1)
            self.count+=1
예제 #36
0
파일: vga.py 프로젝트: Mrmohanak/occ
 def __init__(self, ccw):
     self.__lspci = None
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.__dri = None
     self.fps = None
     vb = Gtk.VBox(False, 2)
     self.add(vb)
     hb = Gtk.HBox(False, 2)
     vb.pack_start(hb, True, True, 2)
     l = Gtk.Label()
     l.set_markup(self.dri_result())
     hb.pack_start(l, False, False, 2)
     hb = Gtk.HBox(False, 2)
     vb.pack_start(hb, False, False, 2)
     hb.pack_start(Gtk.Label(_("glxgears Result:")), False, False, 2)
     self.l = Gtk.Label(_("N/A"))
     hb.pack_start(self.l, False, False, 2)
     self.gears_b = Gtk.Button(stock=Gtk.STOCK_EXECUTE)
     hb.pack_start(self.gears_b, False, False, 2)
     hb.pack_start(Gtk.VBox(), True, True, 2)
     hb = Gtk.HBox(False, 2)
     vb.pack_start(hb, True, True, 2)
     self.suggestion = Gtk.Label()
     hb.pack_start(self.suggestion, False, False, 2)
     self.gears_b.connect('clicked', self.gearsExecute)
     self.advanced = Gtk.Expander()
     self.advanced.set_label(_("Advanced options"))
     vb.pack_start(self.advanced, True, True, 2)
     vb = Gtk.VBox(False, 2)
     self.advanced.add(vb)
     self.__nvidia_gui_init(vb)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     self.checkKMS_b = Gtk.Button(_("check KMS"))
     self.disableKMS_b = Gtk.Button(_("disable KMS"))
     self.enableKMS_b = Gtk.Button(_("enable KMS"))
     hb.pack_start(self.checkKMS_b, False, False, 2)
     hb.pack_start(self.disableKMS_b, False, False, 2)
     hb.pack_start(self.enableKMS_b, False, False, 2)
     self.checkKMS_b.connect('clicked', self.checkKMS)
     self.disableKMS_b.connect('clicked', self.disableKMS)
     self.enableKMS_b.connect('clicked', self.enableKMS)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     hb.pack_start(
         LaunchOrInstall(self, _('Configure Display'),
                         '/usr/bin/system-config-display',
                         ['system-config-display']), False, False, 0)
     #self.xorgConf=Gtk.Button(_("create xorg.conf"))
     #hb.pack_start(self.xorgConf,False,False,0)
     #self.xorgConf.connect('clicked',self.call_vga_mechanism,'createXorgConf')
     self.__ati_gui_init(vb)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     self.accelEXA = Gtk.Button(_("use EXA acceleration"))
     self.accelEXA.connect('clicked', self.call_vga_mechanism,
                           'setAccelEXA')
     hb.pack_start(self.accelEXA, False, False, 0)
     self.accelXAA = Gtk.Button(_("use XAA acceleration"))
     self.accelXAA.connect('clicked', self.call_vga_mechanism,
                           'setAccelXAA')
     hb.pack_start(self.accelXAA, False, False, 0)
     self.accelDef = Gtk.Button(_("use default acceleration"))
     self.accelDef.connect('clicked', self.call_vga_mechanism, 'unsetAccel')
     hb.pack_start(self.accelDef, False, False, 0)
     hb = Gtk.HBox(False, 6)
     vb.pack_start(hb, True, True, 2)
     self.swCursor = Gtk.Button(_("use software cursor"))
     self.swCursor.connect('clicked', self.call_vga_mechanism, 'setSWC_on')
     hb.pack_start(self.swCursor, False, False, 0)
     self.swCursorDef = Gtk.Button(_("use default cursor"))
     self.swCursorDef.connect('clicked', self.call_vga_mechanism,
                              'unsetSWC')
     hb.pack_start(self.swCursorDef, False, False, 0)
     #vb.pack_start(Gtk.Label("fooo:"),False,False,2)
     self.suggest()
예제 #37
0
파일: liveusb.py 프로젝트: Mrmohanak/occ
    def __init__(self, ccw):
        self.__dev = bus.get_object(interface, "/org/freedesktop/UDisks")
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        l = Gtk.Label(description)
        h.pack_start(l, False, False, 2)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Source:')), False, False, 2)
        self.src_iso_file = Gtk.RadioButton.new_with_label_from_widget(
            None, label=_('from iso file'))
        hb.pack_start(self.src_iso_file, False, False, 2)
        h = Gtk.HBox(False, 2)
        hb.pack_start(h, False, False, 2)
        self.iso_file_b = Gtk.FileChooserButton(_('Choose live iso file'))
        h.pack_start(self.iso_file_b, False, False, 2)
        self.src_iso_file.connect(
            'toggled', lambda b: self.iso_file_b.set_sensitive(b.get_active()))

        self.src_iso_dev = Gtk.RadioButton.new_with_label_from_widget(
            self.src_iso_file, label=_('from CD/DVD device'))
        hb.pack_start(self.src_iso_dev, False, False, 2)
        self.src_iso_dev_h = h = Gtk.HBox(False, 2)
        hb.pack_start(h, False, False, 2)
        self.src_iso_dev.connect(
            'toggled',
            lambda b: self.src_iso_dev_h.set_sensitive(b.get_active()))
        self.iso_dev_ls = Gtk.ComboBoxText()
        h.pack_start(self.iso_dev_ls, False, False, 2)
        b = Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked', self.refresh_src_dev)
        h.pack_start(b, False, False, 2)
        self.src_iso_dev.set_active(True)
        self.src_iso_file.set_active(True)

        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        h.pack_start(Gtk.Label(_('Target Device:')), False, False, 2)
        self.target_dev_ls = Gtk.ComboBoxText()
        h.pack_start(self.target_dev_ls, True, True, 2)
        b = Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked', self.refresh_target_dev)
        h.pack_start(b, False, False, 2)

        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        h.pack_start(Gtk.Label(_('Target Options:')), False, False, 2)
        self.format = Gtk.CheckButton(_('Format target partition'))
        self.format.set_tooltip_text(
            _('uncheck this button to preserve data on target device'))
        h.pack_start(self.format, False, False, 2)
        self.reset_mbr = Gtk.CheckButton(_('Reset MBR'))
        self.reset_mbr.set_active(True)
        h.pack_start(self.reset_mbr, False, False, 2)
        h.pack_start(Gtk.Label(_('Overlay size:')), False, False, 2)
        self.overlay_size = Gtk.SpinButton()
        self.overlay_size.set_tooltip_text(
            _('size of persistent overlay in MB, 0 to disable'))
        self.overlay_size.set_adjustment(
            Gtk.Adjustment(200, 0, 10240, 10, 0, 0))
        h.pack_start(self.overlay_size, False, False, 2)
        h.pack_start(Gtk.Label(_('MB')), False, False, 0)
        #        TODO: all the below options needs interaction to enter the pass-phrase
        #        h.pack_start(Gtk.Label('Home image size:'), False,False,2)
        #        self.home_size=Gtk.SpinButton()
        #        self.home_size.set_tooltip_text(_('size of home image in MB, 0 to use the overlay'))
        #        self.home_size.set_range(0,10240)
        #        self.home_size.set_value(0)
        #        h.pack_start(self.home_size, False,False,2)
        #        self.home_enc=Gtk.CheckButton(_('encrypted'))
        #        self.home_enc.set_tooltip_text(_('Encrypt Home image'))
        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        b = Gtk.Button(stock=Gtk.STOCK_EXECUTE)
        b.connect('clicked', self.execute)
        h.pack_start(b, False, False, 2)
        h.pack_start(Gtk.Label(_("This will take some time.")), False, False,
                     2)

        ff = Gtk.FileFilter()
        ff.add_pattern('*.[Ii][Ss][Oo]')
        self.iso_file_b.set_filter(ff)
        self.refresh_src_dev()
        self.refresh_target_dev()
예제 #38
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.__allservices = subprocess.Popen(
            "LANG=C TERM=dumb COLUMNS=1024 systemctl list-unit-files  --all --type service --no-legend --no-pager --no-ask-password",
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            shell=True).communicate()[0].decode('utf-8').strip().split()

        self.__all_ss_services = subprocess.Popen(
            "LANG=C TERM=dumb COLUMNS=1024 systemctl list-units  --all --type service --no-legend --no-pager --no-ask-password",
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            shell=True).communicate()[0].decode('utf-8').strip().split("\n")
        self.__ss_black_list = ("dbus.service", "gdm.service",
                                "lightdm.service", "kdm.service",
                                "sddm.service", "mdm.service",
                                "upower.service", "udisks2.service")
        self.__black_list = ("dbus.service", "gdm.service", "lightdm.service",
                             "kdm.service", "sddm.service", "mdm.service",
                             "upower.service", "udisks2.service")

        self.__all_enabled_disabled_services = self.__get_enabled_disabled_service(
        )
        self.__all_start_stop_services = self.__get_start_stop_service()

        self.count = 0
        self.count1 = 0

        self.notebook = Gtk.Notebook()
        self.add(self.notebook)

        self.page1 = Gtk.HBox()
        self.page1.set_border_width(10)
        self.label1 = Gtk.Label(_("Enable/Disable"))
        self.notebook.append_page(self.page1, self.label1)

        self.page2 = Gtk.HBox()
        self.page2.set_border_width(10)
        self.label2 = Gtk.Label(_("Start/Stop"))
        self.notebook.append_page(self.page2, self.label2)

        self.vbox1 = Gtk.VBox()
        self.vbox2 = Gtk.VBox()

        self.vbox3 = Gtk.VBox()
        self.vbox4 = Gtk.VBox()

        self.grid = Gtk.Grid(row_homogeneous=True)
        self.vbox2.pack_start(self.grid, True, True, 0)
        self.page1.pack_start(self.vbox1, True, True, 0)
        self.page1.pack_start(self.vbox2, True, True, 0)
        self.name_label = Gtk.Label(_("<b>Name</b>"), use_markup=True)
        self.vbox1.pack_start(self.name_label, True, True, 0)
        self.execute_label = Gtk.Label(_("<b>Switch</b>"), use_markup=True)
        self.grid.attach(self.execute_label, 0, self.count, 1, 1)
        self.count += 1

        self.grid1 = Gtk.Grid(row_homogeneous=True)
        self.vbox4.pack_start(self.grid1, True, True, 0)
        self.page2.pack_start(self.vbox3, True, True, 0)
        self.page2.pack_start(self.vbox4, True, True, 0)
        self.name_label1 = Gtk.Label(_("<b>Name</b>"), use_markup=True)
        self.vbox3.pack_start(self.name_label1, True, True, 0)
        self.execute_label1 = Gtk.Label(_("<b>Switch</b>"), use_markup=True)
        self.grid1.attach(self.execute_label1, 0, self.count1, 1, 1)
        self.count1 += 1

        for service in self.__all_enabled_disabled_services:
            self.name = Gtk.Label(service[0][:-8])
            if service[1] == "disabled":
                self.switch = Gtk.Switch()
            else:
                self.switch = Gtk.Switch()
                self.switch.set_active(True)

            self.switch.connect("state-set", self.__enable_or_disable,
                                service[0])
            self.vbox1.pack_start(self.name, True, True, 0)
            self.grid.attach(self.switch, 0, self.count, 1, 1)
            self.count += 1

        for service in self.__all_start_stop_services:
            self.name1 = Gtk.Label(service[0][:-8])
            if service[1] == "dead":
                self.switch1 = Gtk.Switch()
            else:
                self.switch1 = Gtk.Switch()
                self.switch1.set_active(True)

            self.switch1.connect("state-set", self.__start_or_stop, service[0])
            self.vbox3.pack_start(self.name1, True, True, 0)
            self.grid1.attach(self.switch1, 0, self.count1, 1, 1)
            self.count1 += 1
예제 #39
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.__lspci = None
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, True, True, 2)
        l = Gtk.Label()
        l.set_markup(
            _("""This is an advanced tool that should <b>NOT</b> be used in normal cases.
If you tried other tools and it fails you may use this tool."""))
        hb.pack_start(l, False, False, 2)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        self.advanced = Gtk.Expander()
        self.advanced.set_label(_("Show Advanced options"))
        hb.pack_start(self.advanced, False, False, 2)
        vbe = Gtk.VBox(False, 2)
        self.advanced.add(vbe)

        f = Gtk.Frame()
        f.set_label(_('initrd generation'))
        vbe.pack_start(f, False, False, 2)
        vb = Gtk.VBox(False, 2)
        f.add(vb)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        l = Gtk.Label(
            _("""initrd file could contain old modules that conflict some proprietary drivers.
You may want to generate a new initrd file."""))
        hb.pack_start(l, False, False, 2)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        b = Gtk.Button(_("Generate initrd"))
        b.set_image(
            Gtk.Image.new_from_stock(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON))
        b.connect('clicked', self.mkinitrd)
        hb.pack_start(b, False, False, 2)

        f = Gtk.Frame()
        f.set_label(_('Xorg.conf creation tool'))
        vbe.pack_start(f, False, False, 2)
        vb = Gtk.VBox(False, 2)
        f.add(vb)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        l = Gtk.Label(
            _("""Xorg.conf is the file that controls X server which is the base of the graphical environment.
This tool will overwrite xorg.conf with a new one that is not based on your working one."""
              ))
        hb.pack_start(l, False, False, 2)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(Gtk.Label(_('Driver:')), False, False, 2)
        self.driver = Gtk.Entry()
        d, tip = self.default_driver()
        self.driver.set_text(d)
        self.driver.set_tooltip_text(
            _('usually a single lower case word like: %s') % tip)
        hb.pack_start(self.driver, False, False, 2)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        self.compiz = Gtk.CheckButton(_("Enable Composite extension"))
        self.compiz.set_active(True)
        self.compiz.set_tooltip_text(
            _('This extention is needed by special effects but could case problems in rare cases.'
              ))
        hb.pack_start(self.compiz, False, False, 2)
        self.aiglx = Gtk.CheckButton(_("Enable AIGLX"))
        self.aiglx.set_active(True)
        self.aiglx.set_tooltip_text(
            _('Enable Accelerated indirect rendering.'))
        hb.pack_start(self.aiglx, False, False, 2)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(Gtk.Label(_('Vertical Refresh Rate:')), False, False, 2)
        self.auto_vref = Gtk.CheckButton(_('auto'))
        self.auto_vref.set_active(True)
        hb.pack_start(self.auto_vref, False, False, 2)
        self.m_vref = Gtk.CheckButton(_('manual:'))
        self.m_vref.set_active(True)
        hb.pack_start(self.m_vref, False, False, 2)
        self.vref = Gtk.SpinButton()
        self.vref.set_tooltip_text(
            _('a value of 85Hz would be nicer on your eyes, lower values like 60Hz would work with LCD or old CRT monitors.'
              ))
        self.vref.set_adjustment(Gtk.Adjustment(85, 50, 120, 5, 0, 0))
        hb.pack_start(self.vref, False, False, 2)
        self.m_vref.connect(
            'toggled',
            lambda b: self.vref.set_sensitive(self.m_vref.get_active()))

        self.res = []
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(Gtk.Label(_('HD Resolutions:')), False, False, 2)
        for i in ['1920×1080', '1280x1024', '1280×720']:
            self.res.append(Gtk.CheckButton(i))
            hb.pack_start(self.res[-1], False, False, 2)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(Gtk.Label(_('LCD Wide Resolutions:')), False, False, 2)
        for i in [
                '2560x1600', '1920x1200', '1680x1050', '1440x900', '1280x800'
        ]:
            self.res.append(Gtk.CheckButton(i))
            hb.pack_start(self.res[-1], False, False, 2)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        hb.pack_start(Gtk.Label(_('Normal Resolutions:')), False, False, 2)
        res = [
            '1600x1200', '1280x960', '1024x768', '800x600', '640x400',
            '320x240', '320x200'
        ]

        for n, i in enumerate(res):
            c = Gtk.CheckButton(i)
            self.res.append(c)
            if n > 1: c.set_active(True)
            hb.pack_start(c, False, False, 2)

        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, False, False, 2)
        b = Gtk.Button(stock=Gtk.STOCK_SAVE)
        b.connect('clicked', self.save)
        hb.pack_start(b, False, False, 2)
        b = Gtk.Button(_('Delete xorg.conf'))
        b.set_image(
            Gtk.Image.new_from_stock(Gtk.STOCK_DELETE, Gtk.IconSize.BUTTON))
        b.set_tooltip_text(_('This will make X use default settings.'))
        b.connect('clicked', self.delete)
        hb.pack_start(b, False, False, 2)
예제 #40
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.GConf=ccw.GConf
     self.dirs=self.get_dirs()
     creatVBox(self, ccw, description, self.GioSettings) 
예제 #41
0
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
	self.__allservices= subprocess.Popen("LANG=C TERM=dumb COLUMNS=1024 systemctl list-unit-files  --all --type service --no-legend --no-pager --no-ask-password",stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True).communicate()[0].decode('utf-8').strip().split()

	self.__all_ss_services= subprocess.Popen("LANG=C TERM=dumb COLUMNS=1024 systemctl list-units  --all --type service --no-legend --no-pager --no-ask-password",stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True).communicate()[0].decode('utf-8').strip().split("\n")
	self.__ss_black_list=("dbus.service","gdm.service","lightdm.service","kdm.service","sddm.service","mdm.service","upower.service","udisks2.service")
	self.__black_list=("dbus.service","gdm.service","lightdm.service","kdm.service","sddm.service","mdm.service","upower.service","udisks2.service")

	self.__all_enabled_disabled_services=self.__get_enabled_disabled_service()
	self.__all_start_stop_services=self.__get_start_stop_service()

        self.count=0
	self.count1=0

	self.notebook=Gtk.Notebook()
	self.add(self.notebook)
	
	self.page1=Gtk.HBox()
	self.page1.set_border_width(10)
	self.label1=Gtk.Label(_("Enable/Disable"))
	self.notebook.append_page(self.page1,self.label1)	
	
	self.page2=Gtk.HBox()
	self.page2.set_border_width(10)
	self.label2=Gtk.Label(_("Start/Stop"))
	self.notebook.append_page(self.page2,self.label2)

        self.vbox1=Gtk.VBox()
        self.vbox2=Gtk.VBox()
	
        self.vbox3=Gtk.VBox()
        self.vbox4=Gtk.VBox()
	
        self.grid=Gtk.Grid(row_homogeneous=True)
        self.vbox2.pack_start(self.grid,True,True,0)
        self.page1.pack_start(self.vbox1,True,True,0)
        self.page1.pack_start(self.vbox2,True,True,0)
        self.name_label=Gtk.Label(_("<b>Name</b>"),use_markup=True)
        self.vbox1.pack_start(self.name_label,True,True,0)
        self.execute_label=Gtk.Label(_("<b>Switch</b>"),use_markup=True)
        self.grid.attach(self.execute_label,0,self.count,1,1)
        self.count+=1
        
        self.grid1=Gtk.Grid(row_homogeneous=True)
        self.vbox4.pack_start(self.grid1,True,True,0)
        self.page2.pack_start(self.vbox3,True,True,0)
        self.page2.pack_start(self.vbox4,True,True,0)
        self.name_label1=Gtk.Label(_("<b>Name</b>"),use_markup=True)
        self.vbox3.pack_start(self.name_label1,True,True,0)
        self.execute_label1=Gtk.Label(_("<b>Switch</b>"),use_markup=True)
        self.grid1.attach(self.execute_label1,0,self.count1,1,1)
        self.count1+=1
        
        
        for service in self.__all_enabled_disabled_services:
            self.name=Gtk.Label(service[0][:-8])
            if  service[1]=="disabled":
                self.switch=Gtk.Switch()
            else:
                self.switch=Gtk.Switch()
                self.switch.set_active(True)
            
            self.switch.connect("state-set",self.__enable_or_disable,service[0])
            self.vbox1.pack_start(self.name,True,True,0)
            self.grid.attach(self.switch,0,self.count,1,1)
            self.count+=1
			
        for service in self.__all_start_stop_services:
            self.name1=Gtk.Label(service[0][:-8])
            if  service[1]=="dead":
                self.switch1=Gtk.Switch()
            else:
                self.switch1=Gtk.Switch()
                self.switch1.set_active(True)
            
            self.switch1.connect("state-set",self.__start_or_stop,service[0])
            self.vbox3.pack_start(self.name1,True,True,0)
            self.grid1.attach(self.switch1,0,self.count1,1,1)
            self.count1+=1
예제 #42
0
파일: power_save.py 프로젝트: Mrmohanak/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)



	if self.__check_if_bat() :
		if self.__check_if_tlp("/usr/lib/systemd/system/tlp.service"):

			c=self.__backup_config_file()
			if not c:
				return
			self.notebook=Gtk.Notebook()
			self.add(self.notebook)

			self.page1=Gtk.HBox()
			self.page1.set_border_width(10)
			self.label1=Gtk.Label(_("Service"))
			self.notebook.append_page(self.page1,self.label1)


			self.page2=Gtk.HBox()
			self.page2.set_border_width(10)
			self.label2=Gtk.Label(_("Advanced Configuration"))
			self.notebook.append_page(self.page2,self.label2)

			self.vbox=Gtk.VBox()
			self.page1.pack_start(self.vbox,True,True,0)
			self.hbox1=Gtk.HBox(spacing=20)
			self.vbox.pack_start(self.hbox1,True,True,0)
			
			self.vb1=Gtk.VBox(spacing=3)
			self.vb2=Gtk.VBox(spacing=3)
			self.vb3=Gtk.VBox()
			self.hbox1.pack_start(self.vb1,True,True,0)
			self.hbox1.pack_start(self.vb2,True,True,0)
			self.hbox1.pack_start(self.vb3,True,True,0)

			self.service_label=Gtk.Label(_("<b>Service Name</b>"),use_markup=True)
			self.enabled_status_label=Gtk.Label(_("<b>Enable/Disable</b>"),use_markup=True)
			self.active_status_label=Gtk.Label(_("<b>Start/Stop</b>"),use_markup=True)


			self.grid1=Gtk.Grid(row_homogeneous=True,row_spacing=5)
			self.grid2=Gtk.Grid(row_homogeneous=True)
			self.grid3=Gtk.Grid(row_homogeneous=True)
			self.vb1.pack_start(self.grid1,False,False,0)
			self.vb2.pack_start(self.grid2,False,False,0)
			self.vb3.pack_start(self.grid3,False,False,0)
			self.grid1.attach(self.service_label,0,0,1,1)
			self.grid2.attach(self.enabled_status_label,0,0,1,1)
			self.grid3.attach(self.active_status_label,0,0,1,1)

			self.tlp_name_label=Gtk.Label("TLP")
			if self.__is_enabled_disable("tlp.service"):
				self.enable_disable_tlp_switch=Gtk.Switch()
				self.enable_disable_tlp_switch.set_active(True)
			else:
				self.enable_disable_tlp_switch=Gtk.Switch()
		
			if self.__is_active_dead("tlp.service"):
				self.start_stop_tlp_switch=Gtk.Switch()
				self.start_stop_tlp_switch.set_active(True)
			else:
				self.start_stop_tlp_switch=Gtk.Switch()

			self.enable_disable_tlp_switch.connect("state-set",self.__enable_or_disable,"tlp.service")
			self.start_stop_tlp_switch.connect("state-set",self.__start_or_stop,"tlp.service")
			
			self.grid1.attach(self.tlp_name_label,0,1,1,1)
			self.grid2.attach(self.enable_disable_tlp_switch,0,1,1,1)
			self.grid3.attach(self.start_stop_tlp_switch,0,1,1,1)

			self.tlp_sleep_name_label=Gtk.Label("TLP SLEEP")
			if self.__is_enabled_disable("tlp-sleep.service"):
				self.enable_disable_tlp_sleep_switch=Gtk.Switch()
				self.enable_disable_tlp_sleep_switch.set_active(True)
			else:
				self.enable_disable_tlp_sleep_switch=Gtk.Switch()

			self.enable_disable_tlp_sleep_switch.connect("state-set",self.__enable_or_disable,"tlp-sleep.service")
			self.grid1.attach(self.tlp_sleep_name_label,0,2,1,1)
			self.grid2.attach(self.enable_disable_tlp_sleep_switch,0,2,1,1)





			################################################################
			self.config=self.__get_tlp_config()
			self.vbox2=Gtk.VBox(spacing=20)
			self.page2.pack_start(self.vbox2,True,True,0)		
			self.hbox2=Gtk.HBox(spacing=20)
			self.vbox2.pack_start(self.hbox2,True,True,0)
		
		
			self.vb4=Gtk.VBox(spacing=20)
			self.vb5=Gtk.VBox(spacing=20)
			self.vb6=Gtk.VBox(spacing=20)
			self.hbox2.pack_start(self.vb4,True,True,0)
			self.hbox2.pack_start(self.vb5,True,True,0)
			self.hbox2.pack_start(self.vb6,True,True,0)

			self.config_label=Gtk.Label("<b>Keys</b>",use_markup=True)
			self.config_none=Gtk.Label("")
			self.value_label=Gtk.Label("<b>Values</b>",use_markup=True)
			self.vb4.pack_start(self.config_label,True,True,0)
			self.vb5.pack_start(self.config_none,True,True,0)
			self.vb6.pack_start(self.value_label,True,True,0)

			for k,v in self.config.items():
				self.key_entry=Gtk.Entry(text=v[0],max_length=50)
				self.key_entry.connect('changed', self.__on_key_changed,[k,v])
				self.vb4.pack_start(self.key_entry,True,True,0)
				self.label=Gtk.Label("=")
				self.vb5.pack_start(self.label,True,True,0)
				self.value_entry=Gtk.Entry(text=v[1],max_length=50)
				self.value_entry.connect('changed', self.__on_value_changed,[k,v])
				self.vb6.pack_start(self.value_entry,True,True,0)


			#########################################################################
			self.hbox3=Gtk.HBox()
			self.vbox2.pack_start(self.hbox3,True,True,0)
			self.apply_button=Gtk.Button(label="Apply")
			self.apply_button.connect("clicked",self.__on_button_clicked)
			self.hbox3.pack_start(self.apply_button,True,True,0)
			#########################################################################
			if os.path.isfile("/etc/default/tlp.backup_by_ojuba_occ"):
				self.hbox4=Gtk.HBox()
				self.vbox2.pack_start(self.hbox4,True,True,0)
				self.restore_button=Gtk.Button("Restore Default Config File")
				self.restore_button.connect("clicked",self.__restore_default_file_config)
				self.hbox4.pack_start(self.restore_button,True,True,0)
	

		else:
			self.hbox=Gtk.HBox()
			self.add(self.hbox)
			self.label=Gtk.Label("No TLP Service Detected")
			self.hbox.pack_start(self.label,True,True,0)

	else:
		self.hbox=Gtk.HBox()
		self.add(self.hbox)
		self.label=Gtk.Label("NO Battery Is Detected")
		self.hbox.pack_start(self.label,True,True,0)
예제 #43
0
파일: xorgconf.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.__lspci=None
        vb=Gtk.VBox(False,2)
        self.add(vb)
        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,True,True,2)
        l=Gtk.Label()
        l.set_markup(_("""This is an advanced tool that should <b>NOT</b> be used in normal cases.
If you tried other tools and it fails you may use this tool."""))
        hb.pack_start(l,False,False,2)
        hb=Gtk.HBox(False,2)
        vb.pack_start(hb,False,False,2)
        self.advanced=Gtk.Expander()
        self.advanced.set_label(_("Show Advanced options"))
        hb.pack_start(self.advanced,False,False,2)
        vbe=Gtk.VBox(False,2)
        self.advanced.add(vbe)
        
        f=Gtk.Frame()
        f.set_label(_('initrd generation'))
        vbe.pack_start(f,False,False,2)
        vb=Gtk.VBox(False,2)
        f.add(vb)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        l=Gtk.Label(_("""initrd file could contain old modules that conflict some proprietary drivers.
You may want to generate a new initrd file."""))
        hb.pack_start(l,False,False,2)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        b=Gtk.Button(_("Generate initrd"))
        b.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON))
        b.connect('clicked', self.mkinitrd)
        hb.pack_start(b,False,False,2)
        
        f=Gtk.Frame()
        f.set_label(_('Xorg.conf creation tool'))
        vbe.pack_start(f,False,False,2)
        vb=Gtk.VBox(False,2)
        f.add(vb)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        l=Gtk.Label(_("""Xorg.conf is the file that controls X server which is the base of the graphical environment.
This tool will overwrite xorg.conf with a new one that is not based on your working one."""))
        hb.pack_start(l,False,False,2)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        hb.pack_start(Gtk.Label(_('Driver:')),False,False,2)
        self.driver=Gtk.Entry()
        d,tip=self.default_driver()
        self.driver.set_text(d)
        self.driver.set_tooltip_text(_('usually a single lower case word like: %s') % tip)
        hb.pack_start(self.driver,False,False,2)
        
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        self.compiz=Gtk.CheckButton(_("Enable Composite extension"))
        self.compiz.set_active(True)
        self.compiz.set_tooltip_text(_('This extention is needed by special effects but could case problems in rare cases.'))
        hb.pack_start(self.compiz,False,False,2)
        self.aiglx=Gtk.CheckButton(_("Enable AIGLX"))
        self.aiglx.set_active(True)
        self.aiglx.set_tooltip_text(_('Enable Accelerated indirect rendering.'))
        hb.pack_start(self.aiglx,False,False,2)
        
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        hb.pack_start(Gtk.Label(_('Vertical Refresh Rate:')),False,False,2)
        self.auto_vref=Gtk.CheckButton(_('auto'))
        self.auto_vref.set_active(True)
        hb.pack_start(self.auto_vref,False,False,2)
        self.m_vref=Gtk.CheckButton(_('manual:'))
        self.m_vref.set_active(True)
        hb.pack_start(self.m_vref,False,False,2)
        self.vref=Gtk.SpinButton()
        self.vref.set_tooltip_text(_('a value of 85Hz would be nicer on your eyes, lower values like 60Hz would work with LCD or old CRT monitors.'))
        self.vref.set_adjustment(Gtk.Adjustment(85, 50, 120, 5, 0, 0))
        hb.pack_start(self.vref,False,False,2)
        self.m_vref.connect('toggled', lambda b: self.vref.set_sensitive(self.m_vref.get_active()))

        self.res=[]
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        hb.pack_start(Gtk.Label(_('HD Resolutions:')),False,False,2)
        for i in ['1920×1080', '1280x1024', '1280×720']:
            self.res.append(Gtk.CheckButton(i))
            hb.pack_start(self.res[-1],False,False,2)

        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        hb.pack_start(Gtk.Label(_('LCD Wide Resolutions:')),False,False,2)
        for i in ['2560x1600', '1920x1200', '1680x1050', '1440x900', '1280x800']:
            self.res.append(Gtk.CheckButton(i))
            hb.pack_start(self.res[-1],False,False,2)


        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        hb.pack_start(Gtk.Label(_('Normal Resolutions:')),False,False,2)
        res=['1600x1200', '1280x960', '1024x768', '800x600', '640x400', '320x240', '320x200']

        for n,i in enumerate(res):
            c=Gtk.CheckButton(i)
            self.res.append(c)
            if n>1: c.set_active(True)
            hb.pack_start(c,False,False,2)

        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,2)
        b=Gtk.Button(stock=Gtk.STOCK_SAVE)
        b.connect('clicked', self.save)
        hb.pack_start(b,False,False,2)
        b=Gtk.Button(_('Delete xorg.conf'))
        b.set_image(Gtk.Image.new_from_stock(Gtk.STOCK_DELETE, Gtk.IconSize.BUTTON))
        b.set_tooltip_text(_('This will make X use default settings.'))
        b.connect('clicked', self.delete)
        hb.pack_start(b,False,False,2)
예제 #44
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.GConf = ccw.GConf
     creatVBox(self, ccw, description, self.gconfsettings,
               self.gconfsettings, False)
예제 #45
0
파일: fav-apps.py 프로젝트: Mrmohanak/occ
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        h = Gtk.HBox(False, 2)
        vb.pack_start(h, False, False, 6)
        l = Gtk.Label(description)
        h.pack_start(l, False, False, 2)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Desktop:')), False, False, 2)
        #hb.pack_start(LaunchOrInstall(self,'Compiz Fusion','/usr/bin/fusion-icon-gtk',['fusion-icon-gtk','compiz-fusion-extras','compiz-fusion-extras-gnome','ccsm','emerald-themes','emerald']),False,False,2)
        hb.pack_end(
            LaunchOrInstall(self, _('Ayat'), '/usr/bin/ayat', ['ayat-basic']),
            False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Gnome Do', '/usr/bin/gnome-do', [
                'gnome-do', 'gnome-do-plugins', 'gnome-do-plugins-firefox',
                'gnome-do-plugins-thunderbird', 'gnome-do-plugins-eog',
                'gnome-do-plugins-pidgin'
            ]), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Avant Window Navigator',
                            '/usr/bin/avant-window-navigator',
                            ['avant-window-navigator']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'cairo dock', '/usr/bin/cairo-dock', [
                'cairo-dock', 'cairo-dock-plug-ins',
                'cairo-dock-plug-ins-webkit'
            ]), False, False, 2)
        #hb.pack_start(LaunchOrInstall(self,'screenlets','/usr/bin/screenlets',['screenlets']),False,False,2)
        hb.pack_end(
            InstallOrInactive(
                self, _('extra screensavers'), _('extra screensavers'),
                _('extra screensavers'), [
                    'xscreensaver-extras', 'xscreensaver-extras-gss',
                    'xscreensaver-gl-base', 'xscreensaver-gl-extras',
                    'xscreensaver-gl-extras-gss', 'rss-glx',
                    'rss-glx-gnome-screensaver'
                ]), False, False, 2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Internet:')), False, False, 2)
        #hb.pack_end(LaunchOrInstall(self,'Chromium browser','/usr/bin/chromium-browser',['chromium']),False,False,2)
        b = Gtk.Button('Opera browser')
        b.connect('clicked', self.inst_opera)
        b.set_sensitive(not which_exe('opera'))
        hb.pack_end(b, False, False, 2)

        hb.pack_end(
            LaunchOrInstall(self, 'gyachi Yahoo chat', '/usr/bin/gyachi',
                            ['gyachi']), False, False, 2)
        hb.pack_end(
            InstallOrInactive(self, 'Skype', 'Skype is installed',
                              'a proprietary video chat', ['skype']), False,
            False, 2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Mobile related:')), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'wammu PC Suite', '/usr/bin/wammu',
                            ['wammu']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'xgnokii', '/usr/bin/xgnokii', ['xgnokii']),
            False, False, 2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Multimedia and Grpahics:')), False, False,
                      2)
        hb.pack_end(
            LaunchOrInstall(self, 'kdenlive video editor', '/usr/bin/kdenlive',
                            ['kdenlive']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'avidemux video editor',
                            '/usr/bin/avidemux2_qt4', ['avidemux-qt']), False,
            False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'kino video editor', '/usr/bin/kino',
                            ['kino']), False, False, 2)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_end(
            LaunchOrInstall(self, 'EasyTag', '/usr/bin/easytag', ['easytag']),
            False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'DeVeDe', '/usr/bin/devede', ['devede']),
            False, False, 2)
        hb.pack_end(
            InstallOrInactive(self, 'GIMP Help', 'GIMP Help', 'GIMP Help',
                              ['gimp-help-browser', 'gimp-help']), False,
            False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Inkscape', '/usr/bin/inkscape',
                            ['inkscape']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Blender 3D',
                            '/usr/bin/blender-freeworld.bin',
                            ['blender-freeworld', 'blenderplayer-freeworld']),
            False, False, 2)
        hb.pack_end(
            InstallOrInactive(self, 'yafray', 'yafray', 'yafray 3D renderer',
                              ['yafray']), False, False, 2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Games:')), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Pingus', '/usr/bin/pingus', ['pingus']),
            False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Wormux', '/usr/bin/wormux', ['wormux']),
            False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, _('Secret Maryo Chronicles'), '/usr/bin/smc',
                            ['smc']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Mega Mario', '/usr/bin/megamario',
                            ['megamario']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'supertux', '/usr/bin/supertux',
                            ['supertux']), False, False, 2)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_end(
            LaunchOrInstall(self, 'Rocks n Diamonds',
                            '/usr/bin/rocksndiamonds', ['rocksndiamonds']),
            False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Enigma', '/usr/bin/enigma', ['enigma']),
            False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'solarwolf', '/usr/bin/solarwolf',
                            ['solarwolf']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'frozen-bubble', '/usr/bin/frozen-bubble',
                            ['frozen-bubble']), False, False, 2)

        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        #hb.pack_start(Gtk.VBox(False,0),True,True,2)

        hb.pack_end(
            LaunchOrInstall(self, 'War Zone 2100', '/usr/bin/warzone2100',
                            ['warzone2100']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'maniadrive', '/usr/bin/maniadrive',
                            ['maniadrive']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'supertuxkart', '/usr/bin/supertuxkart',
                            ['supertuxkart']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'extremetuxracer',
                            '/usr/bin/extremetuxracer', ['extremetuxracer']),
            False, False, 2)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_end(
            LaunchOrInstall(self, 'xmoto', '/usr/bin/xmoto', ['xmoto']), False,
            False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'neverball', '/usr/bin/neverball',
                            ['neverball']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'foobillard', '/usr/bin/foobillard',
                            ['foobillard']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'armacycles-ad', '/usr/bin/armacycles-ad',
                            ['armacycles-ad']), False, False, 2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Development:')), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Nokia Qt Creator', '/usr/bin/qtcreator.bin',
                            ['qt-creator']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Qt Designer', '/usr/bin/designer-qt4',
                            ['qt-devel']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Gambas BASIC', '/usr/bin/gambas2',
                            ['gambas2-ide']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'MonoDevelop for C#', '/usr/bin/monodevelop',
                            ['monodevelop']), False, False, 2)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_end(
            LaunchOrInstall(self, 'Eclipse IDE', '/usr/bin/eclipse', [
                'eclipse-cdt', 'eclipse-changelog', 'eclipse-jdt',
                'eclipse-mylyn', 'eclipse-mylyn-java', 'eclipse-pde',
                'eclipse-pydev', 'eclipse-rpm-editor', 'eclipse-subclipse'
            ]), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Netbeans IDE', '/usr/bin/netbeans',
                            ['netbeans']), False, False, 2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Servers:')), False, False, 2)
        hb.pack_end(
            InstallOrInactive(
                self, _('web server collection'), _('web server collection'),
                _('collection of LAMP web server related packages'), [
                    'httpd', 'crypto-utils', 'distcache', 'httpd-manual',
                    'mod_perl', 'mod_python', 'mod_wsgi', 'mod_ssl', 'php',
                    'php-ldap', 'php-mysql', 'squid', 'webalizer',
                    'system-config-httpd'
                ]), False, False, 2)
        hb.pack_end(
            InstallOrInactive(self, _('ftp server'), _('ftp server'),
                              _('collection of ftp server related packages'),
                              ['vsftpd', 'system-config-vsftpd']), False,
            False, 2)
        hb.pack_end(
            InstallOrInactive(self, _('tomcat collection'),
                              _('tomcat collection'),
                              _('collection of tomcat related packages'), [
                                  'tomcat6-webapps', 'tomcat6-servlet',
                                  'tomcat6-admin-webapps'
                              ]), False, False, 2)
        hb.pack_end(
            InstallOrInactive(
                self, _('Jetty Java Servlet'), _('Jetty Java Servlet'),
                _('Jetty is a pure Java HTTP Server and Servlet Container'),
                ['jetty']), False, False, 2)
        #hb.pack_start(InstallOrInactive(self, _('clustering collection'), _('clustering collection'), _('collection of clustering related packages'), ['cluster-cim', 'cluster-snmp', 'ipvsadm', 'modcluster', 'rgmanager', 'ricci', 'system-config-cluster']),False,False,2)

        vb.pack_start(Separator(), False, False, 6)
        hb = Gtk.HBox(False, 0)
        vb.pack_start(hb, False, False, 6)
        hb.pack_start(Gtk.Label(_('Engineering:')), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'wxMaxima CAS', '/usr/bin/wxmaxima',
                            ['wxMaxima']), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'Qt Octave', '/usr/bin/qtoctave',
                            ['qtoctave']), False, False, 2)
        hb.pack_end(LaunchOrInstall(self, 'qcad', '/usr/bin/qcad', ['qcad']),
                    False, False, 2)
        hb.pack_end(
            InstallOrInactive(
                self, _('Circuits collection'),
                _('Circuits collection already installed'),
                _('Circuits collection'), [
                    'kicad', 'gspiceui', 'gnucap', 'gwave', 'ngspice',
                    'geda-gschem', 'electronics-menu', 'qucs'
                ]), False, False, 2)
        hb.pack_end(
            LaunchOrInstall(self, 'K Stars', '/usr/bin/kstars',
                            ['kdeedu-kstars']), False, False, 2)
예제 #46
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)

        c = self.__backup_config_file()
        if not c:
            return
        self.notebook = Gtk.Notebook()
        self.add(self.notebook)

        self.page1 = Gtk.HBox()
        self.page1.set_border_width(10)
        self.label1 = Gtk.Label(_("Grub Config"))
        self.notebook.append_page(self.page1, self.label1)

        self.page2 = Gtk.HBox()
        self.page2.set_border_width(10)
        self.label2 = Gtk.Label(_("Refresh Boot Loader"))
        self.notebook.append_page(self.page2, self.label2)

        self.__to_order_d = []
        self.config = self.__get_grub_config()

        self.vbox1 = Gtk.VBox(spacing=20)
        self.page1.pack_start(self.vbox1, True, True, 0)
        self.hbox1 = Gtk.HBox(spacing=20)
        self.vbox1.pack_start(self.hbox1, True, True, 0)

        self.vb1 = Gtk.VBox(spacing=20)
        self.vb2 = Gtk.VBox(spacing=20)
        self.vb3 = Gtk.VBox(spacing=20)
        self.hbox1.pack_start(self.vb1, True, True, 0)
        self.hbox1.pack_start(self.vb2, True, True, 0)
        self.hbox1.pack_start(self.vb3, True, True, 0)

        self.config_label = Gtk.Label("<b>Keys</b>", use_markup=True)
        self.config_none = Gtk.Label("")
        self.value_label = Gtk.Label("<b>Values</b>", use_markup=True)
        self.vb1.pack_start(self.config_label, True, True, 0)
        self.vb2.pack_start(self.config_none, True, True, 0)
        self.vb3.pack_start(self.value_label, True, True, 0)

        for n in self.__to_order_d:
            self.key_entry = Gtk.Entry(text=self.config[n][0], max_length=100)
            self.key_entry.connect('changed', self.__on_key_changed,
                                   [n, self.config[n]])
            self.vb1.pack_start(self.key_entry, True, True, 0)
            self.label = Gtk.Label("=")
            self.vb2.pack_start(self.label, True, True, 0)
            self.value_entry = Gtk.Entry(text=self.config[n][1],
                                         max_length=300)
            self.value_entry.connect('changed', self.__on_value_changed,
                                     [n, self.config[n]])
            self.vb3.pack_start(self.value_entry, True, True, 0)

        self.hbox3 = Gtk.HBox()
        self.vbox1.pack_start(self.hbox3, True, True, 0)
        self.apply_button = Gtk.Button(label="Apply")
        self.apply_button.connect("clicked", self.__on_button_clicked)
        self.hbox3.pack_start(self.apply_button, True, True, 0)

        if os.path.isfile("/etc/default/grub.backup_by_ojuba_occ"):
            self.hbox4 = Gtk.HBox()
            self.vbox1.pack_start(self.hbox4, False, False, 0)
            self.restore_button = Gtk.Button("Restore Default Config File")
            self.restore_button.connect("clicked",
                                        self.__restore_default_file_config)
            self.hbox4.pack_start(self.restore_button, True, True, 0)

        self.vbox2 = Gtk.VBox(spacing=10)
        self.page2.pack_start(self.vbox2, True, True, 0)

        #from os-prob.py plugin
        m = InstallOrInactive(
            self, _("Install os prober"), _("os prober is installed"),
            _('package detects other OSes available on a system'),
            ['os-prober'])
        self.vbox2.pack_start(m, False, False, 0)

        self.apply_b = b = Gtk.Button(
            _('Find and add installed systems to grub menu'))
        b.set_sensitive(not m.get_sensitive())
        b.connect('clicked', self.apply_cb)
        self.vbox2.pack_start(b, False, False, 0)
예제 #47
0
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.GConf=ccw.GConf
     creatVBox(self, ccw, description, self.gconfsettings, self.gconfsettings, False) 
예제 #48
0
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)

	c=self.__backup_config_file()
	if not c:
		return
	self.notebook=Gtk.Notebook()
	self.add(self.notebook)
	
	self.page1=Gtk.HBox()
	self.page1.set_border_width(10)
	self.label1=Gtk.Label(_("Grub Config"))
	self.notebook.append_page(self.page1,self.label1)

	self.page2=Gtk.HBox()
	self.page2.set_border_width(10)
	self.label2=Gtk.Label(_("Refresh Boot Loader"))
	self.notebook.append_page(self.page2,self.label2)

	self.__to_order_d=[]
	self.config=self.__get_grub_config()

	self.vbox1=Gtk.VBox(spacing=20)
	self.page1.pack_start(self.vbox1,True,True,0)		
	self.hbox1=Gtk.HBox(spacing=20)
	self.vbox1.pack_start(self.hbox1,True,True,0)
		
		
	self.vb1=Gtk.VBox(spacing=20)
	self.vb2=Gtk.VBox(spacing=20)
	self.vb3=Gtk.VBox(spacing=20)
	self.hbox1.pack_start(self.vb1,True,True,0)
	self.hbox1.pack_start(self.vb2,True,True,0)
	self.hbox1.pack_start(self.vb3,True,True,0)

	self.config_label=Gtk.Label("<b>Keys</b>",use_markup=True)
	self.config_none=Gtk.Label("")
	self.value_label=Gtk.Label("<b>Values</b>",use_markup=True)
	self.vb1.pack_start(self.config_label,True,True,0)
	self.vb2.pack_start(self.config_none,True,True,0)
	self.vb3.pack_start(self.value_label,True,True,0)

	for n in self.__to_order_d:
		self.key_entry=Gtk.Entry(text=self.config[n][0],max_length=100)
		self.key_entry.connect('changed', self.__on_key_changed,[n,self.config[n]])
		self.vb1.pack_start(self.key_entry,True,True,0)
		self.label=Gtk.Label("=")
		self.vb2.pack_start(self.label,True,True,0)
		self.value_entry=Gtk.Entry(text=self.config[n][1],max_length=300)
		self.value_entry.connect('changed', self.__on_value_changed,[n,self.config[n]])
		self.vb3.pack_start(self.value_entry,True,True,0)



	self.hbox3=Gtk.HBox()
	self.vbox1.pack_start(self.hbox3,True,True,0)
	self.apply_button=Gtk.Button(label="Apply")
	self.apply_button.connect("clicked",self.__on_button_clicked)
	self.hbox3.pack_start(self.apply_button,True,True,0)

	if os.path.isfile("/etc/default/grub.backup_by_ojuba_occ"):
		self.hbox4=Gtk.HBox()
		self.vbox1.pack_start(self.hbox4,False,False,0)
		self.restore_button=Gtk.Button("Restore Default Config File")
		self.restore_button.connect("clicked",self.__restore_default_file_config)
		self.hbox4.pack_start(self.restore_button,True,True,0)
	

	self.vbox2=Gtk.VBox(spacing=10)
	self.page2.pack_start(self.vbox2,True,True,0)

	#from os-prob.py plugin
        m=InstallOrInactive(self, _("Install os prober"),_("os prober is installed"), _('package detects other OSes available on a system'), ['os-prober'])
	self.vbox2.pack_start(m,False,False,0)

        self.apply_b = b = Gtk.Button(_('Find and add installed systems to grub menu'))
        b.set_sensitive(not m.get_sensitive())
        b.connect('clicked', self.apply_cb)
	self.vbox2.pack_start(b,False,False,0)
예제 #49
0
파일: liveusb.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        self.__dev = bus.get_object(interface, "/org/freedesktop/UDisks")
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        l=Gtk.Label(description)
        h.pack_start(l,False,False,2)
        hb=Gtk.HBox(False,2); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Source:')), False,False,2)
        self.src_iso_file=Gtk.RadioButton.new_with_label_from_widget(None, label=_('from iso file'))
        hb.pack_start(self.src_iso_file, False,False,2)
        h=Gtk.HBox(False,2); hb.pack_start(h,False,False,2)
        self.iso_file_b=Gtk.FileChooserButton(_('Choose live iso file'))
        h.pack_start(self.iso_file_b, False,False,2)
        self.src_iso_file.connect('toggled', lambda b: self.iso_file_b.set_sensitive(b.get_active()))
        
        self.src_iso_dev=Gtk.RadioButton.new_with_label_from_widget(self.src_iso_file, label=_('from CD/DVD device'))
        hb.pack_start(self.src_iso_dev, False,False,2)
        self.src_iso_dev_h=h=Gtk.HBox(False,2); hb.pack_start(h,False,False,2)
        self.src_iso_dev.connect('toggled', lambda b: self.src_iso_dev_h.set_sensitive(b.get_active()))
        self.iso_dev_ls=Gtk.ComboBoxText()
        h.pack_start(self.iso_dev_ls, False,False,2)
        b=Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked', self.refresh_src_dev)
        h.pack_start(b, False,False,2)
        self.src_iso_dev.set_active(True)
        self.src_iso_file.set_active(True)

        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        h.pack_start(Gtk.Label(_('Target Device:')), False,False,2)
        self.target_dev_ls=Gtk.ComboBoxText()
        h.pack_start(self.target_dev_ls, True,True,2)
        b=Gtk.Button(stock=Gtk.STOCK_REFRESH)
        b.connect('clicked', self.refresh_target_dev)
        h.pack_start(b, False,False,2)

        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        h.pack_start(Gtk.Label(_('Target Options:')), False,False,2)
        self.format=Gtk.CheckButton(_('Format target partition'))
        self.format.set_tooltip_text(_('uncheck this button to preserve data on target device'))
        h.pack_start(self.format, False,False,2)
        self.reset_mbr=Gtk.CheckButton(_('Reset MBR'))
        self.reset_mbr.set_active(True)
        h.pack_start(self.reset_mbr, False,False,2)
        h.pack_start(Gtk.Label(_('Overlay size:')), False,False,2)
        self.overlay_size=Gtk.SpinButton()
        self.overlay_size.set_tooltip_text(_('size of persistent overlay in MB, 0 to disable'))
        self.overlay_size.set_adjustment(Gtk.Adjustment(200, 0, 10240, 10, 0, 0))
        h.pack_start(self.overlay_size, False,False,2)
        h.pack_start(Gtk.Label(_('MB')), False,False,0)
#        TODO: all the below options needs interaction to enter the pass-phrase
#        h.pack_start(Gtk.Label('Home image size:'), False,False,2)
#        self.home_size=Gtk.SpinButton()
#        self.home_size.set_tooltip_text(_('size of home image in MB, 0 to use the overlay'))
#        self.home_size.set_range(0,10240)
#        self.home_size.set_value(0)
#        h.pack_start(self.home_size, False,False,2)
#        self.home_enc=Gtk.CheckButton(_('encrypted'))
#        self.home_enc.set_tooltip_text(_('Encrypt Home image'))
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        b=Gtk.Button(stock=Gtk.STOCK_EXECUTE)
        b.connect('clicked', self.execute)
        h.pack_start(b, False,False,2)
        h.pack_start(Gtk.Label(_("This will take some time.")), False,False,2)

        ff=Gtk.FileFilter(); ff.add_pattern('*.[Ii][Ss][Oo]')
        self.iso_file_b.set_filter(ff)
        self.refresh_src_dev()
        self.refresh_target_dev()
예제 #50
0
파일: vga.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     self.__lspci=None
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.__dri=None
     self.fps=None
     vb=Gtk.VBox(False,2)
     self.add(vb)
     hb=Gtk.HBox(False,2)
     vb.pack_start(hb,True,True,2)
     l=Gtk.Label()
     l.set_markup(self.dri_result())
     hb.pack_start(l,False,False,2)
     hb=Gtk.HBox(False,2)
     vb.pack_start(hb,False,False,2)
     hb.pack_start(Gtk.Label(_("glxgears Result:")),False,False,2)
     self.l=Gtk.Label(_("N/A"))
     hb.pack_start(self.l,False,False,2)
     self.gears_b=Gtk.Button(stock=Gtk.STOCK_EXECUTE)
     hb.pack_start(self.gears_b,False,False,2)
     hb.pack_start(Gtk.VBox(),True,True,2)
     hb=Gtk.HBox(False,2)
     vb.pack_start(hb,True,True,2)
     self.suggestion=Gtk.Label()
     hb.pack_start(self.suggestion,False,False,2)
     self.gears_b.connect('clicked',self.gearsExecute)
     self.advanced=Gtk.Expander()
     self.advanced.set_label(_("Advanced options"))
     vb.pack_start(self.advanced,True,True,2)
     vb=Gtk.VBox(False,2)
     self.advanced.add(vb)
     self.__nvidia_gui_init(vb)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     self.checkKMS_b=Gtk.Button(_("check KMS"))
     self.disableKMS_b=Gtk.Button(_("disable KMS"))
     self.enableKMS_b=Gtk.Button(_("enable KMS"))
     hb.pack_start(self.checkKMS_b,False,False,2)
     hb.pack_start(self.disableKMS_b,False,False,2)
     hb.pack_start(self.enableKMS_b,False,False,2)
     self.checkKMS_b.connect('clicked',self.checkKMS)
     self.disableKMS_b.connect('clicked',self.disableKMS)
     self.enableKMS_b.connect('clicked',self.enableKMS)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     hb.pack_start(LaunchOrInstall(self, _('Configure Display'),'/usr/bin/system-config-display',['system-config-display']),False,False,0)
     #self.xorgConf=Gtk.Button(_("create xorg.conf"))
     #hb.pack_start(self.xorgConf,False,False,0)
     #self.xorgConf.connect('clicked',self.call_vga_mechanism,'createXorgConf')
     self.__ati_gui_init(vb)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     self.accelEXA=Gtk.Button(_("use EXA acceleration"))
     self.accelEXA.connect('clicked', self.call_vga_mechanism,'setAccelEXA')
     hb.pack_start(self.accelEXA,False,False,0)
     self.accelXAA=Gtk.Button(_("use XAA acceleration"))
     self.accelXAA.connect('clicked', self.call_vga_mechanism,'setAccelXAA')
     hb.pack_start(self.accelXAA,False,False,0)
     self.accelDef=Gtk.Button(_("use default acceleration"))
     self.accelDef.connect('clicked', self.call_vga_mechanism,'unsetAccel')
     hb.pack_start(self.accelDef,False,False,0)
     hb=Gtk.HBox(False,6); vb.pack_start(hb,True,True,2)
     self.swCursor=Gtk.Button(_("use software cursor"))
     self.swCursor.connect('clicked',self.call_vga_mechanism,'setSWC_on')
     hb.pack_start(self.swCursor,False,False,0)
     self.swCursorDef=Gtk.Button(_("use default cursor"))
     self.swCursorDef.connect('clicked', self.call_vga_mechanism, 'unsetSWC')
     hb.pack_start(self.swCursorDef,False,False,0)
     #vb.pack_start(Gtk.Label("fooo:"),False,False,2)
     self.suggest()
예제 #51
0
    def __init__(self, ccw):
        self.__hda_verb_needed = None
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb = Gtk.VBox(False, 2)
        self.add(vb)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, True, True, 2)
        hb.pack_start(
            Gtk.Label(
                _("Warning: using headphone at high volume may harm your ears."
                  )), False, False, 2)
        hb = Gtk.HBox(False, 2)
        vb.pack_start(hb, True, True, 2)
        b = Gtk.Button(_("volume up!"))
        hb.pack_start(b, False, False, 2)
        b.connect('clicked', self.vol_up_cb)
        hb.pack_start(
            LaunchOrInstall(self, _("Simple gnome mixer"),
                            '/usr/bin/gnome-volume-control', ['gnome-media']),
            False, False, 2)
        hb.pack_start(
            LaunchOrInstall(self, _("Advanced mixer"), '/usr/bin/gst-mixer',
                            ['gst-mixer']), False, False, 2)

        e = self.is_hda_verb_needed()
        s = []
        if e:
            s.append(
                _("You may need to use HDA fix from advanced options below."))

        if s:
            hb = Gtk.HBox(False, 2)
            vb.pack_start(hb, True, True, 2)
            hb.pack_start(Gtk.Label("\n".join(s)), False, False, 2)

        hb.pack_start(Gtk.VBox(False, 2), False, False, 2)
        self.advanced = Gtk.Expander()
        self.advanced.set_label(_("Advanced options"))
        vb.pack_start(self.advanced, True, True, 2)
        vb = Gtk.VBox(False, 2)
        self.advanced.add(vb)
        hb = Gtk.HBox(False, 6)
        vb.pack_start(hb, True, True, 2)
        hb.pack_start(Gtk.Label(_("HDA fix for Acer Aspire 8920G:")), False,
                      False, 2)
        b = Gtk.Button(_("apply now"))
        b.connect('clicked', self.hda_verb_now)
        hb.pack_start(b, False, False, 2)
        b = Gtk.Button(_("enable at boot"))
        b.connect('clicked', self.hda_verb_at_boot)
        hb.pack_start(b, False, False, 2)
        b = Gtk.Button(_("remove from boot"))
        b.connect('clicked', self.remove_from_boot)
        hb.pack_start(b, False, False, 2)

        hb = Gtk.HBox(False, 6)
        vb.pack_start(hb, True, True, 2)
        hb.pack_start(
            Gtk.Label(
                _("By default sound works in time-based scheduling which consumes less power and CPU load.\nBut some drivers have a problem with time mode.\nIf you experience skipping in sound you may disable this feature."
                  )), False, False, 2)
        hb = Gtk.HBox(False, 6)
        vb.pack_start(hb, True, True, 2)
        self.tbs = Gtk.CheckButton(_("Time-based scheduling"))
        hb.pack_start(self.tbs, False, False, 2)
        b = Gtk.Button(stock=Gtk.STOCK_APPLY)
        b.connect('clicked', self.tbs_cb)
        hb.pack_start(b, False, False, 2)
        hb = Gtk.HBox(False, 6)
        vb.pack_start(hb, True, True, 2)
        hb.pack_start(
            Gtk.Label(
                _("If you have disabled time-based scheduling and the sound still skips, try setting realtime scheduling."
                  )), False, False, 2)
        hb = Gtk.HBox(False, 6)
        vb.pack_start(hb, True, True, 2)
        self.rt_b = Gtk.CheckButton(_("Realtime scheduling"))
        hb.pack_start(self.rt_b, False, False, 2)
        b = Gtk.Button(stock=Gtk.STOCK_APPLY)
        b.connect('clicked', self.rt_cb)
        hb.pack_start(b, False, False, 2)
        self.set_checkbox()
        self.advanced.set_expanded(e)
예제 #52
0
파일: fav-apps.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        l=Gtk.Label(description)
        h.pack_start(l,False,False,2)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6) 
        hb.pack_start(Gtk.Label(_('Desktop:')),False,False,2)
        #hb.pack_start(LaunchOrInstall(self,'Compiz Fusion','/usr/bin/fusion-icon-gtk',['fusion-icon-gtk','compiz-fusion-extras','compiz-fusion-extras-gnome','ccsm','emerald-themes','emerald']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,_('Ayat'),'/usr/bin/ayat',['ayat-basic']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Gnome Do','/usr/bin/gnome-do',['gnome-do','gnome-do-plugins', 'gnome-do-plugins-firefox','gnome-do-plugins-thunderbird', 'gnome-do-plugins-eog','gnome-do-plugins-pidgin']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Avant Window Navigator','/usr/bin/avant-window-navigator',['avant-window-navigator']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'cairo dock','/usr/bin/cairo-dock',['cairo-dock','cairo-dock-plug-ins','cairo-dock-plug-ins-webkit']),False,False,2)
        #hb.pack_start(LaunchOrInstall(self,'screenlets','/usr/bin/screenlets',['screenlets']),False,False,2)
        hb.pack_end(InstallOrInactive(self, _('extra screensavers'), _('extra screensavers'), _('extra screensavers'), ['xscreensaver-extras', 'xscreensaver-extras-gss', 'xscreensaver-gl-base', 'xscreensaver-gl-extras' , 'xscreensaver-gl-extras-gss','rss-glx','rss-glx-gnome-screensaver']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Internet:')),False,False,2)
        #hb.pack_end(LaunchOrInstall(self,'Chromium browser','/usr/bin/chromium-browser',['chromium']),False,False,2)
        b=Gtk.Button('Opera browser')
        b.connect('clicked', self.inst_opera)
        b.set_sensitive(not which_exe('opera'))
        hb.pack_end(b,False,False,2)
        
        hb.pack_end(LaunchOrInstall(self,'gyachi Yahoo chat','/usr/bin/gyachi',['gyachi']),False,False,2)
        hb.pack_end(InstallOrInactive(self, 'Skype', 'Skype is installed','a proprietary video chat', ['skype']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Mobile related:')),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'wammu PC Suite','/usr/bin/wammu',['wammu']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'xgnokii','/usr/bin/xgnokii',['xgnokii']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Multimedia and Grpahics:')),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'kdenlive video editor','/usr/bin/kdenlive',['kdenlive']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'avidemux video editor','/usr/bin/avidemux2_qt4',['avidemux-qt']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'kino video editor','/usr/bin/kino',['kino']),False,False,2)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_end(LaunchOrInstall(self,'EasyTag','/usr/bin/easytag',['easytag']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'DeVeDe','/usr/bin/devede',['devede']),False,False,2)
        hb.pack_end(InstallOrInactive(self, 'GIMP Help', 'GIMP Help', 'GIMP Help', ['gimp-help-browser', 'gimp-help']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Inkscape','/usr/bin/inkscape',['inkscape']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Blender 3D','/usr/bin/blender-freeworld.bin',['blender-freeworld','blenderplayer-freeworld']),False,False,2)
        hb.pack_end(InstallOrInactive(self, 'yafray', 'yafray', 'yafray 3D renderer', ['yafray']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Games:')),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Pingus','/usr/bin/pingus',['pingus']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Wormux','/usr/bin/wormux',['wormux']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,_('Secret Maryo Chronicles'),'/usr/bin/smc',['smc']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Mega Mario', '/usr/bin/megamario',['megamario']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'supertux','/usr/bin/supertux',['supertux']),False,False,2)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_end(LaunchOrInstall(self, 'Rocks n Diamonds','/usr/bin/rocksndiamonds',['rocksndiamonds']),False,False,2)
        hb.pack_end(LaunchOrInstall(self, 'Enigma','/usr/bin/enigma',['enigma']),False,False,2)
        hb.pack_end(LaunchOrInstall(self, 'solarwolf','/usr/bin/solarwolf',['solarwolf']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'frozen-bubble','/usr/bin/frozen-bubble',['frozen-bubble']),False,False,2)

        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        #hb.pack_start(Gtk.VBox(False,0),True,True,2)

        hb.pack_end(LaunchOrInstall(self,'War Zone 2100','/usr/bin/warzone2100',['warzone2100']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'maniadrive','/usr/bin/maniadrive',['maniadrive']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'supertuxkart','/usr/bin/supertuxkart',['supertuxkart']), False,False,2)
        hb.pack_end(LaunchOrInstall(self, 'extremetuxracer','/usr/bin/extremetuxracer',['extremetuxracer']),False,False,2)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_end(LaunchOrInstall(self,'xmoto','/usr/bin/xmoto',['xmoto']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'neverball','/usr/bin/neverball',['neverball']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'foobillard','/usr/bin/foobillard',['foobillard']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'armacycles-ad','/usr/bin/armacycles-ad',['armacycles-ad']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Development:')),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Nokia Qt Creator','/usr/bin/qtcreator.bin',['qt-creator']),False,False,2)
        hb.pack_end(LaunchOrInstall(self, 'Qt Designer', '/usr/bin/designer-qt4', ['qt-devel']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Gambas BASIC','/usr/bin/gambas2',['gambas2-ide']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'MonoDevelop for C#','/usr/bin/monodevelop',['monodevelop']),False,False,2)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_end(LaunchOrInstall(self,'Eclipse IDE', '/usr/bin/eclipse' ,['eclipse-cdt','eclipse-changelog','eclipse-jdt','eclipse-mylyn','eclipse-mylyn-java','eclipse-pde','eclipse-pydev','eclipse-rpm-editor','eclipse-subclipse']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Netbeans IDE', '/usr/bin/netbeans', ['netbeans']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Servers:')),False,False,2)
        hb.pack_end(InstallOrInactive(self, _('web server collection'), _('web server collection'), _('collection of LAMP web server related packages'), ['httpd', 'crypto-utils', 'distcache', 'httpd-manual', 'mod_perl', 'mod_python', 'mod_wsgi', 'mod_ssl', 'php', 'php-ldap', 'php-mysql', 'squid', 'webalizer', 'system-config-httpd']),False,False,2)
        hb.pack_end(InstallOrInactive(self, _('ftp server'), _('ftp server'), _('collection of ftp server related packages'), ['vsftpd', 'system-config-vsftpd']),False,False,2)
        hb.pack_end(InstallOrInactive(self, _('tomcat collection'), _('tomcat collection'), _('collection of tomcat related packages'), ['tomcat6-webapps','tomcat6-servlet','tomcat6-admin-webapps']),False,False,2)
        hb.pack_end(InstallOrInactive(self, _('Jetty Java Servlet'), _('Jetty Java Servlet'), _('Jetty is a pure Java HTTP Server and Servlet Container'), ['jetty']),False,False,2)
        #hb.pack_start(InstallOrInactive(self, _('clustering collection'), _('clustering collection'), _('collection of clustering related packages'), ['cluster-cim', 'cluster-snmp', 'ipvsadm', 'modcluster', 'rgmanager', 'ricci', 'system-config-cluster']),False,False,2)

        vb.pack_start(Separator(),False,False,6)
        hb=Gtk.HBox(False,0); vb.pack_start(hb,False,False,6)
        hb.pack_start(Gtk.Label(_('Engineering:')),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'wxMaxima CAS','/usr/bin/wxmaxima',['wxMaxima']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'Qt Octave','/usr/bin/qtoctave',['qtoctave']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'qcad','/usr/bin/qcad',['qcad']),False,False,2)
        hb.pack_end(InstallOrInactive(self, _('Circuits collection'), _('Circuits collection already installed'), _('Circuits collection'), ['kicad', 'gspiceui', 'gnucap', 'gwave', 'ngspice', 'geda-gschem', 'electronics-menu','qucs']),False,False,2)
        hb.pack_end(LaunchOrInstall(self,'K Stars','/usr/bin/kstars',['kdeedu-kstars']),False,False,2)
예제 #53
0
파일: grub2-edit.py 프로젝트: albakry/occ
    def __init__(self,ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        vb=Gtk.VBox(False,2)
        self.add(vb)
        if not ccw.installed_info('grub2'): 
            h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
            l=Gtk.Label(_("Grub2 not isntalled!"))
            h.pack_start(l, False,False,2)
            return
        self.default_conf()
        self.load_conf(0,self.conf_fn)
        self.load_conf(1,self.user_conf)
        cfg_dir=os.path.dirname(self.user_conf)
        if os.path.isfile(cfg_dir): os.unlink(cfg_dir)
        if not os.path.exists(cfg_dir): os.mkdir(cfg_dir)
        

        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        l=Gtk.Label(description)
        h.pack_start(l, False,False,2)
        
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        h.pack_start(Gtk.Label('%s :' % _("Time out")), False,False,2)
        self.Time_Out = b = Gtk.SpinButton()
        b.set_adjustment(Gtk.Adjustment(1, 1, 90, 1, 1))
        h.pack_start(b, False,False,2)
        h.pack_start(Gtk.Label(_("Seconds")), False,False,2)
        
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        h.pack_start(Gtk.Label('%s :' % _("Kernel options")), False,False,2)
        self.Kernel_Opt = e = Gtk.Entry()
        e.set_width_chars(50)
        h.pack_start(e, False,False,2)
        
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        self.recovery_c = c = Gtk.CheckButton(_('Enabel recovery option'))
        h.pack_start(c, False,False,2)
        
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        self.theme_c = c = Gtk.CheckButton(_('Enabel Grub2 theme'))
        c.connect('toggled',self.update_theme_cb)
        h.pack_start(c, False,False,2)
        
        if os.path.isfile(self.conf[1]['FONT_FILE']): self.font_fn=self.conf[1]['FONT_FILE']
        self.font_nm = self.conf[1]['FONT_NAME']
        self.gfxmode = self.conf[0]['GRUB_GFXMODE']
        self.bg_fn = self.conf[1]['BACKGROUND']
        # Grub2 theme frame
        self.tf = f = Gtk.Frame(); vb.pack_start(f,False,False,6)
        f.set_label(_('Grub2 Theme:'))
        vbox = Gtk.VBox(False,2)
        f.add(vbox)
        
        h=Gtk.HBox(False,2); vbox.pack_start(h,False,False,6)
        l=Gtk.Label(_("This section will help you to change grub2 Font and background (theme)."))
        h.pack_start(l, False,False,2)
        
        h=Gtk.HBox(False,2); vbox.pack_start(h,False,False,6)
        l=Gtk.Label("%s: %s" %(_("Background"),self.bg_fn))
        #b=Gtk.Button(_('Change picture'))
        #b.connect('clicked', self.open_pic_cb, l)
        #h.pack_start(b, False,False,2)
        fc=Gtk.Button(_("Chang background"))
        fc.connect('clicked', self.img_changed, l)
        h.pack_start(fc, False,False,2)
        h.pack_start(l, False,False,2)
        
        h=Gtk.HBox(False,2); vbox.pack_start(h,False,False,6)
        self.img=img=Gtk.Image()
        h.pack_start(img, False, False, 2)
        self.img_preview()
        
        h=Gtk.HBox(False,2); vbox.pack_start(h,False,False,6)
        self.gfxmode_c = c = Gtk.CheckButton('%s    = %s' %(_("Set GFXMODE"), self.gfxmode))
        c.connect('toggled',self.set_gfxmode_cb)
        c.set_tooltip_markup(_('Enable this option if you have boot troubles\n\nIf your monitor got out sync or turned off, While grub2 menu\nPress enter to continue booting, And enable this option.'))
        c.set_active(self.conf[0]['GRUB_GFXMODE']=='800x600')
        h.pack_start(c, False,False,2)
        
        h=Gtk.HBox(False,2); vbox.pack_start(h,False,False,6)
        l=Gtk.Label("%s: %s" %(_("Font name"),self.font_fn))
        b = Gtk.FontButton()
        b.connect('font-set', self.fc_match_cb, l)
        b.set_font_name(self.conf[1]['FONT_NAME']    + ' 12')
        b.set_size_request(300,-1)
        h.pack_start(b, False,False,2)
        h.pack_start(l, False,False,2)
        
        # Apply buuton
        h=Gtk.HBox(False,2); vb.pack_start(h,False,False,6)
        self.apply_b = b = Gtk.Button(_('Apply'))
        b.connect('clicked', self.apply_cb)
        b.set_size_request(200,-1)
        h.pack_end(b, False,False,2)
        self.Time_Out.set_value(self.conf[0]['GRUB_TIMEOUT'])
        self.Kernel_Opt.set_text(self.conf[0]['GRUB_CMDLINE_LINUX'][1:-1])
        self.recovery_c.set_active(not self.conf[0]['GRUB_DISABLE_RECOVERY']=='true')
        self.theme_c.set_active(True)
        #self.theme_c.set_active(self.conf.has_key('GRUB_BACKGROUND') and self.conf['GRUB_BACKGROUND'] != '')
        self.theme_c.set_active(os.path.isfile('/boot/grub2/unicode.pf2'))
예제 #54
0
    def __init__(self, ccw):
        PluginsClass.__init__(self, ccw, caption, category, priority)
        self.location = os.path.dirname(
            os.path.abspath(__file__))[:-7] + "icons/"
        self.desktop = os.getenv("XDG_CURRENT_DESKTOP")

        self.gif_image = random.choice([
            "%stuxtricks.gif" % self.location,
            "%spanguin_bird_flying_red_animation_clipart.GIF" % self.location
        ])

        self.desktop_cc = {
            "GNOME": ["Gnome", "/usr/bin/gnome-control-center"],
            "KDE": ["Kde", "/usr/bin/systemsettings5"],
            "XFCE": ["Xfce", "/usr/bin/xfce4-settings-manager"],
            "X-LXQt": ["Lxqt", "/usr/bin/lxqt-config"],
            "X-Cinnamon": [
                "Cinnamon",
                "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py"
            ],
            "MATE": ["Mate", "/usr/bin/mate-control-center"],
            "X-Hawaii": ["Hawaii", "/usr/bin/hawaii-system-preferences"]
        }

        self.lxde_cc = [
            ["Customize Look and Feel", "/usr/bin/lxappearance"],
            ["Default Applications", "/usr/bin/lxsession-default-apps"],
            ["Desktop Session Settings", "/usr/bin/lxsession-edit"],
            ["Display Settings", "/usr/bin/lxrandr"],
            ["Windows Manager Configuration", "/usr/bin/obconf"],
            ["Input Device Preferences", "/usr/bin/lxinput"]
        ]

        vb = Gtk.VBox(False, 2)
        self.add(vb)
        hb = Gtk.HBox(False, 5)
        vb.pack_start(hb, True, True, 10)
        vb1 = Gtk.VBox(False, 10)
        hb.pack_start(vb1, True, True, 10)

        pixbuf = GdkPixbuf.PixbufAnimation.new_from_file(self.gif_image)
        image = Gtk.Image.new_from_animation(pixbuf)
        vb1.pack_start(image, True, True, 0)

        if self.desktop == "":
            if os.getenv("DESKTOP_SESSION") == "/usr/share/xsessions/openbox":
                vb1.pack_start(
                    LaunchButton(_('Openbox Manager Configuration'),
                                 '/usr/bin/obconf'), False, False, 5)
            else:
                pass

        elif self.desktop == "LXDE":
            for i in self.lxde_cc:
                vb1.pack_start(LaunchButton(_(i[0]), i[1]), True, True, 0)

        elif self.desktop == "GNOME":
            vb1.pack_start(
                LaunchButton(
                    _('%s Control Center' % self.desktop_cc[self.desktop][0]),
                    self.desktop_cc[self.desktop][1]), True, True, 0)

            if os.path.exists("/usr/bin/gnome-tweak-tool"):
                vb1.pack_start(
                    LaunchButton(_('Gnome Tweak Tool'),
                                 '/usr/bin/gnome-tweak-tool'), False, False, 5)
                vb.pack_start(hb, False, False, 6)

        else:
            vb1.pack_start(
                LaunchButton(
                    _('%s Control Center' % self.desktop_cc[self.desktop][0]),
                    self.desktop_cc[self.desktop][1]), True, True, 0)
예제 #55
0
 def __init__(self, ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     self.GConf = ccw.GConf
     self.dirs = self.get_dirs()
     creatVBox(self, ccw, description, self.GioSettings)
예제 #56
0
파일: gnome-icons.py 프로젝트: albakry/occ
 def __init__(self,ccw):
     PluginsClass.__init__(self, ccw, caption, category, priority)
     creatVBox(self, ccw, description, self.GioSettings)