|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
#-*- coding: utf-8 -*-
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
# Copyright 2012-2016 Mir Calculate. http://www.calculate-linux.org
|
|
|
|
|
#
|
|
|
|
@ -17,6 +17,15 @@
|
|
|
|
|
from PySide import QtGui, QtCore
|
|
|
|
|
from more import LabelWordWrap, _print
|
|
|
|
|
|
|
|
|
|
DEBUG_LEVEL = 20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def debug(level, *args):
|
|
|
|
|
if level <= DEBUG_LEVEL:
|
|
|
|
|
for s in args:
|
|
|
|
|
print s,
|
|
|
|
|
print
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MethodNameWgt(QtGui.QWidget):
|
|
|
|
|
def __init__(self, parent, ClientObj):
|
|
|
|
@ -28,28 +37,28 @@ class MethodNameWgt(QtGui.QWidget):
|
|
|
|
|
self.setAttribute(QtCore.Qt.WA_StyledBackground)
|
|
|
|
|
self.setObjectName('ControlButton')
|
|
|
|
|
self.setStyleSheet("QWidget#ControlButton "
|
|
|
|
|
"{background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
|
|
|
|
"stop: 0 #111111, stop: 0.95 #777777, stop: 1 #666666);}")
|
|
|
|
|
"{background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
|
|
|
|
"stop: 0 #111111, stop: 0.95 #777777, stop: 1 #666666);}")
|
|
|
|
|
|
|
|
|
|
self.hlayout = QtGui.QHBoxLayout(self)
|
|
|
|
|
self.hlayout.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
|
self.hlayout.setContentsMargins(28,0,0,0)
|
|
|
|
|
self.hlayout.setContentsMargins(28, 0, 0, 0)
|
|
|
|
|
self.hlayout.setSpacing(0)
|
|
|
|
|
|
|
|
|
|
self.meth_name = QtGui.QLabel('Method Name', self)
|
|
|
|
|
# self.meth_name.setAlignment(QtCore.Qt.AlignLeft)
|
|
|
|
|
# self.meth_name.setAlignment(QtCore.Qt.AlignLeft)
|
|
|
|
|
self.meth_name.setStyleSheet("font-size: 16px;"
|
|
|
|
|
"font: bold;"
|
|
|
|
|
"color: white;");
|
|
|
|
|
|
|
|
|
|
# "background-color: rgb(220,220,220);}"
|
|
|
|
|
self.button_hover_style = "QPushButton:hover {"\
|
|
|
|
|
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"\
|
|
|
|
|
"stop: 0 #333333, stop: 1 #A0A0A9);}"
|
|
|
|
|
# "stop: 0 #404040, stop: 1 #A8A8B2);}"
|
|
|
|
|
self.button_pressed_style = "QPushButton:pressed {"\
|
|
|
|
|
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"\
|
|
|
|
|
"stop: 0 #222222, stop: 1 #9797A0);}"
|
|
|
|
|
# "background-color: rgb(220,220,220);}"
|
|
|
|
|
self.button_hover_style = "QPushButton:hover {" \
|
|
|
|
|
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," \
|
|
|
|
|
"stop: 0 #333333, stop: 1 #A0A0A9);}"
|
|
|
|
|
# "stop: 0 #404040, stop: 1 #A8A8B2);}"
|
|
|
|
|
self.button_pressed_style = "QPushButton:pressed {" \
|
|
|
|
|
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," \
|
|
|
|
|
"stop: 0 #222222, stop: 1 #9797A0);}"
|
|
|
|
|
|
|
|
|
|
self.hlayout.addWidget(self.meth_name)
|
|
|
|
|
self.setLayout(self.hlayout)
|
|
|
|
@ -64,12 +73,13 @@ class MethodNameWgt(QtGui.QWidget):
|
|
|
|
|
self.meth_name.setText(method_name)
|
|
|
|
|
|
|
|
|
|
def _hide(self):
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
self.hlayout.removeWidget(self.button_widget)
|
|
|
|
|
self.button_widget.close()
|
|
|
|
|
self.hide()
|
|
|
|
|
|
|
|
|
|
# def set_button_style(self):
|
|
|
|
|
|
|
|
|
|
# def set_button_style(self):
|
|
|
|
|
# if hasattr (self, 'next_button'):
|
|
|
|
|
# self.next_button.setStyleSheet("QPushButton {"
|
|
|
|
|
# "color: white; margin 0px;"
|
|
|
|
@ -99,25 +109,23 @@ class ControlButtonWgt(QtGui.QWidget):
|
|
|
|
|
self.setAttribute(QtCore.Qt.WA_StyledBackground)
|
|
|
|
|
self.setObjectName('ControlButton')
|
|
|
|
|
self.setStyleSheet("QWidget#ControlButton "
|
|
|
|
|
# "{background-color: #FF0000;}")
|
|
|
|
|
"{background-color: #FFFFFF;}")
|
|
|
|
|
|
|
|
|
|
self.main_layout = QtGui.QVBoxLayout(self)
|
|
|
|
|
self.main_layout.setContentsMargins(28,8,0,28)
|
|
|
|
|
self.main_layout.setContentsMargins(28, 8, 0, 28)
|
|
|
|
|
self.question_label = LabelWordWrap("")
|
|
|
|
|
#self.question_label.hide()
|
|
|
|
|
# self.question_label.hide()
|
|
|
|
|
self.main_layout.addWidget(self.question_label)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.hlayout = QtGui.QHBoxLayout()
|
|
|
|
|
self.hlayout.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
|
self.hlayout.setContentsMargins(0,0,28,0)
|
|
|
|
|
self.hlayout.setContentsMargins(0, 0, 28, 0)
|
|
|
|
|
self.hlayout.setSpacing(0)
|
|
|
|
|
self.main_layout.addItem(QtGui.QSpacerItem( 0, 0, \
|
|
|
|
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding ))
|
|
|
|
|
self.main_layout.addItem(QtGui.QSpacerItem(
|
|
|
|
|
0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
|
|
|
|
|
self.main_layout.addLayout(self.hlayout)
|
|
|
|
|
|
|
|
|
|
#self.setLayout(self.hlayout)
|
|
|
|
|
# self.setLayout(self.hlayout)
|
|
|
|
|
self.setFixedHeight(90)
|
|
|
|
|
self.hide()
|
|
|
|
|
self.confirmWgt = None
|
|
|
|
@ -131,7 +139,7 @@ class ControlButtonWgt(QtGui.QWidget):
|
|
|
|
|
if self.confirmWgt:
|
|
|
|
|
self.hlayout.removeWidget(self.confirmWgt)
|
|
|
|
|
self.confirmWgt = wgt
|
|
|
|
|
self.hlayout.insertWidget(0,wgt)
|
|
|
|
|
self.hlayout.insertWidget(0, wgt)
|
|
|
|
|
|
|
|
|
|
def close_confirmation(self):
|
|
|
|
|
self.question_label.hide()
|
|
|
|
@ -152,131 +160,163 @@ class ControlButtonWgt(QtGui.QWidget):
|
|
|
|
|
self.break_button = None
|
|
|
|
|
|
|
|
|
|
def _hide(self):
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
self.hlayout.removeWidget(self.button_widget)
|
|
|
|
|
self.button_widget.close()
|
|
|
|
|
self.hide()
|
|
|
|
|
|
|
|
|
|
def add_standart_button(self, Group, x, y, brief = False, \
|
|
|
|
|
next_button_text = None):
|
|
|
|
|
def add_custom_button(self, Group, x, y, brief=False,
|
|
|
|
|
next_button_text=None):
|
|
|
|
|
self.del_button()
|
|
|
|
|
buttons = self._parent.MainFrameWgt.buttons
|
|
|
|
|
self.button_widget = QtGui.QWidget(self)
|
|
|
|
|
end_layout = QtGui.QHBoxLayout(self.button_widget)
|
|
|
|
|
end_layout.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
end_layout.setSpacing(10)
|
|
|
|
|
end_layout.addItem(QtGui.QSpacerItem(
|
|
|
|
|
0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum))
|
|
|
|
|
|
|
|
|
|
self.customs = []
|
|
|
|
|
self.add_cancel_button(end_layout, Group, brief, next_button_text)
|
|
|
|
|
for field, callback in buttons:
|
|
|
|
|
if field.element == "button_next":
|
|
|
|
|
self.add_next_button(end_layout, Group, brief, next_button_text)
|
|
|
|
|
else:
|
|
|
|
|
button = QtGui.QPushButton(self)
|
|
|
|
|
self.customs.append(button)
|
|
|
|
|
button.setText(field.label.decode('utf-8'))
|
|
|
|
|
button.clicked.connect(callback)
|
|
|
|
|
button.setMinimumWidth(62)
|
|
|
|
|
button.setFixedHeight(32)
|
|
|
|
|
end_layout.addWidget(button)
|
|
|
|
|
|
|
|
|
|
self.hlayout.addWidget(self.button_widget)
|
|
|
|
|
|
|
|
|
|
def add_standart_button(self, Group, x, y, brief=False, \
|
|
|
|
|
next_button_text=None):
|
|
|
|
|
self.del_button()
|
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
|
self.button_widget = QtGui.QWidget(self)
|
|
|
|
|
end_layout = QtGui.QHBoxLayout(self.button_widget)
|
|
|
|
|
end_layout.setContentsMargins(0,0,0,0)
|
|
|
|
|
end_layout.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
end_layout.setSpacing(10)
|
|
|
|
|
end_layout.addItem(QtGui.QSpacerItem( 0, 0, \
|
|
|
|
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum ))
|
|
|
|
|
end_layout.addItem(QtGui.QSpacerItem(
|
|
|
|
|
0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum))
|
|
|
|
|
|
|
|
|
|
if self.ClientObj.param_objects[main_frame.method_name]['step'] != 0:
|
|
|
|
|
self.prev_button = QtGui.QPushButton(self)
|
|
|
|
|
try:
|
|
|
|
|
pass
|
|
|
|
|
# self.prev_button.setIcon(QtGui.QIcon.fromTheme("go-previous"))
|
|
|
|
|
finally:
|
|
|
|
|
if Group.prevlabel:
|
|
|
|
|
self.prev_button.setText(Group.prevlabel)
|
|
|
|
|
else:
|
|
|
|
|
self.prev_button.setText(_('Previous'))
|
|
|
|
|
self.add_cancel_button(end_layout, Group, brief, next_button_text)
|
|
|
|
|
self.add_prev_button(end_layout, Group, brief, next_button_text)
|
|
|
|
|
self.add_next_button(end_layout, Group, brief, next_button_text)
|
|
|
|
|
|
|
|
|
|
self.prev_button.clicked.connect(self.button_disabled)
|
|
|
|
|
self.prev_button.clicked.connect(main_frame.button_call_view (-1))
|
|
|
|
|
# self.prev_button.clicked.connect(self.button_enabled)
|
|
|
|
|
self.prev_button.setMinimumWidth(62)
|
|
|
|
|
self.prev_button.setFixedHeight(32)
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
end_layout.addWidget(self.prev_button)
|
|
|
|
|
# self.grid.addWidget(self.prev_button, x, y)
|
|
|
|
|
else:
|
|
|
|
|
self.hlayout.addWidget(self.button_widget)
|
|
|
|
|
x += 1
|
|
|
|
|
return x
|
|
|
|
|
|
|
|
|
|
def add_cancel_button(self, end_layout, Group, brief=False,
|
|
|
|
|
next_button_text=None):
|
|
|
|
|
# создать кнопку отмена
|
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
|
self.prev_button = QtGui.QPushButton(self)
|
|
|
|
|
self.prev_button.setText(_('Cancel').decode('utf-8'))
|
|
|
|
|
|
|
|
|
|
self.prev_button.clicked.connect(self.button_disabled)
|
|
|
|
|
self.prev_button.clicked.connect(self.clear_method_cache)
|
|
|
|
|
method_name = main_frame.method_name
|
|
|
|
|
self.prev_button.clicked.connect(
|
|
|
|
|
lambda:main_frame.clear_cache_info(method_name))
|
|
|
|
|
|
|
|
|
|
self.prev_button.setMinimumWidth(62)
|
|
|
|
|
self.prev_button.setFixedHeight(32)
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
end_layout.addWidget(self.prev_button)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_prev_button(self, end_layout, Group, brief=False,
|
|
|
|
|
next_button_text=None):
|
|
|
|
|
# создать кнопку предыдущий
|
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
|
if (self.ClientObj.param_objects[main_frame.method_name]['step'] != 0
|
|
|
|
|
and main_frame.mutable):
|
|
|
|
|
debug(10, "CREATE PREV BUTTON")
|
|
|
|
|
self.prev_button = QtGui.QPushButton(self)
|
|
|
|
|
self.prev_button.setText(_('Cancel').decode('utf-8'))
|
|
|
|
|
self.prev_button.setText(Group.prevlabel or _('Previous'))
|
|
|
|
|
|
|
|
|
|
self.prev_button.clicked.connect(self.button_disabled)
|
|
|
|
|
self.prev_button.clicked.connect(self.clear_method_cache)
|
|
|
|
|
|
|
|
|
|
self.prev_button.clicked.connect(main_frame.button_call_view(-1))
|
|
|
|
|
# self.prev_button.clicked.connect(self.button_enabled)
|
|
|
|
|
self.prev_button.setMinimumWidth(62)
|
|
|
|
|
self.prev_button.setFixedHeight(32)
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
end_layout.addWidget(self.prev_button)
|
|
|
|
|
|
|
|
|
|
if main_frame.view.groups.GroupField[-1].last and not \
|
|
|
|
|
main_frame.isBrief(self.ClientObj.param_objects\
|
|
|
|
|
[main_frame.method_name]['step']+1) or brief:
|
|
|
|
|
def add_next_button(self, end_layout, Group, brief=False,
|
|
|
|
|
next_button_text=None):
|
|
|
|
|
# если текущая страница - brief
|
|
|
|
|
# если это последний шаг, но метод без brief
|
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
|
if (brief or main_frame.view.groups.GroupField[-1].last and
|
|
|
|
|
not main_frame.hasBrief()):
|
|
|
|
|
debug(10, "CREATE PERFORM BUTTON")
|
|
|
|
|
self.next_button = QtGui.QPushButton(self)
|
|
|
|
|
try:
|
|
|
|
|
pass
|
|
|
|
|
# ok_icon = QtGui.QIcon.fromTheme("dialog-ok-apply")
|
|
|
|
|
# if ok_icon.isNull():
|
|
|
|
|
# ok_icon = ok_icon.fromTheme("go-next")
|
|
|
|
|
# self.next_button.setIcon(ok_icon)
|
|
|
|
|
finally:
|
|
|
|
|
if Group.nextlabel:
|
|
|
|
|
self.next_button.setText(Group.nextlabel)
|
|
|
|
|
else:
|
|
|
|
|
self.next_button.setText(_('Ok'))
|
|
|
|
|
if next_button_text and brief:
|
|
|
|
|
self.next_button.setText(next_button_text)
|
|
|
|
|
if next_button_text and brief:
|
|
|
|
|
self.next_button.setText(next_button_text)
|
|
|
|
|
else:
|
|
|
|
|
self.next_button.setText(Group.nextlabel or _("Ok"))
|
|
|
|
|
|
|
|
|
|
self.next_button.clicked.connect(self.button_disabled)
|
|
|
|
|
if not brief:
|
|
|
|
|
self.next_button.clicked.connect(main_frame.collect_object \
|
|
|
|
|
(False))
|
|
|
|
|
self.next_button.clicked.connect(
|
|
|
|
|
main_frame.collect_object())
|
|
|
|
|
self.next_button.clicked.connect(main_frame.calling(False))
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
end_layout.addWidget(self.next_button)
|
|
|
|
|
else:
|
|
|
|
|
debug(10, "CREATE NEXT BUTTON")
|
|
|
|
|
self.next_button = QtGui.QPushButton(self)
|
|
|
|
|
try:
|
|
|
|
|
pass
|
|
|
|
|
# self.next_button.setIcon(QtGui.QIcon.fromTheme("go-next"))
|
|
|
|
|
finally:
|
|
|
|
|
if Group.nextlabel:
|
|
|
|
|
self.next_button.setText(Group.nextlabel)
|
|
|
|
|
else:
|
|
|
|
|
self.next_button.setText(_('Next'))
|
|
|
|
|
self.next_button.setText(Group.nextlabel or _("Next"))
|
|
|
|
|
|
|
|
|
|
self.next_button.clicked.connect(self.button_disabled)
|
|
|
|
|
if not brief:
|
|
|
|
|
self.next_button.clicked.connect(main_frame.collect_object \
|
|
|
|
|
(False))
|
|
|
|
|
self.next_button.clicked.connect(
|
|
|
|
|
main_frame.collect_object())
|
|
|
|
|
self.next_button.clicked.connect(main_frame.calling(True))
|
|
|
|
|
self.next_button.clicked.connect(main_frame.button_call_view(+1))
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
end_layout.addWidget(self.next_button)
|
|
|
|
|
|
|
|
|
|
self.next_button.setMinimumWidth(64)
|
|
|
|
|
self.next_button.setFixedHeight(32)
|
|
|
|
|
self.next_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return))
|
|
|
|
|
self.next_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Enter))
|
|
|
|
|
# self.next_button.setMaximumHeight(38)
|
|
|
|
|
|
|
|
|
|
# self.set_button_style()
|
|
|
|
|
self.hlayout.addWidget(self.button_widget)
|
|
|
|
|
x += 1
|
|
|
|
|
return x
|
|
|
|
|
|
|
|
|
|
def del_button(self):
|
|
|
|
|
if hasattr (self, 'button_widget'):
|
|
|
|
|
if hasattr(self, 'button_widget'):
|
|
|
|
|
self.hlayout.removeWidget(self.button_widget)
|
|
|
|
|
self.button_widget.close()
|
|
|
|
|
if hasattr (self, 'prev_button'):
|
|
|
|
|
if hasattr(self, 'prev_button'):
|
|
|
|
|
self.prev_button.close()
|
|
|
|
|
if hasattr (self, 'next_button'):
|
|
|
|
|
if hasattr(self, 'next_button'):
|
|
|
|
|
self.next_button.close()
|
|
|
|
|
if hasattr(self, 'customs'):
|
|
|
|
|
for but in self.customs:
|
|
|
|
|
but.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pre_add_button(self):
|
|
|
|
|
self.del_button()
|
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
|
self.button_widget = QtGui.QWidget(self)
|
|
|
|
|
end_layout = QtGui.QHBoxLayout(self.button_widget)
|
|
|
|
|
end_layout.setContentsMargins(0,0,0,0)
|
|
|
|
|
end_layout.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
end_layout.setSpacing(0)
|
|
|
|
|
end_layout.addItem(QtGui.QSpacerItem( 0, 0, \
|
|
|
|
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Maximum))
|
|
|
|
|
end_layout.addItem(QtGui.QSpacerItem(0, 0, \
|
|
|
|
|
QtGui.QSizePolicy.Expanding,
|
|
|
|
|
QtGui.QSizePolicy.Maximum))
|
|
|
|
|
return end_layout
|
|
|
|
|
|
|
|
|
|
def add_clear_cache_button(self, pid = None):
|
|
|
|
|
def add_clear_cache_button(self, pid=None):
|
|
|
|
|
end_layout = self.pre_add_button()
|
|
|
|
|
print "ADD CLOSE"
|
|
|
|
|
self.clear_proc_cache_button = QtGui.QPushButton(_('Close'), self)
|
|
|
|
|
self.ClientObj._parent.user_changed_flag = False
|
|
|
|
|
if pid:
|
|
|
|
@ -294,15 +334,16 @@ class ControlButtonWgt(QtGui.QWidget):
|
|
|
|
|
self.clear_proc_cache_button.setDisabled(True)
|
|
|
|
|
sid = int(self.ClientObj.sid)
|
|
|
|
|
res = self.ClientObj.client.service.clear_pid_cache(sid, self.pid)
|
|
|
|
|
if (hasattr(self._parent.ClientObj,"sys_update_pid") and
|
|
|
|
|
if (hasattr(self._parent.ClientObj, "sys_update_pid") and
|
|
|
|
|
str(self.pid) == str(
|
|
|
|
|
self._parent.ClientObj._parent.sys_update_pid)):
|
|
|
|
|
self._parent.ClientObj._parent.sys_update_pid)):
|
|
|
|
|
self._parent.ClientObj._parent.sys_update_pid = None
|
|
|
|
|
if res:
|
|
|
|
|
_print (_('Error closing the process'))
|
|
|
|
|
_print(_('Error closing the process'))
|
|
|
|
|
|
|
|
|
|
from calculate.consolegui.application.ConnectionTabs \
|
|
|
|
|
import SelectedMethodWgt
|
|
|
|
|
import SelectedMethodWgt
|
|
|
|
|
|
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
|
self.window().close()
|
|
|
|
|
else:
|
|
|
|
@ -314,18 +355,19 @@ class ControlButtonWgt(QtGui.QWidget):
|
|
|
|
|
self.button_disabled()
|
|
|
|
|
sid = int(self.ClientObj.sid)
|
|
|
|
|
|
|
|
|
|
if hasattr (self._parent.MainFrameWgt, 'method_name'):
|
|
|
|
|
if hasattr(self._parent.MainFrameWgt, 'method_name'):
|
|
|
|
|
method = self._parent.MainFrameWgt.method_name
|
|
|
|
|
try:
|
|
|
|
|
res = self.ClientObj.client.service.clear_method_cache \
|
|
|
|
|
(sid, method)
|
|
|
|
|
(sid, method)
|
|
|
|
|
lerror = self.ClientObj.param_objects[method]['error']
|
|
|
|
|
while len(lerror)>0:
|
|
|
|
|
while len(lerror) > 0:
|
|
|
|
|
lerror.pop()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print e
|
|
|
|
|
from calculate.consolegui.application.ConnectionTabs \
|
|
|
|
|
import SelectedMethodWgt
|
|
|
|
|
|
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
|
self.window().close()
|
|
|
|
|
else:
|
|
|
|
@ -353,7 +395,7 @@ class ControlButtonWgt(QtGui.QWidget):
|
|
|
|
|
|
|
|
|
|
def keyPressEvent(self, e):
|
|
|
|
|
if e.key() == QtCore.Qt.Key_Return:
|
|
|
|
|
if hasattr (self, 'next_button'):
|
|
|
|
|
if hasattr(self, 'next_button'):
|
|
|
|
|
self.next_button.click()
|
|
|
|
|
else:
|
|
|
|
|
QtGui.QWidget.keyPressEvent(self, e)
|
|
|
|
|