def onClick(self, sender=None): pane = EditPane(translate("Add"), closeable=True, iconClasses=["modul_%s" % self.parent().parent().module, "apptype_list", "action_add" ]) conf["mainWindow"].stackPane( pane ) edwg = EditWidget(self.parent().parent().module, EditWidget.appList, context=self.parent().parent().context) pane.addWidget( edwg ) pane.focus()
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 self.addWidget(wdg(self.moduleName)) self.focus() elif pathList[1] in ["edit", "clone"] and len(pathList) > 3: pane = Pane(translate("Edit"), closeable=True, iconClasses=[ "module_%s" % self.moduleName, "apptype_tree", "action_edit" ]) edwg = EditWidget(self.moduleName, EditWidget.appTree, key=pathList[3], skelType=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, 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 onClick(self, sender=None): selection = self.parent().parent().getCurrentSelection() 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) conf["mainWindow"].stackPane(pane, focus=True) edwg = EditWidget(self.parent().parent().module, EditWidget.appHierarchy, key=key, context=self.parent().parent().context) pane.addWidget(edwg)
def __init__(self, title, key): super(ServerTaskWidget, self).__init__(title=title) self.widget = EditWidget("_tasks", EditWidget.appSingleton, key, logaction="Task started!") self.appendChild(self.widget) self.appendChild(html5.ext.Button(translate("Cancel"), self.close))
def onEdit(self, *args, **kwargs): """ Edit the image entry. """ pane = Pane( translate("Edit"), closeable=True, iconClasses=[ "modul_%s" % self.parent.destModule, "apptype_list", "action_edit" ] ) conf["mainWindow"].stackPane( pane, focus=True ) edwg = EditWidget( self.parent.destModule, EditWidget.appTree, key=self.data[ "key" ], skelType="leaf" ) pane.addWidget( edwg )
def handleInitialHash(self, pathList, params): assert self.canHandleInitialHash(pathList, params) if pathList[1] == "list": self.addWidget(HierarchyWidget(self.moduleName)) self.focus() elif pathList[1] in ["edit", "clone"] and len(pathList) > 2: pane = Pane(translate("Edit"), closeable=True, 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 onSelectionActivated(self, table, selection ): if not self.parent().parent().selectMode and len(selection)==1: pane = Pane( translate("Edit"), closeable=True, iconClasses=["modul_%s" % self.parent().parent().module, "apptype_tree", "action_edit" ]) conf["mainWindow"].stackPane( pane ) if isinstance( selection[0], self.parent().parent().nodeWidget): skelType = "node" elif isinstance( selection[0], self.parent().parent().leafWidget): skelType = "leaf" else: raise ValueError("Unknown selection type: %s" % str(type(selection[0]))) edwg = EditWidget( self.parent().parent().module, EditWidget.appTree, key=selection[0].data["key"], skelType=skelType) pane.addWidget( edwg ) pane.focus()
def onClick(self, sender=None): pane = Pane(translate("Add"), closeable=True, iconClasses=[ "module_%s" % self.parent().parent().module, "apptype_tree", "action_add_node" ]) conf["mainWindow"].stackPane(pane) edwg = EditWidget(self.parent().parent().module, EditWidget.appTree, node=self.parent().parent().node, skelType="node") pane.addWidget(edwg) pane.focus()
def onClick(self, sender=None): pane = Pane("Add", closeable=True, iconClasses=[ "module_%s" % self.parent().parent().module, "apptype_tree", "action_add_leaf" ]) conf["mainWindow"].stackPane(pane) edwg = EditWidget(self.parent().parent().module, EditWidget.appTree, node=self.parent().parent().node, skelType="leaf", context={"kind": "link"}) pane.addWidget(edwg) pane.focus()
def onClick(self, sender=None): selection = self.parent().parent().getCurrentSelection() if not selection: return print(selection) for s in selection: pane = Pane(translate("Edit"), closeable=True) conf["mainWindow"].stackPane( pane, focus=True ) if isinstance(s,self.parent().parent().nodeWidget): skelType = "node" elif isinstance(s,self.parent().parent().leafWidget): skelType = "leaf" else: raise ValueError("Unknown selection type: %s" % str(type(s))) edwg = EditWidget( self.parent().parent().module, EditWidget.appTree, key=s.data["key"], skelType=skelType, iconClasses=["modul_%s" % self.parent().parent().module, "apptype_tree", "action_edit" ]) pane.addWidget( edwg )
def edit(self, selection): for s in selection: pane = Pane(translate("Edit"), closeable=True) conf["mainWindow"].stackPane(pane, focus=True) print(s) print(s.skelType) edwg = EditWidget(self.parent().parent().module, EditWidget.appTree, key=s.data["key"], skelType=s.skelType, iconClasses=[ "module_%s" % self.parent().parent().module, "apptype_tree", "action_edit" ]) pane.addWidget(edwg)
def onEdit(self, sender=None): pane = Pane(translate("Edit"), closeable=True, iconClasses=[ "module_%s" % self.relationalBone.destModule, "apptype_list", "action_edit" ]) conf["mainWindow"].stackPane(pane, focus=True) try: edwg = EditWidget(self.relationalBone.destModule, EditWidget.appList, key=self.data["dest"]["key"], context=self.relationalBone.context) pane.addWidget(edwg) except AssertionError: conf["mainWindow"].removePane(pane)
def onSelectionActivated(self, table, selection): if not self.parent().parent().isSelector 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 onEdit(self, *args, **kwargs): """ Edit the image. """ if not self.selection: return pane = Pane(translate("Edit"), closeable=True, iconClasses=[ "modul_%s" % self.destModule, "apptype_list", "action_edit" ]) conf["mainWindow"].stackPane(pane, focus=True) try: edwg = EditWidget(self.destModule, EditWidget.appTree, key=self.selection["dest"]["key"], skelType="leaf") pane.addWidget(edwg) except AssertionError: conf["mainWindow"].removePane(pane)