/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-07-31 15:52:43 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110731155243-ln8istmxbryhb4pz
Mechanical changes made by pygi.convert.sh.

Show diffs side-by-side

added added

removed removed

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