From 13f5b071027e5aed0f9ae5eec88f4095f2246f98 Mon Sep 17 00:00:00 2001
From: necoro <>
Date: Tue, 24 Apr 2007 14:36:36 +0000
Subject: added dialogs to warn you when the queue is running on quitting
portato
---
portato/gui/gtk/dialogs.py | 6 +
portato/gui/gtk/glade/portato.glade | 383 ++++++++++++++++++------------------
portato/gui/gtk/windows.py | 11 ++
3 files changed, 209 insertions(+), 191 deletions(-)
(limited to 'portato/gui/gtk')
diff --git a/portato/gui/gtk/dialogs.py b/portato/gui/gtk/dialogs.py
index f6573ef..24d1a20 100644
--- a/portato/gui/gtk/dialogs.py
+++ b/portato/gui/gtk/dialogs.py
@@ -12,6 +12,12 @@
import gtk
+def queue_not_empty_dialog():
+ dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, "There are some packages in the emerge queue and/or an emerge process is running.\nDo you really want to quit?")
+ ret = dialog.run()
+ dialog.destroy()
+ return ret
+
def io_ex_dialog (io_ex):
string = io_ex.strerror
if io_ex.filename:
diff --git a/portato/gui/gtk/glade/portato.glade b/portato/gui/gtk/glade/portato.glade
index 0ac888e..2443bd1 100644
--- a/portato/gui/gtk/glade/portato.glade
+++ b/portato/gui/gtk/glade/portato.glade
@@ -6,6 +6,7 @@
2
GTK_WIN_POS_CENTER
+
True
@@ -401,49 +402,73 @@
4
2
-
+
True
- 1
- True
-
-
- True
- True
- Installed
- True
-
-
-
- False
-
-
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
-
+
True
- True
- Masked
- True
-
-
- False
- 1
-
+
+
+ 2
+ 2
+ 3
+ 5
+ 5
+
+
+
+
+ True
-
- True
- True
- Testing
- True
-
-
-
- False
- 2
-
+
+
+ 1
+ 2
+ GTK_FILL
+ 5
+
+
+
+
+ True
+ GTK_JUSTIFY_CENTER
+ True
+
+
+ 2
+ GTK_FILL
+
+ 10
+
+
+
+
+ True
+ True
+ <span foreground='red'><b>MISSING KEYWORD</b></span>
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_FILL
+
+
+
+
+ True
+ True
+ <b>Installed, but not in portage anymore</b>
+ True
+
1
2
@@ -507,79 +532,55 @@
-
- True
- True
- <b>Installed, but not in portage anymore</b>
- True
-
-
- 1
- 2
- 1
- 2
- GTK_FILL
-
-
-
-
- True
- True
- <span foreground='red'><b>MISSING KEYWORD</b></span>
- True
-
-
- 1
- 2
- 1
- 2
- GTK_FILL
-
-
-
-
- True
- GTK_JUSTIFY_CENTER
- True
-
-
- 2
- GTK_FILL
-
- 10
-
-
-
-
+
True
+ 1
+ True
-
+
+ True
+ True
+ Installed
+ True
+
+
+
+ False
+
-
-
- 1
- 2
- GTK_FILL
- 5
-
-
-
-
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
-
+
True
+ True
+ Masked
+ True
+
+
+ False
+ 1
+
+
+
+
+ True
+ True
+ Testing
+ True
+
+
+
+ False
+ 2
+
+ 1
2
- 2
- 3
- 5
- 5
+ 1
+ 2
+ GTK_FILL
@@ -1090,186 +1091,186 @@
-
+
True
+ 0
+ 5
+ <u><i>Masking Keywords</i></u>
+ True
+ True
- 1
- 2
- 3
- 4
+ 7
+ 8
+ 5
-
+
True
0
- File name to use, if package.use is a directory:
+ 5
+ <u><i>Testing Keywords</i></u>
+ True
True
- 3
- 4
+ 4
+ 5
+ 5
-
+
True
- Add only exact version to package.use
- True
+ 0
+ 5
+ <u><i>Use-Flags</i></u>
+ True
+ True
+
+
+ 1
+ 2
+ 6
+
+
+
+
+ True
+
+
+ True
+ 0
+ GTK_SHADOW_OUT
+
+
+ True
+ 0
+ <u>You may use the following placeholders:</u>
+
+<i>$(cat)</i>: category
+<i>$(pkg)</i>: package name
+<i>$(cat-1)/$(cat-2)</i>: first/second part of the category
+ True
+
+
+
+
+
+ label_item
+
+
+
+
2
- 2
- 3
-
+
True
- Add only exact version to package.keywords
+ Add only exact version to package.mask/package.unmask
True
2
- 5
- 6
+ 8
+ 9
-
+
True
0
- File name to use, if package.keywords is a directory:
+ File name to use, if package.mask/package.unmask is a directory:
True
- 6
- 7
+ 9
+ 10
-
+
True
1
2
- 6
- 7
+ 9
+ 10
-
+
True
1
2
- 9
- 10
+ 6
+ 7
-
+
True
0
- File name to use, if package.mask/package.unmask is a directory:
+ File name to use, if package.keywords is a directory:
True
- 9
- 10
+ 6
+ 7
-
+
True
- Add only exact version to package.mask/package.unmask
+ Add only exact version to package.keywords
True
2
- 8
- 9
+ 5
+ 6
-
+
True
-
-
- True
- 0
- GTK_SHADOW_OUT
-
-
- True
- 0
- <u>You may use the following placeholders:</u>
-
-<i>$(cat)</i>: category
-<i>$(pkg)</i>: package name
-<i>$(cat-1)/$(cat-2)</i>: first/second part of the category
- True
-
-
-
-
-
- label_item
-
-
-
-
+ Add only exact version to package.use
+ True
2
+ 2
+ 3
-
- True
- 0
- 5
- <u><i>Use-Flags</i></u>
- True
- True
-
-
- 1
- 2
- 6
-
-
-
-
+
True
0
- 5
- <u><i>Testing Keywords</i></u>
- True
+ File name to use, if package.use is a directory:
True
- 4
- 5
- 5
+ 3
+ 4
-
+
True
- 0
- 5
- <u><i>Masking Keywords</i></u>
- True
- True
- 7
- 8
- 5
+ 1
+ 2
+ 3
+ 4
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index 5aeceed..12b7a58 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -1115,6 +1115,17 @@ class MainWindow (Window):
def cb_copy_clicked (self, action):
self.console.copy_clipboard()
+ def cb_delete (self, *args):
+ """Looks whether we really want to quit."""
+ if not self.queue.is_empty():
+ ret = queue_not_empty_dialog()
+ if ret == gtk.RESPONSE_CANCEL:
+ return True
+ else:
+ self.queue.kill_emerge()
+
+ return False
+
def cb_destroy (self, widget):
"""Calls main_quit()."""
gtk.main_quit()
--
cgit v1.2.3-70-g09d2