Esempio n. 1
0
	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)
Esempio n. 2
0
    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)
Esempio n. 3
0
	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)
Esempio n. 4
0
	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()
Esempio n. 5
0
	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)
Esempio n. 6
0
	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()
Esempio n. 7
0
	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)
Esempio n. 8
0
    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)