/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/mkdir.py

  • Committer: Aaron Bentley
  • Date: 2007-01-17 06:42:55 UTC
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: aaron.bentley@utoronto.ca-20070117064255-x4gznz5e0lyjq3gk
Remove usused span selector

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
import bzrlib.errors as errors
29
29
 
30
 
from bzrlib.plugins.gtk import _i18n
31
 
from bzrlib.plugins.gtk.dialog import error_dialog, warning_dialog
 
30
from dialog import error_dialog, warning_dialog
32
31
from guifiles import GLADEFILENAME
33
32
 
34
 
from bzrlib.plugins.gtk.errors import show_bzr_error
35
 
 
36
33
 
37
34
class OliveMkdir:
38
35
    """ Display the Make directory dialog and perform the needed actions. """
56
53
        """ Display the Make directory dialog. """
57
54
        self.window.show_all()
58
55
 
59
 
    @show_bzr_error
60
56
    def mkdir(self, widget):
61
57
        # Get the widgets
62
58
        entry = self.glade.get_widget('entry_mkdir')
65
61
        dirname = entry.get_text()
66
62
        
67
63
        if dirname == "":
68
 
            error_dialog(_i18n('No directory name given'),
69
 
                         _i18n('Please specify a desired name for the new directory.'))
 
64
            error_dialog(_('No directory name given'),
 
65
                         _('Please specify a desired name for the new directory.'))
70
66
            return
71
67
        
72
68
        if checkbox.get_active():
77
73
                self.wt.add([os.path.join(self.wtpath, dirname)])
78
74
            except OSError, e:
79
75
                if e.errno == 17:
80
 
                    error_dialog(_i18n('Directory already exists'),
81
 
                                 _i18n('Please specify another name to continue.'))
 
76
                    error_dialog(_('Directory already exists'),
 
77
                                 _('Please specify another name to continue.'))
82
78
                else:
83
79
                    raise
 
80
            except errors.NotBranchError:
 
81
                warning_dialog(_('Directory is not in a branch'),
 
82
                               _('You can only create a non-versioned directory.'))
84
83
        else:
85
84
            # Just a simple directory
86
85
            try:
87
86
                os.mkdir(os.path.join(self.wt.basedir, self.wtpath, dirname))
88
87
            except OSError, e:
89
88
                if e.errno == 17:
90
 
                    error_dialog(_i18n('Directory already exists'),
91
 
                                 _i18n('Please specify another name to continue.'))
 
89
                    error_dialog(_('Directory already exists'),
 
90
                                 _('Please specify another name to continue.'))
92
91
                    return
93
92
 
94
93
        self.close()