/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: Jelmer Vernooij
  • Date: 2006-09-30 10:21:43 UTC
  • Revision ID: jelmer@samba.org-20060930102143-c0ef64d6ca860c21
Merge some files from Olive and bzr-gtk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    pygtk.require("2.0")
23
23
except:
24
24
    pass
25
 
try:
26
 
    import gtk
27
 
    import gtk.glade
28
 
except:
29
 
    sys.exit(1)
 
25
 
 
26
import gtk
 
27
import gtk.glade
30
28
 
31
29
import bzrlib.errors as errors
32
30
 
 
31
from olive import gladefile
 
32
 
33
33
class OliveMkdir:
34
34
    """ Display the Make directory dialog and perform the needed actions. """
35
 
    def __init__(self, gladefile, wt, wtpath, dialog):
 
35
    def __init__(self, wt, wtpath):
36
36
        """ Initialize the Make directory dialog. """
37
 
        self.gladefile = gladefile
38
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_mkdir', 'olive-gtk')
39
 
        
40
 
        # Dialog object
41
 
        self.dialog = dialog
 
37
        self.glade = gtk.glade.XML(gladefile, 'window_mkdir', 'olive-gtk')
42
38
        
43
39
        self.window = self.glade.get_widget('window_mkdir')
44
40
        
61
57
        dirname = entry.get_text()
62
58
        
63
59
        if dirname == "":
64
 
            self.dialog.error_dialog(_('No directory name given'),
 
60
            error_dialog(_('No directory name given'),
65
61
                                     _('Please specify a desired name for the new directory.'))
66
62
            return
67
63
        
75
71
                wt.add([wtpath])
76
72
            except OSError, e:
77
73
                if e.errno == 17:
78
 
                    self.dialog.error_dialog(_('Directory already exists'),
 
74
                    error_dialog(_('Directory already exists'),
79
75
                                             _('Please specify another name to continue.'))
80
76
                else:
81
77
                    raise
82
78
            except errors.NotBranchError:
83
 
                self.dialog.warning_dialog(_('Directory is not in a branch'),
 
79
                warning_dialog(_('Directory is not in a branch'),
84
80
                                           _('You can only create a non-versioned directory.'))
85
81
        else:
86
82
            # Just a simple directory
88
84
                os.mkdir(os.path.join(wt.base, wtpath))
89
85
            except OSError, e:
90
86
                if e.errno == 17:
91
 
                    self.dialog.error_dialog(_('Directory already exists'),
 
87
                    error_dialog(_('Directory already exists'),
92
88
                                             _('Please specify another name to continue.'))
93
89
                    return
94
90