|
|
@ -183,7 +183,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
|
|
def add_custom_button(self, Group, x, y, brief=False,
|
|
|
|
def add_custom_button(self, Group, x, y, brief=False,
|
|
|
|
next_button_text=""):
|
|
|
|
next_button_text=""):
|
|
|
|
# self.del_button()
|
|
|
|
self.del_button()
|
|
|
|
buttons = self._parent.MainFrameWgt.buttons
|
|
|
|
buttons = self._parent.MainFrameWgt.buttons
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
end_layout = qt.QHBoxLayout(self.button_widget)
|
|
|
|
end_layout = qt.QHBoxLayout(self.button_widget)
|
|
|
@ -226,7 +226,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
|
|
def add_standart_button(self, Group, x, y, brief=False, \
|
|
|
|
def add_standart_button(self, Group, x, y, brief=False, \
|
|
|
|
next_button_text=""):
|
|
|
|
next_button_text=""):
|
|
|
|
# self.del_button()
|
|
|
|
self.del_button()
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
main_frame = self._parent.MainFrameWgt
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
@ -337,29 +337,51 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
self.default_button = self.next_button
|
|
|
|
self.default_button = self.next_button
|
|
|
|
|
|
|
|
|
|
|
|
def del_button(self):
|
|
|
|
def del_button(self):
|
|
|
|
|
|
|
|
# buttons will moslty be garbage collected
|
|
|
|
if self.button_widget:
|
|
|
|
if self.button_widget:
|
|
|
|
self.hlayout.removeWidget(self.button_widget)
|
|
|
|
self.hlayout.removeWidget(self.button_widget)
|
|
|
|
|
|
|
|
# only one of the buttons that actually needs to be closed
|
|
|
|
|
|
|
|
try:
|
|
|
|
self.button_widget.close()
|
|
|
|
self.button_widget.close()
|
|
|
|
# self.button_widget = None
|
|
|
|
print("WIDGET BUTTON CLOSED")
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
|
|
|
print(str(e) + f" (WIDGET BUTTON)")
|
|
|
|
|
|
|
|
self.button_widget = None
|
|
|
|
if self.prev_button:
|
|
|
|
if self.prev_button:
|
|
|
|
self.prev_button.close()
|
|
|
|
# try:
|
|
|
|
# self.prev_button = None
|
|
|
|
# self.prev_button.close()
|
|
|
|
|
|
|
|
# print("PREV BUTTON CLOSED")
|
|
|
|
|
|
|
|
# except Exception as e:
|
|
|
|
|
|
|
|
# print(str(e) + f" (PREV BUTTON)")
|
|
|
|
|
|
|
|
self.prev_button = None
|
|
|
|
if self.cancel_button:
|
|
|
|
if self.cancel_button:
|
|
|
|
self.cancel_button.close()
|
|
|
|
# try:
|
|
|
|
# self.cancel_button = None
|
|
|
|
# self.cancel_button.close()
|
|
|
|
|
|
|
|
# print("CANCEL BUTTON CLOSED")
|
|
|
|
|
|
|
|
# except Exception as e:
|
|
|
|
|
|
|
|
# print(str(e) + f" (CANCEL BUTTON)")
|
|
|
|
|
|
|
|
self.cancel_button = None
|
|
|
|
if self.next_button:
|
|
|
|
if self.next_button:
|
|
|
|
self.next_button.close()
|
|
|
|
# try:
|
|
|
|
# self.next_button = None
|
|
|
|
# self.next_button.close()
|
|
|
|
|
|
|
|
# print("NEXT BUTTON CLOSED")
|
|
|
|
|
|
|
|
# except Exception as e:
|
|
|
|
|
|
|
|
# print(str(e) + f" (NEXT BUTTON)")
|
|
|
|
|
|
|
|
self.next_button = None
|
|
|
|
if self.customs:
|
|
|
|
if self.customs:
|
|
|
|
for but in self.customs:
|
|
|
|
for but in self.customs:
|
|
|
|
but.close()
|
|
|
|
# try:
|
|
|
|
# self.customs = None
|
|
|
|
# but.close()
|
|
|
|
|
|
|
|
# print("CUSTOM BUTTON CLOSED")
|
|
|
|
|
|
|
|
# except Exception as e:
|
|
|
|
|
|
|
|
# print(str(e) + f" (CUSTOM BUTTON)")
|
|
|
|
|
|
|
|
self.customs = None
|
|
|
|
if self.default_button:
|
|
|
|
if self.default_button:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
# self.default_button = None
|
|
|
|
self.default_button = None
|
|
|
|
|
|
|
|
|
|
|
|
def pre_add_button(self):
|
|
|
|
def pre_add_button(self):
|
|
|
|
# self.del_button()
|
|
|
|
self.del_button()
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
# add 1 (or 2) button ok (next) [and previous]
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
self.button_widget = qt.QWidget(self)
|
|
|
|
end_layout = qt.QHBoxLayout(self.button_widget)
|
|
|
|
end_layout = qt.QHBoxLayout(self.button_widget)
|
|
|
@ -402,7 +424,7 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
self.window().close()
|
|
|
|
self.window().close()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# self.del_button()
|
|
|
|
self.del_button()
|
|
|
|
self.hide()
|
|
|
|
self.hide()
|
|
|
|
self._parent.back()
|
|
|
|
self._parent.back()
|
|
|
|
|
|
|
|
|
|
|
@ -426,37 +448,42 @@ class ControlButtonWgt(qt.QWidget):
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
if type(self.window()) == SelectedMethodWgt:
|
|
|
|
self.window().close()
|
|
|
|
self.window().close()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# self.del_button()
|
|
|
|
self.del_button()
|
|
|
|
self.hide()
|
|
|
|
self.hide()
|
|
|
|
self._parent.back()
|
|
|
|
self._parent.back()
|
|
|
|
|
|
|
|
|
|
|
|
def button_disabled(self):
|
|
|
|
def button_disabled(self):
|
|
|
|
|
|
|
|
if self.next_button:
|
|
|
|
# if self.next_button:
|
|
|
|
self.next_button.setDisabled(True)
|
|
|
|
# self.next_button.setDisabled(True)
|
|
|
|
if self.prev_button:
|
|
|
|
# if self.prev_button:
|
|
|
|
self.prev_button.setDisabled(True)
|
|
|
|
# self.prev_button.setDisabled(True)
|
|
|
|
if self.cancel_button:
|
|
|
|
# if self.cancel_button:
|
|
|
|
self.cancel_button.setDisabled(True)
|
|
|
|
# self.cancel_button.setDisabled(True)
|
|
|
|
if self.clear_proc_cache_button:
|
|
|
|
# if self.clear_proc_cache_button:
|
|
|
|
try:
|
|
|
|
# self.clear_proc_cache_button.setDisabled(True)
|
|
|
|
self.clear_proc_cache_button.setDisabled(True)
|
|
|
|
# if self.customs:
|
|
|
|
except Exception as e:
|
|
|
|
# for but in self.customs:
|
|
|
|
print(str(e) + (" (Cache button)"))
|
|
|
|
# but.setDisabled(True)
|
|
|
|
if self.customs:
|
|
|
|
|
|
|
|
for but in self.customs:
|
|
|
|
|
|
|
|
but.setDisabled(True)
|
|
|
|
self.ClientObj.app.processEvents()
|
|
|
|
self.ClientObj.app.processEvents()
|
|
|
|
|
|
|
|
|
|
|
|
def button_enabled(self):
|
|
|
|
def button_enabled(self):
|
|
|
|
# if self.next_button:
|
|
|
|
if self.next_button:
|
|
|
|
# self.next_button.setEnabled(True)
|
|
|
|
self.next_button.setEnabled(True)
|
|
|
|
# if self.prev_button:
|
|
|
|
if self.prev_button:
|
|
|
|
# self.prev_button.setEnabled(True)
|
|
|
|
self.prev_button.setEnabled(True)
|
|
|
|
# if self.cancel_button:
|
|
|
|
if self.cancel_button:
|
|
|
|
# self.cancel_button.setEnabled(True)
|
|
|
|
self.cancel_button.setEnabled(True)
|
|
|
|
# if self.clear_proc_cache_button:
|
|
|
|
if self.clear_proc_cache_button:
|
|
|
|
# self.clear_proc_cache_button.setEnabled(True)
|
|
|
|
try:
|
|
|
|
# if self.customs:
|
|
|
|
self.clear_proc_cache_button.setEnabled(True)
|
|
|
|
# for but in self.customs:
|
|
|
|
except Exception as e:
|
|
|
|
# but.setEnabled(True)
|
|
|
|
print(str(e) + (" (Cache button)"))
|
|
|
|
|
|
|
|
if self.customs:
|
|
|
|
|
|
|
|
for but in self.customs:
|
|
|
|
|
|
|
|
but.setEnabled(True)
|
|
|
|
self.ClientObj.app.processEvents()
|
|
|
|
self.ClientObj.app.processEvents()
|
|
|
|
|
|
|
|
|
|
|
|
def keyPressEvent(self, e):
|
|
|
|
def keyPressEvent(self, e):
|
|
|
|