~torsten/bzr-gtk/throttle-config-updates

« back to all changes in this revision

Viewing changes to merge.py

  • Committer: Jasper Groenewegen
  • Date: 2008-07-27 11:37:31 UTC
  • mto: (577.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: colbrac@xs4all.nl-20080727113731-p2krsw6o3m57ctu6
Add PointlessMerge error
Merge dialog title change
Merge dialog icon
Tweak logic

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
 
30
from bzrlib.plugins.gtk import _i18n, icon_path
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="Olive - Merge",
 
40
        gtk.Dialog.__init__(self, title="Merge changes",
41
41
                                  parent=parent,
42
42
                                  flags=0,
43
43
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
44
 
        
 
44
        self.set_icon_from_file(icon_path("bzr-icon-64.png"))
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(self.default_branch_path.partition('file://')[2]):
 
72
        if self.default_branch_path and os.path.isdir(
 
73
                            self.default_branch_path.partition('file://')[2]):
73
74
            self.directory = self.default_branch_path.partition('file://')[2]
74
75
            self._combo_source.set_active(0)
 
76
        elif self.default_branch_path:
 
77
            self._combo_source.set_active(1)
75
78
        else:
76
 
            self._on_custom_source()
 
79
            # If no default_branch_path give, default to folder source with current folder
 
80
            self._combo_source.set_active(0)
77
81
        self.vbox.show_all()
78
82
    
79
83
    def _on_folder_source(self):
99
103
        """ Merge from a custom source (can be folder, remote, etc), create entry """
100
104
        self._source = gtk.HBox()
101
105
        self._custom_entry = gtk.Entry()
102
 
        self._custom_entry.set_text(self.default_branch_path)
 
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)
103
109
        self._custom_entry.show()
104
110
        self._source.pack_start(self._custom_entry, True, True, 0)
105
111
        self.vbox.pack_start(self._source, True, True, 5)