/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: Jasper Groenewegen
  • Date: 2008-07-27 11:20:34 UTC
  • mto: (577.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: colbrac@xs4all.nl-20080727112034-x3c07o6b5gk1drn5
Merge dialog: Add ability to choose between folder and custom location as merge source

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.branch import Branch
28
28
import bzrlib.errors as errors
29
29
 
30
 
from bzrlib.plugins.gtk import _i18n, icon_path
 
30
from bzrlib.plugins.gtk import _i18n
31
31
from bzrlib.plugins.gtk.dialog import error_dialog, info_dialog, warning_dialog
32
32
from bzrlib.plugins.gtk.errors import show_bzr_error
33
33
 
37
37
    
38
38
    def __init__(self, wt, wtpath, default_branch_path=None, parent=None):
39
39
        """ Initialize the Merge dialog. """
40
 
        gtk.Dialog.__init__(self, title="Merge changes",
 
40
        gtk.Dialog.__init__(self, title="Olive - Merge",
41
41
                                  parent=parent,
42
42
                                  flags=0,
43
43
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
44
 
        self.set_icon_from_file(icon_path("bzr-icon-64.png"))
 
44
        
45
45
        # Get arguments
46
46
        self.wt = wt
47
47
        self.wtpath = wtpath
69
69
        self._hbox.set_spacing(5)
70
70
        self.action_area.pack_end(self._button_merge)
71
71
        
72
 
        if self.default_branch_path and os.path.isdir(
73
 
                            self.default_branch_path.partition('file://')[2]):
 
72
        if self.default_branch_path and os.path.isdir(self.default_branch_path.partition('file://')[2]):
74
73
            self.directory = self.default_branch_path.partition('file://')[2]
75
74
            self._combo_source.set_active(0)
76
 
        elif self.default_branch_path:
77
 
            self._combo_source.set_active(1)
78
75
        else:
79
 
            # If no default_branch_path give, default to folder source with current folder
80
 
            self._combo_source.set_active(0)
 
76
            self._on_custom_source()
81
77
        self.vbox.show_all()
82
78
    
83
79
    def _on_folder_source(self):
103
99
        """ Merge from a custom source (can be folder, remote, etc), create entry """
104
100
        self._source = gtk.HBox()
105
101
        self._custom_entry = gtk.Entry()
106
 
        if self.default_branch_path:
107
 
            self._custom_entry.set_text(self.default_branch_path)
108
 
        self._custom_entry.connect("activate", self._on_merge_clicked)
 
102
        self._custom_entry.set_text(self.default_branch_path)
109
103
        self._custom_entry.show()
110
104
        self._source.pack_start(self._custom_entry, True, True, 0)
111
105
        self.vbox.pack_start(self._source, True, True, 5)