|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
from PySide import QtGui
|
|
|
|
|
from PySide.QtGui import QLabel, QLineEdit, QPushButton, QCheckBox, QGroupBox
|
|
|
|
|
from PySide.QtGui import QLabel, QLineEdit, QPushButton, QCheckBox, QGroupBox, \
|
|
|
|
|
QComboBox
|
|
|
|
|
from calculate.api.client.function import create_obj, get_sid
|
|
|
|
|
#import analysis
|
|
|
|
|
from more import _
|
|
|
|
@ -147,19 +148,18 @@ class MFWgt(QtGui.QWidget):
|
|
|
|
|
x += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# choice = field.choice[0]
|
|
|
|
|
# while 1:
|
|
|
|
|
# print _('Select one: ')
|
|
|
|
|
# for i in range(1,len(choice)+1):
|
|
|
|
|
# print choice[i-1], ' - %d' %i
|
|
|
|
|
# try:
|
|
|
|
|
# bool_var = int (raw_input(field.label))
|
|
|
|
|
# if bool_var > 0:
|
|
|
|
|
# self.param_object[field.name] = choice[bool_var - 1]
|
|
|
|
|
# print 'your choice %s' %self.param_object[field.name]
|
|
|
|
|
# break
|
|
|
|
|
# except:
|
|
|
|
|
# pass
|
|
|
|
|
elif field.element == 'combo':
|
|
|
|
|
choice = field.choice[0]
|
|
|
|
|
|
|
|
|
|
self.grid.addWidget(QLabel(field.name), x, y)
|
|
|
|
|
self.ComboBox = QComboBox(self)
|
|
|
|
|
for i in range(0,len(choice)):
|
|
|
|
|
self.ComboBox.addItem(choice[i])
|
|
|
|
|
self.view_dict[field.name] = self.ComboBox
|
|
|
|
|
self.grid.addWidget(self.view_dict[field.name], x, y+1)
|
|
|
|
|
x += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
button_call = QPushButton(_('Call Method'))
|
|
|
|
|
self.grid.addWidget(button_call, x, y+2)
|
|
|
|
|
button_call.clicked.connect(self.calling)
|
|
|
|
@ -174,10 +174,10 @@ class MFWgt(QtGui.QWidget):
|
|
|
|
|
print field_name
|
|
|
|
|
print type (self.view_dict[field_name])
|
|
|
|
|
|
|
|
|
|
if type (self.view_dict[field_name]) == str:
|
|
|
|
|
print "22222222222"
|
|
|
|
|
self.param_object[field_name] = self.view_dict[field_name]
|
|
|
|
|
print self.param_object[field_name]
|
|
|
|
|
# if type (self.view_dict[field_name]) == str:
|
|
|
|
|
# print "22222222222"
|
|
|
|
|
# self.param_object[field_name] = self.view_dict[field_name]
|
|
|
|
|
# print self.param_object[field_name]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if type (self.view_dict[field_name]) == QGroupBox:
|
|
|
|
@ -194,7 +194,15 @@ class MFWgt(QtGui.QWidget):
|
|
|
|
|
self.param_object[field_name] = \
|
|
|
|
|
self.view_dict[field_name].isChecked()
|
|
|
|
|
print self.param_object[field_name]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if type (self.view_dict[field_name]) == QComboBox:
|
|
|
|
|
# bo = self.view_dict[field_name]
|
|
|
|
|
# import ipdb
|
|
|
|
|
# ipdb.set_trace()
|
|
|
|
|
self.param_object[field_name] = \
|
|
|
|
|
self.view_dict[field_name].currentText()
|
|
|
|
|
print self.param_object[field_name]
|
|
|
|
|
|
|
|
|
|
if type (self.view_dict[field_name]) == QLineEdit:
|
|
|
|
|
self.param_object[field_name] = \
|
|
|
|
|
str(self.view_dict[field_name].text())
|
|
|
|
|