Skip to content

Commit

Permalink
Fix the mayadockwidgetmixin not working outside of maya
Browse files Browse the repository at this point in the history
Remove "Take snapshot" annotation from the preview icon
  • Loading branch information
krathjen committed May 5, 2017
1 parent d45640c commit a429713
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,21 @@ def dockWidget(self):

def mayaWindow(self):
"""
:rtype: QMainWindow
:rtype: QMainWindow or None
"""
mainWindowPtr = omui.MQtUtil.mainWindow()
return wrapInstance(long(mainWindowPtr), QtWidgets.QMainWindow)
try:
mainWindowPtr = omui.MQtUtil.mainWindow()
return wrapInstance(long(mainWindowPtr), QtWidgets.QMainWindow)
except NameError, e:
logger.exception(e)

def mapDockAreaToStr(self, dockArea):
"""
:type dockArea: QtCore.Qt.QDockArea
:rtype: str
"""
map = self.dockAreaMap()
return map[dockArea]
areaMap = self.dockAreaMap()
return areaMap[dockArea]

def mapDockAreaFromStr(self, dockAreaStr):
"""
Expand All @@ -196,9 +199,9 @@ def dockArea(self):
"""
:rtype: QtCore.Qt.DockWidgetAreas
"""
if self.isFloating():
dockArea = QtCore.Qt.NoDockWidgetArea
else:
dockArea = QtCore.Qt.NoDockWidgetArea

if self.mayaWindow() and not self.isFloating():
dockArea = self.mayaWindow().dockWidgetArea(self.dockWidget())

return dockArea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ QPushButton:!Checked {
</size>
</property>
<property name="toolTip">
<string>Take snapshot</string>
<string/>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ QPushButton:!Checked {
</size>
</property>
<property name="toolTip">
<string>Take snapshot</string>
<string/>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ QPushButton:!Checked {
</size>
</property>
<property name="toolTip">
<string>Take snapshot</string>
<string/>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ QPushButton:!Checked {
</size>
</property>
<property name="toolTip">
<string>Take snapshot</string>
<string/>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
Expand Down

0 comments on commit a429713

Please sign in to comment.