def gui(self): h = Gtk.HBox(spacing=30) v1 = Gtk.VBox(spacing=2) v1.set_homogeneous(True) v2 = Gtk.VBox(spacing=2) v2.set_homogeneous(True) v3 = Gtk.VBox(spacing=2) v3.set_homogeneous(True) h.pack_start(v1,False,False,0) h.pack_start(v2,False,False,0) h.pack_start(v3,False,False,0) self.vb.pack_start(h,False,False,0) self.nvidiacard.clear() # Froce Stop install nvidia driver right now for k,v in self.nvidiacard.items(): nvidiaicon = get_icon_location("NVLogo_2D.png") nvidiapixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(nvidiaicon,100,100) nvidiaimage = Gtk.Image.new_from_pixbuf(nvidiapixbuf) l1 = Gtk.Label("<b>"+k+" PCI ID "+v[0]+"</b>",use_markup=True) l1.set_line_wrap(True) l1.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) if not nvidia.isdual(): if self.install_or_remove(v[1]): button = Gtk.Button(_("Install")) button.connect("clicked",self.on_install_button_clicked,v[1]) else: button = Gtk.Button(_("Remove")) button.connect("clicked",self.on_remove_button_clicked,v[1]) else: l = Gtk.Label(_("<b>dual GPU Not Supported</b>"),use_markup=True) v1.pack_start(nvidiaimage,False,False,0) v2.pack_start(l1,False,False,0) if not nvidia.isdual(): v3.pack_start(button,True,False,0) else: v3.pack_start(l,True,False,0) broadc= broadcom.broadcom() if broadc: for k,v in broadc.items(): broadcomicon = get_icon_location("broadcom_images.jpg") broadcompixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(broadcomicon,100,100) broadcomimage = Gtk.Image.new_from_pixbuf(broadcompixbuf) l1 = Gtk.Label("<b>"+k+"</b>",use_markup=True) l1.set_line_wrap(True) l1.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) if self.install_or_remove(v[0]): button = Gtk.Button(_("Install")) button.connect("clicked",self.on_install_button_clicked,v[0],"i",True) else: button = Gtk.Button(_("Remove")) button.connect("clicked",self.on_remove_button_clicked,v[0]) v1.pack_start(broadcomimage,False,False,0) v2.pack_start(l1,False,False,0) v3.pack_start(button,True,False,0) self._parent_.show_all()
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) logo_location = get_icon_location("1200px-Tux.svg.png") image = Gtk.Image.new_from_file(logo_location) self._mainbox_.pack_start(image, False, False, 0)
def __init__(self,parent,boxparent): BasePlugin.__init__(self,parent=parent,boxparent=boxparent) self._mainbox_.set_border_width(5) self._mainbox_.set_spacing(20) headericon = get_icon_location("1200px-Tux.svg.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(headericon,100,100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Config Boot Loader\n<span foreground=\"red\">Be Careful</span></b>"),use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage,False,False,0) headerbox.pack_start(headerlabel,False,False,0) headervseparator = Gtk.Separator() headervseparator.set_margin_bottom(10) headervseparator.set_margin_top(30) self.spinner = Gtk.Spinner() self._mainbox_.pack_start(headerbox,False,False,0) self._mainbox_.pack_start(headervseparator,False,False,0) self._mainbox_.pack_start(self.spinner,False,False,0) self.vb=Gtk.VBox(spacing=10) self._mainbox_.pack_start(self.vb,True,False,0) self.gui()
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) mainvbox = Gtk.VBox(spacing=20) mainvbox.set_margin_left(90) mainvbox.set_margin_right(90) self._mainbox_.set_border_width(5) self._mainbox_.pack_start(mainvbox, False, False, 0) headericon = get_icon_location("hdd.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Drives Info</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) headervseparator = Gtk.Separator() headervseparator.set_margin_bottom(30) hbox = Gtk.HBox(spacing=10) mainvbox.pack_start(headerbox, False, False, 0) mainvbox.pack_start(headervseparator, False, False, 0) mainvbox.pack_start(hbox, False, False, 0) vb = Gtk.VBox(spacing=50) drives = get_drives_info(get_all_devices()) for k, v in drives.items(): h = Gtk.HBox(spacing=50) vblogo = Gtk.VBox(spacing=2) vbinfo1 = Gtk.VBox(spacing=2) h.pack_start(vblogo, False, False, 0) h.pack_start(vbinfo1, False, False, 0) pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(v[0], 100, 100) image = Gtk.Image.new_from_pixbuf(pixbuf) vblogo.pack_start(image, False, False, 0) for l in v[1:]: mainlb1 = Gtk.HBox() label1 = Gtk.Label(l, use_markup=True) label1.set_line_wrap(True) label1.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) label1.set_justify(Gtk.Justification.CENTER) mainlb1.pack_start(label1, False, False, 0) vbinfo1.pack_start(mainlb1, False, False, 0) vb.pack_start(h, False, False, 0) mainvbox.pack_start(vb, False, False, 0) fvseparator = Gtk.Separator() fvseparator.set_margin_top(30) fvseparator.set_margin_bottom(30) mainvbox.pack_start(fvseparator, False, False, 0)
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) self._mainbox_.set_border_width(5) self._mainbox_.set_spacing(20) headericon = get_icon_location("GnomeLogoHorizontal.svg") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Gnome Tweak Themes</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) self._mainbox_.pack_start(headerbox, False, False, 0) vseparator = Gtk.Separator() vseparator.set_margin_top(10) self._mainbox_.pack_start(vseparator, False, False, 0) machbox = Gtk.HBox(spacing=20) self._mainbox_.pack_start(machbox, False, False, 0) button_mac_vbox = Gtk.VBox(spacing=1) pixbufmac = GdkPixbuf.Pixbuf.new_from_file_at_size( get_icon_location("Screenshot from 2018-04-08 15-31-58.jpg"), 500, 400) imagemac = Gtk.Image.new_from_pixbuf(pixbufmac) label_mac = Gtk.Label("Ant") button_mac = Gtk.Button() button_mac.connect("clicked", self.on_button_clicked, mac_extensions_to_enable, mac_gsettings, mac_gnome_terminal) button_mac_vbox.pack_start(imagemac, False, False, 0) button_mac_vbox.pack_start(label_mac, False, False, 0) button_mac.add(button_mac_vbox) machbox.pack_start(button_mac, True, False, 0) self.spiner = Gtk.Spinner() self._mainbox_.pack_start(self.spiner, False, False, 0)
def get_drives_info(drives): result = {} bus = dbus.SystemBus() for drive in drives: try: object_ = bus.get_object("org.freedesktop.UDisks2", drive[1]) propos = dbus.Interface(object_, "org.freedesktop.DBus.Properties") id_ = propos.Get("org.freedesktop.UDisks2.Drive", "Id") model = propos.Get("org.freedesktop.UDisks2.Drive", "Model") size = propos.Get("org.freedesktop.UDisks2.Drive", "Size") / 1024 / 1024 speed = propos.Get("org.freedesktop.UDisks2.Drive", "RotationRate") removable = "True" if propos.Get("org.freedesktop.UDisks2.Drive", "Removable") else "False" connectionbus = propos.Get("org.freedesktop.UDisks2.Drive", "ConnectionBus") if not connectionbus: connectionbus = "None" logo_ = get_icon_location( "eject-hard-disk_318-32032.jpg" ) if removable == "True" else get_icon_location( "hard-disk-outline_318-53576.jpg") dr_ = "Drive " + drive[0] id__ = "Id " + id_ model_ = "Model " + model size_ = "Size " + str(round(size, 2)) + "MB" + " {}GB".format( math.ceil(size / 1024)) speed_ = "Speed " + str(speed) removable_ = "Removable " + removable connectionbus_ = "ConnectionBus " + connectionbus result.setdefault(dr_, [ logo_, dr_, id__, model_, size_, speed_, removable_, connectionbus_ ]) except: pass return result
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) self._mainbox_.set_border_width(5) mainvbox = Gtk.VBox(spacing=20) mainvbox.set_border_width(10) mainvbox.set_margin_left(100) mainvbox.set_margin_right(100) self._mainbox_.pack_start(mainvbox, False, False, 0) headericon = get_icon_location("primary-exec.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Get PCI Devices Info</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) mainvbox.pack_start(headerbox, False, False, 0) vseparator = Gtk.Separator() vseparator.set_margin_top(10) mainvbox.pack_start(vseparator, False, False, 0) treestore = Gtk.TreeStore(str) pci_info = self.get_pci_info() for info in pci_info: info = info.strip() if info.startswith("Slot:"): info = pci_info[pci_info.index(info) + 3].split(":", 1)[-1].strip() info = info[::-1].split("[", 1)[-1] tag_ = treestore.append(None, [info[::-1]]) continue treestore.append(tag_, [info]) treeview = Gtk.TreeView() treeview.set_model(treestore) mainvbox.pack_start(treeview, False, False, 0) cellrenderertext = Gtk.CellRendererText() treeviewcolumn = Gtk.TreeViewColumn("PCI Devices") treeview.append_column(treeviewcolumn) treeviewcolumn.pack_start(cellrenderertext, True) treeviewcolumn.add_attribute(cellrenderertext, "text", 0)
def __init__(self,parent,boxparent): BasePlugin.__init__(self,parent=parent,boxparent=boxparent) self.b__ = Gtk.Button() self._mainbox_.set_spacing(20) self._mainbox_.set_margin_left(100) self._mainbox_.set_margin_right(100) headericon = get_icon_location("primary-exec.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(headericon,100,100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Drivers Manager</b>"),use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage,False,False,0) headerbox.pack_start(headerlabel,False,False,0) headervseparator = Gtk.Separator() self._mainbox_.pack_start(headerbox,False,False,0) self._mainbox_.pack_start(headervseparator,False,False,0) self.statuslabel = Gtk.Label(use_markup=True) self.spinner = Gtk.Spinner() self._mainbox_.pack_start(self.spinner,True,True,0) self._mainbox_.pack_start(self.statuslabel,True,True,0) if nvidia.issucureboot(): self.statuslabel.set_label(_("<b>SecureBoot enabled ,Disable SecureBoot From Bios And Try Again</b>")) return refreshbuttonhbox = Gtk.HBox(spacing=3) refreshbuttonhbox.set_homogeneous (True) self.refreshbutton = Gtk.Button(_("Refresh MetaData")) self.refreshbutton.connect("clicked",self.run_refresh_drivers_files) self.refreshbutton2 = Gtk.Button(_("Refresh")) self.refreshbutton2.connect("clicked",self.run_refresh_drivers) refreshbuttonhbox.pack_start(self.refreshbutton,True,True,0) refreshbuttonhbox.pack_start(self.refreshbutton2,True,True,0) self._mainbox_.pack_start(refreshbuttonhbox,False,False,0) self.mainhbox = Gtk.HBox() self.vb = Gtk.VBox(spacing=20) self.mainhbox.add(self.vb) self._mainbox_.pack_start(self.mainhbox,False,False,0) self.nvidiacard = {}
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) self._mainbox_.set_border_width(5) self._mainbox_.set_spacing(20) h = Gtk.HBox() h.set_homogeneous(True) v = Gtk.VBox() headericon = get_icon_location("1200px-Tux.svg.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Update Boot Loader Menu</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) headervseparator = Gtk.Separator() headervseparator.set_margin_bottom(10) headervseparator.set_margin_top(30) self.spinner = Gtk.Spinner() self.t = RunTextView (self._parent_,True,[["pkexec /usr/sbin/update-grub","free",True]],\ cursor_visible=True,end="\n",justification=Gtk.Justification.CENTER,spinner=self.spinner) self.t.set_size_request(200, 200) button = Gtk.Button(_("Update")) button.connect("clicked", self.on_button_clicked) self._mainbox_.pack_start(headerbox, False, False, 0) self._mainbox_.pack_start(headervseparator, False, False, 0) h.pack_start(button, False, False, 0) v.pack_start(self.t, False, False, 0) self._mainbox_.pack_start(h, False, False, 0) self._mainbox_.pack_start(self.spinner, False, False, 0) self._mainbox_.pack_start(v, False, False, 0)
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) self._mainbox_.set_border_width(10) self._mainbox_.set_spacing(30) headericon = get_icon_location("kacsttitle.gif") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Manager Arabic Fonts</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) headervseparator = Gtk.Separator() self.spinner = Gtk.Spinner() self._mainbox_.pack_start(headerbox, False, False, 0) self._mainbox_.pack_start(headervseparator, False, False, 0) self._mainbox_.pack_start(self.spinner, False, False, 0) self.gui()
def __init__(self,parent,boxparent): BasePlugin.__init__(self,parent=parent,boxparent=boxparent) self._mainbox_.set_spacing(25) self.base = dnf.Base() self.base.read_all_repos() self.repos=self.base.repos headericon = get_icon_location("fedora.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(headericon,100,100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Dnf Repos Manager</b>"),use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage,False,False,0) headerbox.pack_start(headerlabel,False,False,0) headervseparator = Gtk.Separator() self._mainbox_.pack_start(headerbox,False,False,0) self._mainbox_.pack_start(headervseparator,False,False,0) searchicon = Gtk.Image() searchicon.set_from_icon_name("edit-find-symbolic", Gtk.IconSize.BUTTON) self.searchbutton = Gtk.ToggleButton() self.searchbutton.add(searchicon) hboxbutton = Gtk.HBox() hboxbutton.pack_start(self.searchbutton,True,False,0) self.searchbutton.connect("toggled", self._on_transition) self._mainbox_.pack_start(hboxbutton,False,False,0) self.revealer = Gtk.Revealer() hboxrevealer = Gtk.HBox() hboxrevealer.pack_start(self.revealer,True,False,0) self.entry = Gtk.SearchEntry(placeholder_text="Search Repo") self.entry.props.margin_left = 15 self.entry.props.margin_right = 15 self.entry.props.margin_top = 5 self.entry.props.margin_bottom = 5 self.entry.connect("search-changed", self._on_search) self.revealer.add(self.entry) self._mainbox_.pack_start(hboxrevealer,False,False,0) mainhbox = Gtk.HBox() vbox = Gtk.VBox(spacing=20) mainhbox.pack_start(vbox,True,False,0) self._mainbox_.pack_start(mainhbox,False,False,0) self.listbox_dnf = Gtk.ListBox() self.listbox_dnf.set_filter_func(self._list_filter_func, None) vbox.pack_start(self.listbox_dnf,False,False,0) for name,repo in self.repos.items(): row_dnf = Gtk.ListBoxRow(activatable=True) self.listbox_dnf.add(row_dnf) h = Gtk.HBox(spacing=10) row_dnf.add(h) h.set_homogeneous (True) labelhbox = Gtk.HBox() switchhbox = Gtk.HBox() label = Gtk.Label(name) label.set_line_wrap(True) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) headerlabel.set_max_width_chars(40) labelhbox.pack_start(label,False,True,0) if not repo.enabled: self.switch=Gtk.Switch() else: self.switch=Gtk.Switch() self.switch.set_active(True) self.switchhandler=self.switch.connect("state-set",self.on_switch_changed,name) switchhbox.pack_start(self.switch,True,False,0) h.pack_start(labelhbox,True,True,0) h.pack_start(switchhbox,True,True,0) self._parent_.connect("key-press-event", self._on_key_press)
def gui(self): if get_selinux_mode()=="disabled": l = Gtk.Label(_("Selinux Is Disabled Nothing To Do")) self._mainbox_.pack_start(l,True,True,0) else: self.mainvbox = Gtk.VBox(spacing=20) self.mainvbox.set_margin_left(90) self.mainvbox.set_margin_right(90) self._mainbox_.set_border_width(5) self._mainbox_.pack_start(self.mainvbox,False,False,0) headericon = get_icon_location("selinux-penguin-new_medium.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(headericon,100,100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Selinux Manager</b>"),use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage,False,False,0) headerbox.pack_start(headerlabel,False,False,0) headervseparator = Gtk.Separator() headervseparator.set_margin_bottom(30) self.mainvbox.pack_start(headerbox,False,False,0) self.mainvbox.pack_start(headervseparator,False,False,0) h_ = Gtk.HBox(spacing=10) hh_ = Gtk.HBox(spacing=10) h_.set_homogeneous (True) vi = Gtk.VBox(spacing=5) v_ = Gtk.VBox(spacing=5) logo__ = get_icon_location("com.mrbimc.selinux.20171031.png") pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(logo__,100,100) image = Gtk.Image.new_from_pixbuf(pixbuf) label = Gtk.Label(_("<b>Set And Apply Selinux Mode</b>"),use_markup=True) #label.set_line_wrap(True) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) label.set_justify(Gtk.Justification.CENTER) self.button1 = Gtk.RadioButton.new_with_label_from_widget(None, _("Enforcing")) self.button2 = Gtk.RadioButton.new_from_widget(self.button1) self.button2.set_label(_("Permissive")) if get_selinux_mode()=="enforcing": self.button1.set_active(True) else: self.button2.set_active(True) self.button1.connect("toggled", self.on_button_toggled) self.button2.connect("toggled", self.on_button_toggled) v_.pack_start(label, False, False, 0) v_.pack_start(self.button1, False, False, 0) v_.pack_start(self.button2, False, False, 0) vi.pack_start(image, False, False, 0) hh_.pack_start(vi, False, False, 0) hh_.pack_start(v_, False, False, 0) h_.pack_start(hh_, False, False, 0) self.mainvbox.pack_start(h_, False, False, 0) self._parent_.show_all()
def gui_(self): self.system_systemd = systemd.SystemDSystem() self.user_systemd = systemd.SystemDUser() self.system_enabled_disabled_service = collections.OrderedDict( sorted(self.system_systemd. get_all_service_timer_enabled_disabled_unit_files_dict( ).items())) self.user_enabled_disabled_service = collections.OrderedDict( sorted(self.user_systemd. get_all_service_timer_enabled_disabled_unit_files_dict( ).items())) headericon = get_icon_location("SYSTEMD-e1434229775958.gif") self.headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>SystemD Service Manager</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) self.headerbox.pack_start(headerimage, False, False, 0) self.headerbox.pack_start(headerlabel, False, False, 0) self._mainbox_.pack_start(self.headerbox, False, False, 0) self.mainhbox = Gtk.HBox() vbox = Gtk.VBox(spacing=20) self.mainhbox.pack_start(vbox, True, False, 0) self._mainbox_.pack_start(self.mainhbox, False, False, 0) if len(self.user_enabled_disabled_service.items()) != 0: usertitlehbox = Gtk.HBox() user_edhbox = Gtk.HBox() user_sthbox = Gtk.HBox() usertitle = Gtk.Label(_("<b>Services Name</b>"), use_markup=True) user_ed = Gtk.Label(_("<b>Enable/Disable</b>"), use_markup=True) user_st = Gtk.Label(_("<b>Start/Stop</b>"), use_markup=True) usertitlehbox.pack_start(usertitle, False, False, 0) user_edhbox.pack_start(user_ed, False, False, 0) user_sthbox.pack_start(user_st, False, False, 0) userlabel = Gtk.Label(_("<b>User Services</b>"), use_markup=True) searchicon = Gtk.Image() searchicon.set_from_icon_name("edit-find-symbolic", Gtk.IconSize.BUTTON) self.searchbutton = Gtk.ToggleButton() self.searchbutton.add(searchicon) hboxbutton = Gtk.HBox() hboxbutton.pack_start(self.searchbutton, True, False, 0) self.searchbutton.connect("toggled", self._on_transition1) self.revealer1 = Gtk.Revealer() hboxrevealer = Gtk.HBox() hboxrevealer.pack_start(self.revealer1, True, False, 0) self.entry1 = Gtk.SearchEntry(placeholder_text="Search Service") self.entry1.props.margin_left = 15 self.entry1.props.margin_right = 15 self.entry1.props.margin_top = 5 self.entry1.props.margin_bottom = 5 self.entry1.connect("search-changed", self._on_search1) self.revealer1.add(self.entry1) uservseparator = Gtk.Separator() uservseparator.set_margin_top(30) h = Gtk.HBox() h.set_homogeneous(True) h.pack_start(usertitlehbox, True, True, 0) h.pack_start(user_edhbox, True, False, 0) h.pack_start(user_sthbox, True, False, 0) vbox.pack_start(uservseparator, False, False, 0) vbox.pack_start(userlabel, False, False, 0) vbox.pack_start(hboxbutton, False, False, 0) vbox.pack_start(hboxrevealer, False, False, 0) vbox.pack_start(h, False, False, 0) self.listbox1 = Gtk.ListBox() self.listbox1.set_filter_func(self._list_filter_func1, None) vbox.pack_start(self.listbox1, False, False, 0) for k, v in self.user_enabled_disabled_service.items(): row = Gtk.ListBoxRow(activatable=True) self.listbox1.add(row) h = Gtk.HBox() row.add(h) h.set_homogeneous(True) labelhbox = Gtk.HBox() label = Gtk.Label(k) label.set_selectable(True) label.set_line_wrap(True) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) label.set_max_width_chars(40) labelhbox.pack_start(label, False, True, 0) if v[0] == "disabled": self.switch = Gtk.Switch() else: self.switch = Gtk.Switch() self.switch.set_active(True) if v[1][3] != "active": self.switch_ = Gtk.Switch() else: self.switch_ = Gtk.Switch() self.switch_.set_active(True) self.switchhandler = self.switch.connect( "state-set", self.on_switch_changed_user_enable_disable, k) self.switchhandler_ = self.switch_.connect( "state-set", self.on_switch_changed_user_start_stop, k) switchhbox = Gtk.HBox() switchhbox_ = Gtk.HBox() switchhbox.pack_start(self.switch, True, False, 0) switchhbox_.pack_start(self.switch_, True, False, 0) h.pack_start(labelhbox, True, True, 0) h.pack_start(switchhbox, True, True, 0) h.pack_start(switchhbox_, True, True, 0) if len(self.system_enabled_disabled_service.items()) != 0: systemtitlehbox = Gtk.HBox() system_edhbox = Gtk.HBox() system_sthbox = Gtk.HBox() systemtitle = Gtk.Label(_("<b>Services Name</b>"), use_markup=True) system_ed = Gtk.Label(_("<b>Enable/Disable</b>"), use_markup=True) system_st = Gtk.Label(_("<b>Start/Stop</b>"), use_markup=True) systemtitlehbox.pack_start(systemtitle, False, False, 0) system_edhbox.pack_start(system_ed, False, False, 0) system_sthbox.pack_start(system_st, False, False, 0) systemlabel = Gtk.Label(_("<b>System Services</b>"), use_markup=True) searchicon = Gtk.Image() searchicon.set_from_icon_name("edit-find-symbolic", Gtk.IconSize.BUTTON) searchbutton = Gtk.ToggleButton() searchbutton.add(searchicon) hboxbutton = Gtk.HBox() hboxbutton.pack_start(searchbutton, True, False, 0) searchbutton.connect("toggled", self._on_transition2) self.revealer2 = Gtk.Revealer() hboxrevealer = Gtk.HBox() hboxrevealer.pack_start(self.revealer2, True, False, 0) self.entry2 = Gtk.SearchEntry(placeholder_text="Search Service") self.entry2.props.margin_left = 15 self.entry2.props.margin_right = 15 self.entry2.props.margin_top = 5 self.entry2.props.margin_bottom = 5 self.entry2.connect("search-changed", self._on_search2) self.revealer2.add(self.entry2) systemvseparator = Gtk.Separator() systemvseparator.set_margin_top(30) h = Gtk.HBox() h.set_homogeneous(True) h.pack_start(systemtitlehbox, True, True, 0) h.pack_start(system_edhbox, True, False, 0) h.pack_start(system_sthbox, True, False, 0) vbox.pack_start(systemvseparator, False, False, 0) vbox.pack_start(systemlabel, False, False, 0) vbox.pack_start(hboxbutton, False, False, 0) vbox.pack_start(hboxrevealer, False, False, 0) vbox.pack_start(h, False, False, 0) self.listbox2 = Gtk.ListBox() self.listbox2.props.margin_bottom = 150 self.listbox2.set_filter_func(self._list_filter_func2, None) vbox.pack_start(self.listbox2, False, False, 0) for k, v in self.system_enabled_disabled_service.items(): row2 = Gtk.ListBoxRow(activatable=True) self.listbox2.add(row2) h = Gtk.HBox() row2.add(h) h.set_homogeneous(True) labelhbox2 = Gtk.HBox() label2 = Gtk.Label(k) label2.set_selectable(True) label2.set_line_wrap(True) label2.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) label2.set_max_width_chars(40) labelhbox2.pack_start(label2, False, True, 0) if v[0] == "disabled": self.switch2 = Gtk.Switch() else: self.switch2 = Gtk.Switch() self.switch2.set_active(True) if v[1][3] != "active": self.switch2_ = Gtk.Switch() else: self.switch2_ = Gtk.Switch() self.switch2_.set_active(True) self.switchhandler2 = self.switch2.connect( "state-set", self.on_switch_changed_system_enable_disable, k) self.switchhandler2_ = self.switch2_.connect( "state-set", self.on_switch_changed_system_start_stop, k) switchhbox2 = Gtk.HBox() switchhbox2_ = Gtk.HBox() switchhbox2.pack_start(self.switch2, True, False, 0) switchhbox2_.pack_start(self.switch2_, True, False, 0) h.pack_start(labelhbox2, True, True, 0) h.pack_start(switchhbox2, True, True, 0) h.pack_start(switchhbox2_, True, True, 0)
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) self.drives_dict = {} mainvbox = Gtk.VBox(spacing=20) mainvbox.set_margin_left(60) mainvbox.set_margin_right(60) vbox1 = Gtk.VBox(spacing=20) vbox2 = Gtk.VBox(spacing=20) self._mainbox_.set_border_width(10) self._mainbox_.set_spacing(30) headericon = get_icon_location("flash-chip.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label( _("<b>Fix USB Flash Memory Adter dd Command</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) headervseparator = Gtk.Separator() self.fixbutton = Gtk.Button(_("Run Fix")) self.fixbutton.connect("clicked", self.on_fixhbutton_clicked) self._mainbox_.pack_start(headerbox, False, False, 0) self._mainbox_.pack_start(headervseparator, False, False, 0) self._mainbox_.pack_start(mainvbox, False, False, 0) self.spinner = Gtk.Spinner() self.spinner.hide() hboxforcecheckbutton = Gtk.HBox(spacing=3) labelforcecheckbutton = Gtk.Label(_("Force\nUmount")) labelforcecheckbutton.set_line_wrap(True) labelforcecheckbutton.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) labelforcecheckbutton.set_max_width_chars(13) labelforcecheckbutton.set_justify(Gtk.Justification.CENTER) self.forcecheckbutton = Gtk.CheckButton() self.forcecheckbutton.set_active(False) self.forcecheckbutton.set_tooltip_text(_("Force Umount")) hboxforcecheckbutton.pack_start(labelforcecheckbutton, False, False, 0) hboxforcecheckbutton.pack_start(self.forcecheckbutton, False, False, 0) combobox = Gtk.HBox(spacing=10) refreshbutton = Gtk.Button(_("Refresh")) refreshbutton.connect("clicked", self.on_refreshbutton_clicked) self.combo = Gtk.ComboBoxText() self.on_refreshbutton_clicked() self.combo.set_active(0) combobox.pack_start(self.combo, True, True, 0) combobox.pack_start(hboxforcecheckbutton, False, False, 0) vbox2.pack_start(combobox, False, False, 0) vbox2.pack_start(self.spinner, False, False, 0) vbox2.pack_start(refreshbutton, False, False, 0) vbox2.pack_start(self.fixbutton, False, False, 0) mainvbox.pack_start(vbox1, False, False, 0) mainvbox.pack_start(vbox2, False, False, 0)
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) mainvbox = Gtk.VBox(spacing=20) self._mainbox_.pack_start(mainvbox, False, False, 0) lock_ = False """desktop=os.getenv("XDG_CURRENT_DESKTOP") if desktop=="": if os.getenv("DESKTOP_SESSION")=="/usr/share/xsessions/openbox": desktop = "OpenBox" desktop_cc={"GNOME" :["Gnome Center",get_icon_location("gnome-logo-icon-23471.png"),"/usr/bin/gnome-control-center"], "KDE" :["Kde Control Center",get_icon_location("11949942481641741323about_kde.svg.hi.png"),"/usr/bin/systemsettings5"] , "XFCE" :["Xfce Control Center",get_icon_location("XFCE-full.sh.png"),"/usr/bin/xfce4-settings-manager"] , "X-LXQt" :["Lxqt Control Center",get_icon_location("lxqt_logo_by_i_sty-d7rmlxd.png"),"/usr/bin/lxqt-config"] , "X-Cinnamon" :["Cinnamon Center",get_icon_location("mintlogo-kde.svg"),"/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py"], "MATE" :["Mate Control Center",get_icon_location("mate_desktop_logo.jpg"),"/usr/bin/mate-control-center"] , "X-Hawaii" :["Hawaii Control Center",get_icon_location("clip_art_illustration_of_a_beautiful_colorful_parrot_sitting_on_a_branch_the_background_has_a_rainbow_and_palm_trees_0515-1102-0914-3316_SMU.jpg"),"/usr/bin/hawaii-system-preferences"], "Openbox" :["Openbox Manager Configuration",get_icon_location("Openbox-logo.png"),"/usr/bin/obconf"] } for k_ in desktop_cc.keys(): if False:#skiped lock_ = True self._mainbox_.set_border_width(100) hbox1 = Gtk.HBox(spacing=10) vbox1 = Gtk.VBox(spacing=20) op = desktop_cc[desktop] vheader = Gtk.VBox(spacing=3) vbox1.pack_start(vheader,False,False,0) label = Gtk.Label("<b>"+op[0]+"</b>",use_markup=True) label.set_line_wrap(True) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) label.set_max_width_chars(13) label.set_justify(Gtk.Justification.CENTER) pixbuf=GdkPixbuf.Pixbuf.new_from_file_at_size(op[1],100,100) image = Gtk.Image.new_from_pixbuf(pixbuf) vheader.pack_start(image,False,False,0) vheader.pack_start(label,False,False,0) bbox = Gtk.HBox() button = Gtk.Button("Run") #button.get_style_context().add_class("destructive-action") button.set_size_request(150,40) button.connect("clicked",self.on_button_clicked,op[2]) hseparator = Gtk.Separator() hseparator.set_margin_top(30) hseparator.set_margin_top(30) bbox.pack_start(button,True,False,0) vbox1.pack_start(bbox,False,False,0) if os.path.isfile("/usr/bin/gnome-tweak-tool") and "GNOME" in k_: i = get_icon_location("gnome_tweak_tool_22409.png") vbox2 = Gtk.VBox(spacing=20) vheader2 = Gtk.VBox(spacing=3) vbox2.pack_start(vheader2,False,False,0) label2 = Gtk.Label("<b>Gnome Tweak Tool</b>",use_markup=True) label2.set_line_wrap(True) label2.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR ) label2.set_max_width_chars(13) pixbuf2=GdkPixbuf.Pixbuf.new_from_file_at_size(i,100,100) image2 = Gtk.Image.new_from_pixbuf(pixbuf2) vheader2.pack_start(image2,False,False,0) vheader2.pack_start(label2,False,False,0) bbox2 = Gtk.HBox() button2 = Gtk.Button("Run") #button2.get_style_context().add_class("destructive-action") button2.set_size_request(150,40) button2.connect("clicked",self.on_button_clicked,"/usr/bin/gnome-tweak-tool") bbox2.pack_start(button2,True,False,0) vbox2.pack_start(bbox2,False,False,0) hbox1.pack_start(vbox1,True,False,0) if os.path.isfile("/usr/bin/gnome-tweak-tool") and "GNOME" in k_: hbox1.pack_start(hseparator,True,False,0) hbox1.pack_start(vbox2,True,False,0) mainvbox.pack_start(hbox1,False,False,0) else: vseparator = Gtk.Separator() vseparator.set_margin_top(10) mainvbox.pack_start(hbox1,False,False,0) mainvbox.pack_start(vseparator,False,False,0)""" if not lock_: self._mainbox_.set_border_width(5) 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"] ] lxde_logo = get_icon_location("cropped-lxde-icon.png") hbox1 = Gtk.HBox(spacing=10) vbox1 = Gtk.VBox(spacing=20) vheader = Gtk.VBox(spacing=3) vbox1.pack_start(vheader, False, False, 0) label = Gtk.Label(_("<b>Lxde Control Programs</b>"), use_markup=True) label.set_line_wrap(True) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) label.set_max_width_chars(13) label.set_justify(Gtk.Justification.CENTER) pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( lxde_logo, 100, 100) image = Gtk.Image.new_from_pixbuf(pixbuf) vheader.pack_start(image, False, False, 0) vheader.pack_start(label, False, False, 0) for i in lxde_cc: if os.path.isfile(i[1]): button = Gtk.Button(i[0]) #button.get_style_context().add_class("destructive-action") button.set_size_request(150, 40) button.connect("clicked", self.on_button_clicked, i[1]) vbox1.pack_start(button, False, False, 0) vseparator = Gtk.Separator() vseparator.set_margin_top(10) hbox1.pack_start(vbox1, True, False, 0) mainvbox.pack_start(hbox1, False, False, 0) mainvbox.pack_start(vseparator, False, False, 0)
def __init__(self, parent, boxparent): BasePlugin.__init__(self, parent=parent, boxparent=boxparent) self._mainbox_.set_border_width(5) mainvbox = Gtk.VBox(spacing=20) mainvbox.set_border_width(10) mainvbox.set_margin_left(100) mainvbox.set_margin_right(100) self._mainbox_.pack_start(mainvbox, False, False, 0) headericon = get_icon_location("primary-exec.png") headerbox = Gtk.VBox(spacing=6) headerpixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( headericon, 100, 100) headerimage = Gtk.Image.new_from_pixbuf(headerpixbuf) headerlabel = Gtk.Label(_("<b>Get Exec</b>"), use_markup=True) headerlabel.set_line_wrap(True) headerlabel.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) headerlabel.set_max_width_chars(13) headerlabel.set_justify(Gtk.Justification.CENTER) headerbox.pack_start(headerimage, False, False, 0) headerbox.pack_start(headerlabel, False, False, 0) mainvbox.pack_start(headerbox, False, False, 0) vseparator = Gtk.Separator() vseparator.set_margin_top(10) mainvbox.pack_start(vseparator, False, False, 0) vb = Gtk.VBox(spacing=10) hb = Gtk.HBox(spacing=10) vmainbox = Gtk.VBox(spacing=30) hbox1 = Gtk.HBox(spacing=10) hbox2 = Gtk.HBox(spacing=10) hbox3 = Gtk.HBox(spacing=10) hbox4 = Gtk.HBox(spacing=10) hbox5 = Gtk.HBox(spacing=10) hbox6 = Gtk.HBox(spacing=10) hbox0 = Gtk.HBox(spacing=10) self.filenameentry = Gtk.Entry() self.filenameentry.set_placeholder_text(_("Enter Program Name...")) self.filenameentry.set_max_length(63) argv_check_vbox = Gtk.VBox(spacing=2) argv_label = Gtk.Label("argv") self.argv_check = Gtk.CheckButton() self.argv_check.set_tooltip_text(_("Get Command with argv")) self.argv_check.set_active(True) self.label1 = Gtk.Label(_("Name : ")) self.label2 = Gtk.Label(_("Command : ")) self.label3 = Gtk.Label(_("Path : ")) self.label0 = Gtk.Label(_("File : ")) self.label1.set_line_wrap(True) self.label2.set_line_wrap(True) self.label3.set_line_wrap(True) self.label0.set_line_wrap(True) self.label1_ = Gtk.Label() self.label2_ = Gtk.Label() self.label3_ = Gtk.Label() self.label0_ = Gtk.Label() self.label1_.set_line_wrap(True) self.label2_.set_line_wrap(True) self.label3_.set_line_wrap(True) self.label0_.set_line_wrap(True) self.label1_.set_selectable(True) self.label2_.set_selectable(True) self.label3_.set_selectable(True) self.label0_.set_selectable(True) button_vbox = Gtk.VBox(spacing=5) run_button = Gtk.Button(_("Get")) run_button.connect("clicked", self.on_run_button_clicked) argv_check_vbox.pack_start(argv_label, True, True, 0) argv_check_vbox.pack_start(self.argv_check, True, True, 0) hbox1.pack_start(self.filenameentry, True, True, 0) hbox1.pack_start(argv_check_vbox, False, False, 0) hbox2.pack_start(self.label1, False, False, 0) hbox2.pack_start(self.label1_, False, False, 0) hbox3.pack_start(self.label2, False, False, 0) hbox3.pack_start(self.label2_, False, False, 0) hbox4.pack_start(self.label3, False, False, 0) hbox4.pack_start(self.label3_, False, False, 0) hbox0.pack_start(self.label0, False, False, 0) hbox0.pack_start(self.label0_, False, False, 0) hbox5.pack_start(run_button, True, True, 0) button_vbox.pack_start(hbox5, True, True, 0) vmainbox.pack_start(hbox1, True, True, 0) vmainbox.pack_start(hbox2, True, True, 0) vmainbox.pack_start(hbox3, True, True, 0) vmainbox.pack_start(hbox4, True, True, 0) vmainbox.pack_start(hbox0, True, True, 0) vmainbox.pack_start(button_vbox, True, True, 0) hb.pack_start(vmainbox, True, True, 0) vb.pack_start(hb, True, True, 0) mainvbox.pack_start(vb, False, False, 0) vseparator = Gtk.Separator() vseparator.set_margin_top(10) mainvbox.pack_start(vseparator, False, False, 0)