35
35
import bzrlib.errors as bzrerrors
36
36
from bzrlib.workingtree import WorkingTree
38
from dialog import error_dialog, info_dialog, warning_dialog
39
from errors import show_bzr_error
38
from bzrlib.plugins.gtk.dialog import error_dialog, info_dialog, warning_dialog
39
from bzrlib.plugins.gtk.errors import show_bzr_error
40
40
from guifiles import GLADEFILENAME
42
# import this classes only once
44
from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
45
from bzrlib.plugins.gtk.viz.branchwin import BranchWindow
46
from bzrlib.plugins.gtk.annotate.gannotate import GAnnotateWindow
47
from bzrlib.plugins.gtk.annotate.config import GAnnotateConfig
49
# olive+bzr-gtk not installed. try to import from sources
50
path = os.path.dirname(os.path.dirname(__file__))
51
if path not in sys.path:
53
from viz.diffwin import DiffWindow
54
from viz.branchwin import BranchWindow
55
from annotate.gannotate import GAnnotateWindow
56
from annotate.config import GAnnotateConfig
58
# History delimiter used in config files
42
from bzrlib.plugins.gtk.diff import DiffWindow
43
from bzrlib.plugins.gtk.viz.branchwin import BranchWindow
44
from bzrlib.plugins.gtk.annotate.gannotate import GAnnotateWindow
45
from bzrlib.plugins.gtk.annotate.config import GAnnotateConfig
46
from bzrlib.plugins.gtk.commit import CommitDialog
47
from bzrlib.plugins.gtk.push import PushDialog
62
50
""" The main Olive GTK frontend class. This is called when launching the
65
53
def __init__(self):
66
54
self.toplevel = gtk.glade.XML(GLADEFILENAME, 'window_main', 'olive-gtk')
68
55
self.window = self.toplevel.get_widget('window_main')
70
self.pref = OlivePreferences()
56
self.pref = Preferences()
74
59
# Initialize the statusbar
223
208
def on_menuitem_branch_get_activate(self, widget):
224
209
""" Branch/Get... menu handler. """
225
from branch import BranchDialog
210
from bzrlib.plugins.gtk.branch import BranchDialog
226
211
branch = BranchDialog(self.get_path(), self.window)
227
212
response = branch.run()
228
213
if response != gtk.RESPONSE_NONE:
236
221
def on_menuitem_branch_checkout_activate(self, widget):
237
222
""" Branch/Checkout... menu handler. """
238
from checkout import CheckoutDialog
223
from bzrlib.plugins.gtk.checkout import CheckoutDialog
239
224
checkout = CheckoutDialog(self.get_path(), self.window)
240
225
response = checkout.run()
241
226
if response != gtk.RESPONSE_NONE:
247
232
checkout.destroy()
249
235
def on_menuitem_branch_commit_activate(self, widget):
250
236
""" Branch/Commit... menu handler. """
251
from commit import CommitDialog
252
237
commit = CommitDialog(self.wt, self.wtpath, self.notbranch, self.get_selected_right(), self.window)
253
238
response = commit.run()
254
239
if response != gtk.RESPONSE_NONE:
262
247
def on_menuitem_branch_merge_activate(self, widget):
263
248
""" Branch/Merge... menu handler. """
264
from merge import MergeDialog
249
from bzrlib.plugins.gtk.merge import MergeDialog
266
251
if self.check_for_changes():
267
252
error_dialog(_('There are local changes in the branch'),
270
255
merge = MergeDialog(self.wt, self.wtpath)
273
259
def on_menuitem_branch_missing_revisions_activate(self, widget):
274
260
""" Branch/Missing revisions menu handler. """
275
261
local_branch = self.wt.branch
322
308
def on_menuitem_branch_push_activate(self, widget):
323
309
""" Branch/Push... menu handler. """
324
from push import PushDialog
325
310
push = PushDialog(self.wt.branch, self.window)
326
311
response = push.run()
327
312
if response != gtk.RESPONSE_NONE:
342
327
def on_menuitem_branch_status_activate(self, widget):
343
328
""" Branch/Status... menu handler. """
344
from status import OliveStatus
345
status = OliveStatus(self.wt, self.wtpath)
329
from bzrlib.plugins.gtk.status import StatusDialog
330
status = StatusDialog(self.wt, self.wtpath)
1015
1000
def set_bookmark_title(self, path, title):
1016
1001
""" Set bookmark title. """
1002
# FIXME: What if path isn't listed yet?
1003
# FIXME: Canonicalize paths first?
1017
1004
self.config.set(path, 'title', title)
1019
1006
def remove_bookmark(self, path):