def do_populate_popup(self, menu, buffer, iter, image): populate_popup_add_separator(menu, prepend=True) item = gtk.MenuItem(self.edit_label) item.connect('activate', lambda o: self.edit_object(buffer, iter, image)) menu.prepend(item)
def do_populate_popup(self, menu, buffer, iter, image): populate_popup_add_separator(menu, prepend=True) item = gtk.MenuItem(_('_Edit GNU R Plot')) # T: menu item in context menu item.connect('activate', lambda o: self.edit_object(buffer, iter, image)) menu.prepend(item)
def do_populate_popup(self, menu): populate_popup_add_separator(menu, prepend=True) item = gtk.CheckMenuItem(_('Sort alphabetically')) # T: Context menu item for tag cloud item.set_active(self._alphabetically) item.connect('toggled', self._switch_sorting) item.show_all() menu.prepend(item)
def do_populate_popup(self, menu): populate_popup_add_separator(menu, prepend=True) item = Gtk.CheckMenuItem(_('Sort alphabetically')) # T: Context menu item for tag cloud item.set_active(self._alphabetically) item.connect('toggled', self._switch_sorting) item.show_all() menu.prepend(item)
def on_populate_popup(self, treeview, menu): populate_popup_add_separator(menu) item = Gtk.MenuItem.new_with_mnemonic(_('Open in New _Window')) item.connect('activate', self.on_open_new_window, treeview) menu.append(item) # Other per page menu items do not really apply here... menu.show_all()
def on_populate_popup(self, treeview, menu): # Add a popup menu item to switch the treeview mode populate_popup_add_separator(menu, prepend=True) item = gtk.CheckMenuItem(_('Sort pages by tags')) # T: menu option item.set_active(self.plugin.uistate['treeview'] == 'tags') item.connect_object('toggled', self.__class__.toggle_treeview, self) menu.prepend(item) menu.show_all()
def on_populate_popup(self, treeview, menu): # Add a popup menu item to switch the treeview mode populate_popup_add_separator(menu, prepend=True) item = gtk.CheckMenuItem(_('Sort pages by tags')) # T: menu option item.set_active(self.uistate['treeview'] == 'tags') item.connect_object('toggled', self.__class__.toggle_treeview, self) menu.prepend(item) menu.show_all()
def do_initialize_popup(self, menu): # TODO get path first and determine what menu options are valid path = self.get_selected_path() or Path(':') self.ui.populate_popup('page_popup', menu, path) populate_popup_add_separator(menu) item = gtk.ImageMenuItem('gtk-copy') item.connect('activate', lambda o: self.do_copy()) menu.append(item) menu.show_all() self.populate_popup_expand_collapse(menu)
def on_populate_popup(self, treeview, menu): # Add a popup menu item to switch the treeview mode populate_popup_add_separator(menu, prepend=True) item = Gtk.CheckMenuItem(_('Show full page name')) # T: menu option item.set_active(self.uistate['show_full_page_name']) item.connect_object('toggled', self.__class__.toggle_show_full_page_name, self) menu.prepend(item) item = Gtk.CheckMenuItem(_('Sort pages by tags')) # T: menu option item.set_active(self.uistate['treeview'] == 'tags') item.connect_object('toggled', self.__class__.toggle_treeview, self) model = self.treeview.get_model() if isinstance(model, TaggedPageTreeStore): item.set_sensitive(False) # with tag selection toggle does nothing menu.prepend(item) menu.show_all()
def do_initialize_popup(self, menu): # TODO get path first and determine what menu options are valid path = self.get_selected_path() or Path(':') uiactions = UIActions( self, self.notebook, path, self.navigation, ) uiactions.populate_menu_with_actions(PAGE_ACTIONS, menu) populate_popup_add_separator(menu) item = Gtk.MenuItem.new_with_mnemonic(_('_Copy')) # T: menu label item.connect('activate', lambda o: self.do_copy()) menu.append(item) menu.show_all() self.populate_popup_expand_collapse(menu)
def on_populate_popup(self, treeview, menu): # If not a not a page (but e.g. a tag), remove page action if not treeview.get_selected_path(): for item in menu.get_children(): menu.remove(item) # Add a popup menu item to switch the treeview mode populate_popup_add_separator(menu, prepend=True) item = gtk.CheckMenuItem(_('Show full page name')) # T: menu option item.set_active(self.uistate['show_full_page_name']) item.connect_object('toggled', self.__class__.toggle_show_full_page_name, self) menu.prepend(item) item = gtk.CheckMenuItem(_('Sort pages by tags')) # T: menu option item.set_active(self.uistate['treeview'] == 'tags') item.connect_object('toggled', self.__class__.toggle_treeview, self) menu.prepend(item) menu.show_all()
def on_populate_popup(self, treeview, menu): model, paths = treeview.get_selection().get_selected_rows() if not paths: can_promote = False can_demote = False else: can_promote = self.can_promote(paths) can_demote = self.can_demote(paths) populate_popup_add_separator(menu, prepend=True) for text, sensitive, handler in ( (_('Demote'), can_demote, self.on_demote), # T: action to lower level of heading in the text (_('Promote'), can_promote, self.on_promote), # T: action to raise level of heading in the text ): item = gtk.MenuItem(text) menu.prepend(item) if sensitive: item.connect('activate', handler) else: item.set_sensitive(False)
def on_populate_popup(self, treeview, menu): populate_popup_add_separator(menu) item = Gtk.MenuItem.new_with_mnemonic(_('Open in New _Window')) item.connect('activate', self.on_open_new_window, treeview) menu.append(item)
def on_populate_popup(self, treeview, menu): populate_popup_add_separator(menu) item = gtk.MenuItem(_('Open in New _Window')) item.connect('activate', self.on_open_new_window, treeview) menu.append(item)