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