OpenToonz - An open-source full-featured 2D animation creation software
C
Merge branch 'master' into shortplay
Jeremy Bullocka956afb48823
diff --cc toonz/sources/include/toonz/preferences.hindex caa778e6e,ba939e9ac..fb8e7b9b8--- a/toonz/sources/include/toonz/preferences.h+++ b/toonz/sources/include/toonz/preferences.h@@@ -484,70 -378,60 +378,63 @@@ public}// Animation tab-- void setKeyframeType(int s);- int getKeyframeType() const { return m_keyframeType; }-- void setAnimationStep(int s);- int getAnimationStep() const { return m_animationStep; }+ int getKeyframeType() const { return getIntValue(keyframeType); }+ int getAnimationStep() const { return getIntValue(animationStep); }// Preview tab-- void setBlankValues(int blanksCount, TPixel32 blankColor);- void getBlankValues(int &blanksCount, TPixel32 &blankColor) const {- blanksCount = m_blanksCount, blankColor = m_blankColor;+ void getBlankValues(int &bCount, TPixel32 &bColor) const {+ bCount = getIntValue(blanksCount), bColor = getColorValue(blankColor);+ }+ bool rewindAfterPlaybackEnabled() const {+ return getBoolValue(rewindAfterPlayback);+ }++ int getShortPlayFrameCount() const {++ return getIntValue(shortPlayFrameCount);+ }-- void enablePreviewAlwaysOpenNewFlip(bool on);bool previewAlwaysOpenNewFlipEnabled() const {- return m_previewAlwaysOpenNewFlipEnabled;+ return getBoolValue(previewAlwaysOpenNewFlip);}-- void enableRewindAfterPlayback(bool on);- bool rewindAfterPlaybackEnabled() const {- return m_rewindAfterPlaybackEnabled;+ bool fitToFlipbookEnabled() const { return getBoolValue(fitToFlipbook); }+ bool isGeneratedMovieViewEnabled() const {+ return getBoolValue(generatedMovieViewEnabled);}- void setShortPlayFrameCount(int frames);- int getShortPlayFrameCount() const { return m_shortPlayFrameCount; }-- void enableFitToFlipbook(bool on);- bool fitToFlipbookEnabled() const { return m_fitToFlipbookEnabled; }-// Onion Skin tab+ bool isOnionSkinEnabled() const { return getBoolValue(onionSkinEnabled); }+ int getOnionPaperThickness() const {+ return getIntValue(onionPaperThickness);+ }- void enableOnionSkin(bool on);- bool isOnionSkinEnabled() const { return m_onionSkinEnabled; }- void setOnionPaperThickness(int thickness);- int getOnionPaperThickness() const { return m_onionPaperThickness; }-- void setOnionData(const TPixel &frontOnionColor, const TPixel &backOnionColor,- bool inksOnly);- void getOnionData(TPixel &frontOnionColor, TPixel &backOnionColor,+ void getOnionData(TPixel &frontColor, TPixel &backColor,bool &inksOnly) const {- frontOnionColor = m_frontOnionColor, backOnionColor = m_backOnionColor,- inksOnly = m_inksOnly;+ frontColor = getColorValue(frontOnionColor),+ backColor = getColorValue(backOnionColor),+ inksOnly = getBoolValue(onionInksOnly);+ }+ bool getOnionSkinDuringPlayback() {+ return getBoolValue(onionSkinDuringPlayback);}- bool getOnionSkinDuringPlayback() { return m_onionSkinDuringPlayback; }- void setOnionSkinDuringPlayback(bool on);-- void useOnionColorsForShiftAndTraceGhosts(bool on);bool areOnionColorsUsedForShiftAndTraceGhosts() const {- return m_useOnionColorsForShiftAndTraceGhosts;+ return getBoolValue(useOnionColorsForShiftAndTraceGhosts);}- // Transparency Check tab-- void setTranspCheckData(const TPixel &bg, const TPixel &ink,- const TPixel &paint);- void getTranspCheckData(TPixel &bg, TPixel &ink, TPixel &paint) const {- bg = m_transpCheckBg;- ink = m_transpCheckInk;- paint = m_transpCheckPaint;+ bool getAnimatedGuidedDrawing() const {+ return getBoolValue(animatedGuidedDrawing);}- void enableCurrentTimelineIndicator(bool on);- bool isCurrentTimelineIndicatorEnabled() const {- return m_currentTimelineEnabled;+ // Colors tab+ TPixel getViewerBgColor() const { return getColorValue(viewerBGColor); }+ TPixel getPreviewBgColor() const { return getColorValue(previewBGColor); }+ TPixel getLevelEditorBoxColor() const {+ return getColorValue(levelEditorBoxColor);+ }+ void getChessboardColors(TPixel32 &col1, TPixel32 &col2) const {+ col1 = getColorValue(chessboardColor1);+ col2 = getColorValue(chessboardColor2);+ }+ void getTranspCheckData(TPixel &bg, TPixel &ink, TPixel &paint) const {+ bg = getColorValue(transpCheckInkOnBlack);+ ink = getColorValue(transpCheckInkOnWhite);+ paint = getColorValue(transpCheckPaint);}// Version Control tabdiff --cc toonz/sources/include/toonz/preferencesitemids.hindex 000000000,320a36d69..a347c4490mode 000000,100644..100644--- a/toonz/sources/include/toonz/preferencesitemids.h+++ b/toonz/sources/include/toonz/preferencesitemids.h@@@ -1,0 -1,193 +1,194 @@@+ #ifndef PREFERENCESITEMIDS_H+ #define PREFERENCESITEMIDS_H++ enum PreferencesItemId {+ // General+ defaultViewerEnabled,+ rasterOptimizedMemory,+ autosaveEnabled,+ autosavePeriod,+ autosaveSceneEnabled,+ autosaveOtherFilesEnabled,+ startupPopupEnabled,+ undoMemorySize,+ taskchunksize,+ replaceAfterSaveLevelAs,+ backupEnabled,+ backupKeepCount,+ sceneNumberingEnabled,+ watchFileSystemEnabled,+ projectRoot,+ customProjectRoot,+ pathAliasPriority,++ //----------+ // Interface+ CurrentStyleSheetName,+ pixelsOnly,+ oldUnits,+ oldCameraUnits,+ linearUnits,+ cameraUnits,+ CurrentRoomChoice,+ functionEditorToggle,+ moveCurrentFrameByClickCellArea,+ actualPixelViewOnSceneEditingMode,+ levelNameOnEachMarkerEnabled,+ showRasterImagesDarkenBlendedInViewer,+ showFrameNumberWithLetters,+ iconSize,+ viewShrink,+ viewStep,+ viewerZoomCenter,+ CurrentLanguageName,+ interfaceFont,+ interfaceFontStyle,+ colorCalibrationEnabled,+ colorCalibrationLutPaths,++ //----------+ // Visualization+ show0ThickLines,+ regionAntialias,++ //----------+ // Loading+ importPolicy,+ autoExposeEnabled,+ subsceneFolderEnabled,+ removeSceneNumberFromLoadedLevelName,+ IgnoreImageDpi,+ initialLoadTlvCachingBehavior,+ columnIconLoadingPolicy,+ levelFormats, // need to be handle separately++ //----------+ // Saving+ rasterBackgroundColor,++ //----------+ // Import / Export+ ffmpegPath,+ ffmpegTimeout,+ fastRenderPath,++ //----------+ // Drawing+ scanLevelType,+ DefLevelType,+ newLevelSizeToCameraSizeEnabled,+ DefLevelWidth,+ DefLevelHeight,+ DefLevelDpi,+ AutocreationType,+ EnableAutoStretch,+ vectorSnappingTarget,+ saveUnpaintedInCleanup,+ minimizeSaveboxAfterEditing,+ useNumpadForSwitchingStyles,+ downArrowInLevelStripCreatesNewFrame,+ keepFillOnVectorSimplify,+ useHigherDpiOnVectorSimplify,++ //----------+ // Tools+ dropdownShortcutsCycleOptions,+ FillOnlysavebox,+ multiLayerStylePickerEnabled,+ cursorBrushType,+ cursorBrushStyle,+ cursorOutlineEnabled,+ levelBasedToolsDisplay,++ //----------+ // Xsheet+ xsheetLayoutPreference,+ xsheetStep,+ xsheetAutopanEnabled,+ DragCellsBehaviour,+ ignoreAlphaonColumn1Enabled,+ showKeyframesOnXsheetCellArea,+ showXsheetCameraColumn,+ useArrowKeyToShiftCellSelection,+ inputCellsWithoutDoubleClickingEnabled,+ shortcutCommandsWhileRenamingCellEnabled,+ showXSheetToolbar,+ expandFunctionHeader,+ showColumnNumbers,+ syncLevelRenumberWithXsheet,+ currentTimelineEnabled,+ currentColumnColor,++ //----------+ // Animation+ keyframeType,+ animationStep,++ //----------+ // Preview+ blanksCount,+ blankColor,+ rewindAfterPlayback,+ previewAlwaysOpenNewFlip,+ fitToFlipbook,+ generatedMovieViewEnabled,++ shortPlayFrameCount,++ //----------+ // Onion Skin+ onionSkinEnabled,+ onionPaperThickness,+ backOnionColor,+ frontOnionColor,+ onionInksOnly,+ onionSkinDuringPlayback,+ useOnionColorsForShiftAndTraceGhosts,+ animatedGuidedDrawing,++ //----------+ // Colors+ viewerBGColor,+ previewBGColor,+ levelEditorBoxColor,+ chessboardColor1,+ chessboardColor2,+ transpCheckInkOnWhite,+ transpCheckInkOnBlack,+ transpCheckPaint,++ //----------+ // Version Control+ SVNEnabled,+ automaticSVNFolderRefreshEnabled,+ latestVersionCheckEnabled,++ //----------+ // Touch / Tablet Settings+ // TounchGestureControl // Touch Gesture is a checkable command and not in+ // preferences.ini+ winInkEnabled,++ //----------+ // Others (not appeared in the popup)+ // Shortcut popup settings+ shortcutPreset,+ // Viewer context menu+ guidedDrawingType,+ // OSX shared memory settings+ shmmax,+ shmseg,+ shmall,+ shmmni,+ //- obsoleted / unused members+ // interfaceFontWeight,+ // autoCreateEnabled,+ // animationSheetEnabled,+ // askForOverrideRender,+ // textureSize, // set to 0+ // LineTestFpsCapture,+ // guidedDrawingType,++ PreferencesItemCount+ };++ #endifdiff --cc toonz/sources/toonz/preferencespopup.cppindex df94a950e,c1a617495..f159533a9--- a/toonz/sources/toonz/preferencespopup.cpp+++ b/toonz/sources/toonz/preferencespopup.cpp@@@ -710,35 -913,359 +913,360 @@@ void PreferencesPopup::insertDualUIs//------------------------------------------------------------------------------ void PreferencesPopup::onStartupPopupChanged(int index) {- m_pref->enableStartupPopup(index == Qt::Checked);+ void PreferencesPopup::insertFootNote(QGridLayout* layout) {+ QLabel* note =+ new QLabel(tr("* Changes will take effect the next time you run Toonz"));+ note->setStyleSheet("font-size: 10px; font: italic;");+ layout->addWidget(note, layout->rowCount(), 0, 1, 2,+ Qt::AlignLeft | Qt::AlignVCenter);+ }++ //-----------------------------------------------------------------------------++ QString PreferencesPopup::getUIString(PreferencesItemId id) {+ const static QMap<PreferencesItemId, QString> uiStringTable = {+ // General+ {defaultViewerEnabled, tr("Use Default Viewer for Movie Formats")},+ {rasterOptimizedMemory, tr("Minimize Raster Memory Fragmentation *")},+ {autosaveEnabled, tr("Save Automatically")},+ {autosavePeriod, tr("Interval(Minutes): ")},+ {autosaveSceneEnabled, tr("Automatically Save the Scene File")},+ {autosaveOtherFilesEnabled, tr("Automatically Save Non-Scene Files")},+ {startupPopupEnabled, tr("Show Startup Window when OpenToonz Starts")},+ {undoMemorySize, tr("Undo Memory Size (MB)")},+ {taskchunksize, tr("Render Task Chunk Size:")},+ {replaceAfterSaveLevelAs,+ tr("Replace Toonz Level after SaveLevelAs command")},+ {backupEnabled, tr("Backup Scene and Animation Levels when Saving")},+ {backupKeepCount, tr("# of backups to keep: ")},+ {sceneNumberingEnabled, tr("Show Info in Rendered Frames")},+ {watchFileSystemEnabled,+ tr("Watch File System and Update File Browser Automatically")},+ //{ projectRoot, tr("") },+ {customProjectRoot, tr("Custom Project Path(s): ")},+ {pathAliasPriority, tr("Path Alias Priority:")},++ // Interface+ {CurrentStyleSheetName, tr("Theme:")},+ {pixelsOnly, tr("All imported images will use the same DPI")},+ //{ oldUnits, tr("") },+ //{ oldCameraUnits, tr("") },+ {linearUnits, tr("Unit:")},+ {cameraUnits, tr("Camera Unit:")},+ {CurrentRoomChoice, tr("Rooms*:")},+ {functionEditorToggle, tr("Function Editor*:")},+ {moveCurrentFrameByClickCellArea,+ tr("Move Current Frame by Clicking on Xsheet / Numerical Columns Cell "+ "Area")},+ {actualPixelViewOnSceneEditingMode,+ tr("Enable Actual Pixel View on Scene Editing Mode")},+ {levelNameOnEachMarkerEnabled, tr("Display Level Name on Each Marker")},+ {showRasterImagesDarkenBlendedInViewer,+ tr("Show Raster Images Darken Blended")},+ {showFrameNumberWithLetters,+ tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell")},+ {iconSize, tr("Icon Size *")},+ {viewShrink, tr("Viewer Shrink")},+ {viewStep, tr("Step")},+ {viewerZoomCenter, tr("Viewer Zoom Center")},+ {CurrentLanguageName, tr("Language *:")},+ {interfaceFont, tr("Font *:")},+ {interfaceFontStyle, tr("Style *:")},+ {colorCalibrationEnabled,+ tr("Color Calibration using 3D Look-up Table *")},+ {colorCalibrationLutPaths,+ tr("3DLUT File for [%1] *:")+ .arg(LutManager::instance()->getMonitorName())},++ // Visualization+ {show0ThickLines, tr("Show Lines with Thickness 0")},+ {regionAntialias, tr("Antialiased Region Boundaries")},++ // Loading+ {importPolicy, tr("Default File Import Behavior:")},+ {autoExposeEnabled, tr("Expose Loaded Levels in Xsheet")},+ {subsceneFolderEnabled,+ tr("Create Sub-folder when Importing Sub-xsheet")},+ {removeSceneNumberFromLoadedLevelName,+ tr("Automatically Remove Scene Number from Loaded Level Name")},+ {IgnoreImageDpi, tr("Use Camera DPI for All Imported Images")},+ {initialLoadTlvCachingBehavior, tr("Default TLV Caching Behavior:")},+ {columnIconLoadingPolicy, tr("Column Icon:")},+ //{ levelFormats, tr("") },++ // Saving+ {rasterBackgroundColor, tr("Matte color: ")},++ // Import / Export+ {ffmpegPath, tr("FFmpeg Path: ")},+ {ffmpegTimeout, tr("FFmpeg Timeout:")},+ {fastRenderPath, tr("Fast Render Path: ")},++ // Drawing+ {scanLevelType, tr("Scan File Format:")},+ {DefLevelType, tr("Default Level Type:")},+ {newLevelSizeToCameraSizeEnabled,+ tr("New Levels Default to the Current Camera Size")},+ {DefLevelWidth, tr("Width:")},+ {DefLevelHeight, tr(" Height:")},+ {DefLevelDpi, tr("DPI:")},+ {AutocreationType, tr("Autocreation:")},+ {EnableAutoStretch, tr("Enable auto-stretch frame")},+ {vectorSnappingTarget, tr("Vector Snapping:")},+ {saveUnpaintedInCleanup,+ tr("Keep Original Cleaned Up Drawings As Backup")},+ {minimizeSaveboxAfterEditing, tr("Minimize Savebox after Editing")},+ {useNumpadForSwitchingStyles,+ tr("Use Numpad and Tab keys for Switching Styles")},+ {downArrowInLevelStripCreatesNewFrame,+ tr("Down Arrow at End of Level Strip Creates a New Frame")},+ {keepFillOnVectorSimplify,+ tr("Keep fill when using \"Replace Vectors\" command")},+ {useHigherDpiOnVectorSimplify,+ tr("Use higher DPI for calculations - Slower but more accurate")},++ // Tools+ {dropdownShortcutsCycleOptions, tr("Dropdown Shortcuts:")},+ {FillOnlysavebox, tr("Use the TLV Savebox to Limit Filling Operations")},+ {multiLayerStylePickerEnabled,+ tr("Multi Layer Style Picker : Switch Levels by Picking")},+ {cursorBrushType, tr("Basic Cursor Type:")},+ {cursorBrushStyle, tr("Cursor Style:")},+ {cursorOutlineEnabled, tr("Show Cursor Size Outlines")},+ {levelBasedToolsDisplay, tr("Toolbar Display Behaviour:")},++ // Xsheet+ {xsheetLayoutPreference, tr("Column Header Layout*:")},+ {xsheetStep, tr("Next/Previous Step Frames:")},+ {xsheetAutopanEnabled, tr("Xsheet Autopan during Playback")},+ {DragCellsBehaviour, tr("Cell-dragging Behaviour:")},+ {ignoreAlphaonColumn1Enabled,+ tr("Ignore Alpha Channel on Levels in Column 1")},+ {showKeyframesOnXsheetCellArea, tr("Show Keyframes on Cell Area")},+ {showXsheetCameraColumn, tr("Show Camera Column")},+ {useArrowKeyToShiftCellSelection,+ tr("Use Arrow Key to Shift Cell Selection")},+ {inputCellsWithoutDoubleClickingEnabled,+ tr("Enable to Input Cells without Double Clicking")},+ {shortcutCommandsWhileRenamingCellEnabled,+ tr("Enable OpenToonz Commands' Shortcut Keys While Renaming Cell")},+ {showXSheetToolbar, tr("Show Toolbar in the XSheet ")},+ {expandFunctionHeader,+ tr("Expand Function Editor Header to Match Xsheet Toolbar Height*")},+ {showColumnNumbers, tr("Show Column Numbers in Column Headers")},+ {syncLevelRenumberWithXsheet,+ tr("Sync Level Strip Drawing Number Changes with the Xsheet")},+ {currentTimelineEnabled,+ tr("Show Current Time Indicator (Timeline Mode only)")},+ {currentColumnColor, tr("Current Column Color:")},++ // Animation+ {keyframeType, tr("Default Interpolation:")},+ {animationStep, tr("Animation Step:")},++ // Preview+ {blanksCount, tr("Blank Frames:")},+ {blankColor, tr("Blank Frames Color:")},+ {rewindAfterPlayback, tr("Rewind after Playback")},++ {shortPlayFrameCount, tr("Number of Frames to Play for Short Play")},+ {previewAlwaysOpenNewFlip, tr("Display in a New Flipbook Window")},+ {fitToFlipbook, tr("Fit to Flipbook")},+ {generatedMovieViewEnabled, tr("Open Flipbook after Rendering")},++ // Onion Skin+ {onionSkinEnabled, tr("Onion Skin ON")},+ {onionPaperThickness, tr("Paper Thickness:")},+ {backOnionColor, tr("Previous Frames Correction:")},+ {frontOnionColor, tr("Following Frames Correction:")},+ {onionInksOnly, tr("Display Lines Only ")},+ {onionSkinDuringPlayback, tr("Show Onion Skin During Playback")},+ {useOnionColorsForShiftAndTraceGhosts,+ tr("Use Onion Skin Colors for Reference Drawings of Shift and Trace")},+ {animatedGuidedDrawing, tr("Vector Guided Style:")},++ // Colors+ {viewerBGColor, tr("Viewer BG Color")},+ {previewBGColor, tr("Preview BG Color")},+ {levelEditorBoxColor, tr("Level Editor Box Color")},+ {chessboardColor1, tr("ChessBoard Color 1")},+ {chessboardColor2, tr("Chessboard Color 2")},+ {transpCheckInkOnWhite, tr("Ink Color on White Bg:")},+ {transpCheckInkOnBlack, tr("Ink Color on Black Bg:")},+ {transpCheckPaint, tr("Paint Color:")},++ // Version Control+ {SVNEnabled, tr("Enable Version Control*")},+ {automaticSVNFolderRefreshEnabled,+ tr("Automatically Refresh Folder Contents")},+ {latestVersionCheckEnabled,+ tr("Check for the Latest Version of OpenToonz on Launch")},++ // Touch / Tablet Settings+ // TounchGestureControl // Touch Gesture is a checkable command and not in+ // preferences.ini+ {winInkEnabled, tr("Enable Windows Ink Support* (EXPERIMENTAL)")}};++ return uiStringTable.value(id, QString());+ }++ //-----------------------------------------------------------------------------+ // returns list for combo items+ // ComboBoxItem consists of an item label string and data to be stored in+ // preferences++ QList<ComboBoxItem> PreferencesPopup::getComboItemList(+ PreferencesItemId id) const {+ const static QMap<PreferencesItemId, QList<ComboBoxItem>> comboItemsTable = {+ {pathAliasPriority,+ {{tr("Project Folder Aliases (+drawings, +scenes, etc.)"),+ Preferences::ProjectFolderAliases},+ {tr("Scene Folder Alias ($scenefolder)"),+ Preferences::SceneFolderAlias},+ {tr("Use Project Folder Aliases Only"),+ Preferences::ProjectFolderOnly}}},+ {linearUnits, // cameraUnits shares items with linearUnits+ {{tr("cm"), "cm"},+ {tr("mm"), "mm"},+ {tr("inch"), "inch"},+ {tr("field"), "field"},+ {tr("pixel"), "pixel"}}},+ {functionEditorToggle,+ {{tr("Graph Editor Opens in Popup"),+ Preferences::ShowGraphEditorInPopup},+ {tr("Spreadsheet Opens in Popup"),+ Preferences::ShowFunctionSpreadsheetInPopup},+ {tr("Toggle Between Graph Editor and Spreadsheet"),+ Preferences::ToggleBetweenGraphAndSpreadsheet}}},+ {viewerZoomCenter, {{tr("Mouse Cursor"), 0}, {tr("Viewer Center"), 1}}},+ {importPolicy,+ {{tr("Always ask before loading or importing"), 0},+ {tr("Always import the file to the current project"), 1},+ {tr("Always load the file from the current location"), 2}}},+ {initialLoadTlvCachingBehavior,+ {{tr("On Demand"), 0},+ {tr("All Icons"), 1},+ {tr("All Icons & Images"), 2}}},+ {columnIconLoadingPolicy,+ {{tr("At Once"), Preferences::LoadAtOnce},+ {tr("On Demand"), Preferences::LoadOnDemand}}},+ {scanLevelType, {{"tif", "tif"}, {"png", "png"}}},+ {DefLevelType,+ {{tr("Toonz Vector Level"), PLI_XSHLEVEL},+ {tr("Toonz Raster Level"), TZP_XSHLEVEL},+ {tr("Raster Level"), OVL_XSHLEVEL}}},+ {AutocreationType,+ {{tr("Disabled"), 0},+ {tr("Enabled"), 1},+ {tr("Use Xsheet as Animation Sheet"), 2}}},+ {vectorSnappingTarget,+ {{tr("Strokes"), 0}, {tr("Guides"), 1}, {tr("All"), 2}}},+ {dropdownShortcutsCycleOptions,+ {{tr("Open the dropdown to display all options"), 0},+ {tr("Cycle through the available options"), 1}}},+ {cursorBrushType,+ {{tr("Small"), "Small"},+ {tr("Large"), "Large"},+ {tr("Crosshair"), "Crosshair"}}},+ {cursorBrushStyle,+ {{tr("Default"), "Default"},+ {tr("Left-Handed"), "Left-Handed"},+ {tr("Simple"), "Simple"}}},+ {levelBasedToolsDisplay,+ {{tr("Default"), 0},+ {tr("Enable Tools For Level Only"), 1},+ {tr("Show Tools For Level Only"), 2}}},+ {xsheetLayoutPreference,+ {{tr("Classic"), "Classic"},+ {tr("Classic-revised"), "Classic-revised"},+ {tr("Compact"), "Compact"}}},+ {DragCellsBehaviour,+ {{tr("Cells Only"), 0}, {tr("Cells and Column Data"), 1}}},+ {keyframeType, // note that the value starts from 1, not 0+ {{tr("Constant"), 1},+ {tr("Linear"), 2},+ {tr("Speed In / Speed Out"), 3},+ {tr("Ease In / Ease Out"), 4},+ {tr("Ease In / Ease Out %"), 5},+ {tr("Exponential"), 6},+ {tr("Expression "), 7},+ {tr("File"), 8}}},+ {animatedGuidedDrawing,+ {{tr("Arrow Markers"), 0}, {tr("Animated Guide"), 1}}}};+ assert(comboItemsTable.contains(id));+ return comboItemsTable.value(id, QList<ComboBoxItem>());+ }++ template <typename T>+ inline T PreferencesPopup::getUI(PreferencesItemId id) {+ assert(m_controlIdMap.keys(id).count() == 1);+ T ret = dynamic_cast<T>(m_controlIdMap.key(id));+ assert(ret);+ return ret;}- //-----------------------------------------------------------------------------+ //**********************************************************************************+ // PrefencesPopup's constructor+ //**********************************************************************************- void PreferencesPopup::onKeyframeTypeChanged(int index) {- m_pref->setKeyframeType(index + 1);- }- //-----------------------------------------------------------------------------+ PreferencesPopup::PreferencesPopup()+ : QDialog(TApp::instance()->getMainWindow()), m_formatProperties() {+ setWindowTitle(tr("Preferences"));+ setObjectName("PreferencesPopup");- void PreferencesPopup::onAutocreationTypeChanged(int index) {- m_pref->setAutocreationType(index);- if (index == 2)- m_enableAutoStretch->setDisabled(false);- else- m_enableAutoStretch->setDisabled(true);- }- //-----------------------------------------------------------------------------+ m_pref = Preferences::instance();- void PreferencesPopup::onAnimationStepChanged() {- m_pref->setAnimationStep(m_animationStepField->getValue());- }+ // Category List+ QListWidget* categoryList = new QListWidget(this);+ QStringList categories;+ categories << tr("General") << tr("Interface") << tr("Visualization")+ << tr("Loading") << tr("Saving") << tr("Import/Export")+ << tr("Drawing") << tr("Tools") << tr("Xsheet") << tr("Animation")+ << tr("Preview") << tr("Onion Skin") << tr("Colors")+ << tr("Version Control") << tr("Touch/Tablet Settings");+ categoryList->addItems(categories);+ categoryList->setFixedWidth(160);+ categoryList->setCurrentRow(0);+ categoryList->setAlternatingRowColors(true);- //-----------------------------------------------------------------------------+ QStackedWidget* stackedWidget = new QStackedWidget(this);+ stackedWidget->addWidget(createGeneralPage());+ stackedWidget->addWidget(createInterfacePage());+ stackedWidget->addWidget(createVisualizationPage());+ stackedWidget->addWidget(createLoadingPage());+ stackedWidget->addWidget(createSavingPage());+ stackedWidget->addWidget(createImportExportPage());+ stackedWidget->addWidget(createDrawingPage());+ stackedWidget->addWidget(createToolsPage());+ stackedWidget->addWidget(createXsheetPage());+ stackedWidget->addWidget(createAnimationPage());+ stackedWidget->addWidget(createPreviewPage());+ stackedWidget->addWidget(createOnionSkinPage());+ stackedWidget->addWidget(createColorsPage());+ stackedWidget->addWidget(createVersionControlPage());+ stackedWidget->addWidget(createTouchTabletPage());++ QHBoxLayout* mainLayout = new QHBoxLayout();+ mainLayout->setMargin(0);+ mainLayout->setSpacing(0);+ {+ // Category+ QVBoxLayout* categoryLayout = new QVBoxLayout();+ categoryLayout->setMargin(5);+ categoryLayout->setSpacing(10);+ {+ categoryLayout->addWidget(new QLabel(tr("Category"), this), 0,+ Qt::AlignLeft | Qt::AlignVCenter);+ categoryLayout->addWidget(categoryList, 1);+ }+ mainLayout->addLayout(categoryLayout, 0);+ mainLayout->addWidget(stackedWidget, 1);+ }+ setLayout(mainLayout);- void PreferencesPopup::onLanguageTypeChanged(const QString &langName) {- m_pref->setCurrentLanguage(langName);- QString currentLanguage = m_pref->getCurrentLanguage();+ bool ret = connect(categoryList, SIGNAL(currentRowChanged(int)),+ stackedWidget, SLOT(setCurrentIndex(int)));++ assert(ret);}//-----------------------------------------------------------------------------@@@ -946,33 -1717,25 +1718,26 @@@ QWidget* PreferencesPopup::createAnimat//------------------------------------------------------------------------------ void PreferencesPopup::onSceneNumberingChanged(int index) {- m_pref->enableSceneNumbering(index == Qt::Checked);- }+ QWidget* PreferencesPopup::createPreviewPage() {+ QWidget* widget = new QWidget(this);+ QGridLayout* lay = new QGridLayout();+ setupLayout(lay);- //-----------------------------------------------------------------------------+ insertUI(blanksCount, lay);+ insertUI(blankColor, lay);+ insertUI(rewindAfterPlayback, lay);++ insertUI(shortPlayFrameCount, lay);+ insertUI(previewAlwaysOpenNewFlip, lay);+ insertUI(fitToFlipbook, lay);+ insertUI(generatedMovieViewEnabled, lay);- void PreferencesPopup::onDefLevelTypeChanged(int index) {- if (0 <= index && index < m_defLevelType->count()) {- int levelType = m_defLevelType->itemData(index).toInt();- m_pref->setDefLevelType(levelType);- bool isRaster =- levelType != PLI_XSHLEVEL && !m_newLevelToCameraSizeCB->isChecked();- m_defLevelWidth->setEnabled(isRaster);- m_defLevelHeight->setEnabled(isRaster);- if (!m_pixelsOnlyCB->isChecked()) m_defLevelDpi->setEnabled(isRaster);- }- }+ lay->setRowStretch(lay->rowCount(), 1);+ widget->setLayout(lay);- //-----------------------------------------------------------------------------+ m_onEditedFuncMap.insert(blanksCount, &PreferencesPopup::onBlankCountChanged);+ m_onEditedFuncMap.insert(blankColor, &PreferencesPopup::onBlankColorChanged);- void PreferencesPopup::onDefLevelParameterChanged() {- double w = m_defLevelWidth->getValue();- double h = m_defLevelHeight->getValue();- double dpi = m_defLevelDpi->getValue();- m_pref->setDefLevelWidth(w);- m_pref->setDefLevelHeight(h);- m_pref->setDefLevelDpi(dpi);+ return widget;}//-----------------------------------------------------------------------------diff --cc toonz/sources/toonzlib/preferences.cppindex 2cbcb01db,2e004d5cc..1d2884098--- a/toonz/sources/toonzlib/preferences.cpp+++ b/toonz/sources/toonzlib/preferences.cpp@@@ -767,30 -331,257 +331,258 @@@ void Preferences::initializeOptions()//------------------------------------------------------------------ void Preferences::enableGeneratedMovieView(bool on) {- m_generatedMovieViewEnabled = on;- m_settings->setValue("generatedMovieViewEnabled", on ? "1" : "0");- }-- //------------------------------------------------------------------- void Preferences::enableXsheetAutopan(bool on) {- m_xsheetAutopanEnabled = on;- m_settings->setValue("xsheetAutopanEnabled", on ? "1" : "0");- }-- //-------------------------------------------------------------------- void Preferences::enableIgnoreAlphaonColumn1(bool on) {- m_ignoreAlphaonColumn1Enabled = on;- m_settings->setValue("ignoreAlphaonColumn1Enabled", on ? "1" : "0");- }-- //-------------------------------------------------------------------- void Preferences::enableShowKeyframesOnXsheetCellArea(bool on) {- m_showKeyframesOnXsheetCellArea = on;- m_settings->setValue("showKeyframesOnXsheetCellArea", on ? "1" : "0");+ void Preferences::definePreferenceItems() {+ // General+ define(defaultViewerEnabled, "defaultViewerEnabled", QMetaType::Bool, false);+ define(rasterOptimizedMemory, "rasterOptimizedMemory", QMetaType::Bool,+ false);+ define(autosaveEnabled, "autosaveEnabled", QMetaType::Bool, false);+ define(autosavePeriod, "autosavePeriod", QMetaType::Int, 15, 1, 60);+ define(autosaveSceneEnabled, "autosaveSceneEnabled", QMetaType::Bool, true);+ define(autosaveOtherFilesEnabled, "autosaveOtherFilesEnabled",+ QMetaType::Bool, true);+ define(startupPopupEnabled, "startupPopupEnabled", QMetaType::Bool, true);+ define(undoMemorySize, "undoMemorySize", QMetaType::Int, 100, 0, 2000);+ define(taskchunksize, "taskchunksize", QMetaType::Int, 10, 1, 2000);+ define(replaceAfterSaveLevelAs, "replaceAfterSaveLevelAs", QMetaType::Bool,+ true);+ define(backupEnabled, "backupEnabled", QMetaType::Bool, true);+ define(backupKeepCount, "backupKeepCount", QMetaType::Int, 1, 1,+ std::numeric_limits<int>::max());+ define(sceneNumberingEnabled, "sceneNumberingEnabled", QMetaType::Bool,+ false);+ define(watchFileSystemEnabled, "watchFileSystemEnabled", QMetaType::Bool,+ true);+ define(projectRoot, "projectRoot", QMetaType::Int, 0x08);+ define(customProjectRoot, "customProjectRoot", QMetaType::QString, "");+ define(pathAliasPriority, "pathAliasPriority", QMetaType::Int,+ (int)ProjectFolderOnly);++ setCallBack(autosaveEnabled, &Preferences::enableAutosave);+ setCallBack(autosavePeriod, &Preferences::setAutosavePeriod);+ setCallBack(undoMemorySize, &Preferences::setUndoMemorySize);++ // Interface+ define(CurrentStyleSheetName, "CurrentStyleSheetName", QMetaType::QString,+ "Default");+ define(pixelsOnly, "pixelsOnly", QMetaType::Bool, false);+ define(oldUnits, "oldUnits", QMetaType::QString, "mm");+ define(oldCameraUnits, "oldCameraUnits", QMetaType::QString, "inch");+ define(linearUnits, "linearUnits", QMetaType::QString, "mm");+ define(cameraUnits, "cameraUnits", QMetaType::QString, "inch");+ define(CurrentRoomChoice, "CurrentRoomChoice", QMetaType::QString, "Default");+ define(functionEditorToggle, "functionEditorToggle", QMetaType::Int,+ (int)ShowGraphEditorInPopup);+ define(moveCurrentFrameByClickCellArea, "moveCurrentFrameByClickCellArea",+ QMetaType::Bool, true);+ define(actualPixelViewOnSceneEditingMode, "actualPixelViewOnSceneEditingMode",+ QMetaType::Bool, false);+ define(levelNameOnEachMarkerEnabled, "levelNameOnEachMarkerEnabled",+ QMetaType::Bool, false);+ define(showRasterImagesDarkenBlendedInViewer,+ "showRasterImagesDarkenBlendedInViewer", QMetaType::Bool, false);+ define(showFrameNumberWithLetters, "showFrameNumberWithLetters",+ QMetaType::Bool, false);+ define(iconSize, "iconSize", QMetaType::QSize, QSize(80, 45), QSize(10, 10),+ QSize(400, 400));+ define(viewShrink, "viewShrink", QMetaType::Int, 1, 1, 20);+ define(viewStep, "viewStep", QMetaType::Int, 1, 1, 20);+ define(viewerZoomCenter, "viewerZoomCenter", QMetaType::Int,+ 0); // Mouse Cursor+ define(CurrentLanguageName, "CurrentLanguageName", QMetaType::QString,+ "English");+ #ifdef _WIN32+ QString defaultFont("Segoe UI");+ #elif defined Q_OS_MACOS+ QString defaultFont("Helvetica Neue");+ #else+ QString defaultFont("Helvetica");+ #endif+ define(interfaceFont, "interfaceFont", QMetaType::QString, defaultFont);+ define(interfaceFontStyle, "interfaceFontStyle", QMetaType::QString,+ "Regular");+ define(colorCalibrationEnabled, "colorCalibrationEnabled", QMetaType::Bool,+ false);+ define(colorCalibrationLutPaths, "colorCalibrationLutPaths",+ QMetaType::QVariantMap, QVariantMap());++ setCallBack(pixelsOnly, &Preferences::setPixelsOnly);+ setCallBack(linearUnits, &Preferences::setUnits);+ setCallBack(cameraUnits, &Preferences::setCameraUnits);++ // Visualization+ define(show0ThickLines, "show0ThickLines", QMetaType::Bool, true);+ define(regionAntialias, "regionAntialias", QMetaType::Bool, false);++ // Loading+ define(importPolicy, "importPolicy", QMetaType::Int, 0); // Always ask+ define(autoExposeEnabled, "autoExposeEnabled", QMetaType::Bool, true);+ define(subsceneFolderEnabled, "subsceneFolderEnabled", QMetaType::Bool, true);+ define(removeSceneNumberFromLoadedLevelName,+ "removeSceneNumberFromLoadedLevelName", QMetaType::Bool, false);+ define(IgnoreImageDpi, "IgnoreImageDpi", QMetaType::Bool, false);+ define(initialLoadTlvCachingBehavior, "initialLoadTlvCachingBehavior",+ QMetaType::Int, 0); // On Demand+ define(columnIconLoadingPolicy, "columnIconLoadingPolicy", QMetaType::Int,+ (int)LoadAtOnce);+ //"levelFormats" need to be handle separately++ // Saving+ define(rasterBackgroundColor, "rasterBackgroundColor", QMetaType::QColor,+ QColor(Qt::white));++ setCallBack(rasterBackgroundColor, &Preferences::setRasterBackgroundColor);++ // Import / Export+ define(ffmpegPath, "ffmpegPath", QMetaType::QString, "");+ define(ffmpegTimeout, "ffmpegTimeout", QMetaType::Int, 600, 1,+ std::numeric_limits<int>::max());+ define(fastRenderPath, "fastRenderPath", QMetaType::QString, "desktop");++ // Drawing+ define(scanLevelType, "scanLevelType", QMetaType::QString, "tif");+ define(DefLevelType, "DefLevelType", QMetaType::Int, TZP_XSHLEVEL);+ define(newLevelSizeToCameraSizeEnabled, "newLevelSizeToCameraSizeEnabled",+ QMetaType::Bool, false);+ define(DefLevelWidth, "DefLevelWidth", QMetaType::Double,+ TCamera().getSize().lx, 0.1, std::numeric_limits<double>::max());+ define(DefLevelHeight, "DefLevelHeight", QMetaType::Double,+ TCamera().getSize().ly, 0.1, std::numeric_limits<double>::max());+ define(DefLevelDpi, "DefLevelDpi", QMetaType::Double, TCamera().getDpi().x,+ 0.1, std::numeric_limits<double>::max());+ define(AutocreationType, "AutocreationType", QMetaType::Int,+ 2); // Use Xsheet as Animation Sheet+ define(EnableAutoStretch, "EnableAutoStretch", QMetaType::Bool, true);+ define(vectorSnappingTarget, "vectorSnappingTarget", QMetaType::Int,+ (int)SnapAll);+ define(saveUnpaintedInCleanup, "saveUnpaintedInCleanup", QMetaType::Bool,+ true);+ define(minimizeSaveboxAfterEditing, "minimizeSaveboxAfterEditing",+ QMetaType::Bool, true);+ define(useNumpadForSwitchingStyles, "useNumpadForSwitchingStyles",+ QMetaType::Bool, true);+ define(downArrowInLevelStripCreatesNewFrame,+ "downArrowInLevelStripCreatesNewFrame", QMetaType::Bool, true);+ define(keepFillOnVectorSimplify, "keepFillOnVectorSimplify", QMetaType::Bool,+ true);+ define(useHigherDpiOnVectorSimplify, "useHigherDpiOnVectorSimplify",+ QMetaType::Bool, false);++ // Tools+ define(dropdownShortcutsCycleOptions, "dropdownShortcutsCycleOptions",+ QMetaType::Int,+ 1); // Cycle through the available options (changed from bool to int)+ define(FillOnlysavebox, "FillOnlysavebox", QMetaType::Bool, false);+ define(multiLayerStylePickerEnabled, "multiLayerStylePickerEnabled",+ QMetaType::Bool, false);+ define(cursorBrushType, "cursorBrushType", QMetaType::QString, "Small");+ define(cursorBrushStyle, "cursorBrushStyle", QMetaType::QString, "Default");+ define(cursorOutlineEnabled, "cursorOutlineEnabled", QMetaType::Bool, true);+ define(levelBasedToolsDisplay, "levelBasedToolsDisplay", QMetaType::Int,+ 0); // Default++ // Xsheet+ define(xsheetLayoutPreference, "xsheetLayoutPreference", QMetaType::QString,+ "Classic-revised");+ define(xsheetStep, "xsheetStep", QMetaType::Int, 10, 0,+ std::numeric_limits<int>::max());+ define(xsheetAutopanEnabled, "xsheetAutopanEnabled", QMetaType::Bool, true);+ define(DragCellsBehaviour, "DragCellsBehaviour", QMetaType::Int,+ 1); // Cells and Column Data+ define(ignoreAlphaonColumn1Enabled, "ignoreAlphaonColumn1Enabled",+ QMetaType::Bool, false);+ define(showKeyframesOnXsheetCellArea, "showKeyframesOnXsheetCellArea",+ QMetaType::Bool, true);+ define(showXsheetCameraColumn, "showXsheetCameraColumn", QMetaType::Bool,+ true);+ define(useArrowKeyToShiftCellSelection, "useArrowKeyToShiftCellSelection",+ QMetaType::Bool, true);+ define(inputCellsWithoutDoubleClickingEnabled,+ "inputCellsWithoutDoubleClickingEnabled", QMetaType::Bool, false);+ define(shortcutCommandsWhileRenamingCellEnabled,+ "shortcutCommandsWhileRenamingCellEnabled", QMetaType::Bool, false);+ define(showXSheetToolbar, "showXSheetToolbar", QMetaType::Bool, true);+ define(expandFunctionHeader, "expandFunctionHeader", QMetaType::Bool, false);+ define(showColumnNumbers, "showColumnNumbers", QMetaType::Bool, false);+ define(syncLevelRenumberWithXsheet, "syncLevelRenumberWithXsheet",+ QMetaType::Bool, true);+ define(currentTimelineEnabled, "currentTimelineEnabled", QMetaType::Bool,+ true);+ define(currentColumnColor, "currentColumnColor", QMetaType::QColor,+ QColor(Qt::yellow));++ // Animation+ define(keyframeType, "keyframeType", QMetaType::Int, 2); // Linear+ define(animationStep, "animationStep", QMetaType::Int, 1, 1, 500);++ // Preview+ define(blanksCount, "blanksCount", QMetaType::Int, 0, 0, 1000);+ define(blankColor, "blankColor", QMetaType::QColor, QColor(Qt::white));+ define(rewindAfterPlayback, "rewindAfterPlayback", QMetaType::Bool, true);++ define(getShortPlayFrameCount, "shortPlayFrameCount", QMetaType::Int, 8);+ define(previewAlwaysOpenNewFlip, "previewAlwaysOpenNewFlip", QMetaType::Bool,+ false);+ define(fitToFlipbook, "fitToFlipbook", QMetaType::Bool, false);+ define(generatedMovieViewEnabled, "generatedMovieViewEnabled",+ QMetaType::Bool, true);++ // Onion Skin+ define(onionSkinEnabled, "onionSkinEnabled", QMetaType::Bool, true);+ define(onionPaperThickness, "onionPaperThickness", QMetaType::Int, 50, 0,+ 100);+ define(backOnionColor, "backOnionColor", QMetaType::QColor, QColor(Qt::red));+ define(frontOnionColor, "frontOnionColor", QMetaType::QColor,+ QColor(Qt::green));+ define(onionInksOnly, "onionInksOnly", QMetaType::Bool, false);+ define(onionSkinDuringPlayback, "onionSkinDuringPlayback", QMetaType::Bool,+ false);+ define(useOnionColorsForShiftAndTraceGhosts,+ "useOnionColorsForShiftAndTraceGhosts", QMetaType::Bool, true);+ define(animatedGuidedDrawing, "animatedGuidedDrawing", QMetaType::Int,+ 0); // Arrow Markers (changed from bool to int)++ // Colors+ define(viewerBGColor, "viewerBGColor", QMetaType::QColor,+ QColor(128, 128, 128));+ define(previewBGColor, "previewBGColor", QMetaType::QColor,+ QColor(64, 64, 64));+ define(levelEditorBoxColor, "levelEditorBoxColor", QMetaType::QColor,+ QColor(128, 128, 128));+ define(chessboardColor1, "chessboardColor1", QMetaType::QColor,+ QColor(180, 180, 180));+ define(chessboardColor2, "chessboardColor2", QMetaType::QColor,+ QColor(230, 230, 230));+ define(transpCheckInkOnWhite, "transpCheckInkOnWhite", QMetaType::QColor,+ QColor(Qt::black));+ define(transpCheckInkOnBlack, "transpCheckInkOnBlack", QMetaType::QColor,+ QColor(Qt::white));+ define(transpCheckPaint, "transpCheckPaint", QMetaType::QColor,+ QColor(127, 127, 127));++ // Version Control+ define(SVNEnabled, "SVNEnabled", QMetaType::Bool, false);+ define(automaticSVNFolderRefreshEnabled, "automaticSVNFolderRefreshEnabled",+ QMetaType::Bool, true);+ define(latestVersionCheckEnabled, "latestVersionCheckEnabled",+ QMetaType::Bool, true);++ // Touch / Tablet Settings+ // TounchGestureControl // Touch Gesture is a checkable command and not in+ // preferences.ini+ define(winInkEnabled, "winInkEnabled", QMetaType::Bool, false);++ // Others (not appeared in the popup)+ // Shortcut popup settings+ define(shortcutPreset, "shortcutPreset", QMetaType::QString, "defopentoonz");+ // Viewer context menu+ define(guidedDrawingType, "guidedDrawingType", QMetaType::Int, 0); // Off+ #if defined(MACOSX) && defined(__LP64__)+ // OSX shared memory settings+ define(shmmax, "shmmax", QMetaType::Int, -1);+ define(shmseg, "shmseg", QMetaType::Int, -1);+ define(shmall, "shmall", QMetaType::Int, -1);+ define(shmmni, "shmmni", QMetaType::Int, -1);+ #endif}//-----------------------------------------------------------------