def _setup_overclock(self, builder): self.cputemp_label = builder.get_object("cpuTempLabel") self.overclockbutton = builder.get_object("OverclockButton") self.speedlabel = builder.get_object("SpeedLabel") self.speed_radiobuttons = [ builder.get_object("Default_Speed_radiobutton"), builder.get_object("Mid_Speed_radiobutton"), builder.get_object("High_Speed_radiobutton") ] self.rebootlabel = builder.get_object("OCRebootLabel") self.rebootlabel.set_visible(False) self.start_tempmonitor() self.currentspeed = self._run_piclockspeed('get') self._set_currentspeed() if self.pi_model in self.PI_1800_MODELS: # if Pi is Model 400, disable 1.5GHz, since its default is 1.8GHz self.speed_radiobuttons[0].set_sensitive(False) app_statuslabel = builder.get_object("AppStatusLabel") tab = builder.get_object("OverclockTab") cputempbox = builder.get_object("CPUTempBox") hint.add(tab, app_statuslabel, hint.OVERCLOCK_TAB) hint.add(cputempbox, app_statuslabel, hint.CPU_TEMP) for button in self.speed_radiobuttons: hint.add(button, app_statuslabel, hint.CPU_SPEEDS) if os.path.exists('/boot/firmware/config.txt'): hint.add(self.overclockbutton, app_statuslabel, hint.SPEED_BUTTON) self.overclockbutton.connect("clicked", self.on_overclockbutton_clicked) else: for button in self.speed_radiobuttons: button.set_sensitive(False) hint.add(self.overclockbutton, app_statuslabel, hint.NO_CONFIGTXT) self.speedlabel.set_text("")
def __init__(self, builder): self.logoutloginlabel = builder.get_object("LogoutLoginLabel") self.logoutloginlabel.set_visible(False) self.standardradiobutton = builder.get_object("StandardRadioButton") self.compactradiobutton = builder.get_object("CompactRadioButton") self.miniradiobutton = builder.get_object("MiniRadioButton") gsettings = Gio.Settings.new('org.ubuntubudgie.armconfig') layout = gsettings.get_string('layout-style') if layout == "standard": self.standardradiobutton.set_active(True) elif layout == "compact": self.compactradiobutton.set_active(True) elif layout == "mini": self.miniradiobutton.set_active(True) else: raise SystemExit('Unknown layout to initialise') width, height, xoffset, yoffset = self._get_resolution() resolution = builder.get_object("ResolutionLabel") resolution.set_text(str(width) + " x " + str(height)) standard_recommendation = builder.get_object("StandardRecommendedLabel") compact_recommendation = builder.get_object("CompactRecommendedLabel") mini_recommendation = builder.get_object("MiniRecommendedLabel") if height >= 900: standard_recommendation.set_text("Recommended") compact_recommendation.set_text("") mini_recommendation.set_text("") elif height >= 768: standard_recommendation.set_text("") compact_recommendation.set_text("Recommended") mini_recommendation.set_text("") else: standard_recommendation.set_text("") compact_recommendation.set_text("") mini_recommendation.set_text("Recommended") app_statuslabel = builder.get_object("AppStatusLabel") tab = builder.get_object("LayoutTab") applybutton = builder.get_object("ApplyButton") hint.add(tab, app_statuslabel, hint.LAYOUTS_TAB) hint.add(self.standardradiobutton, app_statuslabel, hint.STANDARD_RES) hint.add(self.compactradiobutton, app_statuslabel, hint.COMPACT_RES) hint.add(self.miniradiobutton, app_statuslabel, hint.MINI_RES) hint.add(applybutton, app_statuslabel, hint.APPLY_LAYOUT)
def __init__(self, builder): # If method='server', it looks for findmypiserver.py running on remote # If method='mac', it will look via mac (needs nmap installed) self.findpi_treeview = FindMyPiTreeView() self.replace_gui(builder) self.findpi_statuslabel = builder.get_object("PiStatusLabel") self.app_statuslabel = builder.get_object("AppStatusLabel") self.refresh_button = builder.get_object("PiRefreshButton") self.copyip_button = builder.get_object("PiCopyIpButton") self.nmap_button = builder.get_object("NmapButton") self.gsettings = Gio.Settings.new('org.ubuntubudgie.armconfig') if self._has_nmap() and self.gsettings.get_boolean('nmapscan'): if self._nmap_warn(): self.findpi_treeview.set_method('mac') self.nmap_button.set_label("Disable nmap") else: self.gsettings.set_boolean('nmapscan', False) self.findpi_treeview.set_method('server') self.nmap_button.set_label("Enable nmap") else: self.findpi_treeview.set_method('server') self.nmap_button.set_label("Enable nmap") self.nmap_button.connect("clicked", self.on_nmap_button_clicked) hint.add(self.nmap_button, self.app_statuslabel, hint.NMAP_BUTTON) self.refresh_button.connect("clicked", self.on_refresh_clicked) hint.add(self.refresh_button, self.app_statuslabel, hint.REFRESH_BUTTON) self.copyip_button.connect("clicked", self.on_copyip_clicked) hint.add(self.copyip_button, self.app_statuslabel, hint.COPYIP_BUTTON) self.findpi_treeview.start()
def __init__(self, builder, device): self.displaygrid = builder.get_object("DisplayGrid") self.moderadiobuttons = [ builder.get_object("FkmsRadioButton"), builder.get_object("KmsRadioButton"), builder.get_object("LegacyRadioButton") ] self.memradiobuttons = [ builder.get_object("Mem128RadioButton"), builder.get_object("Mem256RadioButton"), builder.get_object("Mem512RadioButton") ] self.modebutton = builder.get_object("ModeButton") self.current_mode = '' self.membutton = builder.get_object("MemoryButton") self.current_mem = '' self.rebootlabel = builder.get_object("RebootLabel") self.rebootlabel.set_visible(False) self.app_statuslabel = builder.get_object("AppStatusLabel") tab = builder.get_object("DisplayTab") for button in self.moderadiobuttons: hint.add(button, self.app_statuslabel, hint.VIDEO_MODE) for button in self.memradiobuttons: hint.add(button, self.app_statuslabel, hint.GPU_MEMORY) hint.add(tab, self.app_statuslabel, hint.DISPLAY_TAB) hint.add(self.modebutton, self.app_statuslabel, hint.UPDATE_VIDEO) hint.add(self.membutton, self.app_statuslabel, hint.UPDATE_MEMORY) if device.pi_model is not None: if self.load_initial(): self.modebutton.connect("clicked", self.on_modebutton_clicked) self.memsignal = self.membutton.connect("clicked", self.on_membutton_clicked) if not self.safe_to_change_mode(): self.disable_mode_selection() else: #self.disable_controls() self.displaygrid.set_visible(False)
def disable_controls(self): for button in (self.moderadiobuttons + self.memradiobuttons): button.set_sensitive(False) hint.add(self.modebutton, self.app_statuslabel, hint.NO_PIBOOTCTL) hint.add(self.membutton, self.app_statuslabel, hint.NO_PIBOOTCTL)
def __init__(self, builder, device): self.iplabel = builder.get_object("IPLabel") self.refresh_ip() self.gsettings = Gio.Settings.new('org.ubuntubudgie.armconfig') self.locksetting = Gio.Settings.new('org.gnome.desktop.screensaver') self.run_findmypi = self.gsettings.get_boolean('enableserver') app_statuslabel = builder.get_object("AppStatusLabel") if GLib.find_program_in_path("pipewire") == None: self.found_grd = False else: self.found_grd = True self.vncbutton = builder.get_object("VNCButton") self.vncbutton.connect('clicked', self.vncbuttonclicked) self.vncbutton.set_visible(self.found_grd) self.xrdpbutton = builder.get_object("XRDPButton") self.xrdpbutton.connect('clicked', self.xrdpbuttonclicked) self.xrdpstatuslabel = builder.get_object("XRDPStatusLabel") self.sshstatuslabel = builder.get_object("SSHStatusLabel") self.findmypistatuslabel = builder.get_object("FindMyPiStatusLabel") self.sshbutton = builder.get_object("SSHButton") self.sshbutton.connect('clicked', self.sshbuttonclicked) self.autologincheck = builder.get_object("AutoLoginCheckButton") self.autologincheck.set_active(self.is_autologin()) self.autologin_handler = self.autologincheck.connect( "toggled", self.autologintoggled) self.findmypibutton = builder.get_object("FindMyPiButton") self.findmypibutton.connect('clicked', self.findmypibuttonclicked) tab = builder.get_object("RemoteTab") refresh_ip_button = builder.get_object("RefreshIPButton") hint.add(refresh_ip_button, app_statuslabel, hint.REFRESH_IP) hint.add(self.autologincheck, app_statuslabel, hint.AUTOLOGIN) hint.add(self.findmypibutton, app_statuslabel, hint.FINDMYPI_SERVER) hint.add(self.sshbutton, app_statuslabel, hint.SSH_BUTTON) hint.add(self.xrdpbutton, app_statuslabel, hint.XRDP_BUTTON) hint.add(self.vncbutton, app_statuslabel, hint.VNC_BUTTON) hint.add(tab, app_statuslabel, hint.REMOTE_TAB) if self.run_findmypi: if not self.findmypi_server(): self.start_findmypi() self.findmypistatuslabel.set_text("Server is active") else: self.findmypistatuslabel.set_text("Server is inactive") self.run_remote(self.xrdpstatuslabel, self.XRDP, 'status') if not self.found_grd: self.run_remote(self.sshstatuslabel, self.SSH, 'status')
Gio.resources_register(resource) builder = Gtk.Builder.new_from_resource('/org/ubuntubudgie/armconfig/config.ui') window = builder.get_object("ConfigWindow") window.show_all() standardradiobutton = builder.get_object("StandardRadioButton") compactradiobutton = builder.get_object("CompactRadioButton") miniradiobutton = builder.get_object("MiniRadioButton") startlogincheckbutton = builder.get_object("StartLoginCheckButton") gsettings = Gio.Settings.new('org.ubuntubudgie.armconfig') startlogincheckbutton.set_active(gsettings.get_boolean('runarmconfig')) notebook = builder.get_object('ConfigNotebook') notebook.set_current_page(gsettings.get_int('lastpage')) layoutstyle = Layout(builder) overclock = Overclock(builder, args.force_model, model_list) builder.connect_signals(Handler) app_statuslabel = builder.get_object("AppStatusLabel") hint.add(startlogincheckbutton, app_statuslabel, hint.AUTOSTART) if ((overclock.pi_model is None and not args.force_arm_mode) or args.force_findpi_mode): findmypi = FindMyPi(builder) else: remote = Remote(builder, overclock) display = Display(builder, overclock) Gtk.main()