/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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2007-04-06 17:59:23 UTC
  • mto: (188.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 190.
  • Revision ID: szilveszter.farkas@gmail.com-20070406175923-fkwoo73iy2yuv3jy
Added the new Initialize dialog to Olive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
from bzrlib.plugins.gtk.annotate.config import GAnnotateConfig
49
49
from bzrlib.plugins.gtk.commit import CommitDialog
50
50
from bzrlib.plugins.gtk.conflicts import ConflictsDialog
 
51
from bzrlib.plugins.gtk.initialize import InitDialog
51
52
from bzrlib.plugins.gtk.push import PushDialog
52
53
 
53
54
class OliveGtk:
343
344
        status = StatusDialog(self.wt, self.wtpath)
344
345
        status.display()
345
346
    
346
 
    @show_bzr_error
347
347
    def on_menuitem_branch_initialize_activate(self, widget):
348
348
        """ Initialize current directory. """
349
 
        import bzrlib.bzrdir as bzrdir
 
349
        init = InitDialog(self.path, self.window)
 
350
        response = init.run()
 
351
        if response != gtk.RESPONSE_NONE:
 
352
            init.hide()
350
353
        
351
 
        if not os.path.exists(self.path):
352
 
            os.mkdir(self.path)
353
 
 
354
 
        try:
355
 
            existing_bzrdir = bzrdir.BzrDir.open(self.path)
356
 
        except bzrerrors.NotBranchError:
357
 
            bzrdir.BzrDir.create_branch_convenience(self.path)
358
 
        else:
359
 
            if existing_bzrdir.has_branch():
360
 
                if existing_bzrdir.has_workingtree():
361
 
                    raise bzrerrors.AlreadyBranchError(self.path)
362
 
                else:
363
 
                    raise bzrerrors.BranchExistsWithoutWorkingTree(self.path)
364
 
            else:
365
 
                existing_bzrdir.create_branch()
366
 
                existing_bzrdir.create_workingtree()
367
 
        info_dialog(_('Initialize successful'),
368
 
                    _('Directory successfully initialized.'))
369
 
        self.refresh_right()
 
354
            if response == gtk.RESPONSE_OK:
 
355
                self.refresh_right()
 
356
            
 
357
            init.destroy()
370
358
        
371
359
    def on_menuitem_file_annotate_activate(self, widget):
372
360
        """ File/Annotate... menu handler. """