summaryrefslogtreecommitdiff
path: root/geneticone/gui/gtk/dialogs.py
diff options
context:
space:
mode:
authornecoro <>2006-11-12 19:13:28 +0000
committernecoro <>2006-11-12 19:13:28 +0000
commit580ebfccad88986c4f5f91f346ab5bf555f45ced (patch)
tree9ed5a71aee728c78928ca9a837d32d7b7b6fdea1 /geneticone/gui/gtk/dialogs.py
parentccee291737673926730f8573c22bb348b10438eb (diff)
downloadportato-580ebfccad88986c4f5f91f346ab5bf555f45ced.tar.gz
portato-580ebfccad88986c4f5f91f346ab5bf555f45ced.tar.bz2
portato-580ebfccad88986c4f5f91f346ab5bf555f45ced.zip
rewritten config to take directly the const-keys; added io_ex_dialog
Diffstat (limited to '')
-rw-r--r--geneticone/gui/gtk/dialogs.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/geneticone/gui/gtk/dialogs.py b/geneticone/gui/gtk/dialogs.py
index cb643ce..7607fd4 100644
--- a/geneticone/gui/gtk/dialogs.py
+++ b/geneticone/gui/gtk/dialogs.py
@@ -12,20 +12,27 @@
import gtk
+def io_ex_dialog (io_ex):
+ string = io_ex.strerror
+ if io_ex.filename:
+ string = string+": "+io_ex.filename
+
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, string)
+ ret = dialog.run()
+ dialog.destroy()
+ return ret
+
def blocked_dialog (blocked, blocks):
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, blocked+" is blocked by "+blocks+".\nPlease unmerge the blocking package.")
- dialog.run()
+ ret = dialog.run()
dialog.destroy()
+ return ret
def not_root_dialog ():
errorMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "You cannot (un)merge without being root.")
- errorMB.run()
+ ret = errorMB.run()
errorMB.destroy()
-
-def masked_dialog (cpv):
- dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, cpv+" seems to be masked.\nPlease edit the appropriate file(s) to unmask it and restart Genetic/One.\n")
- dialog.run()
- dialog.destroy()
+ return ret
def unmask_dialog (cpv):
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, cpv+" seems to be masked.\nDo you want to unmask it and its dependencies?.\n")
@@ -35,19 +42,22 @@ def unmask_dialog (cpv):
def nothing_found_dialog ():
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, "Package not found!")
- dialog.run()
+ ret = dialog.run()
dialog.destroy()
+ return ret
def changed_flags_dialog (what = "flags"):
hintMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
"You have changed %s. Genetic/One will write these changes into the appropriate files. Please backup them if you think it is necessairy." % what)
- hintMB.run()
+ ret = hintMB.run()
hintMB.destroy()
+ return ret
def remove_deps_dialog ():
infoMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, "You cannot remove dependencies. :)")
- infoMB.run()
+ ret = infoMB.run()
infoMB.destroy()
+ return ret
def remove_queue_dialog ():
askMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, "Do you really want to clear the whole queue?")