summaryrefslogtreecommitdiff
path: root/geneticone/gui/gtk/windows.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--geneticone/gui/gtk/windows.py37
1 files changed, 20 insertions, 17 deletions
diff --git a/geneticone/gui/gtk/windows.py b/geneticone/gui/gtk/windows.py
index 8c6febb..8623e51 100644
--- a/geneticone/gui/gtk/windows.py
+++ b/geneticone/gui/gtk/windows.py
@@ -195,13 +195,11 @@ class PreferenceWindow (AbstractDialog):
for box in self.checkboxes:
self.tree.get_widget(box).\
- set_active(self.cfg.get_boolean(\
- self.cfg.const[self.checkboxes[box]]))
+ set_active(self.cfg.get_boolean(self.checkboxes[box]))
for edit in self.edits:
self.tree.get_widget(edit).\
- set_text(self.cfg.get(\
- self.cfg.const[self.edits[edit]]))
+ set_text(self.cfg.get(self.edits[edit]))
self.window.show_all()
@@ -209,19 +207,19 @@ class PreferenceWindow (AbstractDialog):
"""Sets all options in the Config-instance."""
for box in self.checkboxes:
- self.cfg.set_boolean(\
- self.cfg.const[self.checkboxes[box]],\
- self.tree.get_widget(box).get_active())
+ self.cfg.set_boolean(self.checkboxes[box], self.tree.get_widget(box).get_active())
for edit in self.edits:
- self.cfg.set(\
- self.cfg.const[self.edits[edit]],\
- self.tree.get_widget(edit).get_text())
+ self.cfg.set(self.edits[edit],self.tree.get_widget(edit).get_text())
def cb_ok_clicked(self, button):
"""Saves, writes to config-file and closes the window."""
self._save()
- self.cfg.write()
+ try:
+ self.cfg.write()
+ except IOError, e:
+ io_ex_dialog(e)
+
self.window.destroy()
def cb_cancel_clicked (self, button):
@@ -577,7 +575,12 @@ class MainWindow (Window):
self.db.populate()
# config
- self.cfg = Config(CONFIG_LOCATION)
+ try:
+ self.cfg = Config(CONFIG_LOCATION)
+ except IOError, e:
+ io_ex_dialog(e)
+ raise e
+
self.cfg.modify_external_configs()
# set vpaned position
@@ -746,7 +749,7 @@ class MainWindow (Window):
if not self.doUpdate:
self.queue.emerge(force=True)
else:
- self.queue.update_world(force=True, newuse = self.cfg.get_boolean(self.cfg.const["newuse_opt"]), deep = self.cfg.get_boolean(self.cfg.const["deep_opt"]))
+ self.queue.update_world(force=True, newuse = self.cfg.get_boolean("newuse_opt"), deep = self.cfg.get_boolean("deep_opt"))
self.doUpdate = False
def cb_unmerge_clicked (self, button):
@@ -762,7 +765,7 @@ class MainWindow (Window):
not_root_dialog()
else:
- updating = backend.update_world(newuse = self.cfg.get_boolean(self.cfg.const["newuse_opt"]), deep = self.cfg.get_boolean(self.cfg.const["deep_opt"]))
+ updating = backend.update_world(newuse = self.cfg.get_boolean("newuse_opt"), deep = self.cfg.get_boolean("deep_opt"))
debug("updating list:", [(x.get_cpv(), y.get_cpv()) for x,y in updating])
try:
@@ -802,7 +805,7 @@ class MainWindow (Window):
not_root_dialog()
else:
self.notebook.set_current_page(self.CONSOLE_PAGE)
- cmd = self.cfg.get(self.cfg.const["syncCmd_opt"])
+ cmd = self.cfg.get("syncCmd_opt")
if cmd != "emerge --sync":
cmd = cmd.split()
@@ -861,12 +864,12 @@ class MainWindow (Window):
store, it = sel.get_selected()
if it:
package = store.get_value(it, 0)
- if not self.cfg.get_local(package, self.cfg.const["oneshot_opt"]):
+ if not self.cfg.get_local(package, "oneshot_opt"):
set = True
else:
set = False
- self.cfg.set_local(package, self.cfg.const["oneshot_opt"], set)
+ self.cfg.set_local(package, "oneshot_opt", set)
self.queue.append(package, update = True, oneshot = set, forceUpdate = True)
def cb_destroy (self, widget):
td>2021-02-16Use go-embed for templates instead of inline strings.René 'Necoro' Neumann6-74/+79 2021-02-16Issue #46: Fix semantics of `n` resultRené 'Necoro' Neumann2-9/+15 2021-02-16Issue #46: Move and rename writer; add commentsRené 'Necoro' Neumann3-12/+21 2021-02-15Issue #46: Improvements; add testsRené 'Necoro' Neumann2-1/+48 2021-02-15Bump github.com/google/uuid from 1.1.4 to 1.2.0dependabot[bot]2-3/+3 2021-02-15Issue #46: Make the resulting email body not to include single \r or \n. This...René 'Necoro' Neumann2-2/+66 2021-01-20Bump github.com/PuerkitoBio/goquery from 1.6.0 to 1.6.1dependabot[bot]2-3/+3 2021-01-09Bump github.com/google/uuid from 1.1.2 to 1.1.4dependabot[bot]2-3/+3 2021-01-09Bump github.com/emersion/go-message from 0.14.0 to 0.14.1 (#42)dependabot[bot]2-3/+3 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0