def _list_populate(self, *args): self.states.clear() for s in self._edit_grp.part.states: ico = None if s == self._edit_grp.part.state.name: ico = Icon(self.states) ico.file_set(self.theme_file, "editje/icon/confirm") ico.scale_set(0, 0) lbl = "%s %.2f" % s self.states.item_append(lbl, None, ico, self._show_actions, s) self.states.go()
def action_add(self, pg_name, label, func_cb, data=None, icon=None, key=None): page = self.__pages.get(pg_name) if page: title, subtitle, box, content, actions, action_btns = page btn = WizardAction(self._parent, label, func_cb, key, data) if icon: ico = Icon(self._parent) ico.file_set(self.__theme_file, "editje/icon/" + icon) btn.icon_set(ico) ico.show() action_btns[label] = btn btn.show() actions.pack_end(btn)
def boot_cmd(win=False): with open("/proc/cmdline") as file1: bootcmd = file1.readline()[:-1] if win: from elementary import Popup, Entry, Button, Icon en = Entry(win) en.entry_set(bootcmd) bt = Button(win) bt.text = "Close" bt.callback_clicked_add(lambda o: popup.delete()) ic = Icon(win) ic.standard_set("system") popup = Popup(win) popup.size_hint_weight = (1.0, 1.0) popup.part_content_set("title,icon", ic) popup.part_text_set("title,text", "Boot Command") popup.part_content_set("default", en) popup.part_content_set("button1", bt) popup.show() else: return bootcmd
def _list_populate(self, *args): self.states.clear() for s in self._edit_grp.part.states: ico = None if s == self._edit_grp.part.state.name: ico = Icon(self.states) ico.file_set(self.theme_file, "editje/icon/confirm") ico.resizable_set(0, 0) lbl = "%s %.2f" % s self.states.item_append(lbl, None, ico, self._show_actions, s) self.states.go()
def action_add(self, pg_name, label, func_cb, data=None, icon=None, key=None): page = self.__pages.get(pg_name) if page: title, subtitle, box, content, actions, action_btns = page btn = WizardAction(self._parent, label, func_cb, key, data) if icon: ico = Icon(self._parent) ico.file_set(self.__theme_file, "editje/icon/" + icon) btn.content_set(ico) ico.show() action_btns[label] = btn btn.show() actions.pack_end(btn)