OpenToonz - An open-source full-featured 2D animation creation software
C
Rooms Selection (#378)
turtletooth8d9ba3307e7c
diff --git a/stuff/profiles/layouts/rooms/Default/layouts.txt b/stuff/profiles/layouts/rooms/Default/layouts.txtnew file mode 100644index 000000000..cf0377e2e--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/layouts.txt@@ -0,0 +1,8 @@+room1.ini+room2.ini+room3.ini+room4.ini+room5.ini+room6.ini+room7.ini+room8.ini\ No newline at end of filediff --git a/stuff/profiles/layouts/OpenToonz/menubar_template.xml b/stuff/profiles/layouts/rooms/Default/menubar_template.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/menubar_template.xmlrename to stuff/profiles/layouts/rooms/Default/menubar_template.xmldiff --git a/stuff/profiles/layouts/rooms/Default/room1.ini b/stuff/profiles/layouts/rooms/Default/room1.ininew file mode 100644index 000000000..0089f659d--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room1.ini@@ -0,0 +1,18 @@+[room]+hierarchy="-1 0 [ [ [ 5 [ 6 4 ] ] 2 ] [ 1 3 ] 0 ] "+pane_0\name=Xsheet+name=Basics+pane_0\geometry=@Rect(1667 0 253 996)+pane_1\name=FilmStrip+pane_1\geometry=@Rect(1254 0 405 530)+pane_2\name=LevelPalette+pane_2\geometry=@Rect(0 808 1246 188)+pane_3\name=StyleEditor+pane_3\geometry=@Rect(1254 538 405 458)+pane_4\name=SceneViewer+pane_4\geometry=@Rect(43 34 1203 766)+pane_2\viewtype=0+pane_5\name=ToolBar+pane_5\geometry=@Rect(0 0 35 800)+pane_6\name=ToolOptions+pane_6\geometry=@Rect(43 0 1203 26)diff --git a/stuff/profiles/layouts/rooms/Default/room2.ini b/stuff/profiles/layouts/rooms/Default/room2.ininew file mode 100644index 000000000..f9275865d--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room2.ini@@ -0,0 +1,11 @@+[room]+pane_0\name=ComboViewer+pane_0\geometry=@Rect(0 0 1075 558)+pane_1\name=CleanupSettings+pane_1\geometry=@Rect(1083 0 455 857)+pane_2\name=Xsheet+pane_2\geometry=@Rect(0 600 1075 257)+hierarchy="-1 0 [ [ 0 3 2 ] 1 ] "+pane_3\name=ToolOptions+name=Cleanup+pane_3\geometry=@Rect(0 566 1075 26)diff --git a/stuff/profiles/layouts/rooms/Default/room3.ini b/stuff/profiles/layouts/rooms/Default/room3.ininew file mode 100644index 000000000..521c25397--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room3.ini@@ -0,0 +1,16 @@+[room]+pane_0\name=SceneViewer+pane_0\geometry=@Rect(43 34 984 823)+pane_1\name=ToolBar+pane_1\geometry=@Rect(0 0 35 857)+pane_2\name=FilmStrip+pane_2\geometry=@Rect(1344 0 194 857)+pane_3\name=ToolOptions+pane_3\geometry=@Rect(43 0 1293 26)+pane_4\name=LevelPalette+pane_4\geometry=@Rect(1035 34 301 147)+pane_4\viewtype=0+pane_5\name=StyleEditor+pane_5\geometry=@Rect(1035 189 301 668)+hierarchy="-1 0 [ 1 [ 3 [ 0 [ 4 5 ] ] ] 2 ] "+name=Drawingdiff --git a/stuff/profiles/layouts/rooms/Default/room4.ini b/stuff/profiles/layouts/rooms/Default/room4.ininew file mode 100644index 000000000..170d35d64--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room4.ini@@ -0,0 +1,18 @@+[room]+pane_0\name=SceneViewer+pane_0\geometry=@Rect(43 34 904 487)+pane_1\name=ToolBar+pane_1\geometry=@Rect(0 0 35 857)+pane_2\name=ToolOptions+pane_2\geometry=@Rect(43 0 904 26)+pane_3\name=Xsheet+pane_3\geometry=@Rect(955 0 384 522)+pane_4\name=FunctionEditor+pane_4\geometry=@Rect(43 529 904 328)+pane_5\name=Schematic+pane_5\geometry=@Rect(955 530 583 327)+hierarchy="-1 0 [ 1 [ 2 0 4 ] [ [ 3 6 ] 5 ] ] "+name=Animation+pane_5\viewtype=1+pane_6\name=FilmStrip+pane_6\geometry=@Rect(1347 0 191 522)diff --git a/stuff/profiles/layouts/rooms/Default/room5.ini b/stuff/profiles/layouts/rooms/Default/room5.ininew file mode 100644index 000000000..56dd4a799--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room5.ini@@ -0,0 +1,20 @@+[room]+pane_0\name=SceneViewer+pane_0\geometry=@Rect(43 34 990 534)+pane_1\name=ToolBar+pane_1\geometry=@Rect(0 0 35 857)+pane_2\name=ToolOptions+pane_2\geometry=@Rect(43 0 1495 26)+pane_3\name=ColorModel+pane_3\geometry=@Rect(1041 34 245 228)+pane_4\name=Xsheet+pane_4\geometry=@Rect(43 576 990 281)+pane_5\name=LevelPalette+pane_5\geometry=@Rect(1041 270 497 87)+pane_5\viewtype=0+pane_6\name=StyleEditor+pane_6\geometry=@Rect(1041 365 497 492)+pane_7\name=StudioPalette+pane_7\geometry=@Rect(1294 34 244 228)+hierarchy="-1 0 [ 1 [ 2 [ [ 0 4 ] [ [ 3 7 ] 5 6 ] ] ] ] "+name=Plteditdiff --git a/stuff/profiles/layouts/rooms/Default/room6.ini b/stuff/profiles/layouts/rooms/Default/room6.ininew file mode 100644index 000000000..582fbad49--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room6.ini@@ -0,0 +1,9 @@+[room]+pane_0\name=Xsheet+pane_0\geometry=@Rect(0 0 913 857)+pane_1\name=FunctionEditor+pane_1\geometry=@Rect(921 417 617 440)+hierarchy="-1 0 [ 0 [ 2 1 ] ] "+name=Xsheet+pane_2\name=SceneViewer+pane_2\geometry=@Rect(921 0 617 409)diff --git a/stuff/profiles/layouts/rooms/Default/room7.ini b/stuff/profiles/layouts/rooms/Default/room7.ininew file mode 100644index 000000000..43f4a25a1--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room7.ini@@ -0,0 +1,7 @@+[room]+pane_0\name=Browser+pane_0\geometry=@Rect(0 0 1538 425)+pane_1\name=SceneCast+pane_1\geometry=@Rect(0 433 1538 424)+hierarchy="-1 1 [ 0 1 ] "+name=Browserdiff --git a/stuff/profiles/layouts/rooms/Default/room8.ini b/stuff/profiles/layouts/rooms/Default/room8.ininew file mode 100644index 000000000..62fadefad--- /dev/null+++ b/stuff/profiles/layouts/rooms/Default/room8.ini@@ -0,0 +1,7 @@+[room]+pane_0\name=Tasks+pane_0\geometry=@Rect(0 0 765 857)+pane_1\name=BatchServers+pane_1\geometry=@Rect(773 0 765 857)+hierarchy="-1 0 [ 0 1 ] "+name=Farmdiff --git a/stuff/profiles/layouts/OpenToonz/layouts.txt b/stuff/profiles/layouts/rooms/StudioGhibli/layouts.txtsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/layouts.txtrename to stuff/profiles/layouts/rooms/StudioGhibli/layouts.txtdiff --git a/stuff/profiles/layouts/rooms/StudioGhibli/menubar_template.xml b/stuff/profiles/layouts/rooms/StudioGhibli/menubar_template.xmlnew file mode 100644index 000000000..7b9c58be2--- /dev/null+++ b/stuff/profiles/layouts/rooms/StudioGhibli/menubar_template.xml@@ -0,0 +1,222 @@+<menubar>+ <menu title="File">+ <command>MI_NewScene</command>+ <command>MI_LoadScene</command>+ <command>MI_SaveScene</command>+ <command>MI_SaveSceneAs</command>+ <command>MI_SaveAll</command>+ <command>MI_OpenRecentScene</command>+ <command>MI_RevertScene</command>+ <separator/>+ <command>MI_LoadFolder</command>+ <command>MI_LoadSubSceneFile</command>+ <separator/>+ <command>MI_NewLevel</command>+ <command>MI_LoadLevel</command>+ <command>MI_SaveLevel</command>+ <command>MI_SaveLevelAs</command>+ <command>MI_ExportLevel</command>+ <command>MI_OpenRecentLevel</command>+ <separator/>+ <command>MI_ConvertFileWithInput</command>+ <separator/>+ <command>MI_LoadColorModel</command>+ <separator/>+ <command>MI_ImportMagpieFile</command>+ <separator/>+ <command>MI_NewProject</command>+ <command>MI_ProjectSettings</command>+ <command>MI_SaveDefaultSettings</command>+ <separator/>+ <command>MI_PreviewSettings</command>+ <command>MI_Preview</command>+ <separator/>+ <command>MI_OutputSettings</command>+ <command>MI_Render</command>+ <separator/>+ <command>MI_PrintXsheet</command>+ <command>MI_Print</command>+ <separator/>+ <command>MI_Preferences</command>+ <command>MI_ShortcutPopup</command>+ <separator/>+ <command>MI_RunScript</command>+ <command>MI_OpenScriptConsole</command>+ <separator/>+ <command>MI_Quit</command>+ <command_debug>MI_ReloadStyle</command_debug>+ </menu>+ <menu title="Edit">+ <command>MI_Undo</command>+ <command>MI_Redo</command>+ <separator/>+ <command>MI_Cut</command>+ <command>MI_Copy</command>+ <command>MI_Paste</command>+ <command>MI_PasteInto</command>+ <separator/>+ <command>MI_Clear</command>+ <command>MI_Insert</command>+ <separator/>+ <command>MI_SelectAll</command>+ <command>MI_InvertSelection</command>+ <separator/>+ <command>MI_RemoveEndpoints</command>+ <separator/>+ <command>MI_Group</command>+ <command>MI_Ungroup</command>+ <command>MI_EnterGroup</command>+ <command>MI_ExitGroup</command>+ <separator/>+ <command>MI_BringToFront</command>+ <command>MI_BringForward</command>+ <command>MI_SendBack</command>+ <command>MI_SendBackward</command>+ </menu>+ <menu title="Scan & Cleanup">+ <command>MI_DefineScanner</command>+ <command>MI_ScanSettings</command>+ <command>MI_Scan</command>+ <command>MI_SetScanCropbox</command>+ <command>MI_ResetScanCropbox</command>+ <separator/>+ <command>MI_CleanupSettings</command>+ <command>MI_CleanupPreview</command>+ <command>MI_CameraTest</command>+ <command>MI_Cleanup</command>+ </menu>+ <menu title="Level">+ <command>MI_AddFrames</command>+ <command>MI_Renumber</command>+ <command>MI_ReplaceLevel</command>+ <command>MI_RevertToCleanedUp</command>+ <command>MI_RevertToLastSaved</command>+ <command>MI_ConvertToVectors</command>+ <command>MI_Tracking</command>+ <separator/>+ <command>MI_ExposeResource</command>+ <command>MI_EditLevel</command>+ <separator/>+ <command>MI_LevelSettings</command>+ <command>MI_FileInfo</command>+ <separator/>+ <command>MI_AdjustLevels</command>+ <command>MI_AdjustThickness</command>+ <command>MI_Antialias</command>+ <command>MI_Binarize</command>+ <command>MI_BrightnessAndContrast</command>+ <command>MI_CanvasSize</command>+ <command>MI_LinesFade</command>+ <separator/>+ <command>MI_RemoveUnused</command>+ </menu>+ <menu title="Xsheet">+ <command>MI_SceneSettings</command>+ <command>MI_CameraSettings</command>+ <separator/>+ <command>MI_OpenChild</command>+ <command>MI_CloseChild</command>+ <command>MI_SaveSubxsheetAs</command>+ <command>MI_Collapse</command>+ <command>MI_Resequence</command>+ <command>MI_CloneChild</command>+ <command>MI_ExplodeChild</command>+ <separator/>+ <command>MI_ApplyMatchLines</command>+ <command>MI_MergeCmapped</command>+ <separator/>+ <command>MI_MergeColumns</command>+ <command>MI_DeleteMatchLines</command>+ <command>MI_DeleteInk</command>+ <separator/>+ <command>MI_InsertFx</command>+ <command>MI_NewOutputFx</command>+ <separator/>+ <command>MI_InsertSceneFrame</command>+ <command>MI_RemoveSceneFrame</command>+ <command>MI_InsertGlobalKeyframe</command>+ <command>MI_RemoveGlobalKeyframe</command>+ </menu>+ <menu title="Cells">+ <command>MI_Reverse</command>+ <command>MI_Swing</command>+ <command>MI_Random</command>+ <command>MI_Increment</command>+ <command>MI_Dup</command>+ <separator/>+ <command>MI_ResetStep</command>+ <command>MI_IncreaseStep</command>+ <command>MI_DecreaseStep</command>+ <command>MI_Step2</command>+ <command>MI_Step3</command>+ <command>MI_Step4</command>+ <command>MI_Each2</command>+ <command>MI_Each3</command>+ <command>MI_Each4</command>+ <command>MI_Rollup</command>+ <command>MI_Rolldown</command>+ <command>MI_TimeStretch</command>+ <separator/>+ <command>MI_Autorenumber</command>+ <command>MI_Duplicate</command>+ <command>MI_MergeFrames</command>+ <command>MI_CloneLevel</command>+ </menu>+ <menu title="View">+ <command>MI_ViewCamera</command>+ <command>MI_ViewTable</command>+ <command>MI_FieldGuide</command>+ <command>MI_SafeArea</command>+ <command>MI_ViewBBox</command>+ <command>MI_ViewColorcard</command>+ <command>MI_ViewGuide</command>+ <command>MI_ViewRuler</command>+ <separator/>+ <command>MI_TCheck</command>+ <command>MI_ICheck</command>+ <command>MI_Ink1Check</command>+ <command>MI_PCheck</command>+ <command>MI_IOnly</command>+ <command>MI_BCheck</command>+ <command>MI_GCheck</command>+ <command>MI_ACheck</command>+ <separator/>+ <command>MI_ShiftTrace</command>+ <command>MI_EditShift</command>+ <command>MI_NoShift</command>+ <command>MI_ResetShift</command>+ <separator/>+ <command>MI_RasterizePli</command>+ <separator/>+ <command>MI_Link</command>+ </menu>+ <menu title="Windows">+ <command>MI_DockingCheck</command>+ <separator/>+ <command>MI_OpenBatchServers</command>+ <command>MI_OpenCleanupSettings</command>+ <command>MI_OpenColorModel</command>+ <command>MI_OpenFileBrowser</command>+ <command>MI_OpenFileViewer</command>+ <command>MI_OpenFunctionEditor</command>+ <command>MI_OpenFilmStrip</command>+ <command>MI_OpenPalette</command>+ <command>MI_OpenFileBrowser2</command>+ <command>MI_OpenSchematic</command>+ <command>MI_OpenStudioPalette</command>+ <command>MI_OpenStyleControl</command>+ <command>MI_OpenTasks</command>+ <command>MI_OpenTMessage</command>+ <command>MI_OpenToolbar</command>+ <command>MI_OpenToolOptionBar</command>+ <command>MI_OpenLevelView</command>+ <command>MI_OpenComboViewer</command>+ <command>MI_OpenXshView</command>+ <command>MI_OpenHistoryPanel</command>+ <separator/>+ <command>MI_ResetRoomLayout</command>+ </menu>+ <menu title="Help">+ <command>MI_About</command>+ </menu>+</menubar>\ No newline at end of filediff --git a/stuff/profiles/layouts/OpenToonz/room1.ini b/stuff/profiles/layouts/rooms/StudioGhibli/room1.inisimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room1.inirename to stuff/profiles/layouts/rooms/StudioGhibli/room1.inidiff --git a/stuff/profiles/layouts/OpenToonz/room1_menubar.xml b/stuff/profiles/layouts/rooms/StudioGhibli/room1_menubar.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room1_menubar.xmlrename to stuff/profiles/layouts/rooms/StudioGhibli/room1_menubar.xmldiff --git a/stuff/profiles/layouts/OpenToonz/room2.ini b/stuff/profiles/layouts/rooms/StudioGhibli/room2.inisimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room2.inirename to stuff/profiles/layouts/rooms/StudioGhibli/room2.inidiff --git a/stuff/profiles/layouts/OpenToonz/room2_menubar.xml b/stuff/profiles/layouts/rooms/StudioGhibli/room2_menubar.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room2_menubar.xmlrename to stuff/profiles/layouts/rooms/StudioGhibli/room2_menubar.xmldiff --git a/stuff/profiles/layouts/OpenToonz/room3.ini b/stuff/profiles/layouts/rooms/StudioGhibli/room3.inisimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room3.inirename to stuff/profiles/layouts/rooms/StudioGhibli/room3.inidiff --git a/stuff/profiles/layouts/OpenToonz/room3_menubar.xml b/stuff/profiles/layouts/rooms/StudioGhibli/room3_menubar.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room3_menubar.xmlrename to stuff/profiles/layouts/rooms/StudioGhibli/room3_menubar.xmldiff --git a/stuff/profiles/layouts/OpenToonz/room4.ini b/stuff/profiles/layouts/rooms/StudioGhibli/room4.inisimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room4.inirename to stuff/profiles/layouts/rooms/StudioGhibli/room4.inidiff --git a/stuff/profiles/layouts/OpenToonz/room4_menubar.xml b/stuff/profiles/layouts/rooms/StudioGhibli/room4_menubar.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room4_menubar.xmlrename to stuff/profiles/layouts/rooms/StudioGhibli/room4_menubar.xmldiff --git a/stuff/profiles/layouts/OpenToonz/room5.ini b/stuff/profiles/layouts/rooms/StudioGhibli/room5.inisimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room5.inirename to stuff/profiles/layouts/rooms/StudioGhibli/room5.inidiff --git a/stuff/profiles/layouts/OpenToonz/room5_menubar.xml b/stuff/profiles/layouts/rooms/StudioGhibli/room5_menubar.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room5_menubar.xmlrename to stuff/profiles/layouts/rooms/StudioGhibli/room5_menubar.xmldiff --git a/stuff/profiles/layouts/OpenToonz/room6.ini b/stuff/profiles/layouts/rooms/StudioGhibli/room6.inisimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room6.inirename to stuff/profiles/layouts/rooms/StudioGhibli/room6.inidiff --git a/stuff/profiles/layouts/OpenToonz/room6_menubar.xml b/stuff/profiles/layouts/rooms/StudioGhibli/room6_menubar.xmlsimilarity index 100%rename from stuff/profiles/layouts/OpenToonz/room6_menubar.xmlrename to stuff/profiles/layouts/rooms/StudioGhibli/room6_menubar.xmldiff --git a/toonz/sources/include/toonz/preferences.h b/toonz/sources/include/toonz/preferences.hindex f1cbebaf0..b51c5d55f 100644--- a/toonz/sources/include/toonz/preferences.h+++ b/toonz/sources/include/toonz/preferences.h@@ -140,6 +140,15 @@ public:void setCameraUnits(std::string s);QString getCameraUnits() const { return m_cameraUnits; }+ //void setRoomChoice(std::string s);+ //QString getRoomChoice() const { return m_roomChoice; }++ void setCurrentRoomChoice(int currentRoomChoice);+ void setCurrentRoomChoice(QString currentRoomChoice);+ QString getCurrentRoomChoice() const;+ int getRoomChoiceCount() const;+ QString getRoomChoice(int index) const;+void enableGeneratedMovieView(bool on);bool isGeneratedMovieViewEnabled() const{@@ -440,13 +449,15 @@ private:std::unique_ptr<QSettings> m_settings;QMap<int, QString> m_languageMaps,- m_styleSheetMaps;+ m_styleSheetMaps,+ m_roomMaps;std::vector<LevelFormat> m_levelFormats;QString m_units,m_cameraUnits,- m_scanLevelType;+ m_scanLevelType,+ m_currentRoomChoice;double m_defLevelWidth,m_defLevelHeight,@@ -471,6 +482,7 @@ private:m_autocreationType,m_keyframeType,m_animationStep;+int m_currentLanguage,m_currentStyleSheet,m_undoMemorySize, // in megabytesdiff --git a/toonz/sources/include/toonz/toonzfolders.h b/toonz/sources/include/toonz/toonzfolders.hindex 1435b9bcf..99a677020 100644--- a/toonz/sources/include/toonz/toonzfolders.h+++ b/toonz/sources/include/toonz/toonzfolders.h@@ -24,6 +24,12 @@ DVAPI TFilePath getModulesDir();DVAPI TFilePath getTemplateModuleDir();DVAPI TFilePath getMyModuleDir();+DVAPI TFilePath getRoomsDir();+DVAPI TFilePath getTemplateRoomsDir();+DVAPI TFilePath getMyRoomsDir();+DVAPI TFilePath getRoomsFile(TFilePath filename);+DVAPI TFilePath getRoomsFile(std::string fn);+// restituisce getMyModuleDir() + filename// o getTemplateModuleDir() + filenameDVAPI TFilePath getModuleFile(TFilePath filename);diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cppindex 55e749e92..6378b3926 100644--- a/toonz/sources/toonz/mainwindow.cpp+++ b/toonz/sources/toonz/mainwindow.cpp@@ -102,16 +102,16 @@ bool readRoomList(std::vector<TFilePath> &roomPaths,TFilePath fp;/*-レイアウトファイルが指定されている場合--*/if (!argumentLayoutFileName.isEmpty()) {- fp = ToonzFolder::getModuleFile(argumentLayoutFileName.toStdString());+ fp = ToonzFolder::getRoomsFile(argumentLayoutFileName.toStdString());if (!TFileStatus(fp).doesExist()) {DVGui::warning("Room layout file " + argumentLayoutFileName + " not found!");- fp = ToonzFolder::getModuleFile(layoutsFileName);+ fp = ToonzFolder::getRoomsFile(layoutsFileName);if (!TFileStatus(fp).doesExist())return false;} elseargumentLayoutFileLoaded = true;} else {- fp = ToonzFolder::getModuleFile(layoutsFileName);+ fp = ToonzFolder::getRoomsFile(layoutsFileName);if (!TFileStatus(fp).doesExist())return false;}@@ -144,7 +144,7 @@ bool readRoomList(std::vector<TFilePath> &roomPaths,void writeRoomList(std::vector<TFilePath> &roomPaths){- TFilePath fp = ToonzFolder::getMyModuleDir() + layoutsFileName;+ TFilePath fp = ToonzFolder::getMyRoomsDir() + layoutsFileName;TSystem::touchParentDir(fp);Tofstream os(fp);if (!os)@@ -170,7 +170,7 @@ void writeRoomList(std::vector<Room *> &rooms)void makePrivate(Room *room){- TFilePath layoutDir = ToonzFolder::getMyModuleDir();+ TFilePath layoutDir = ToonzFolder::getMyRoomsDir();TFilePath roomPath = room->getPath();std::string mbSrcFileName = roomPath.getName() + "_menubar.xml";if (roomPath == TFilePath() || roomPath.getParentDir() != layoutDir) {@@ -189,12 +189,12 @@ void makePrivate(Room *room)TFilePath myMBPath = layoutDir + mbDstFileName;if (!TFileStatus(myMBPath).isReadable()){- TFilePath templateRoomMBPath = ToonzFolder::getTemplateModuleDir() + mbSrcFileName;+ TFilePath templateRoomMBPath = ToonzFolder::getTemplateRoomsDir() + mbSrcFileName;if (TFileStatus(templateRoomMBPath).doesExist())TSystem::copyFile(myMBPath, templateRoomMBPath);else{- TFilePath templateFullMBPath = ToonzFolder::getTemplateModuleDir() + "menubar_template.xml";+ TFilePath templateFullMBPath = ToonzFolder::getTemplateRoomsDir() + "menubar_template.xml";if (TFileStatus(templateFullMBPath).doesExist())TSystem::copyFile(myMBPath, templateFullMBPath);else@@ -379,7 +379,7 @@ MainWindow::MainWindow(const QString &argumentLayoutFileName, QWidget *parent, Q{m_toolsActionGroup = new QActionGroup(this);m_toolsActionGroup->setExclusive(true);-+ m_currentRoomsChoice = Preferences::instance()->getCurrentRoomChoice();defineActions();TApp::instance()->getCurrentScene()->setDirtyFlag(false);@@ -527,6 +527,13 @@ int MainWindow::getRoomCount() const//-----------------------------------------------------------------------------+void MainWindow::refreshWriteSettings()+{+ writeSettings();+}++//-----------------------------------------------------------------------------+void MainWindow::readSettings(const QString &argumentLayoutFileName){@@ -570,7 +577,7 @@ void MainWindow::readSettings(const QString &argumentLayoutFileName)/*- ここでMenuBarファイルをロードする -*/std::string mbFileName = roomPath.getName() + "_menubar.xml";- stackedMenuBar->loadAndAddMenubar(ToonzFolder::getModuleFile(mbFileName));+ stackedMenuBar->loadAndAddMenubar(ToonzFolder::getRoomsFile(mbFileName));//room->setDockOptions(QMainWindow::DockOptions(// (QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks) & ~QMainWindow::AllowTabbedDocks));@@ -627,7 +634,7 @@ void MainWindow::readSettings(const QString &argumentLayoutFileName)writeRoomList(rooms);// Imposto la stanza corrente- fp = ToonzFolder::getModuleFile(currentRoomFileName);+ fp = ToonzFolder::getRoomsFile(currentRoomFileName);Tifstream is(fp);std::string currentRoomName;is >> currentRoomName;@@ -705,10 +712,13 @@ void MainWindow::writeSettings()rooms.push_back(room);room->save();}- writeRoomList(rooms);+ if (m_currentRoomsChoice == Preferences::instance()->getCurrentRoomChoice())+ {+ writeRoomList(rooms);+ }//Current room settings- Tofstream os(ToonzFolder::getMyModuleDir() + currentRoomFileName);+ Tofstream os(ToonzFolder::getMyRoomsDir() + currentRoomFileName);os << getCurrentRoom()->getName().toStdString();//Main window settings@@ -1094,8 +1104,12 @@ void MainWindow::resetRoomsLayout()m_saveSettingsOnQuit = false;- TFilePath layoutDir = ToonzFolder::getMyModuleDir();+ TFilePath layoutDir = ToonzFolder::getMyRoomsDir();if (layoutDir != TFilePath()) {+ //TSystem::deleteFile(layoutDir);+ TSystem::rmDirTree(layoutDir);+ }+ /*if (layoutDir != TFilePath()) {try {TFilePathSet fpset;TSystem::readDirectory(fpset, layoutDir, true, false);@@ -1107,7 +1121,7 @@ void MainWindow::resetRoomsLayout()}} catch (...) {}- }+ }*/DVGui::info(QObject::tr("The rooms will be reset the next time you run Toonz."));}diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.hindex e178be573..fb8793f27 100644--- a/toonz/sources/toonz/mainwindow.h+++ b/toonz/sources/toonz/mainwindow.h@@ -71,6 +71,8 @@ class MainWindow : public QMainWindowbool m_saveSettingsOnQuit;int m_oldRoomIndex;+ QString m_currentRoomsChoice;+UpdateChecker *m_updateChecker;TopBar *m_topBar;@@ -108,7 +110,7 @@ public:Room *getRoomByName(QString &roomName);Room *getCurrentRoom() const;-+ void refreshWriteSettings();/*-- FillAreas,FillLinesに直接切り替えるコマンド --*/void toggleFillAreas();void toggleFillLines();@@ -127,9 +129,9 @@ private:/*!Must be call before readSettings().*/void defineActions();/*- Room *createPaintRoom();- Room *createAnimationRoom();- Room *createBrowserRoom();+ Room *createPaintRoom();+ Room *createAnimationRoom();+ Room *createBrowserRoom();Room *createPltEditRoom();Room *createFarmRoom();*/diff --git a/toonz/sources/toonz/menubar.cpp b/toonz/sources/toonz/menubar.cppindex fff63ae9b..48f9671e6 100644--- a/toonz/sources/toonz/menubar.cpp+++ b/toonz/sources/toonz/menubar.cpp@@ -1442,7 +1442,7 @@ void StackedMenuBar::doCustomizeMenuBar(int index)/*- OKが押され、roomname_menubar.xmlが更新された状態 -*//*- xmlファイルからメニューバーを作り直して格納 -*/std::string mbFileName = room->getPath().getName() + "_menubar.xml";- TFilePath mbPath = ToonzFolder::getMyModuleDir() + mbFileName;+ TFilePath mbPath = ToonzFolder::getMyRoomsDir() + mbFileName;if (!TFileStatus(mbPath).isReadable()){DVGui::warning(tr("Cannot open menubar settings file %1").arg(QString::fromStdString(mbFileName)));diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cppindex f4aa12f01..a842f7f0d 100644--- a/toonz/sources/toonz/preferencespopup.cpp+++ b/toonz/sources/toonz/preferencespopup.cpp@@ -53,7 +53,7 @@ namespacestatic const int unitsCount = 5, inchIdx = 2;static const QString units[unitsCount] = {"cm", "mm", "inch", "field", "pixel"};-+static const QString rooms[2] = { "standard", "studioGhibli" };enum DpiPolicy { DP_ImageDpi,DP_CustomDpi };@@ -220,6 +220,15 @@ void PreferencesPopup::onCameraUnitChanged(int index)//-----------------------------------------------------------------------------+void PreferencesPopup::onRoomChoiceChanged(int index)+{+ TApp::instance()->writeSettings();+ m_pref->setCurrentRoomChoice(index);++}++//-----------------------------------------------------------------------------+void PreferencesPopup::onScanLevelTypeChanged(const QString &text){m_pref->setScanLevelType(text.toStdString());@@ -879,6 +888,10 @@ PreferencesPopup::PreferencesPopup()QComboBox *styleSheetType = new QComboBox(this);QComboBox *unitOm = new QComboBox(this);QComboBox *cameraUnitOm = new QComboBox(this);+ //Choose between standard and Studio Ghibli rooms+ QComboBox *roomChoice = new QComboBox(this);++m_iconSizeLx = new DVGui::IntLineEdit(this, 80, 10, 400);m_iconSizeLy = new DVGui::IntLineEdit(this, 60, 10, 400);m_viewShrink = new DVGui::IntLineEdit(this, 1, 1, 20);@@ -1038,6 +1051,20 @@ PreferencesPopup::PreferencesPopup()idx = std::find(::units, ::units + ::unitsCount, m_pref->getCameraUnits()) - ::units;cameraUnitOm->setCurrentIndex((idx < ::unitsCount) ? idx : ::inchIdx);+ QStringList roomList;+ int currentRoomIndex = 0;+ for (int i = 0; i < m_pref->getRoomChoiceCount(); i++) {+ QString string = m_pref->getRoomChoice(i);+ if (string == m_pref->getCurrentRoomChoice())+ currentRoomIndex = i;+ roomList.push_back(string);+ }++ if (roomList.size() > 1) {+ roomChoice->addItems(roomList);+ roomChoice->setCurrentIndex(currentRoomIndex);+ }+m_iconSizeLx->setValue(m_pref->getIconSize().lx);m_iconSizeLy->setValue(m_pref->getIconSize().ly);int shrink, step;@@ -1245,6 +1272,9 @@ PreferencesPopup::PreferencesPopup()styleLay->addWidget(new QLabel(tr("Camera Unit:"), this), 2, 0, Qt::AlignRight | Qt::AlignVCenter);styleLay->addWidget(cameraUnitOm, 2, 1);++ styleLay->addWidget(new QLabel(tr("Rooms *:"), this), 3, 0, Qt::AlignRight | Qt::AlignVCenter);+ styleLay->addWidget(roomChoice, 3, 1);}styleLay->setColumnStretch(0, 0);styleLay->setColumnStretch(1, 0);@@ -1575,6 +1605,7 @@ PreferencesPopup::PreferencesPopup()ret = ret && connect(styleSheetType, SIGNAL(currentIndexChanged(int)), SLOT(onStyleSheetTypeChanged(int)));ret = ret && connect(unitOm, SIGNAL(currentIndexChanged(int)), SLOT(onUnitChanged(int)));ret = ret && connect(cameraUnitOm, SIGNAL(currentIndexChanged(int)), SLOT(onCameraUnitChanged(int)));+ ret = ret && connect(roomChoice, SIGNAL(currentIndexChanged(int)), SLOT(onRoomChoiceChanged(int)));ret = ret && connect(openFlipbookAfterCB, SIGNAL(stateChanged(int)), this, SLOT(onViewGeneratedMovieChanged(int)));ret = ret && connect(m_iconSizeLx, SIGNAL(editingFinished()), SLOT(onIconSizeChanged()));ret = ret && connect(m_iconSizeLy, SIGNAL(editingFinished()), SLOT(onIconSizeChanged()));diff --git a/toonz/sources/toonz/preferencespopup.h b/toonz/sources/toonz/preferencespopup.hindex e4616c93d..f22845c56 100644--- a/toonz/sources/toonz/preferencespopup.h+++ b/toonz/sources/toonz/preferencespopup.h@@ -99,6 +99,7 @@ private slots:void onUnitChanged(int index);void onCameraUnitChanged(int index);+ void onRoomChoiceChanged(int index);void onScanLevelTypeChanged(const QString &text);void onMinuteChanged();void onIconSizeChanged();diff --git a/toonz/sources/toonz/tapp.cpp b/toonz/sources/toonz/tapp.cppindex 35c8f48c8..d081ab1ec 100644--- a/toonz/sources/toonz/tapp.cpp+++ b/toonz/sources/toonz/tapp.cpp@@ -234,6 +234,16 @@ TMainWindow *TApp::getCurrentRoom() const//-----------------------------------------------------------------------------+void TApp::writeSettings()+{+ MainWindow *mainWindow = dynamic_cast<MainWindow *>(getMainWindow());+ if (mainWindow)+ mainWindow->refreshWriteSettings();+}++//-----------------------------------------------------------------------------++TPaletteHandle *TApp::getCurrentPalette() const{return m_paletteController->getCurrentPalette();diff --git a/toonz/sources/toonz/tapp.h b/toonz/sources/toonz/tapp.hindex 9e8ffac92..29b9b6b1e 100644--- a/toonz/sources/toonz/tapp.h+++ b/toonz/sources/toonz/tapp.h@@ -177,6 +177,8 @@ public:bool isPenCloseToTablet() const { return m_isPenCloseToTablet; }+ void writeSettings();+protected:bool eventFilter(QObject *obj, QEvent *event);diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cppindex aabe6c01b..4a6be3062 100644--- a/toonz/sources/toonzlib/preferences.cpp+++ b/toonz/sources/toonzlib/preferences.cpp@@ -227,7 +227,7 @@ bool Preferences::LevelFormat::matches(const TFilePath &fp) const//**********************************************************************************Preferences::Preferences()- : m_units("mm"), m_cameraUnits("inch"), m_scanLevelType("tif"), m_defLevelWidth(0.0), m_defLevelHeight(0.0), m_defLevelDpi(0.0), m_iconSize(160, 120), m_blankColor(TPixel32::White), m_frontOnionColor(TPixel::Black), m_backOnionColor(TPixel::Black), m_transpCheckBg(TPixel::White), m_transpCheckInk(TPixel::Black), m_transpCheckPaint(TPixel(127, 127, 127)), m_autosavePeriod(15), m_chunkSize(10), m_rasterOptimizedMemory(0), m_shrink(1), m_step(1), m_blanksCount(0), m_keyframeType(3), m_animationStep(1), m_textureSize(0), m_xsheetStep(10), m_shmmax(-1), m_shmseg(-1), m_shmall(-1), m_shmmni(-1), m_onionPaperThickness(50), m_currentLanguage(0), m_currentStyleSheet(0), m_undoMemorySize(100), m_dragCellsBehaviour(0), m_lineTestFpsCapture(25), m_defLevelType(0), m_autocreationType(1), m_autoExposeEnabled(true), m_autoCreateEnabled(true), m_subsceneFolderEnabled(true), m_generatedMovieViewEnabled(true), m_xsheetAutopanEnabled(true), m_ignoreAlphaonColumn1Enabled(false), m_rewindAfterPlaybackEnabled(true), m_fitToFlipbookEnabled(false), m_previewAlwaysOpenNewFlipEnabled(false), m_autosaveEnabled(false), m_defaultViewerEnabled(false), m_saveUnpaintedInCleanup(true), m_askForOverrideRender(true), m_automaticSVNFolderRefreshEnabled(true), m_SVNEnabled(false), m_minimizeSaveboxAfterEditing(true), m_levelsBackupEnabled(false), m_sceneNumberingEnabled(false), m_animationSheetEnabled(false), m_inksOnly(false), m_fillOnlySavebox(false), m_show0ThickLines(true), m_regionAntialias(false), m_viewerBGColor(128, 128, 128, 255), m_previewBGColor(64, 64, 64, 255), m_chessboardColor1(180, 180, 180), m_chessboardColor2(230, 230, 230), m_showRasterImagesDarkenBlendedInViewer(false), m_actualPixelViewOnSceneEditingMode(false), m_viewerZoomCenter(0), m_initialLoadTlvCachingBehavior(0), m_removeSceneNumberFromLoadedLevelName(false), m_replaceAfterSaveLevelAs(true), m_showFrameNumberWithLetters(false), m_levelNameOnEachMarker(false), m_columnIconLoadingPolicy((int)LoadAtOnce), m_moveCurrentFrameByClickCellArea(true), m_onionSkinEnabled(true), m_multiLayerStylePickerEnabled(false), m_paletteTypeOnLoadRasterImageAsColorModel(0), m_showKeyframesOnXsheetCellArea(true)+ : m_units("mm"), m_cameraUnits("inch"), m_currentRoomChoice("Default"), m_scanLevelType("tif"), m_defLevelWidth(0.0), m_defLevelHeight(0.0), m_defLevelDpi(0.0), m_iconSize(160, 120), m_blankColor(TPixel32::White), m_frontOnionColor(TPixel::Black), m_backOnionColor(TPixel::Black), m_transpCheckBg(TPixel::White), m_transpCheckInk(TPixel::Black), m_transpCheckPaint(TPixel(127, 127, 127)), m_autosavePeriod(15), m_chunkSize(10), m_rasterOptimizedMemory(0), m_shrink(1), m_step(1), m_blanksCount(0), m_keyframeType(3), m_animationStep(1), m_textureSize(0), m_xsheetStep(10), m_shmmax(-1), m_shmseg(-1), m_shmall(-1), m_shmmni(-1), m_onionPaperThickness(50), m_currentLanguage(0), m_currentStyleSheet(0), m_undoMemorySize(100), m_dragCellsBehaviour(0), m_lineTestFpsCapture(25), m_defLevelType(0), m_autocreationType(1), m_autoExposeEnabled(true), m_autoCreateEnabled(true), m_subsceneFolderEnabled(true), m_generatedMovieViewEnabled(true), m_xsheetAutopanEnabled(true), m_ignoreAlphaonColumn1Enabled(false), m_rewindAfterPlaybackEnabled(true), m_fitToFlipbookEnabled(false), m_previewAlwaysOpenNewFlipEnabled(false), m_autosaveEnabled(false), m_defaultViewerEnabled(false), m_saveUnpaintedInCleanup(true), m_askForOverrideRender(true), m_automaticSVNFolderRefreshEnabled(true), m_SVNEnabled(false), m_minimizeSaveboxAfterEditing(true), m_levelsBackupEnabled(false), m_sceneNumberingEnabled(false), m_animationSheetEnabled(false), m_inksOnly(false), m_fillOnlySavebox(false), m_show0ThickLines(true), m_regionAntialias(false), m_viewerBGColor(128, 128, 128, 255), m_previewBGColor(64, 64, 64, 255), m_chessboardColor1(180, 180, 180), m_chessboardColor2(230, 230, 230), m_showRasterImagesDarkenBlendedInViewer(false), m_actualPixelViewOnSceneEditingMode(false), m_viewerZoomCenter(0), m_initialLoadTlvCachingBehavior(0), m_removeSceneNumberFromLoadedLevelName(false), m_replaceAfterSaveLevelAs(true), m_showFrameNumberWithLetters(false), m_levelNameOnEachMarker(false), m_columnIconLoadingPolicy((int)LoadAtOnce), m_moveCurrentFrameByClickCellArea(true), m_onionSkinEnabled(true), m_multiLayerStylePickerEnabled(false), m_paletteTypeOnLoadRasterImageAsColorModel(0), m_showKeyframesOnXsheetCellArea(true){TCamera camera;m_defLevelType = PLI_XSHLEVEL;@@ -345,6 +345,7 @@ Preferences::Preferences()std::sort(m_levelFormats.begin(), m_levelFormats.end(), // Format sorting must beformatLess); // enforced+ //load languagesTFilePath lang_path = TEnv::getConfigDir() + "loc";TFilePathSet lang_fpset;m_languageMaps[0] = "English";@@ -369,6 +370,7 @@ Preferences::Preferences()} catch (...) {}+ //load stylesTFilePath path(TEnv::getConfigDir() + "qss");TFilePathSet fpset;try {@@ -391,8 +393,50 @@ Preferences::Preferences()} catch (...) {}+ //load rooms or layouts+ QString rooms;+ bool roomsExist = false;+ rooms = m_settings->value("CurrentRoomChoice").toString();++ TFilePath room_path(TEnv::getStuffDir() + "profiles/layouts/rooms");+ TFilePathSet room_fpset;+ try {+ TSystem::readDirectory(room_fpset, room_path, true, false);+ TFilePathSet::iterator it = room_fpset.begin();+ int i = 0;+ for (it; it != room_fpset.end(); it++) {+ TFilePath newPath = *it;+ if (newPath == room_path)+ continue;+ if (TFileStatus(newPath).isDirectory()) {+ QString string = QString::fromStdWString(newPath.getWideName());+ if (string == rooms)+ roomsExist = true;+ m_roomMaps[i] = string;+ i++;+ }+ }+ }+ catch (...) {+ }+ //make sure the selected rooms exists+ if (rooms != "" && roomsExist)+ {+ m_currentRoomChoice = rooms;+ setCurrentRoomChoice(rooms);+ }+ //or set the selected rooms to the first ones in the folder+ else+ {+ m_currentRoomChoice = m_roomMaps[0];+ setCurrentRoomChoice(0);+ }+getValue(*m_settings, "CurrentLanguage", m_currentLanguage);getValue(*m_settings, "CurrentStyleSheet", m_currentStyleSheet);+++getValue(*m_settings, "DragCellsBehaviour", m_dragCellsBehaviour);getValue(*m_settings, "LineTestFpsCapture", m_lineTestFpsCapture);@@ -886,6 +930,44 @@ void Preferences::setCameraUnits(std::string units)setCurrentUnits("camera.lx", units);setCurrentUnits("camera.ly", units);}++//-----------------------------------------------------------------++void Preferences::setCurrentRoomChoice(int currentRoomChoice)+{+ m_currentRoomChoice = getRoomChoice(currentRoomChoice);+ m_settings->setValue("CurrentRoomChoice", m_currentRoomChoice);+}++//-----------------------------------------------------------------++void Preferences::setCurrentRoomChoice(QString currentRoomChoice)+{+ m_currentRoomChoice = currentRoomChoice;+ m_settings->setValue("CurrentRoomChoice", m_currentRoomChoice);+}++//-----------------------------------------------------------------++QString Preferences::getCurrentRoomChoice() const+{+ return m_currentRoomChoice;+}++//-----------------------------------------------------------------++int Preferences::getRoomChoiceCount() const+{+ return m_roomMaps.size();+}++//-----------------------------------------------------------------++QString Preferences::getRoomChoice(int index) const+{+ return m_roomMaps[index];+}+//-----------------------------------------------------------------void Preferences::setScanLevelType(std::string type)diff --git a/toonz/sources/toonzlib/toonzfolders.cpp b/toonz/sources/toonzlib/toonzfolders.cppindex 560dc0864..a40d9b07e 100644--- a/toonz/sources/toonzlib/toonzfolders.cpp+++ b/toonz/sources/toonzlib/toonzfolders.cpp@@ -5,6 +5,7 @@#include "tenv.h"//#include "appmainshell.h"#include "tconvert.h"+#include "toonz/preferences.h"using namespace TEnv;@@ -77,7 +78,8 @@ TFilePath ToonzFolder::getReslistPath(bool forCleanup)TFilePath ToonzFolder::getTemplateModuleDir(){- return getModulesDir() + getModuleName();+ //return getModulesDir() + getModuleName();+ return getModulesDir() + "settings";}TFilePath ToonzFolder::getMyModuleDir()@@ -100,6 +102,40 @@ TFilePath ToonzFolder::getModuleFile(std::string fn)return ToonzFolder::getModuleFile(TFilePath(fn));}+//turtle+TFilePath ToonzFolder::getRoomsDir()+{+ return getProfileFolder() + "layouts/rooms";+}++TFilePath ToonzFolder::getTemplateRoomsDir()+{+ return getRoomsDir() + Preferences::instance()->getCurrentRoomChoice().toStdWString();+ //TFilePath fp(getMyModuleDir() + TFilePath(mySettingsFileName));+ //return getRoomsDir() + getModuleName();+}++TFilePath ToonzFolder::getMyRoomsDir()+{+ //TFilePath fp(getTemplateRoomsDir());+ TFilePath fp(getProfileFolder());+ return fp.withName(fp.getWideName() + L"/layouts/personal/" + Preferences::instance()->getCurrentRoomChoice().toStdWString() + L"." + TSystem::getUserName().toStdWString());+}++TFilePath ToonzFolder::getRoomsFile(TFilePath filename)+{+ TFilePath fp = getMyRoomsDir() + filename;+ if (TFileStatus(fp).doesExist())+ return fp;+ fp = getTemplateRoomsDir() + filename;+ return fp;+}++TFilePath ToonzFolder::getRoomsFile(std::string fn)+{+ return ToonzFolder::getRoomsFile(TFilePath(fn));+}+//===================================================================FolderListenerManager::FolderListenerManager()