From 8e82e1cd922db2eb3f6c2b2e8d9b5106f482bf59 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Thu, 10 Dec 2015 21:05:39 -0500 Subject: combox/gui.py (ComboxConfigDialog.apply) Glued the graphical interface with the combox configuration function; now the ComboxConfigDialog.apply method writes the configuration information to the default combox configuration directory. --- ChangeLog | 6 ++++++ combox/gui.py | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19932e8..44aac0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-12-10 Siddharth Ravikumar + + * combox/gui.py (ComboxConfigDialog.apply): now writes the + configuration to disk in the default combox configuration + directory. + 2015-12-03 Siddharth Ravikumar * combox/gui.py: input validation kinda done + added status bar. diff --git a/combox/gui.py b/combox/gui.py index df1118a..a6630d9 100644 --- a/combox/gui.py +++ b/combox/gui.py @@ -23,6 +23,8 @@ import tkFileDialog from Tkinter import * +from combox.config import config_cb + # # Adapted from: # http://effbot.org/tkinterbook/tkinter-dialog-windows.htm @@ -278,13 +280,19 @@ class ComboxConfigDialog(object): no_nodes = self.cb_no_nodes_entry.get() passp = self.cb_pp_entry.get() - print combox_name, combox_dir, passp, no_nodes + config_info = [combox_name, combox_dir, '', no_nodes] # get info about nodes. for i in xrange(len(self.node_path_entries)): - print "node %d" % i, - print self.node_path_entries[i].get(), - print self.node_size_entries[i].get() + config_info.append("node_%d" % i) + config_info.append(self.node_path_entries[i].get()) + config_info.append(self.node_size_entries[i].get()) + + config_info_iter = iter(config_info) + def_input = lambda(x): next(config_info_iter) + def_pass = lambda: passp + + config_cb(pass_func=def_pass, input_func=def_input) def create_askdirectory_button(self, entry, row): -- cgit v1.2.3