Alignment of function boxes
This commit is contained in:
parent
b754a5df44
commit
78183df0e9
|
@ -45,6 +45,7 @@ def workflow_list():
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
|
|
||||||
class Workflow:
|
class Workflow:
|
||||||
"""Defines a workflow that contains a set of analysis stages.
|
"""Defines a workflow that contains a set of analysis stages.
|
||||||
|
|
||||||
|
@ -79,12 +80,14 @@ class Workflow:
|
||||||
logger.log('notice','Project added in : %s' %self.name)
|
logger.log('notice','Project added in : %s' %self.name)
|
||||||
self.project = project
|
self.project = project
|
||||||
|
|
||||||
|
|
||||||
class EmptyWorkflow(Workflow):
|
class EmptyWorkflow(Workflow):
|
||||||
name = 'Empty Workflow'
|
name = 'Empty Workflow'
|
||||||
|
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
Workflow.__init__(self, None)
|
Workflow.__init__(self, None)
|
||||||
|
|
||||||
|
|
||||||
class Stage:
|
class Stage:
|
||||||
"""A stage is a part of the data analysis process.
|
"""A stage is a part of the data analysis process.
|
||||||
|
|
||||||
|
@ -115,13 +118,14 @@ class Function:
|
||||||
self.id = id
|
self.id = id
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
# ,ust return a Validation object
|
# just return a Validation object
|
||||||
def validate_input(input):
|
def validate_input(input):
|
||||||
return Validation(True,"Validation Not Implemented")
|
return Validation(True,"Validation Not Implemented")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Validation:
|
class Validation:
|
||||||
def __init__(self,result, reason):
|
def __init__(self,result, reason):
|
||||||
self.succeeded = result
|
self.succeeded = result
|
||||||
|
@ -139,10 +143,14 @@ class WorkflowView (gtk.VBox):
|
||||||
# Add stage in the process
|
# Add stage in the process
|
||||||
for stage in wf.stages:
|
for stage in wf.stages:
|
||||||
exp = gtk.Expander(stage.name)
|
exp = gtk.Expander(stage.name)
|
||||||
|
btn_align = gtk.Alignment(xscale=0.9)
|
||||||
|
btn_align.set_padding(0,4,20,0)
|
||||||
|
btn_align.show()
|
||||||
btn_box = gtk.VBox()
|
btn_box = gtk.VBox()
|
||||||
|
btn_align.add(btn_box)
|
||||||
btn_box.show()
|
btn_box.show()
|
||||||
exp.add(btn_box)
|
exp.add(btn_align)
|
||||||
|
|
||||||
# Add functions in each stage
|
# Add functions in each stage
|
||||||
for fun in stage.functions:
|
for fun in stage.functions:
|
||||||
btn = gtk.Button(fun.name)
|
btn = gtk.Button(fun.name)
|
||||||
|
@ -254,7 +262,7 @@ class OptionsDialog(gtk.Dialog):
|
||||||
self.nb = nb = gtk.Notebook()
|
self.nb = nb = gtk.Notebook()
|
||||||
|
|
||||||
# 1. page: input/output
|
# 1. page: input/output
|
||||||
#
|
|
||||||
#inputs
|
#inputs
|
||||||
input_frame = gtk.Frame("Input")
|
input_frame = gtk.Frame("Input")
|
||||||
hbox = gtk.HBox(True, 8)
|
hbox = gtk.HBox(True, 8)
|
||||||
|
@ -365,9 +373,9 @@ class OptionsDialog(gtk.Dialog):
|
||||||
self._options.update(options)
|
self._options.update(options)
|
||||||
|
|
||||||
def set_output(self):
|
def set_output(self):
|
||||||
# get marked output data
|
# get toggled output data
|
||||||
out_data = [item[0] for name, mark, ic in self.dataset_list for item in self._options['all_data'] if mark==True and name==item[1]]
|
out_data = [item[0] for name, mark, ic in self.dataset_list for item in self._options['all_data'] if mark==True and name==item[1]]
|
||||||
# get marked plots
|
# get toggled plots
|
||||||
out_plots = [item[0] for name, mark, ic in self.plot_list for item in self._options['all_plots'] if mark==True and name==item[1]]
|
out_plots = [item[0] for name, mark, ic in self.plot_list for item in self._options['all_plots'] if mark==True and name==item[1]]
|
||||||
# update options
|
# update options
|
||||||
self._options['out_data'] = out_data
|
self._options['out_data'] = out_data
|
||||||
|
@ -398,7 +406,7 @@ class OptionsDialog(gtk.Dialog):
|
||||||
try:
|
try:
|
||||||
self.wTree = gtk.glade.XML(glade_file)
|
self.wTree = gtk.glade.XML(glade_file)
|
||||||
except:
|
except:
|
||||||
logger.log('debug', 'Could not find glade file: %s' %glade_file)
|
logger.log('notice', 'Could not find glade file: %s' %glade_file)
|
||||||
|
|
||||||
widget = self.wTree.get_widget(widget_name)
|
widget = self.wTree.get_widget(widget_name)
|
||||||
win = widget.get_parent()
|
win = widget.get_parent()
|
||||||
|
@ -407,6 +415,7 @@ class OptionsDialog(gtk.Dialog):
|
||||||
self.nb.insert_page(widget, gtk.Label(page_title), -1)
|
self.nb.insert_page(widget, gtk.Label(page_title), -1)
|
||||||
self.nb.set_current_page(0)
|
self.nb.set_current_page(0)
|
||||||
|
|
||||||
|
|
||||||
def toggled(renderer, path, store):
|
def toggled(renderer, path, store):
|
||||||
it = store.get_iter(path)
|
it = store.get_iter(path)
|
||||||
old_value = store.get_value(it, 1)
|
old_value = store.get_value(it, 1)
|
||||||
|
|
Reference in New Issue