/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-13 14:08:06 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-20060813140806-3364d3e02a086d51
Modified OliveDialog class interface; huge cleanups.

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

    * olive/frontend/gtk/branch.py: display number of revisions branched
    * olive/frontend/gtk/*: use new dialog interface with detailed descriptions
    * olive/frontend/gtk/dialog.py: modified according to GNOME HIG (primary
      and secondary text)

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