summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-23 23:42:57 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-23 23:42:57 +0200
commitc0b751facc2dd5ca6dc6bf15a855e4d22dd24356 (patch)
tree4011f70cd8cbb0df76218f49744d745e1f5fa7d8 /portato
parent771d3afbe73ffdd7df3381fb0bcde737ade2e4f8 (diff)
downloadportato-c0b751facc2dd5ca6dc6bf15a855e4d22dd24356.tar.gz
portato-c0b751facc2dd5ca6dc6bf15a855e4d22dd24356.tar.bz2
portato-c0b751facc2dd5ca6dc6bf15a855e4d22dd24356.zip
allowed to dismiss the warning dialogs for keywords/useflags
Diffstat (limited to '')
-rw-r--r--portato/gui/dialogs.py8
-rw-r--r--portato/gui/windows/main.py6
-rw-r--r--portato/session.py13
3 files changed, 21 insertions, 6 deletions
diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py
index 0313cae..8f0c78c 100644
--- a/portato/gui/dialogs.py
+++ b/portato/gui/dialogs.py
@@ -57,11 +57,15 @@ def nothing_found_dialog ():
return ret
def changed_flags_dialog (what = "flags"):
+ check = gtk.CheckButton(_("Do not show this dialog again."))
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)
+ _("You have changed %s.\nPortato will write these changes into the appropriate files.\nPlease backup them if you think it is necessairy.") % what)
+ hintMB.vbox.add(check)
+ hintMB.vbox.show_all()
ret = hintMB.run()
hintMB.destroy()
- return ret
+
+ 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. :)"))
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 8e5eafb..364810d 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -1357,7 +1357,8 @@ class MainWindow (Window):
"""Execute the current queue."""
if len(flags.newUseFlags) > 0:
- changed_flags_dialog(_("use flags"))
+ if not self.session.get_boolean("useflags", "dialogs"):
+ self.session.set("useflags", changed_flags_dialog(_("use flags"))[1], "dialogs")
try:
flags.write_use_flags()
except IOError, e:
@@ -1368,7 +1369,8 @@ class MainWindow (Window):
debug("new masked: %s",flags.new_masked)
debug("new unmasked: %s", flags.new_unmasked)
debug("new testing: %s", flags.newTesting)
- changed_flags_dialog(_("masking keywords"))
+ if not self.session.get_boolean("keywords", "dialogs"):
+ self.session.set("keywords", changed_flags_dialog(_("masking keywords"))[1], "dialogs")
try:
flags.write_masked()
flags.write_testing()
diff --git a/portato/session.py b/portato/session.py
index da15171..5d1a640 100644
--- a/portato/session.py
+++ b/portato/session.py
@@ -105,9 +105,18 @@ class Session (object):
except SectionNotFoundException:
self._cfg.add_section(section)
self._cfg.add(key, value, section, with_blankline = False)
-
+
def get (self, key, section):
- return self._cfg.get(key, section)
+ try:
+ return self._cfg.get(key, section)
+ except KeyError:
+ return None
+
+ def get_boolean (self, key, section):
+ try:
+ return self._cfg.get_boolean(key, section)
+ except KeyError:
+ return None
def check_version (self, vers):
pass # do nothing atm