/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 olive/__init__.py

MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
import bzrlib.errors as bzrerrors
36
36
from bzrlib.workingtree import WorkingTree
37
37
 
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
41
41
 
42
 
# import this classes only once
43
 
try:
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
48
 
except ImportError:
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:
52
 
        sys.path.append(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
57
 
 
58
 
# History delimiter used in config files
59
 
delimiter = ' '
 
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
60
48
 
61
49
class OliveGtk:
62
50
    """ The main Olive GTK frontend class. This is called when launching the
64
52
    
65
53
    def __init__(self):
66
54
        self.toplevel = gtk.glade.XML(GLADEFILENAME, 'window_main', 'olive-gtk')
67
 
        
68
55
        self.window = self.toplevel.get_widget('window_main')
69
 
        
70
 
        self.pref = OlivePreferences()
71
 
        
 
56
        self.pref = Preferences()
72
57
        self.path = None
73
58
 
74
59
        # Initialize the statusbar
211
196
        return self.path
212
197
   
213
198
    def on_about_activate(self, widget):
214
 
        from dialog import about
 
199
        from bzrlib.plugins.gtk.dialog import about
215
200
        about()
216
201
        
217
202
    def on_menuitem_add_files_activate(self, widget):
222
207
    
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:
235
220
    
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:
246
231
            
247
232
            checkout.destroy()
248
233
    
 
234
    @show_bzr_error
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:
261
246
    
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
265
250
        
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)
271
256
            merge.display()
272
257
 
 
258
    @show_bzr_error
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
321
307
    
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:
341
326
    
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)
346
331
        status.display()
347
332
    
348
333
    @show_bzr_error
930
915
 
931
916
import ConfigParser
932
917
 
933
 
class OlivePreferences:
 
918
class Preferences:
934
919
    """ A class which handles Olive's preferences. """
935
920
    def __init__(self):
936
921
        """ Initialize the Preferences class. """
1014
999
    
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)
1018
1005
    
1019
1006
    def remove_bookmark(self, path):