Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the main settings on the guide #370

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions release/scripts/mgear/shifter/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,9 @@ def addFullNameParam(self):
Note that animatable and keyable are True per default.

"""
if not self.settings["add_full_name_param"]:
return

# attr = self.addAnimEnumParam("", "", 0, ["---------------"] )
if self.options["classicChannelNames"]:
attr = self.addAnimEnumParam(
self.getName(), "__________", 0, [self.getName()]
Expand All @@ -1193,7 +1194,7 @@ def addFullNameParam(self):
name = self.name
else:
name = self.guide.compName
attr = self.addAnimEnumParam(name, "__________", 0, [name])
attr = self.addAnimEnumParam(name, "__________", 0, [self.getName()])

return attr

Expand Down
17 changes: 17 additions & 0 deletions release/scripts/mgear/shifter/component/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def initialHierarchy(self):
self.pOverrideComponentColor = self.addParam("Override_Color", "bool", False)
self.pOverrideUseRGBColor = self.addParam("Use_RGB_Color", "bool", False)

self.pAddFullNameParam = self.addParam("add_full_name_param", "bool", True)

self.pOverrideColorIndexfk = self.addParam("color_fk", "long", 6, 0, 31)
self.pOverrideColorIndexik = self.addParam("color_ik", "long", 18, 0, 31)

Expand Down Expand Up @@ -1268,6 +1270,10 @@ def populate_controls(self):
QtCore.Qt.Checked if self.root.Use_RGB_Color.get() else QtCore.Qt.Unchecked
)

self.mainSettingsTab.addFullNameParam_checkBox.setCheckState(
QtCore.Qt.Checked if self.root.add_full_name_param.get() else QtCore.Qt.Unchecked
)

tab = self.mainSettingsTab

index_widgets = (
Expand Down Expand Up @@ -1440,12 +1446,23 @@ def create_connections(self):
partial(self.updateCheck, tab.overrideColors_checkBox, "Override_Color")
)

tab.addFullNameParam_checkBox.stateChanged.connect(
partial(self.updateCheck, tab.addFullNameParam_checkBox, "add_full_name_param")
)

tab.addFullNameParam_checkBox.stateChanged.connect(self.changeHostStatus)

def joint_names_dialog(self):
dialog = JointNames(self.root, self)
dialog.setWindowTitle(self.windowTitle())
dialog.attributeChanged.connect(self.refresh_controls)
dialog.show()

def changeHostStatus(self):
status = self.mainSettingsTab.addFullNameParam_checkBox.isChecked()
self.mainSettingsTab.host_lineEdit.setEnabled(status)
self.mainSettingsTab.host_pushButton.setEnabled(status)


class JointNames(QtWidgets.QDialog, jnui.Ui_Form):
attributeChanged = QtCore.Signal()
Expand Down
7 changes: 6 additions & 1 deletion release/scripts/mgear/shifter/component/main_settings_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def setupUi(self, Form):
self.groupBox.setObjectName("groupBox")
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
self.gridLayout_2.setObjectName("gridLayout_2")
self.addFullNameParam_checkBox = QtWidgets.QCheckBox(self.groupBox)
self.addFullNameParam_checkBox.setObjectName("addFullNameParam_checkBox")
self.addFullNameParam_checkBox.setChecked(True)
self.gridLayout_2.addWidget(self.addFullNameParam_checkBox, 0, 0, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.host_label = QtWidgets.QLabel(self.groupBox)
Expand All @@ -29,7 +33,7 @@ def setupUi(self, Form):
self.host_pushButton = QtWidgets.QPushButton(self.groupBox)
self.host_pushButton.setObjectName("host_pushButton")
self.horizontalLayout_2.addWidget(self.host_pushButton)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 1)
self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 1)
self.groupBox_4 = QtWidgets.QGroupBox(Form)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
Expand Down Expand Up @@ -283,6 +287,7 @@ def setupUi(self, Form):
def retranslateUi(self, Form):
Form.setWindowTitle(QtWidgets.QApplication.translate("Form", "Form", None, -1))
self.groupBox.setTitle(QtWidgets.QApplication.translate("Form", "Channels Host Settings", None, -1))
self.addFullNameParam_checkBox.setText(QtWidgets.QApplication.translate("Form", "Add Full Name Param", None, -1))
self.host_label.setText(QtWidgets.QApplication.translate("Form", "Host:", None, -1))
self.host_pushButton.setText(QtWidgets.QApplication.translate("Form", "<<", None, -1))
self.groupBox_4.setTitle(QtWidgets.QApplication.translate("Form", "Color Settings", None, -1))
Expand Down
13 changes: 10 additions & 3 deletions release/scripts/mgear/shifter/component/main_settings_ui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>286</width>
<height>518</height>
<width>436</width>
<height>511</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -39,7 +39,7 @@
<string>Channels Host Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="host_label">
Expand All @@ -60,6 +60,13 @@
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="addFullNameParam_checkBox">
<property name="text">
<string>Add Full Name Param</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
Loading