1
# Copyright (C) 2007 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
from bzrlib.plugins.gtk.logview import LogView
27
class TagsWindow(gtk.Window):
28
""" Tags window. Allows the user to view/add/remove tags. """
29
def __init__(self, branch, parent=None):
30
""" Initialize the Tags window. """
31
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
38
self._button_add = gtk.Button(stock=gtk.STOCK_ADD)
39
self._button_remove = gtk.Button(stock=gtk.STOCK_REMOVE)
40
self._button_close = gtk.Button(stock=gtk.STOCK_CLOSE)
41
self._model = gtk.ListStore(str, str)
42
self._treeview_tags = gtk.TreeView(self._model)
43
self._scrolledwindow_tags = gtk.ScrolledWindow()
44
self._logview = LogView()
45
self._hbox = gtk.HBox()
46
self._vbox_buttons = gtk.VBox()
47
self._vpaned = gtk.VPaned()
50
self._button_close.connect('clicked', self._on_close_clicked)
53
self.set_title(_("Tags - Olive"))
55
self._scrolledwindow_tags.set_policy(gtk.POLICY_AUTOMATIC,
58
# Construct the dialog
59
self._scrolledwindow_tags.add(self._treeview_tags)
61
self._vbox_buttons.pack_start(self._button_add)
62
self._vbox_buttons.pack_start(self._button_remove)
63
self._vbox_buttons.pack_start(self._button_close)
65
self._vpaned.add1(self._scrolledwindow_tags)
66
self._vpaned.add2(self._logview)
68
self._hbox.pack_start(self._vpaned)
69
self._hbox.pack_start(self._vbox_buttons)
76
def _on_close_clicked(self, widget):
77
""" Close button event handler. """
79
if self._parent is None: