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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-09 17:43:44 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060809174344-61ca8dac23ebe7cb
Main window preferences (size, position) are stored.

2006-08-09  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/__init__.py: simplified preference handling
    * olive/frontend/gtk/handler.py: window preferences are stored on quit

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import olive.backend.errors as errors
32
32
import olive.backend.fileops as fileops
33
33
 
 
34
from dialog import OliveDialog
 
35
 
34
36
class OliveMkdir:
35
37
    """ Display the Make directory dialog and perform the needed actions. """
36
 
    def __init__(self, gladefile, comm, dialog):
 
38
    def __init__(self, gladefile, comm):
37
39
        """ Initialize the Make directory dialog. """
38
40
        self.gladefile = gladefile
39
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_mkdir', 'olive-gtk')
 
41
        self.glade = gtk.glade.XML(self.gladefile, 'window_mkdir')
40
42
        
41
 
        # Communication object
42
43
        self.comm = comm
43
 
        # Dialog object
44
 
        self.dialog = dialog
 
44
        
 
45
        self.dialog = OliveDialog(self.gladefile)
45
46
        
46
47
        self.window = self.glade.get_widget('window_mkdir')
47
48
        
64
65
        dirname = entry.get_text()
65
66
        
66
67
        if dirname == "":
67
 
            self.dialog.error_dialog(_('No directory name given'),
68
 
                                     _('Please specify a desired name for the new directory.'))
 
68
            self.dialog.error_dialog('No directory name given.')
69
69
            return
70
70
        
71
71
        newdir = self.comm.get_path() + '/' + dirname
75
75
            try:
76
76
                fileops.mkdir(newdir)
77
77
            except errors.DirectoryAlreadyExists:
78
 
                self.dialog.error_dialog(_('Directory already exists'),
79
 
                                         _('Please specify another name to continue.'))
 
78
                self.dialog.error_dialog('Directory already exists.')
80
79
                return
81
80
            except errors.NotBranchError:
82
 
                self.dialog.warning_dialog(_('Directory is not in a branch'),
83
 
                                           _('You can only create a non-versioned directory.'))
 
81
                self.dialog.warning_dialog('Directory is not in a branch: not versioned.')
84
82
        else:
85
83
            # Just a simple directory
86
84
            try:
87
85
                os.mkdir(newdir)
88
86
            except OSError, e:
89
87
                if e.errno == 17:
90
 
                    self.dialog.error_dialog(_('Directory already exists'),
91
 
                                             _('Please specify another name to continue.'))
 
88
                    self.dialog.error_dialog('Directory already exists.')
92
89
                    return
93
90
 
94
91
        self.close()