Skip to content

Commit

Permalink
Make open asset directory optional in low PySide6 version
Browse files Browse the repository at this point in the history
Signed-off-by: Loren Eteval <[email protected]>
  • Loading branch information
LorenEteval committed May 28, 2024
1 parent b62c39e commit c83eba2
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions Furious/Window/XrayAssetViewerWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ def __init__(self, *args, **kwargs):
self.xrayAssetViewerWidget = XrayAssetViewerQListWidget(parent=self)
self.setCentralWidget(self.xrayAssetViewerWidget)

if versionToValue(PYSIDE6_VERSION) <= versionToValue('6.1.3'):
openAssetDirectoryActions = [None]
else:
# openUrl will crash on PySide6 6.1.3, probably a Qt bug
openAssetDirectoryActions = [
AppQAction(
_('Open Asset Directory'),
callback=lambda: self.openAssetDirectory(),
shortcut=QtCore.QKeyCombination(
QtCore.Qt.KeyboardModifier.ControlModifier,
QtCore.Qt.Key.Key_O,
),
),
]

self.fileMenu = AppQMenu(
AppQAction(
_('Refresh'),
Expand All @@ -67,14 +82,7 @@ def __init__(self, *args, **kwargs):
),
),
AppQSeperator(),
AppQAction(
_('Open Asset Directory'),
callback=lambda: self.openAssetDirectory(),
shortcut=QtCore.QKeyCombination(
QtCore.Qt.KeyboardModifier.ControlModifier,
QtCore.Qt.Key.Key_O,
),
),
*openAssetDirectoryActions,
AppQAction(
_('Import From File...'),
callback=lambda: self.appendNewItem(),
Expand Down

0 comments on commit c83eba2

Please sign in to comment.