Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Move Notice to Command Save All

Abel You976ba4ae7a61
diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp
index 6a88aea89..a264d7418 100644
--- a/toonz/sources/toonz/iocommand.cpp
+++ b/toonz/sources/toonz/iocommand.cpp
@@ -1739,6 +1739,18 @@ bool IoCmd::saveLevel(TXshSimpleLevel *sl) {
bool IoCmd::saveAll(int flags) {
// try to save as much as possible
// if anything is wrong, return false
+
+ QMainWindow *parent = TApp::instance()->getMainWindow();
+ QLabel *Label = new QLabel("Saving...", parent);
+ Label->setStyleSheet(
+ "font-size: 20px;"
+ "background-color: black; color: white; "
+ "font-weight: bold; padding: 5px;");
+ Label->adjustSize();
+ QPoint pos = parent->rect().bottomRight();
+ Label->move(pos.x() - Label->width() - 40, pos.y() - Label->height() - 30);
+ Label->show();
+
// NOTE: saveScene already check saveInProgress
bool result = saveScene(flags);
@@ -1759,6 +1771,23 @@ bool IoCmd::saveAll(int flags) {
app->getCurrentLevel()->notifyLevelTitleChange();
app->getCurrentPalette()->notifyPaletteTitleChanged();
if (untitled) scene->setUntitled();
+
+ //End Label Notice
+ if (result) {
+ Label->setText("Saved All");
+ Label->setStyleSheet(
+ "font-size: 20px;"
+ "background-color: black; color: green; "
+ "font-weight: bold; padding: 5px;");
+ } else {
+ Label->setText("Save Failed");
+ Label->setStyleSheet(
+ "font-size: 20px;"
+ "background-color: black; color: green; "
+ "font-weight: bold; padding: 5px;");
+ }
+
+ QTimer::singleShot(2500, Label, &QLabel::deleteLater);
return result;
}
diff --git a/toonz/sources/toonz/tapp.cpp b/toonz/sources/toonz/tapp.cpp
index d0121aadd..374d0eb3e 100644
--- a/toonz/sources/toonz/tapp.cpp
+++ b/toonz/sources/toonz/tapp.cpp
@@ -714,19 +714,6 @@ void TApp::autosave() {
//DVGui::ProgressDialog pb(
// "Autosaving scene..." + toQString(scene->getScenePath()), 0, 0, 1);
- QMainWindow *parent = TApp::instance()->getMainWindow();
- //parent->setDisabled(true);
-
- QLabel *Label = new QLabel("Autosaving...",parent);
- Label->setStyleSheet(
- "font-size: 20px;"
- "background-color: black; color: white; "
- "font-weight: bold; padding: 5px;");
- Label->adjustSize();
- QPoint pos = parent->rect().bottomRight();
- Label->move(pos.x() - Label->width() - 40, pos.y() - Label->height() - 30);
- Label->show();
-
Preferences *pref = Preferences::instance();
if (pref->isAutosaveSceneEnabled() && pref->isAutosaveOtherFilesEnabled()) {
IoCmd::saveAll(IoCmd::AUTO_SAVE);
@@ -736,14 +723,6 @@ void TApp::autosave() {
IoCmd::saveNonSceneFiles();
}
- //parent->setDisabled(false);
-
- Label->setText("Autosaved");
- Label->setStyleSheet(
- "font-size: 20px;"
- "background-color: black; color: green; "
- "font-weight: bold; padding: 5px;");
- QTimer::singleShot(2500, Label, &QLabel::deleteLater);
}
//-----------------------------------------------------------------------------