예제 #1
0
파일: vmlab.py 프로젝트: hsavolai/vmlab
 def dialog_file_error(self, error_msg):
     messagedialog(gtk.MESSAGE_ERROR, 
                 "File operation failed!",
                 error_msg,
                 self.toplevel,
                 gtk.BUTTONS_OK
                 )
예제 #2
0
파일: app.py 프로젝트: dsaran/packagehelper
    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
예제 #3
0
파일: vmlab.py 프로젝트: hsavolai/vmlab
 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