summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--geneticone/backend/flags.py25
-rw-r--r--geneticone/gui/dialogs.py6
2 files changed, 16 insertions, 15 deletions
diff --git a/geneticone/backend/flags.py b/geneticone/backend/flags.py
index 1d2f321..cb26935 100644
--- a/geneticone/backend/flags.py
+++ b/geneticone/backend/flags.py
@@ -301,19 +301,20 @@ def write_use_flags ():
insert(flag,l)
file_cache[file][line-1] = " ".join(l)
+ if flagsToAdd:
# write new lines
- msg = "\n#geneticone update#\n"
- if CONFIG["usePerVersion"]: # add on a per-version-base
- msg += "=%s %s\n" % (cpv, ' '.join(flagsToAdd))
- else: # add on a per-package-base
- list = split_package_name(cpv)
- msg += "%s/%s %s\n" % (list[0], list[1], ' '.join(flagsToAdd))
- if not file in file_cache:
- f = open(file, "a")
- f.write(msg)
- f.close()
- else:
- file_cache[file].append(msg)
+ msg = "\n#geneticone update#\n"
+ if CONFIG["usePerVersion"]: # add on a per-version-base
+ msg += "=%s %s\n" % (cpv, ' '.join(flagsToAdd))
+ else: # add on a per-package-base
+ list = split_package_name(cpv)
+ msg += "%s/%s %s\n" % (list[0], list[1], ' '.join(flagsToAdd))
+ if not file in file_cache:
+ f = open(file, "a")
+ f.write(msg)
+ f.close()
+ else:
+ file_cache[file].append(msg)
# write to disk
for file in file_cache.keys():
diff --git a/geneticone/gui/dialogs.py b/geneticone/gui/dialogs.py
index ddb9d52..3429873 100644
--- a/geneticone/gui/dialogs.py
+++ b/geneticone/gui/dialogs.py
@@ -38,18 +38,18 @@ def nothing_found_dialog ():
dialog.destroy()
def changed_flags_dialog (what = "flags"):
- hintMB = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
+ 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()
hintMB.destroy()
def remove_deps_dialog ():
- infoMB = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, "You cannot remove dependencies. :)")
+ infoMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, "You cannot remove dependencies. :)")
infoMB.run()
infoMB.destroy()
def remove_queue_dialog ():
- askMB = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, "Do you really want to clear the whole queue?")
+ 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