diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index 342c043..505a8b2 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -456,6 +456,8 @@ centralWidget->setLayout(centralWidgetLayout);*/ setCommandHandler("MI_NewRasterLevel", this, &MainWindow::onNewRasterLevelButtonPressed); setCommandHandler(MI_ClearCacheFolder, this, &MainWindow::clearCacheFolder); + setCommandHandler("MI_NewMetaLevel", this, + &MainWindow::onNewMetaLevelButtonPressed); // remove ffmpegCache if still exists from crashed exit QString ffmpegCachePath = ToonzFolder::getCacheRootFolder().getQString() + "//ffmpeg"; @@ -1845,6 +1847,8 @@ void MainWindow::defineActions() { "new_toonz_raster_level"); createMenuLevelAction(MI_NewRasterLevel, QT_TR_NOOP("&New Raster Level"), "", "new_raster_level"); + createMenuFileAction(MI_NewMetaLevel, QT_TR_NOOP("&New Assistant Level"), + "new_meta_level"); createMenuLevelAction(MI_LoadLevel, QT_TR_NOOP("&Load Level..."), "", "load_level"); createMenuLevelAction(MI_SaveLevel, QT_TR_NOOP("&Save Level"), "", @@ -3121,6 +3125,15 @@ void MainWindow::clearCacheFolder() { //----------------------------------------------------------------------------- +void MainWindow::onNewMetaLevelButtonPressed() { + int defaultLevelType = Preferences::instance()->getDefLevelType(); + Preferences::instance()->setValue(DefLevelType, META_XSHLEVEL); + CommandManager::instance()->execute("MI_NewLevel"); + Preferences::instance()->setValue(DefLevelType, defaultLevelType); +} + +//----------------------------------------------------------------------------- + class ReloadStyle final : public MenuItemHandler { public: ReloadStyle() : MenuItemHandler("MI_ReloadStyle") {} diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.h index 4dd7794..f85d5c6 100644 --- a/toonz/sources/toonz/mainwindow.h +++ b/toonz/sources/toonz/mainwindow.h @@ -99,6 +99,7 @@ public: void onNewToonzRasterLevelButtonPressed(); void onNewRasterLevelButtonPressed(); void clearCacheFolder(); + void onNewMetaLevelButtonPressed(); QString getLayoutName() { return m_layoutName; } diff --git a/toonz/sources/toonz/menubarcommandids.h b/toonz/sources/toonz/menubarcommandids.h index 504a282..ba7b371 100644 --- a/toonz/sources/toonz/menubarcommandids.h +++ b/toonz/sources/toonz/menubarcommandids.h @@ -29,6 +29,7 @@ #define MI_NewVectorLevel "MI_NewVectorLevel" #define MI_NewToonzRasterLevel "MI_NewToonzRasterLevel" #define MI_NewRasterLevel "MI_NewRasterLevel" +#define MI_NewMetaLevel "MI_NewMetaLevel" #define MI_LoadLevel "MI_LoadLevel" #define MI_LoadFolder "MI_LoadFolder" #define MI_SaveLevel "MI_SaveLevel"