/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/rename.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 OliveRename:
37
35
    """ Display the Rename dialog and perform the needed actions. """
38
 
    def __init__(self, gladefile, comm):
 
36
    def __init__(self, gladefile, comm, dialog):
39
37
        """ Initialize the Rename dialog. """
40
38
        self.gladefile = gladefile
41
39
        self.glade = gtk.glade.XML(self.gladefile, 'window_rename')
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_rename')
48
47
        
65
64
        new_filename = entry.get_text()
66
65
            
67
66
        if old_filename is None:
68
 
            self.dialog.error_dialog('No file was selected.')
 
67
            self.dialog.error_dialog('No file was selected',
 
68
                                     'Please select a file from the list to proceed.')
69
69
            return
70
70
        
71
71
        if new_filename == "":
72
 
            self.dialog.error_dialog('New filename not specified.')
 
72
            self.dialog.error_dialog('Filename not given',
 
73
                                     'Please specify a new name for the file.')
73
74
            return
74
75
        
75
76
        source = self.comm.get_path() + '/' + old_filename
79
80
        try:
80
81
            fileops.rename(source, destination)
81
82
        except errors.NotBranchError:
82
 
            self.dialog.error_dialog('Selected file is not in a branch.')
 
83
            self.dialog.error_dialog('File is not in a branch',
 
84
                                     'The selected file is not in a branch.')
83
85
            return
84
86
        except errors.NotSameBranchError:
85
 
            self.dialog.error_dialog('The destination is not in the same branch.')
 
87
            self.dialog.error_dialog('Not the same branch',
 
88
                                     'The destination is not in the same branch.')
86
89
            return
 
90
        except:
 
91
            raise
87
92
 
88
93
        self.close()
89
94
        self.comm.refresh_right()