/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-07-09 15:23:26 UTC
  • mto: This revision was merged to the branch mainline in revision 794.
  • Revision ID: jelmer@samba.org-20120709152326-dzxb8zoz0btull7n
Remove bzr-notify.

Show diffs side-by-side

added added

removed removed

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