def onEntryActivated(self, event): index = event.GetIndex() docIDO = self.model.getEntry(index) blogId = None if self.blog is not None: blogId = self.blog.getId() actionContext = ZBlogPostActionContext(self, docIDO, blogId) self.openAction.runAction(actionContext) event.Skip()
def createActionContext(self): docIDO = None blogId = None selection = self.entriesListView.getSelection() if selection: index = selection[0] docIDO = self.model.getEntry(index) if self.blog is not None: blogId = self.blog.getId() return ZBlogPostActionContext(self, docIDO, blogId)
def onEntryRightClick(self, event): index = event.GetIndex() docIDO = self.blogPostsListQueryModel.getDocumentIDO(index) actionContext = ZBlogPostActionContext(self, docIDO) provider = ZModelBasedMenuContentProvider(self.blogPostContextMenu, actionContext) handler = ZModelBasedMenuEventHandler(self.blogPostContextMenu, actionContext) menu = ZMenu(self, self.blogPostContextMenu.getRootNode(), provider, handler) self.PopupMenu(menu) event.Skip()
def onEntryRightClick(self, event): index = event.GetIndex() docIDO = self.model.getEntry(index) blogId = None if self.blog is not None: blogId = self.blog.getId() actionContext = ZBlogPostActionContext(self, docIDO, blogId) provider = ZModelBasedMenuContentProvider(self.blogPostContextMenu, actionContext) handler = ZModelBasedMenuEventHandler(self.blogPostContextMenu, actionContext) menu = ZMenu(self, self.blogPostContextMenu.getRootNode(), provider, handler) self.PopupMenu(menu) event.Skip()
def onEntryActivated(self, event): index = event.GetIndex() docIDO = self.blogPostsListQueryModel.getDocumentIDO(index) actionContext = ZBlogPostActionContext(self, docIDO) self.openAction.runAction(actionContext)