Exemple #1
0
	def __init__(self, ui):
		Dialog.__init__(self, ui, _('Custom Tools'), buttons=gtk.BUTTONS_CLOSE) # T: Dialog title
		self.set_help(':Help:Custom Tools')
		self.manager = CustomToolManager()

		self.add_help_text(_(
			'You can configure custom tools that will appear\n'
			'in the tool menu and in the tool bar or context menus.'
		) ) # T: help text in "Custom Tools" dialog

		hbox = gtk.HBox(spacing=5)
		self.vbox.add(hbox)

		self.listview = CustomToolList(self.manager)
		hbox.add(self.listview)

		vbox = gtk.VBox(spacing=5)
		hbox.pack_start(vbox, False)

		for stock, handler, data in (
			(gtk.STOCK_ADD, self.__class__.on_add, None),
			(gtk.STOCK_EDIT, self.__class__.on_edit, None),
			(gtk.STOCK_DELETE, self.__class__.on_delete, None),
			(gtk.STOCK_GO_UP, self.__class__.on_move, -1),
			(gtk.STOCK_GO_DOWN, self.__class__.on_move, 1),
		):
			button = IconButton(stock) # TODO tooltips for icon button
			if data:
				button.connect_object('clicked', handler, self, data)
			else:
				button.connect_object('clicked', handler, self)
			vbox.pack_start(button, False)