diff --git a/Engine/FrameEntry.h b/Engine/FrameEntry.h index b55bd45164..06765ff4f0 100644 --- a/Engine/FrameEntry.h +++ b/Engine/FrameEntry.h @@ -29,11 +29,15 @@ #include #include + #if !defined(Q_MOC_RUN) && !defined(SBK_RUN) #include #endif + +CLANG_DIAG_OFF(deprecated) #include #include +CLANG_DIAG_ON(deprecated) #include "Global/GlobalDefines.h" #include "Engine/FrameKey.h" diff --git a/Engine/Settings.cpp b/Engine/Settings.cpp index 799f332c6f..67bee2787d 100644 --- a/Engine/Settings.cpp +++ b/Engine/Settings.cpp @@ -1080,7 +1080,6 @@ Settings::initializeKnobsViewers() _autoProxyLevel->populateChoices(autoProxyChoices); _viewersTab->addKnob(_autoProxyLevel); - _maximumNodeViewerUIOpened = AppManager::createKnob( this, tr("Max. opened node viewer interface") ); _maximumNodeViewerUIOpened->setName("maxNodeUiOpened"); _maximumNodeViewerUIOpened->setMinimum(1); @@ -1088,6 +1087,17 @@ Settings::initializeKnobsViewers() _maximumNodeViewerUIOpened->disableSlider(); _maximumNodeViewerUIOpened->setHintToolTip( tr("Controls the maximum amount of nodes that can have their interface showing up at the same time in the viewer") ); _viewersTab->addKnob(_maximumNodeViewerUIOpened); + + _viewerKeys = AppManager::createKnob( this, tr("Use number keys for the viewer") ); + _viewerKeys->setName("viewerNumberKeys"); + _viewerKeys->setAnimationEnabled(false); + _viewerKeys->setHintToolTip( tr("When enabled, the row of number keys on the keyboard " + "is used for switching input ( connects input to A side, " + " connects input to B side), even if the corresponding " + "character in the current keyboard layout is not a number.\n" + "This may have to be disabled when using a remote display connection " + "to Linux from a different OS.") ); + _viewersTab->addKnob(_viewerKeys); } // Settings::initializeKnobsViewers void @@ -1499,6 +1509,7 @@ Settings::setDefaultValues() _autoProxyWhenScrubbingTimeline->setDefaultValue(true); _autoProxyLevel->setDefaultValue(1); _maximumNodeViewerUIOpened->setDefaultValue(2); + _viewerKeys->setDefaultValue(true); _warnOcioConfigKnobChanged->setDefaultValue(true); _ocioStartupCheck->setDefaultValue(true); @@ -2190,6 +2201,9 @@ Settings::onKnobValueChanged(KnobI* k, return ret; } // onKnobValueChanged +//////////////////////////////////////////////////////// +// "Viewers" pane + ImageBitDepthEnum Settings::getViewersBitDepth() const { @@ -2210,6 +2224,75 @@ Settings::getViewerTilesPowerOf2() const return _powerOf2Tiling->getValue(); } +int +Settings::getCheckerboardTileSize() const +{ + return _checkerboardTileSize->getValue(); +} + +void +Settings::getCheckerboardColor1(double* r, + double* g, + double* b, + double* a) const +{ + *r = _checkerboardColor1->getValue(0); + *g = _checkerboardColor1->getValue(1); + *b = _checkerboardColor1->getValue(2); + *a = _checkerboardColor1->getValue(3); +} + +void +Settings::getCheckerboardColor2(double* r, + double* g, + double* b, + double* a) const +{ + *r = _checkerboardColor2->getValue(0); + *g = _checkerboardColor2->getValue(1); + *b = _checkerboardColor2->getValue(2); + *a = _checkerboardColor2->getValue(3); +} + +bool +Settings::isAutoWipeEnabled() const +{ + return _autoWipe->getValue(); +} + +bool +Settings::isAutoProxyEnabled() const +{ + return _autoProxyWhenScrubbingTimeline->getValue(); +} + +unsigned int +Settings::getAutoProxyMipMapLevel() const +{ + return (unsigned int)_autoProxyLevel->getValue() + 1; +} + +int +Settings::getMaxOpenedNodesViewerContext() const +{ + return _maximumNodeViewerUIOpened->getValue(); +} + +bool +Settings::isViewerKeysEnabled() const +{ + return _viewerKeys->getValue(); +} + +/////////////////////////////////////////////////////// +// "Caching" pane + +bool +Settings::isAggressiveCachingEnabled() const +{ + return _aggressiveCaching->getValue(); +} + double Settings::getRamMaximumPercent() const { @@ -2234,6 +2317,8 @@ Settings::getMaximumDiskCacheNodeSize() const return (U64)( _maxDiskCacheNodeGB->getValue() ) * std::pow(1024., 3.); } +/////////////////////////////////////////////////// + double Settings::getUnreachableRamPercent() const { @@ -3144,36 +3229,6 @@ Settings::isAutoFixRelativeFilePathEnabled() const return _fixPathsOnProjectPathChanged->getValue(); } -int -Settings::getCheckerboardTileSize() const -{ - return _checkerboardTileSize->getValue(); -} - -void -Settings::getCheckerboardColor1(double* r, - double* g, - double* b, - double* a) const -{ - *r = _checkerboardColor1->getValue(0); - *g = _checkerboardColor1->getValue(1); - *b = _checkerboardColor1->getValue(2); - *a = _checkerboardColor1->getValue(3); -} - -void -Settings::getCheckerboardColor2(double* r, - double* g, - double* b, - double* a) const -{ - *r = _checkerboardColor2->getValue(0); - *g = _checkerboardColor2->getValue(1); - *b = _checkerboardColor2->getValue(2); - *a = _checkerboardColor2->getValue(3); -} - int Settings::getNumberOfParallelRenders() const { @@ -3290,12 +3345,6 @@ Settings::notifyOnFileChange() const return _notifyOnFileChange->getValue(); } -bool -Settings::isAggressiveCachingEnabled() const -{ - return _aggressiveCaching->getValue(); -} - bool Settings::isAutoTurboEnabled() const { @@ -3753,24 +3802,6 @@ Settings::getDopeSheetEditorNodeSeparationWith() const return 4; } -int -Settings::getMaxOpenedNodesViewerContext() const -{ - return _maximumNodeViewerUIOpened->getValue(); -} - -bool -Settings::isAutoProxyEnabled() const -{ - return _autoProxyWhenScrubbingTimeline->getValue(); -} - -unsigned int -Settings::getAutoProxyMipMapLevel() const -{ - return (unsigned int)_autoProxyLevel->getValue() + 1; -} - bool Settings::isNaNHandlingEnabled() const { @@ -3826,12 +3857,6 @@ Settings::getUserStyleSheetFilePath() const return _qssFile->getValue(); } -bool -Settings::isAutoWipeEnabled() const -{ - return _autoWipe->getValue(); -} - void Settings::setRenderQueuingEnabled(bool enabled) { diff --git a/Engine/Settings.h b/Engine/Settings.h index 9087d0ef4d..8572305504 100644 --- a/Engine/Settings.h +++ b/Engine/Settings.h @@ -94,10 +94,6 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON ViewSpec view, bool originatedFromMainThread) OVERRIDE FINAL; - ImageBitDepthEnum getViewersBitDepth() const; - - int getViewerTilesPowerOf2() const; - double getRamMaximumPercent() const; double getRamPlaybackMaximumPercent() const; @@ -241,11 +237,19 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool isAutoFixRelativeFilePathEnabled() const; - bool isAutoWipeEnabled() const; - + /////////////////////////////////////////////////////// + // "Viewers" pane + ImageBitDepthEnum getViewersBitDepth() const; + int getViewerTilesPowerOf2() const; int getCheckerboardTileSize() const; void getCheckerboardColor1(double* r, double* g, double* b, double* a) const; void getCheckerboardColor2(double* r, double* g, double* b, double* a) const; + bool isAutoWipeEnabled() const; + bool isAutoProxyEnabled() const; + unsigned int getAutoProxyMipMapLevel() const; + int getMaxOpenedNodesViewerContext() const; + bool isViewerKeysEnabled() const; + /////////////////////////////////////////////////////// bool areRGBPixelComponentsSupported() const; @@ -347,15 +351,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON int getSEFontSize() const; std::string getSEFontFamily() const; - void getPluginIconFrameColor(int *r, int *g, int *b) const; int getDopeSheetEditorNodeSeparationWith() const; - bool isAutoProxyEnabled() const; - unsigned int getAutoProxyMipMapLevel() const; - - int getMaxOpenedNodesViewerContext() const; - bool isNaNHandlingEnabled() const; bool isCopyInputImageForPluginRenderEnabled() const; @@ -473,6 +471,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON boost::shared_ptr _maxDiskCacheNodeGB; boost::shared_ptr _diskCachePath; boost::shared_ptr _wipeDiskCache; + + // "Viewers" pane boost::shared_ptr _viewersTab; boost::shared_ptr _texturesMode; boost::shared_ptr _powerOf2Tiling; @@ -483,6 +483,9 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON boost::shared_ptr _autoProxyWhenScrubbingTimeline; boost::shared_ptr _autoProxyLevel; boost::shared_ptr _maximumNodeViewerUIOpened; + boost::shared_ptr _viewerKeys; + + // "Nodegraph" pane boost::shared_ptr _nodegraphTab; boost::shared_ptr _autoTurbo; boost::shared_ptr _useNodeGraphHints; diff --git a/Gui/Gui.cpp b/Gui/Gui.cpp index 18b44bbbce..39ec72f696 100644 --- a/Gui/Gui.cpp +++ b/Gui/Gui.cpp @@ -566,11 +566,12 @@ Gui::createMenuActions() _imp->actionConnectInput[i] = new ActionWithShortcut(kShortcutGroupGlobal, ids[i], descs[i], this); _imp->actionConnectInput[i]->setData( i % (NATRON_CONNECT_INPUT_NB / 2) ); _imp->actionConnectInput[i]->setShortcutContext(Qt::WidgetShortcut); - if (i < NATRON_CONNECT_INPUT_NB/2) { + if (i < NATRON_CONNECT_INPUT_NB / 2) { QObject::connect( _imp->actionConnectInput[i], SIGNAL(triggered()), this, SLOT(connectInput()) ); } else { QObject::connect( _imp->actionConnectInput[i], SIGNAL(triggered()), this, SLOT(connectBInput()) ); - } } + } + } _imp->actionImportLayout = new ActionWithShortcut(kShortcutGroupGlobal, kShortcutIDActionImportLayout, kShortcutDescActionImportLayout, this); QObject::connect( _imp->actionImportLayout, SIGNAL(triggered()), this, SLOT(importLayout()) ); diff --git a/Gui/Gui30.cpp b/Gui/Gui30.cpp index 514da5217c..0e1eee7f58 100644 --- a/Gui/Gui30.cpp +++ b/Gui/Gui30.cpp @@ -528,6 +528,7 @@ Gui::connectBInput(int inputNb) { #pragma message WARN("TODO: Gui::connectBInput()") qDebug() << "Gui::connectBInput" << inputNb; + return connectInput(inputNb); } diff --git a/Gui/Gui50.cpp b/Gui/Gui50.cpp index 973161fe88..b7675c88cb 100644 --- a/Gui/Gui50.cpp +++ b/Gui/Gui50.cpp @@ -334,9 +334,15 @@ Gui::setLastKeyUpVisitedClickFocus(bool visited) /// Handle the viewer keys separately: use the nativeVirtualKey so that they work /// on any keyboard, including French AZERTY (where numbers are shifted) int -Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) +Gui::handleNativeKeys(int key, + quint32 nativeScanCode, + quint32 nativeVirtualKey) { //qDebug() << "scancode=" << nativeScanCode << "virtualkey=" << nativeVirtualKey; + if ( !appPTR->getCurrentSettings()->isViewerKeysEnabled() ) { + return key; + } + #ifdef Q_WS_MAC // OS X virtual key codes, from // MacOSX10.11.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Events.h @@ -352,30 +358,39 @@ Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) // kVK_ANSI_0 = 0x1D, Q_UNUSED(nativeScanCode); switch (nativeVirtualKey) { - case 0x12: - return Qt::Key_1; - case 0x13: - return Qt::Key_2; - case 0x14: - return Qt::Key_3; - case 0x15: - return Qt::Key_4; - case 0x16: - return Qt::Key_6; - case 0x17: - return Qt::Key_5; - case 0x18: - return Qt::Key_9; - case 0x1A: - return Qt::Key_7; - case 0x1C: - return Qt::Key_8; - case 0x1D: - return Qt::Key_0; + case 0x12: + + return Qt::Key_1; + case 0x13: + + return Qt::Key_2; + case 0x14: + + return Qt::Key_3; + case 0x15: + + return Qt::Key_4; + case 0x16: + + return Qt::Key_6; + case 0x17: + + return Qt::Key_5; + case 0x18: + + return Qt::Key_9; + case 0x1A: + + return Qt::Key_7; + case 0x1C: + + return Qt::Key_8; + case 0x1D: + + return Qt::Key_0; } #endif #ifdef Q_WS_WIN -#pragma message WARN("TODO: handle keys 0-9 on AZERTY keyboards") // https://msdn.microsoft.com/en-us/library/aa299374%28v=vs.60%29.aspx // 48 0x30 (VK_0) | 0 key // 49 0x31 (VK_1) | 1 key @@ -390,58 +405,78 @@ Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) // Windows seems to always return the same virtual key for digits, whatever the modifi Q_UNUSED(nativeScanCode); switch (nativeVirtualKey) { - case 0x30: - return Qt::Key_0; - case 0x31: - return Qt::Key_1; - case 0x32: - return Qt::Key_2; - case 0x33: - return Qt::Key_3; - case 0x34: - return Qt::Key_4; - case 0x35: - return Qt::Key_5; - case 0x36: - return Qt::Key_6; - case 0x37: - return Qt::Key_7; - case 0x38: - return Qt::Key_8; - case 0x39: - return Qt::Key_9; + case 0x30: + + return Qt::Key_0; + case 0x31: + + return Qt::Key_1; + case 0x32: + + return Qt::Key_2; + case 0x33: + + return Qt::Key_3; + case 0x34: + + return Qt::Key_4; + case 0x35: + + return Qt::Key_5; + case 0x36: + + return Qt::Key_6; + case 0x37: + + return Qt::Key_7; + case 0x38: + + return Qt::Key_8; + case 0x39: + + return Qt::Key_9; } #endif #if defined(Q_WS_X11) && defined(Q_OS_LINUX) -#pragma message WARN("TODO: handle keys 0-9 on AZERTY keyboards") // probably only possible on Linux, since scancodes are OS-dependent // https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html Q_UNUSED(nativeVirtualKey); switch (nativeScanCode) { - case 10: - return Qt::Key_1; - case 11: - return Qt::Key_2; - case 12: - return Qt::Key_3; - case 13: - return Qt::Key_4; - case 14: - return Qt::Key_5; - case 15: - return Qt::Key_6; - case 16: - return Qt::Key_7; - case 17: - return Qt::Key_8; - case 18: - return Qt::Key_9; - case 19: - return Qt::Key_0; + case 10: + + return Qt::Key_1; + case 11: + + return Qt::Key_2; + case 12: + + return Qt::Key_3; + case 13: + + return Qt::Key_4; + case 14: + + return Qt::Key_5; + case 15: + + return Qt::Key_6; + case 16: + + return Qt::Key_7; + case 17: + + return Qt::Key_8; + case 18: + + return Qt::Key_9; + case 19: + + return Qt::Key_0; } #endif + return key; -} +} // Gui::handleNativeKeys void Gui::keyPressEvent(QKeyEvent* e) diff --git a/Gui/GuiPrivate.h b/Gui/GuiPrivate.h index dffc4f386d..20f773d5f2 100644 --- a/Gui/GuiPrivate.h +++ b/Gui/GuiPrivate.h @@ -52,7 +52,7 @@ CLANG_DIAG_ON(uninitialized) NATRON_NAMESPACE_ENTER; -#define NATRON_CONNECT_INPUT_NB (2*10) +#define NATRON_CONNECT_INPUT_NB (2 * 10) struct GuiPrivate { diff --git a/Gui/NodeViewerContext.h b/Gui/NodeViewerContext.h index ff33d44772..9ed557cd0c 100644 --- a/Gui/NodeViewerContext.h +++ b/Gui/NodeViewerContext.h @@ -31,6 +31,10 @@ #include #endif +CLANG_DIAG_OFF(deprecated) +#include +CLANG_DIAG_ON(deprecated) + #include "Engine/ViewIdx.h" #include "Gui/GuiFwd.h" diff --git a/Gui/ViewerTab30.cpp b/Gui/ViewerTab30.cpp index a99dc407e3..e0031e8026 100644 --- a/Gui/ViewerTab30.cpp +++ b/Gui/ViewerTab30.cpp @@ -1135,12 +1135,12 @@ ViewerTab::connectToInput(int inputNb) } } - void ViewerTab::connectToBInput(int inputNb) { #pragma message WARN("TODO: ViewerTab::connectToBInput()") qDebug() << "ViewerTab::connectToBInput" << inputNb; + return connectToInput(inputNb); } diff --git a/INSTALL_LINUX.md b/INSTALL_LINUX.md index 2259db5e06..3ab965ea8d 100644 --- a/INSTALL_LINUX.md +++ b/INSTALL_LINUX.md @@ -119,6 +119,10 @@ LIBS is the path to the libs expat: LIBS += -lexpat expat: PKGCONFIG -= expat cairo: PKGCONFIG -= cairo + PYSIDE_PKG_CONFIG_PATH = $$system($$PYTHON_CONFIG --prefix)/lib/pkgconfig + pyside: PKGCONFIG += pyside + pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtCore + pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtGui EOF ----- end ----- diff --git a/global.pri b/global.pri index 321950dbca..980fd26dff 100644 --- a/global.pri +++ b/global.pri @@ -332,12 +332,6 @@ unix { LIBS += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --libs pyside) } } - !macx { - PYSIDE_PKG_CONFIG_PATH = $$system($$PYTHON_CONFIG --prefix)/lib/pkgconfig - pyside: PKGCONFIG += pyside-py2 - pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside-py2)/QtCore - pyside: INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside-py2)/QtGui - } } #unix *-xcode {