/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tags.py

  • Committer: Curtis Hovey
  • Date: 2011-09-05 03:44:26 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110905034426-p98pxnay9rmzkr99
Fix the initializer for many classes.
Replace Gtk.Dialog.vbox with .get_content_area().

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
33
33
 
34
34
        # Get arguments
35
35
        self.branch = branch
74
74
        # Construct the dialog
75
75
        self._scrolledwindow_tags.add(self._treeview_tags)
76
76
 
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)
81
85
 
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)
84
90
 
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",
203
 
                                  parent=parent,
204
 
                                  flags=0,
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))
206
211
 
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)
242
247
 
243
 
        self.vbox.add(self._hbox)
 
248
        self.get_content_area().add(self._hbox)
244
249
 
245
 
        self.action_area.pack_end(self._button_remove)
 
250
        self.action_area.pack_end(self._button_remove, False, False, 0)
246
251
 
247
252
        # Display dialog
248
 
        self.vbox.show_all()
 
253
        self.get_content_area().show_all()
249
254
 
250
255
        # Default to Commit button
251
256
        self._button_remove.grab_default()
260
265
 
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",
264
 
                                  parent=parent,
265
 
                                  flags=0,
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))
268
271
 
269
272
        # Get arguments
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)
302
305
 
303
306
        # Show the dialog
304
 
        self.vbox.show_all()
 
307
        self.get_content_area().show_all()
305
308
 
306
309
    def _on_add_clicked(self, widget):
307
310
        """ Add button clicked handler. """