/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: Curtis Hovey
  • Date: 2011-08-12 20:25:28 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110812202528-4xf4a2t23urx50d2
Updated gst to gtk3.

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