From aaf3830acd70c3a40be92974f3a896f19ae29192 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Fri, 24 Nov 2006 12:02:21 +0000 Subject: Renamed to portato --- portato/gui/gtk/dialogs.py | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 portato/gui/gtk/dialogs.py (limited to 'portato/gui/gtk/dialogs.py') diff --git a/portato/gui/gtk/dialogs.py b/portato/gui/gtk/dialogs.py new file mode 100644 index 0000000..68cd629 --- /dev/null +++ b/portato/gui/gtk/dialogs.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +# +# File: portato/gui/gtk/dialogs.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2006 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +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.") + 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 are not root.") + ret = errorMB.run() + errorMB.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") + ret = dialog.run() + dialog.destroy() + return ret + +def nothing_found_dialog (): + dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, "Package not found!") + 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. Portato will write these changes into the appropriate files. Please backup them if you think it is necessairy." % what) + 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. :)") + 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?") + ret = askMB.run() + askMB.destroy() + return ret -- cgit v1.2.3-54-g00ecf