improved UI button type & warning message

This commit is contained in:
Eero Tamminen 2010-03-11 23:55:43 +02:00
parent bf41ad1d6e
commit a16c8afb27
2 changed files with 6 additions and 2 deletions

View File

@ -86,7 +86,9 @@ class ConfigStore:
print "ERROR: configuration file '%' loading failed" % path
return
else:
print "WARNING: configuration file missing, using defaults"
print "WARNING: configuration file missing"
if self.defaults:
print "-> using defaults"
self.sections = self.defaults
self.path = path
self.original = self.get_checkpoint()

View File

@ -47,13 +47,14 @@ subclasses overriding run() require also an argument."""
# Note/Todo/Error/Ask dialogs
class NoteDialog(HatariUIDialog):
button = gtk.BUTTONS_OK
icontype = gtk.MESSAGE_INFO
textpattern = "\n%s"
def run(self, text):
"run(text), show message dialog with given text"
dialog = gtk.MessageDialog(self.parent,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
self.icontype, gtk.BUTTONS_CLOSE, self.textpattern % text)
self.icontype, self.button, self.textpattern % text)
dialog.run()
dialog.destroy()
@ -61,6 +62,7 @@ class TodoDialog(NoteDialog):
textpattern = "\nTODO: %s"
class ErrorDialog(NoteDialog):
button = gtk.BUTTONS_CLOSE
icontype = gtk.MESSAGE_ERROR
textpattern = "\nERROR: %s"