/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 merge.py

  • Committer: Jelmer Vernooij
  • Date: 2012-03-23 12:56:39 UTC
  • Revision ID: jelmer@samba.org-20120323125639-z3qgalx8qodxr2zw
bzr-handle-patch: Use spaces rather than tabs for indentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    
37
37
    def __init__(self, wt, wtpath, default_branch_path=None, parent=None):
38
38
        """ Initialize the Merge dialog. """
39
 
        GObject.GObject.__init__(self, title="Merge changes",
40
 
                                  parent=parent,
41
 
                                  flags=0,
42
 
                                  buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
 
39
        super(MergeDialog, self).__init__(
 
40
            title="Merge changes", parent=parent, flags=0,
 
41
            buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
43
42
        self.set_icon_from_file(icon_path("bzr-icon-64.png"))
44
43
        # Get arguments
45
44
        self.wt = wt
55
54
        for entry in [_i18n("Folder"),_i18n("Custom Location")]:
56
55
            self._combo_source.append_text(entry)
57
56
        self._combo_source.connect("changed", self._on_combo_changed)
58
 
        self._button_merge = Gtk.Button(_i18n("_Merge"))
 
57
        self._button_merge = Gtk.Button(_i18n("_Merge"), use_underline=True)
59
58
        self._button_merge_icon = Gtk.Image()
60
59
        self._button_merge_icon.set_from_stock(Gtk.STOCK_APPLY, Gtk.IconSize.BUTTON)
61
60
        self._button_merge.set_image(self._button_merge_icon)
62
61
        self._button_merge.connect('clicked', self._on_merge_clicked)
63
62
        
64
63
        # Add widgets to dialog
65
 
        self.vbox.pack_start(self._hbox, False, False, 0)
 
64
        self.get_content_area().pack_start(self._hbox, False, False, 0)
66
65
        self._hbox.add(self._label_merge_from)
67
66
        self._hbox.add(self._combo_source)
68
67
        self._hbox.set_spacing(5)
69
 
        self.action_area.pack_end(self._button_merge)
 
68
        self.action_area.pack_end(self._button_merge, False, False, 0)
70
69
        
71
70
        if self.default_branch_path and os.path.isdir(
72
71
                            self.default_branch_path.partition('file://')[2]):
77
76
        else:
78
77
            # If no default_branch_path give, default to folder source with current folder
79
78
            self._combo_source.set_active(0)
80
 
        self.vbox.show_all()
 
79
        self.get_content_area().show_all()
81
80
    
82
81
    def _on_folder_source(self):
83
82
        """ Merge from folder, create a filechooser dialog and button """
95
94
            directory = os.path.dirname(self.wt.abspath(self.wtpath))
96
95
        self._filechooser_dialog.set_current_folder(directory)
97
96
        self._source.pack_start(self._filechooser, True, True, 0)
98
 
        self.vbox.pack_start(self._source, True, True, 5)
 
97
        self.get_content_area().pack_start(self._source, True, True, 5)
99
98
        self._source.show()
100
99
    
101
100
    def _on_custom_source(self):
107
106
        self._custom_entry.connect("activate", self._on_merge_clicked)
108
107
        self._custom_entry.show()
109
108
        self._source.pack_start(self._custom_entry, True, True, 0)
110
 
        self.vbox.pack_start(self._source, True, True, 5)
 
109
        self.get_content_area().pack_start(self._source, True, True, 5)
111
110
        self._source.show()
112
111
    
113
112
    def _on_combo_changed(self, widget):