|
|
|
@ -106,7 +106,8 @@ class MethodNameWgt(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
def __init__(self, parent, ClientObj):
|
|
|
|
|
qt.QWidget.__init__(self, parent)
|
|
|
|
|
super().__init__(parent)
|
|
|
|
|
# qt.QWidget.__init__(self, parent)
|
|
|
|
|
self._parent = parent
|
|
|
|
|
self.ClientObj = ClientObj
|
|
|
|
|
|
|
|
|
@ -114,8 +115,10 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
self.setAttribute(qt.Qt.WA_StyledBackground)
|
|
|
|
|
self.setObjectName('ControlButton')
|
|
|
|
|
self.setStyleSheet("QWidget#ControlButton "
|
|
|
|
|
"{background-color: %s;}"%
|
|
|
|
|
get_system_rgb(self, ParameterWindow))
|
|
|
|
|
"{background-color: rgb(255,0,0);}")
|
|
|
|
|
# self.setStyleSheet("QWidget#ControlButton "
|
|
|
|
|
# "{background-color: %s;}"%
|
|
|
|
|
# get_system_rgb(self, ParameterWindow))
|
|
|
|
|
|
|
|
|
|
self.main_layout = qt.QVBoxLayout(self)
|
|
|
|
|
self.main_layout.setContentsMargins(28, 8, 0, 28)
|
|
|
|
@ -182,7 +185,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
def add_custom_button(self, Group, x, y, brief=False,
|
|
|
|
|
next_button_text=""):
|
|
|
|
|
self.del_button()
|
|
|
|
|
# self.del_button()
|
|
|
|
|
buttons = self._parent.MainFrameWgt.buttons
|
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
|
end_layout = qt.QHBoxLayout(self.button_widget)
|
|
|
|
@ -220,7 +223,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
def add_standart_button(self, Group, x, y, brief=False, \
|
|
|
|
|
next_button_text=""):
|
|
|
|
|
self.del_button()
|
|
|
|
|
# self.del_button()
|
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
@ -354,7 +357,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
# self.default_button = None
|
|
|
|
|
|
|
|
|
|
def pre_add_button(self):
|
|
|
|
|
self.del_button()
|
|
|
|
|
# self.del_button()
|
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
|
end_layout = qt.QHBoxLayout(self.button_widget)
|
|
|
|
@ -381,7 +384,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
self.hlayout.addWidget(self.button_widget)
|
|
|
|
|
|
|
|
|
|
def clear_pid_cache(self):
|
|
|
|
|
self.button_disabled()
|
|
|
|
|
# self.button_disabled()
|
|
|
|
|
self.clear_proc_cache_button.setDisabled(True)
|
|
|
|
|
sid = int(self.ClientObj.sid)
|
|
|
|
|
res = self.ClientObj.client.service.clear_pid_cache(sid, self.pid)
|
|
|
|
@ -398,7 +401,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
|
self.window().close()
|
|
|
|
|
else:
|
|
|
|
|
self.del_button()
|
|
|
|
|
# self.del_button()
|
|
|
|
|
self.hide()
|
|
|
|
|
self._parent.back()
|
|
|
|
|
|
|
|
|
@ -422,22 +425,22 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
|
self.window().close()
|
|
|
|
|
else:
|
|
|
|
|
self.del_button()
|
|
|
|
|
# self.del_button()
|
|
|
|
|
self.hide()
|
|
|
|
|
self._parent.back()
|
|
|
|
|
|
|
|
|
|
def button_disabled(self):
|
|
|
|
|
if self.next_button:
|
|
|
|
|
self.next_button.setDisabled(True)
|
|
|
|
|
if self.prev_button:
|
|
|
|
|
self.prev_button.setDisabled(True)
|
|
|
|
|
if self.cancel_button:
|
|
|
|
|
self.cancel_button.setDisabled(True)
|
|
|
|
|
if self.clear_proc_cache_button:
|
|
|
|
|
self.clear_proc_cache_button.setDisabled(True)
|
|
|
|
|
if self.customs:
|
|
|
|
|
for but in self.customs:
|
|
|
|
|
but.setDisabled(True)
|
|
|
|
|
# if self.next_button:
|
|
|
|
|
# self.next_button.setDisabled(True)
|
|
|
|
|
# if self.prev_button:
|
|
|
|
|
# self.prev_button.setDisabled(True)
|
|
|
|
|
# if self.cancel_button:
|
|
|
|
|
# self.cancel_button.setDisabled(True)
|
|
|
|
|
# if self.clear_proc_cache_button:
|
|
|
|
|
# self.clear_proc_cache_button.setDisabled(True)
|
|
|
|
|
# if self.customs:
|
|
|
|
|
# for but in self.customs:
|
|
|
|
|
# but.setDisabled(True)
|
|
|
|
|
self.ClientObj.app.processEvents()
|
|
|
|
|
|
|
|
|
|
def button_enabled(self):
|
|
|
|
|