Example #1
0
 def dialog_file_error(self, error_msg):
     messagedialog(gtk.MESSAGE_ERROR, 
                 "File operation failed!",
                 error_msg,
                 self.toplevel,
                 gtk.BUTTONS_OK
                 )
Example #2
0
    def _save(self, project, path):
        """ Internal save """
        if self._is_writable(path):
            project.save(path)
            self._refresh_project_entry(project)
            self._refresh_title()
            success = True
        else:
            submsg1 = _('Could not save project "%s"') % project.name
            submsg2 = _('Project "%s" could not be saved to %s. '
                        'Permission denied.') % \
                        (project.name, os.path.abspath(path))
            text = '<span weight="bold" size="larger">%s</span>\n\n%s\n' % \
                   (submsg1, submsg2)
            result = messagedialog(
                gtk.MESSAGE_ERROR, text, parent=self._window,
                buttons=((gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL),
                         (gtk.STOCK_SAVE_AS, gtk.RESPONSE_YES)))

            if result == gtk.RESPONSE_YES:
                success = self._project_save_as(_('Save as'), project)
            else:
                success = False

        self._add_recent_project(project)
        return success
Example #3
0
 def dialog_overwrite(self):
     response = messagedialog(gtk.MESSAGE_QUESTION, 
                 "File exists, overwrite?",
                 None,
                 self.toplevel,
                 gtk.BUTTONS_OK_CANCEL
                 )
     if response == gtk.RESPONSE_OK:
         return True
     return False