Skip to content

Commit

Permalink
change button name and add tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
jlorrain authored and ClementHector committed Feb 7, 2022
1 parent da42cbf commit bf31458
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions openpype/tools/pyblish_pype/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ def __init__(self, controller, parent=None):

presets_button = widgets.ButtonWithMenu(awesome["filter"])
presets_button.setEnabled(False)

self.change_mode_btn = QtWidgets.QPushButton()
if self.controller.sanity_mode:
self.change_mode_btn.setText("C")
self.set_publish_mode_btn()
else:
self.change_mode_btn.setText("S")
self.set_validation_mode_btn()
aditional_btns_layout.addWidget(self.change_mode_btn)
aditional_btns_layout.addWidget(presets_button)

Expand Down Expand Up @@ -1139,16 +1140,22 @@ def on_was_processed(self, result):
#
# -------------------------------------------------------------------------

def change_to_sanity_mode(self):
def set_validation_mode_btn(self):
self.change_mode_btn.setText("V")
self.change_mode_btn.setToolTip("Switch to Validation mode.")

def set_publish_mode_btn(self):
self.change_mode_btn.setText("P")
self.change_mode_btn.setToolTip("Switch to Publish mode.")

self.change_mode_btn.setText("C")
def change_to_sanity_mode(self):
self.set_publish_mode_btn()
self.controller.sanity_mode = True
self.controller.deactivate_validator_plugins()
self.reset()

def change_to_classic_mode(self):

self.change_mode_btn.setText("S")
self.set_validation_mode_btn()
self.controller.sanity_mode = False
self.reset()

Expand Down

0 comments on commit bf31458

Please sign in to comment.