def en_wait(self, fs): path = fs.selected_get() if os.path.exists(path): self.init_wait(fs, path) return else: self.fs.selected_set(HOME) self.fs.path_set(HOME) checks.file_noexist_popup(self.win)
def __init__(self, command=False): # ----Main Window win = self.win = elm.StandardWindow("edeb", "eDeb") win.callback_delete_request_add(lambda o: elm.exit()) vbox = elm.Box(win) vbox.padding_set(5, 25) vbox.size_hint_align_set(-1.0, -1.0) vbox.size_hint_weight_set(1.0, 1.0) vbox.show() sep = elm.Separator(win) sep.horizontal_set(True) vbox.pack_end(sep) sep.show() fsbox = elm.Box(win) fsbox.size_hint_align_set(-1.0, -1.0) fsbox.size_hint_weight_set(1.0, 1.0) vbox.pack_end(fsbox) fsbox.show() fs = self.fs = elm.FileselectorEntry(win) fs.text_set("Select .deb file") fs.window_title_set("Select a .deb file:") fs.expandable_set(False) fs.inwin_mode_set(True) fs.is_save_set(True) fs.path_set(HOME) fs.callback_file_chosen_add(self.init_wait) fs.callback_activated_add(self.en_wait) fs.size_hint_align_set(-1.0, -1.0) fs.size_hint_weight_set(1.0, 1.0) fsbox.pack_end(fs) fs.show() fil = elm.Box(win) fil.size_hint_align_set(-1.0, -1.0) fil.size_hint_weight_set(1.0, 1.0) vbox.pack_end(fil) fil.show() btbox = elm.Box(win) btbox.size_hint_align_set(-1.0, -1.0) btbox.size_hint_weight_set(1.0, 0.0) vbox.pack_end(btbox) btbox.show() tb = elm.Toolbar(self.win) tb.size_hint_weight_set(1.0, 0.0) tb.size_hint_align_set(-1.0, -1.0) self.bt1 = tb.item_append("", "Install", self.inst_check, win) tb.select_mode_set(2) btbox.pack_end(tb) tb.show() tb = elm.Toolbar(self.win) tb.size_hint_weight_set(1.0, 0.0) tb.size_hint_align_set(-1.0, -1.0) self.bt2 = tb.item_append("", "Package Info", self.bt_wait) tb.select_mode_set(2) btbox.pack_end(tb) tb.show() sep = elm.Separator(win) sep.horizontal_set(True) vbox.pack_end(sep) sep.show() win.resize_object_add(vbox) win.resize(425, 285) win.show() # -------Add deb from CLI if clargs.deb: separator_string = " " path = separator_string.join(clargs.deb) if os.path.exists(path): self.fs.path_set("%s" % path) self.fs.selected_set("%s" % path) self.et = ecore.Timer(0.11, self.cli_add, path) self.n = n = elm.Notify(self.win) lb = elm.Label(self.win) lb.text = "<b>Loading Package Information...</b>" lb.size_hint_align = 0.0, 0.5 lb.show() n.orient = 1 n.allow_events_set(False) n.content = lb n.show() else: checks.file_noexist_popup(self.win)