def onClick(self, sender=None): selection = self.parent().parent().currentSelectedElements if not selection: return for s in selection: if isinstance(s, self.parent().parent().nodeWidget): i = html5.ext.InputDialog(translate("Directory Name"), successHandler=self.editDir, value=s.data["name"]) i.dirKey = s.data["key"] return pane = Pane("Edit", closeable=True, iconClasses=[ "modul_%s" % self.parent().parent().module, "apptype_tree", "action_edit" ]) conf["mainWindow"].stackPane(pane, focus=True) skelType = "leaf" edwg = EditWidget(self.parent().parent().module, EditWidget.appTree, key=s.data["key"], skelType=skelType) pane.addWidget(edwg)
def openEditor(self, key): pane = Pane(translate("Edit"), closeable=True, iconURL="icons-edit", iconClasses=[ "modul_%s" % self.logObj["modul"], "apptype_list", "action_edit" ]) conf["mainWindow"].stackPane(pane, focus=True) edwg = EditWidget(self.logObj["modul"], EditWidget.appList, key=key) pane.addWidget(edwg)
def openLog(self): apane = Pane(translate("Log"), closeable=True, iconClasses=["apptype_list"], collapseable=True) wg = logWidget(self.logsList) apane.addWidget(wg) conf["mainWindow"].addPane(apane) conf["mainWindow"].focusPane(apane)
def openEdit(self, key): apane = Pane( translate("Edit"), closeable=True, iconClasses=["module_%s" % "user", "apptype_list", "action_edit"], collapseable=True) conf["mainWindow"].addPane(apane) edwg = EditWidget("user", EditWidget.appList, key=key) actions = edwg.actionbar.getActions() actions.append("cancel.close") edwg.actionbar.setActions(actions, widget=edwg) apane.addWidget(edwg) conf["mainWindow"].focusPane(apane)
def handleInitialHash(self, pathList, params): assert self.canHandleInitialHash(pathList, params) if pathList[1] == "list": wdg = displayDelegateSelector.select(self.moduleName, self.moduleInfo) assert wdg is not None, "Got no handler for %s" % self.moduleName node = None if len(pathList) >= 3 and pathList[2]: node = pathList[2] self.addWidget(wdg(self.moduleName, node=node)) self.focus() elif pathList[1] in ["edit", "clone"] and len(pathList) > 2: pane = Pane(translate("Edit"), closeable=True, iconURL="icons-edit", iconClasses=[ "module_%s" % self.moduleName, "apptype_hierarchy", "action_edit" ]) edwg = EditWidget(self.moduleName, EditWidget.appHierarchy, key=pathList[2], hashArgs=(params or None), clone=pathList[1] == "clone") pane.addWidget(edwg) conf["mainWindow"].addPane(pane, parentPane=self) pane.focus()
def openEditor(self, key): pane = Pane(translate("Clone"), closeable=True, iconURL="icons-clone", iconClasses=[ "modul_%s" % self.parent().parent().module, "apptype_list", "action_edit" ]) conf["mainWindow"].stackPane(pane) edwg = EditWidget(self.parent().parent().module, EditWidget.appList, key=key, clone=True, context=self.parent().parent().context) pane.addWidget(edwg) pane.focus()
def onSelectionActivated(self, table, selection): if not self.parent().parent().selectionCallback and len( selection) == 1 and isinstance( selection[0], self.parent().parent().leafWidget): pane = Pane(translate("Edit"), closeable=True, iconClasses=[ "modul_%s" % self.parent().parent().module, "apptype_tree", "action_edit" ]) conf["mainWindow"].stackPane(pane) skelType = "leaf" edwg = EditWidget(self.parent().parent().module, EditWidget.appTree, key=selection[0].data["key"], skelType=skelType) pane.addWidget(edwg) pane.focus()
def handleInitialHash(self, pathList, params): assert self.canHandleInitialHash(pathList, params) if pathList[1] == "list": if self.mode != "group": self.addWidget(self.createWidget()) self.focus() else: DeferredCall(self.focus, _delay=250) elif pathList[1] == "add": pane = Pane(translate("Add"), closeable=True, iconURL="icons-add", iconClasses=[ "module_%s" % self.moduleName, "apptype_list", "action_add" ]) edwg = EditWidget(self.moduleName, EditWidget.appList, hashArgs=(params or None)) pane.addWidget(edwg) conf["mainWindow"].addPane(pane, parentPane=self) pane.focus() elif pathList[1] in ["edit", "clone"] and len(pathList) > 2: pane = Pane(translate("Edit"), closeable=True, iconURL="icons-edit", iconClasses=[ "module_%s" % self.moduleName, "apptype_list", "action_edit" ]) edwg = EditWidget(self.moduleName, EditWidget.appList, key=pathList[2], hashArgs=(params or None), clone=pathList[1] == "clone") pane.addWidget(edwg) conf["mainWindow"].addPane(pane, parentPane=self) pane.focus()