From 359309950a1283dbbf9df6ce1085838087cfc262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Fri, 9 Apr 2010 23:38:24 +0200 Subject: Show dialog, that update world might not work as expected --- portato/gui/dialogs.py | 11 +++++++++++ portato/gui/windows/main.py | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'portato/gui') diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py index 7ad5c7f..2cc2d6b 100644 --- a/portato/gui/dialogs.py +++ b/portato/gui/dialogs.py @@ -83,6 +83,17 @@ def changed_flags_dialog (what = "flags"): return ret, check.get_active() +def update_world_warning_dialog (): + check = gtk.CheckButton(_("Do not show this dialog again.")) + hintMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, _("'Update World' may be giving errors")) + hintMB.format_secondary_text(_("Due to the fast changing portage, 'update world' might not work correctly or even throw errors.\nThis will be fixed (hopefully) in the next release.")) + hintMB.vbox.add(check) + hintMB.vbox.show_all() + ret = hintMB.run() + hintMB.destroy() + + return ret, check.get_active() + def remove_deps_dialog (): infoMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, _("You cannot remove dependencies. :)")) ret = infoMB.run() diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 665f1d6..0ec35a2 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -1512,7 +1512,14 @@ class MainWindow (Window): finally: self.window.window.set_cursor(None) - GtkThread(name="Update-Thread", target=__update).start() + # for some reason, I have to create the thread before displaying the dialog + # else the GUI hangs + t = GtkThread(name="Update-Thread", target=__update) + + if not self.session.get_bool("update_world_warning", "dialogs"): + self.session.set("update_world_warning", str(dialogs.update_world_warning_dialog()[1]), "dialogs") + + t.start() return True -- cgit v1.2.3