29
29
""" Tags window. Allows the user to view/add/remove tags. """
30
30
def __init__(self, branch, parent=None):
31
31
""" Initialize the Tags window. """
32
Window.__init__(self, parent)
32
super(TagsWindow, self).__init__(parent=parent)
35
35
self.branch = branch
74
74
# Construct the dialog
75
75
self._scrolledwindow_tags.add(self._treeview_tags)
77
self._vbox_buttons_top.pack_start(self._button_add, False, False, 0)
78
self._vbox_buttons_top.pack_start(self._button_remove, False, False, 0)
79
self._vbox_buttons_top.pack_start(self._button_refresh, False, False, 0)
80
self._vbox_buttons_bottom.pack_start(self._button_close, False, False, 0)
77
self._vbox_buttons_top.pack_start(
78
self._button_add, False, False, 0)
79
self._vbox_buttons_top.pack_start(
80
self._button_remove, False, False, 0)
81
self._vbox_buttons_top.pack_start(
82
self._button_refresh, False, False, 0)
83
self._vbox_buttons_bottom.pack_start(
84
self._button_close, False, False, 0)
82
self._vbox_buttons.pack_start(self._vbox_buttons_top, True, True, 0)
83
self._vbox_buttons.pack_start(self._vbox_buttons_bottom, False, False, 0)
86
self._vbox_buttons.pack_start(
87
self._vbox_buttons_top, True, True, 0)
88
self._vbox_buttons.pack_start(
89
self._vbox_buttons_bottom, False, False, 0)
85
91
self._vpaned.add1(self._scrolledwindow_tags)
86
92
self._vpaned.add2(self._revisionview)
199
205
class RemoveTagDialog(Gtk.Dialog):
200
206
""" Confirm removal of tag. """
201
207
def __init__(self, tagname, parent):
202
GObject.GObject.__init__(self, title="Remove tag",
205
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
208
super(RemoveTagDialog, self).__init__(
209
title="Remove tag", parent=parent, flags=0,
210
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
207
212
# Get the arguments
208
213
self.tag = tagname
240
245
self._hbox.pack_start(self._image_question, True, True, 0)
241
246
self._hbox.pack_start(self._vbox_question, True, True, 0)
243
self.vbox.add(self._hbox)
248
self.get_content_area().add(self._hbox)
245
self.action_area.pack_end(self._button_remove)
250
self.action_area.pack_end(self._button_remove, False, False, 0)
253
self.get_content_area().show_all()
250
255
# Default to Commit button
251
256
self._button_remove.grab_default()
261
266
def __init__(self, repository, revid=None, branch=None, parent=None):
262
267
""" Initialize Add tag dialog. """
263
GObject.GObject.__init__(self, title="Add tag",
266
buttons=(Gtk.STOCK_CANCEL,
267
Gtk.ResponseType.CANCEL))
268
super(AddTagDialog, self).__init__(
269
title="Add tag", parent=parent, flags=0,
270
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
270
273
self._repository = repository
297
300
self._table.attach(self._label_revid, 0, 1, 1, 2)
298
301
self._table.attach(self._entry_name, 1, 2, 0, 1)
299
302
self._table.attach(self._hbox_revid, 1, 2, 1, 2)
300
self.vbox.add(self._table)
301
self.action_area.pack_end(self._button_add)
303
self.get_content_area().add(self._table)
304
self.action_area.pack_end(self._button_add, False, False, 0)
303
306
# Show the dialog
307
self.get_content_area().show_all()
306
309
def _on_add_clicked(self, widget):
307
310
""" Add button clicked handler. """