Example #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)
Example #2
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)
Example #3
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)
Example #4
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)
Example #5
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)
Example #6
0
    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()
Example #7
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()
Example #8
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.uistate['treeview'] == 'tags')
        item.connect_object('toggled', self.__class__.toggle_treeview, self)
        menu.prepend(item)

        menu.show_all()
Example #9
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)
Example #10
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)
Example #11
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(_('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()
Example #12
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(':')

        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)
Example #13
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()
Example #14
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)
	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)
Example #16
0
    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)
Example #17
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)