diff --git a/toonz/sources/common/tmsgcore.cpp b/toonz/sources/common/tmsgcore.cpp index fc480b5..d70213c 100644 --- a/toonz/sources/common/tmsgcore.cpp +++ b/toonz/sources/common/tmsgcore.cpp @@ -140,11 +140,11 @@ void TMsgCore::readFromSocket(QTcpSocket *socket) //server side QString str = messages.at(i).simplified(); str.chop(4); //rimuovo i "#END" alla fine if (str.startsWith("ERROR")) - DVGui::MsgBox(DVGui::CRITICAL, str.right(str.size() - 5)); + DVGui::error(str.right(str.size() - 5)); else if (str.startsWith("WARNING")) - DVGui::MsgBox(DVGui::WARNING, str.right(str.size() - 7)); + DVGui::warning(str.right(str.size() - 7)); else if (str.startsWith("INFO")) - DVGui::MsgBox(DVGui::INFORMATION, str.right(str.size() - 4)); + DVGui::info(str.right(str.size() - 4)); else assert(false); } @@ -213,19 +213,19 @@ void DVGui::MsgBox(MsgType type, const QString &text) void DVGui::error(const QString &msg) { - MsgBox(DVGui::CRITICAL, msg); + DVGui::MsgBox(DVGui::CRITICAL, msg); } //----------------------------------------------------------------------------- void DVGui::warning(const QString &msg) { - MsgBox(DVGui::WARNING, msg); + DVGui::MsgBox(DVGui::WARNING, msg); } //----------------------------------------------------------------------------- void DVGui::info(const QString &msg) { - MsgBox(DVGui::INFORMATION, msg); + DVGui::MsgBox(DVGui::INFORMATION, msg); } diff --git a/toonz/sources/include/toonzqt/dvdialog.h b/toonz/sources/include/toonzqt/dvdialog.h index fabd4cf..40f794c 100644 --- a/toonz/sources/include/toonzqt/dvdialog.h +++ b/toonz/sources/include/toonzqt/dvdialog.h @@ -244,7 +244,7 @@ signals: 0 -> Cancel or Close Popup, 1,2,3,... -> checkbox clicked. */ -class DVAPI RadioButtonDialog : public Dialog +class DVAPI RadioButtonDialog : public DVGui::Dialog { Q_OBJECT @@ -267,7 +267,7 @@ int DVAPI RadioButtonMsgBox(MsgType type, const QString &labelText, //----------------------------------------------------------------------------- -class DVAPI ProgressDialog : public Dialog +class DVAPI ProgressDialog : public DVGui::Dialog { Q_OBJECT diff --git a/toonz/sources/include/toonzqt/validatedchoicedialog.h b/toonz/sources/include/toonzqt/validatedchoicedialog.h index 6e227ae..f5a1157 100644 --- a/toonz/sources/include/toonzqt/validatedchoicedialog.h +++ b/toonz/sources/include/toonzqt/validatedchoicedialog.h @@ -41,7 +41,7 @@ namespace DVGui ValidatedChoiceDialog() constructor. */ -class DVAPI ValidatedChoiceDialog : public Dialog +class DVAPI ValidatedChoiceDialog : public DVGui::Dialog { Q_OBJECT diff --git a/toonz/sources/tcleanupper/tcleanupper.cpp b/toonz/sources/tcleanupper/tcleanupper.cpp index 55cb5fc..6239076 100644 --- a/toonz/sources/tcleanupper/tcleanupper.cpp +++ b/toonz/sources/tcleanupper/tcleanupper.cpp @@ -129,7 +129,7 @@ void fatalError(string msg) { #ifdef _WIN32 msg = "Application can't start:\n" + msg; - DVGui::MsgBox(DVGui::CRITICAL, QString::fromStdString(msg)); + DVGui::error(QString::fromStdString(msg)); //MessageBox(0,msg.c_str(),"Fatal error",MB_ICONERROR); exit(1); #else @@ -411,7 +411,7 @@ void cleanupLevel(TXshSimpleLevel *xl, std::set fidsInXsheet, string info = "cleanupping " + toString(xl->getPath()); LevelUpdater updater(xl); m_userLog.info(info); - DVGui::MsgBox(DVGui::INFORMATION, QString::fromStdString(info)); + DVGui::info(QString::fromStdString(info)); bool firstImage = true; std::set::iterator it = fidsInXsheet.begin(); for (it; it != fidsInXsheet.end(); it++) { @@ -425,7 +425,7 @@ void cleanupLevel(TXshSimpleLevel *xl, std::set fidsInXsheet, if (0 != (status & TXshSimpleLevel::Cleanupped) && !overwrite) { cout << " skipped" << endl; m_userLog.info(" skipped"); - DVGui::MsgBox(DVGui::INFORMATION, QString("--skipped frame ") + QString::fromStdString(fid.expand())); + DVGui::info(QString("--skipped frame ") + QString::fromStdString(fid.expand())); continue; } TRasterImageP original = xl->getFrameToCleanup(fid); @@ -831,7 +831,7 @@ int main(int argc, char *argv[]) TImageCache::instance()->clear(true); } - DVGui::MsgBox(DVGui::INFORMATION, "Cleanup Done."); + DVGui::info("Cleanup Done."); return 0; } //------------------------------------------------------------------------ diff --git a/toonz/sources/tcomposer/tcomposer.cpp b/toonz/sources/tcomposer/tcomposer.cpp index 05116d4..81a5c86 100644 --- a/toonz/sources/tcomposer/tcomposer.cpp +++ b/toonz/sources/tcomposer/tcomposer.cpp @@ -310,7 +310,7 @@ bool MyMovieRenderListener::onFrameCompleted(int frame) msg = toString(fp.getWideString()) + " computed"; cout << msg << endl; m_userLog->info(msg); - DVGui::MsgBox(DVGui::INFORMATION, QString::fromStdString(msg)); + DVGui::info(QString::fromStdString(msg)); if (FarmController) { try { FarmController->taskProgress(TaskId, m_frameCompletedCount + m_frameFailedCount, m_frameCount, frame + 1, FrameDone); @@ -1029,7 +1029,7 @@ int main(int argc, char *argv[]) toString(TStopWatch::global(8).getTotalTime() / 1000.0, 2) + " seconds spent on rendering" + "\n"; cout << msg + msg2; m_userLog->info(msg + msg2); - DVGui::MsgBox(DVGui::INFORMATION, QString::fromStdString(msg)); + DVGui::info(QString::fromStdString(msg)); TImageCache::instance()->clear(true); /* cout << "Compositing completed in " + toString(Sw1.getTotalTime()/1000.0, 2) + " seconds"; diff --git a/toonz/sources/toonz/batches.cpp b/toonz/sources/toonz/batches.cpp index f0c785c..7d6c855 100644 --- a/toonz/sources/toonz/batches.cpp +++ b/toonz/sources/toonz/batches.cpp @@ -478,7 +478,7 @@ void BatchesController::removeTask(const QString &id) TFarmTask *task = it->second; if (task->m_status == Running || task->m_status == Waiting) { - DVGui::MsgBox(DVGui::WARNING, taskBusyStr().arg(task->m_name)); + DVGui::warning(taskBusyStr().arg(task->m_name)); return; } @@ -531,7 +531,7 @@ void BatchesController::removeAllTasks() for (tt = m_tasks.begin(); tt != tEnd; ++tt) { TFarmTask *task = tt->second; if (task->m_status == Running || task->m_status == Waiting) { - DVGui::MsgBox(DVGui::WARNING, taskBusyStr().arg(task->m_name)); + DVGui::warning(taskBusyStr().arg(task->m_name)); return; } } @@ -930,7 +930,7 @@ QString BatchesController::getListName() const void BatchesController::saveas() { if (getTaskCount() == 0) { - DVGui::MsgBox(DVGui::WARNING, tr("The Task List is empty!")); + DVGui::warning(tr("The Task List is empty!")); return; } diff --git a/toonz/sources/toonz/batchserversviewer.cpp b/toonz/sources/toonz/batchserversviewer.cpp index 278aa75..2d6ac1a 100644 --- a/toonz/sources/toonz/batchserversviewer.cpp +++ b/toonz/sources/toonz/batchserversviewer.cpp @@ -55,7 +55,7 @@ void FarmServerListView::update() new MyListItem(sid.m_id, sid.m_name, this); } } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } } @@ -73,7 +73,7 @@ void FarmServerListView::activate() BatchesController::instance()->update(); static_cast(parentWidget())->updateSelected(); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } } @@ -91,7 +91,7 @@ void FarmServerListView::deactivate() BatchesController::instance()->update(); static_cast(parentWidget())->updateSelected(); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } } //----------------------------------------------------------------------------- @@ -109,7 +109,7 @@ void FarmServerListView::openContextMenu(const QPoint &p) try { state = controller->queryServerState2(item->m_id); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); return; } @@ -181,7 +181,7 @@ void BatchServersViewer::updateServerInfo(const QString &id) try { controller->queryServerInfo(id, info); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } switch (info.m_state) { @@ -223,7 +223,7 @@ void BatchServersViewer::updateServerInfo(const QString &id) m_tasks->setText("<" + task.m_id + "> " + task.m_name); } catch (TException &e) { m_tasks->setText(""); - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } } @@ -353,15 +353,15 @@ void BatchServersViewer::onProcessWith(int index) try { connected = TFarmStuff::testConnectionToController(); } catch (TMissingGRootEnvironmentVariable &) { - DVGui::MsgBox(DVGui::WARNING, QString(tr("In order to use the render farm you have to define the Farm Global Root first."))); + DVGui::warning(QString(tr("In order to use the render farm you have to define the Farm Global Root first."))); m_processWith->setCurrentIndex(0); return; } catch (TMissingGRootFolder &) { - DVGui::MsgBox(DVGui::WARNING, tr("The Farm Global Root folder doesn't exist\nPlease create this folder before using the render farm.")); + DVGui::warning(tr("The Farm Global Root folder doesn't exist\nPlease create this folder before using the render farm.")); m_processWith->setCurrentIndex(0); return; } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); m_processWith->setCurrentIndex(0); return; } @@ -377,7 +377,7 @@ void BatchServersViewer::onProcessWith(int index) .arg(hostName) .arg(QString::number(port))); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); m_processWith->setCurrentIndex(0); return; } diff --git a/toonz/sources/toonz/castviewer.cpp b/toonz/sources/toonz/castviewer.cpp index 539bf47..6718800 100644 --- a/toonz/sources/toonz/castviewer.cpp +++ b/toonz/sources/toonz/castviewer.cpp @@ -458,7 +458,7 @@ void CastTreeViewer::deleteFolder() QString itemName = item->data(0, Qt::DisplayRole).toString(); if (itemName == AudioFolderName) return; - int ret = MsgBox(tr("Delete folder ") + item->text(0) + "?", tr("Yes"), tr("No"), 1); + int ret = DVGui::MsgBox(tr("Delete folder ") + item->text(0) + "?", tr("Yes"), tr("No"), 1); if (ret == 2 || ret == 0) return; QTreeWidgetItem *parentItem = item->parent(); diff --git a/toonz/sources/toonz/cleanuppaletteviewer.cpp b/toonz/sources/toonz/cleanuppaletteviewer.cpp index 9512d3f..21cfab1 100644 --- a/toonz/sources/toonz/cleanuppaletteviewer.cpp +++ b/toonz/sources/toonz/cleanuppaletteviewer.cpp @@ -217,7 +217,7 @@ void CleanupPaletteViewer::onRemoveClicked(bool) QString question; question = QObject::tr("Are you sure you want to delete the selected cleanup color?"); - int ret = MsgBox(question, QObject::tr("Delete"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Delete"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return; diff --git a/toonz/sources/toonz/cleanuppopup.cpp b/toonz/sources/toonz/cleanuppopup.cpp index acd5e95..121c922 100644 --- a/toonz/sources/toonz/cleanuppopup.cpp +++ b/toonz/sources/toonz/cleanuppopup.cpp @@ -204,19 +204,19 @@ void addCleanupDefaultPalette(TXshSimpleLevelP sl) TFileStatus pfs(palettePath); if (!pfs.doesExist() || !pfs.isReadable()) { - DVGui::MsgBox(DVGui::WARNING, QString("CleanupDefaultPalette file: %1 is not found!").arg(QString::fromStdWString(palettePath.getWideString()))); + DVGui::warning(QString("CleanupDefaultPalette file: %1 is not found!").arg(QString::fromStdWString(palettePath.getWideString()))); return; } TIStream is(palettePath); if (!is) { - DVGui::MsgBox(DVGui::WARNING, QString("CleanupDefaultPalette file: failed to get TIStream")); + DVGui::warning(QString("CleanupDefaultPalette file: failed to get TIStream")); return; } string tagName; if (!is.matchTag(tagName) || tagName != "palette") { - DVGui::MsgBox(DVGui::WARNING, QString("CleanupDefaultPalette file: This is not palette file")); + DVGui::warning(QString("CleanupDefaultPalette file: This is not palette file")); return; } @@ -607,7 +607,7 @@ bool CleanupPopup::analyzeCleanupList() // Thus, the conservative approach is not feasible. // Inform the user and abort cleanup - DVGui::MsgBox(DVGui::WARNING, tr("There were errors opening the existing level \"%1\".\n\nPlease choose to delete the existing level and create a new one\nwhen running the cleanup process.").arg(QString::fromStdWString(outputPath.getLevelNameW()))); + DVGui::warning(tr("There were errors opening the existing level \"%1\".\n\nPlease choose to delete the existing level and create a new one\nwhen running the cleanup process.").arg(QString::fromStdWString(outputPath.getLevelNameW()))); return false; } @@ -618,7 +618,7 @@ bool CleanupPopup::analyzeCleanupList() m_params->getOutputImageInfo(outRes, outDpi.x, outDpi.y); if (oldRes != outRes) { - DVGui::MsgBox(DVGui::WARNING, tr("The resulting resolution of level \"%1\"\ndoes not match with that of previously cleaned up level drawings.\n\nPlease set the right camera resolution and closest field, or choose to delete\nthe existing level and create a new one when running the cleanup process.").arg(QString::fromStdWString(outputPath.getLevelNameW()))); + DVGui::warning(tr("The resulting resolution of level \"%1\"\ndoes not match with that of previously cleaned up level drawings.\n\nPlease set the right camera resolution and closest field, or choose to delete\nthe existing level and create a new one when running the cleanup process.").arg(QString::fromStdWString(outputPath.getLevelNameW()))); return false; } @@ -788,7 +788,7 @@ void CleanupPopup::execute() // If there are no (more) frames to cleanup, warn and quit int framesCount = m_completion.second; if (!framesCount) { - DVGui::MsgBox(DVGui::INFORMATION, tr("It is not possible to cleanup: the cleanup list is empty.")); + DVGui::info(tr("It is not possible to cleanup: the cleanup list is empty.")); reset(); return; @@ -946,7 +946,7 @@ QString CleanupPopup::setupLevel() TIStream is(targetPalettePath); string tagName; if (!is.matchTag(tagName) || tagName != "palette") { - DVGui::MsgBox(DVGui::WARNING, QString("CleanupDefaultPalette file: This is not palette file")); + DVGui::warning(QString("CleanupDefaultPalette file: This is not palette file")); return NULL; } m_originalPalette = new TPalette(); @@ -1150,7 +1150,7 @@ void CleanupPopup::cleanupFrame() bool autocentered; ri = cl->autocenterOnly(original, false, autocentered); if (!autocentered) - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The autocentering failed on the current drawing.")); + DVGui::warning(QObject::tr("The autocentering failed on the current drawing.")); } sl->setFrame(fid, ri); @@ -1205,7 +1205,7 @@ void CleanupPopup::cleanupFrame() int autocenterType = params->m_autocenterType; if (autocenterType == CleanupTypes::AUTOCENTER_FDG && !cpi->m_autocentered) - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The autocentering failed on the current drawing.")); + DVGui::warning(QObject::tr("The autocentering failed on the current drawing.")); delete cpi; @@ -1294,7 +1294,7 @@ void CleanupPopup::onCleanupFrame() const QString &err = setupLevel(); if (!err.isEmpty()) { - MsgBox(DVGui::CRITICAL, err); + DVGui::error(err); return; } } @@ -1331,7 +1331,7 @@ void CleanupPopup::onCleanupAllFrame() const QString &err = setupLevel(); if (!err.isEmpty()) { - MsgBox(DVGui::CRITICAL, err); + DVGui::error(err); return; } } diff --git a/toonz/sources/toonz/cleanupsettingsmodel.cpp b/toonz/sources/toonz/cleanupsettingsmodel.cpp index 9f4c8ef..7860297 100644 --- a/toonz/sources/toonz/cleanupsettingsmodel.cpp +++ b/toonz/sources/toonz/cleanupsettingsmodel.cpp @@ -452,7 +452,7 @@ void CleanupSettingsModel::processFrame(TXshSimpleLevel *sl, TFrameId fid) m_cameraTestTransformed = cl->autocenterOnly(m_original.getPointer(), true, autocentered); if (params->m_autocenterType != CleanupTypes::AUTOCENTER_NONE && !autocentered) - MsgBox(DVGui::WARNING, QObject::tr("The autocentering failed on the current drawing.")); + DVGui::warning(QObject::tr("The autocentering failed on the current drawing.")); } } } diff --git a/toonz/sources/toonz/cleanupsettingspane.cpp b/toonz/sources/toonz/cleanupsettingspane.cpp index 7bafe83..6a63c90 100644 --- a/toonz/sources/toonz/cleanupsettingspane.cpp +++ b/toonz/sources/toonz/cleanupsettingspane.cpp @@ -499,7 +499,7 @@ void CleanupSettingsPane::onSaveSettings() { /*--- Clueaup保存先を指定していないとエラーを返す ---*/ if (m_pathField->getPath().isEmpty()) { - DVGui::MsgBox(DVGui::WARNING, "Please fill the Save In field."); + DVGui::warning("Please fill the Save In field."); return; } CleanupSettingsModel::instance()->promptSave(); diff --git a/toonz/sources/toonz/colormodelviewer.cpp b/toonz/sources/toonz/colormodelviewer.cpp index d9be0b5..5acd0ea 100644 --- a/toonz/sources/toonz/colormodelviewer.cpp +++ b/toonz/sources/toonz/colormodelviewer.cpp @@ -156,7 +156,7 @@ void ColorModelViewer::loadImage(const TFilePath &fp) QList list; list.append(QObject::tr("Overwrite the destination palette.")); list.append(QObject::tr("Keep the destination palette and apply it to the color model.")); - int ret = RadioButtonMsgBox(DVGui::WARNING, question, list); + int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list); if (ret == 0) return; bool replace = false; @@ -558,7 +558,7 @@ void ColorModelViewer::removeColorModel() void ColorModelViewer::onRefImageNotFound() { - MsgBox(DVGui::INFORMATION, tr("It is not possible to retrieve the color model set for the current level.")); + DVGui::info(tr("It is not possible to retrieve the color model set for the current level.")); } //============================================================================= diff --git a/toonz/sources/toonz/convertpopup.cpp b/toonz/sources/toonz/convertpopup.cpp index 835a735..0653a40 100644 --- a/toonz/sources/toonz/convertpopup.cpp +++ b/toonz/sources/toonz/convertpopup.cpp @@ -117,7 +117,7 @@ void ConvertPopup::Converter::run() if (TSystem::doesExistFileOrLevel(dstFilePath)) { if (m_parent->m_skip->isChecked()) { - DVGui::MsgBox(DVGui::INFORMATION, tr("Level %1 already exists; skipped.").arg(levelName)); + DVGui::info(tr("Level %1 already exists; skipped.").arg(levelName)); m_skippedCount++; continue; } else { @@ -168,7 +168,7 @@ void ConvertPopup::Converter::convertLevel(const TFilePath &sourceFileFullPath) popup->getFrameRange(sourceFileFullPath, from, to); if (from == TFrameId() || to == TFrameId()) { - DVGui::MsgBox(DVGui::WARNING, tr("Level %1 has no frame; skipped.").arg(levelName)); + DVGui::warning(tr("Level %1 has no frame; skipped.").arg(levelName)); popup->m_notifier->notifyError(); return; @@ -212,7 +212,7 @@ void ConvertPopup::Converter::convertLevelWithConvert2Tlv(const TFilePath &sourc string errorMessage; if (!tlvConverter->init(errorMessage)) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(errorMessage)); + DVGui::warning(QString::fromStdString(errorMessage)); tlvConverter->abort(); } else { int count = tlvConverter->getFramesToConvertCount(); @@ -220,7 +220,7 @@ void ConvertPopup::Converter::convertLevelWithConvert2Tlv(const TFilePath &sourc for (int j = 0; j < count && !stop; j++) { if (!tlvConverter->convertNext(errorMessage)) { stop = true; - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(errorMessage)); + DVGui::warning(QString::fromStdString(errorMessage)); } if (popup->m_progressDialog->wasCanceled()) stop = true; @@ -795,7 +795,7 @@ void ConvertPopup::convertToTlv(bool toPainted) Convert2Tlv *converter = makeTlvConverter(m_srcFilePaths[i]); if (TSystem::doesExistFileOrLevel(converter->m_levelOut)) { if (m_skip->isChecked()) { - MsgBox(INFORMATION, QString(tr("Level ")) + QString::fromStdWString(converter->m_levelOut.withoutParentDir().getWideString()) + QString(tr(" already exists; skipped"))); + DVGui::info(QString(tr("Level ")) + QString::fromStdWString(converter->m_levelOut.withoutParentDir().getWideString()) + QString(tr(" already exists; skipped"))); delete converter; skipped++; continue; @@ -818,7 +818,7 @@ void ConvertPopup::convertToTlv(bool toPainted) string errorMessage; if (!converters[i]->init(errorMessage)) { converters[i]->abort(); - MsgBox(CRITICAL, QString::fromStdString(errorMessage)); + DVGui::error(QString::fromStdString(errorMessage)); delete converters[i]; converters[i] = 0; skipped++; @@ -839,14 +839,14 @@ void ConvertPopup::convertToTlv(bool toPainted) converters[i] = 0; } if (errorMessage != "") - MsgBox(CRITICAL, QString::fromStdString(errorMessage)); + DVGui::error(QString::fromStdString(errorMessage)); QApplication::restoreOverrideCursor(); FileBrowser::refreshFolder(m_srcFilePaths[0].getParentDir()); TFilePath::setUnderscoreFormatAllowed(false); return; } pb.setValue(++k); - MsgBox(INFORMATION, QString(tr("Level ")) + QString::fromStdWString(m_srcFilePaths[i].withoutParentDir().getWideString()) + QString(tr(" converted to tlv."))); + DVGui::info(QString(tr("Level ")) + QString::fromStdWString(m_srcFilePaths[i].withoutParentDir().getWideString()) + QString(tr(" converted to tlv."))); } TFilePath levelOut(converters[i]->m_levelOut); delete converters[i]; @@ -860,11 +860,11 @@ void ConvertPopup::convertToTlv(bool toPainted) if (m_srcFilePaths.size() == 1) { if (skipped == 0) - MsgBox(INFORMATION, tr("Level %1 converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); + DVGui::info(tr("Level %1 converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); else - DVGui::MsgBox(DVGui::WARNING, tr("Warning: Level %1 NOT converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); + DVGui::warning(tr("Warning: Level %1 NOT converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); } else - MsgBox(skipped == 0 ? INFORMATION : WARNING, tr("Converted %1 out of %2 Levels to TLV Format").arg(QString::number(m_srcFilePaths.size() - skipped)).arg(QString::number(m_srcFilePaths.size()))); + DVGui::MsgBox(skipped == 0 ? DVGui::INFORMATION : DVGui::WARNING, tr("Converted %1 out of %2 Levels to TLV Format").arg(QString::number(m_srcFilePaths.size() - skipped)).arg(QString::number(m_srcFilePaths.size()))); FileBrowser::refreshFolder(m_srcFilePaths[0].getParentDir()); TFilePath::setUnderscoreFormatAllowed(false); @@ -914,7 +914,7 @@ TPalette *ConvertPopup::readUserProvidedPalette() const is >> palette; // note! refCount==0 } catch (...) { - DVGui::MsgBox(DVGui::WARNING, tr("Warning: Can't read palette '%1' ").arg(m_palettePath->getPath())); + DVGui::warning(tr("Warning: Can't read palette '%1' ").arg(m_palettePath->getPath())); if (palette) { delete palette; palette = 0; @@ -964,14 +964,14 @@ void ConvertPopup::getFrameRange(const TFilePath &sourceFilePath, bool ConvertPopup::checkParameters() const { if (m_srcFilePaths.size() == 1 && m_fileNameFld->text().isEmpty()) { - DVGui::MsgBox(DVGui::WARNING, tr("No output filename specified: please choose a valid level name.")); + DVGui::warning(tr("No output filename specified: please choose a valid level name.")); return false; } if (m_fileFormat->currentText() == TlvExtension) { if (m_tlvMode->currentText() == TlvMode_PaintedFromTwoImages) { if (m_unpaintedSuffix->text() == "") { - DVGui::MsgBox(DVGui::WARNING, tr("No unpainted suffix specified: cannot convert.")); + DVGui::warning(tr("No unpainted suffix specified: cannot convert.")); return false; } } @@ -1046,22 +1046,22 @@ void ConvertPopup::onConvertFinished() int skippedCount = m_converter->getSkippedCount(); if (errorCount > 0) { if (skippedCount > 0) - DVGui::MsgBox(DVGui::CRITICAL, tr("Convert completed with %1 error(s) and %2 level(s) skipped").arg(errorCount).arg(skippedCount)); + DVGui::error(tr("Convert completed with %1 error(s) and %2 level(s) skipped").arg(errorCount).arg(skippedCount)); else - DVGui::MsgBox(DVGui::CRITICAL, tr("Convert completed with %1 error(s) ").arg(errorCount)); + DVGui::error(tr("Convert completed with %1 error(s) ").arg(errorCount)); } else if (skippedCount > 0) { - DVGui::MsgBox(DVGui::WARNING, tr("%1 level(s) skipped").arg(skippedCount)); + DVGui::warning(tr("%1 level(s) skipped").arg(skippedCount)); } /* if (m_srcFilePaths.size()==1) { if (skipped==0) - MsgBox(INFORMATION, tr("Level %1 converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); + DVGui::info(tr("Level %1 converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); else - DVGui::MsgBox(DVGui::WARNING, tr("Warning: Level %1 NOT converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); + DVGui::warning(tr("Warning: Level %1 NOT converted to TLV Format").arg(QString::fromStdWString(m_srcFilePaths[0].withoutParentDir().getWideString()))); } else - MsgBox(skipped==0?INFORMATION:WARNING, tr("Converted %1 out of %2 Levels to TLV Format").arg( QString::number(m_srcFilePaths.size()-skipped)).arg(QString::number(m_srcFilePaths.size()))); + DVGui::MsgBox(skipped==0?DVGui::INFORMATION:DVGui::WARNING, tr("Converted %1 out of %2 Levels to TLV Format").arg( QString::number(m_srcFilePaths.size()-skipped)).arg(QString::number(m_srcFilePaths.size()))); */ //TFilePath parentDir = m_srcFilePaths[0].getParentDir(); diff --git a/toonz/sources/toonz/curveio.cpp b/toonz/sources/toonz/curveio.cpp index b30b945..8aee7b6 100644 --- a/toonz/sources/toonz/curveio.cpp +++ b/toonz/sources/toonz/curveio.cpp @@ -115,7 +115,7 @@ bool SaveCurvePopup::execute() getCurve()->saveData(os); return true; } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to save the curve.")); + DVGui::warning(QObject::tr("It is not possible to save the curve.")); return false; } } @@ -160,7 +160,7 @@ bool LoadCurvePopup::execute() curve->setDefaultValue(defaultValue); TUndoManager::manager()->add(undo); } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to load the curve.")); + DVGui::warning(QObject::tr("It is not possible to load the curve.")); return false; } @@ -227,7 +227,7 @@ bool ExportCurvePopup::execute() os << curve->getValue(i) << std::endl; } } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to export data.")); + DVGui::warning(QObject::tr("It is not possible to export data.")); return false; } diff --git a/toonz/sources/toonz/drawingdata.cpp b/toonz/sources/toonz/drawingdata.cpp index ec42f79..d5c4022 100644 --- a/toonz/sources/toonz/drawingdata.cpp +++ b/toonz/sources/toonz/drawingdata.cpp @@ -351,7 +351,7 @@ bool DrawingData::getLevelFrames(TXshSimpleLevel *sl, message = "NOTICE: Some styles were added from copied palette."; else message = "NOTICE: Some styles were added from original palette."; - DVGui::MsgBox(DVGui::INFORMATION, message); + DVGui::info(message); } QApplication::restoreOverrideCursor(); diff --git a/toonz/sources/toonz/dvdirtreeview.cpp b/toonz/sources/toonz/dvdirtreeview.cpp index 0f8a551..794edd3 100644 --- a/toonz/sources/toonz/dvdirtreeview.cpp +++ b/toonz/sources/toonz/dvdirtreeview.cpp @@ -392,7 +392,7 @@ void DvDirTreeView::dropEvent(QDropEvent *e) TSystem::removeFileOrLevel(srcFp); FileBrowser::refreshFolder(srcFp.getParentDir()); } else - MsgBox(CRITICAL, tr("There was an error copying %1 to %2").arg(toQString(srcFp)).arg(toQString(dstFp))); + DVGui::error(tr("There was an error copying %1 to %2").arg(toQString(srcFp)).arg(toQString(dstFp))); } } } @@ -567,7 +567,7 @@ void DvDirTreeView::deleteFolder() if (!node->isRenameEnabled()) return; TFilePath fp = node->getPath(); - int ret = MsgBox(tr("Delete folder ") + toQString(fp) + "?", tr("Yes"), tr("No"), 1); + int ret = DVGui::MsgBox(tr("Delete folder ") + toQString(fp) + "?", tr("Yes"), tr("No"), 1); if (ret == 2 || ret == 0) return; @@ -575,7 +575,7 @@ void DvDirTreeView::deleteFolder() TSystem::rmDir(fp); IconGenerator::instance()->remove(fp); } catch (...) { - MsgBox(CRITICAL, tr("It is not possible to delete the folder.") + toQString(fp)); + DVGui::error(tr("It is not possible to delete the folder.") + toQString(fp)); return; } @@ -617,7 +617,7 @@ void DvDirTreeView::updateVersionControl(DvDirVersionControlNode *node) if (rootNode) { QString localPath = QString::fromStdWString(rootNode->getLocalPath()); if (!QFile::exists(localPath)) { - DVGui::MsgBox(DVGui::WARNING, tr("The local path does not exist:") + " " + localPath); + DVGui::warning(tr("The local path does not exist:") + " " + localPath); return; } @@ -1164,7 +1164,7 @@ void DvDirTreeView::onCheckOutError(const QString &text) setRefreshVersionControlEnabled(true); - MsgBox(CRITICAL, tr("Refresh operation failed:\n") + text); + DVGui::error(tr("Refresh operation failed:\n") + text); } //----------------------------------------------------------------------------- @@ -1297,7 +1297,7 @@ void DvDirTreeView::onRefreshStatusError(const QString &text) return; m_currentRefreshedNode->restoreName(); setRefreshVersionControlEnabled(true); - MsgBox(CRITICAL, tr("Refresh operation failed:\n") + text); + DVGui::error(tr("Refresh operation failed:\n") + text); } //----------------------------------------------------------------------------- @@ -1327,7 +1327,7 @@ void DvDirTreeView::onCheckPartialLockError(const QString &text) m_thread.disconnect(SIGNAL(done(const QString &))); m_thread.disconnect(SIGNAL(error(const QString &))); setRefreshVersionControlEnabled(true); - MsgBox(CRITICAL, tr("Refresh operation failed:\n") + text); + DVGui::error(tr("Refresh operation failed:\n") + text); } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonz/exportlevelcommand.cpp b/toonz/sources/toonz/exportlevelcommand.cpp index 06faa25..841c4ee 100644 --- a/toonz/sources/toonz/exportlevelcommand.cpp +++ b/toonz/sources/toonz/exportlevelcommand.cpp @@ -65,7 +65,7 @@ struct BusyCursorOverride { struct ExportOverwriteCB : public IoCmd::OverwriteCallbacks { bool overwriteRequest(const TFilePath &fp) { - int ret = MsgBox(QObject::tr("Warning: file %1 already exists.").arg(toQString(fp)), + int ret = DVGui::MsgBox(QObject::tr("Warning: file %1 already exists.").arg(toQString(fp)), QObject::tr("Continue Exporting"), QObject::tr("Stop Exporting"), 1); return (ret == 1); } @@ -530,7 +530,7 @@ bool IoCmd::exportLevel(const TFilePath &path, TXshSimpleLevel *sl, sl = TApp::instance()->getCurrentLevel()->getSimpleLevel(); if (!sl) { - MsgBox(CRITICAL, QObject::tr("No level selected!")); + DVGui::error(QObject::tr("No level selected!")); return false; } } diff --git a/toonz/sources/toonz/exportlevelpopup.cpp b/toonz/sources/toonz/exportlevelpopup.cpp index 47bbf74..71a7706 100644 --- a/toonz/sources/toonz/exportlevelpopup.cpp +++ b/toonz/sources/toonz/exportlevelpopup.cpp @@ -647,7 +647,7 @@ bool ExportLevelPopup::execute() return ret; } else { if (!isValidFileName(QString::fromStdString(fp.getName()))) { - DVGui::MsgBox(DVGui::CRITICAL, tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); + DVGui::error(tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); return false; } diff --git a/toonz/sources/toonz/exportpanel.cpp b/toonz/sources/toonz/exportpanel.cpp index 024f0fb..670e8b6 100644 --- a/toonz/sources/toonz/exportpanel.cpp +++ b/toonz/sources/toonz/exportpanel.cpp @@ -246,12 +246,12 @@ void RenderController::generateMovie(TFilePath outPath, bool emitSignal) else msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(fp.getWideString())); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); return; } catch (...) { QString msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(fp.getWideString())); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); return; } @@ -292,7 +292,7 @@ void RenderController::generateMovie(TFilePath outPath, bool emitSignal) movieGenerator.addSoundtrack(scene, frameOffset, sceneFrames); } catch (const TException&) { QString text = tr("The %1 scene contains an audio file with different characteristics from the one used in the first exported scene.\nThe audio file will not be included in the rendered clip.").arg(QString::fromStdWString(fp.getLevelNameW())); - DVGui::MsgBox(DVGui::WARNING, text); + DVGui::warning(text); } } @@ -315,7 +315,7 @@ void RenderController::generateMovie(TFilePath outPath, bool emitSignal) if (!TSystem::showDocument(outPath)) { QString msg(QObject::tr("It is not possible to display the file %1: no player associated with its format").arg(QString::fromStdWString(outPath.withoutParentDir().getWideString()))); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); } } else { int r0 = 1, r1 = totalFrameCount, step = 1; diff --git a/toonz/sources/toonz/exportscenepopup.cpp b/toonz/sources/toonz/exportscenepopup.cpp index 7192938..936b981 100644 --- a/toonz/sources/toonz/exportscenepopup.cpp +++ b/toonz/sources/toonz/exportscenepopup.cpp @@ -43,16 +43,16 @@ TFilePath importScene(TFilePath scenePath) try { ret = IoCmd::loadScene(scene, scenePath, true); } catch (TException &e) { - MsgBox(CRITICAL, QObject::tr("Error loading scene %1 :%2").arg(toQString(scenePath)).arg(QString::fromStdWString(e.getMessage()))); + DVGui::error(QObject::tr("Error loading scene %1 :%2").arg(toQString(scenePath)).arg(QString::fromStdWString(e.getMessage()))); return TFilePath(); } catch (...) { - MsgBox(CRITICAL, QObject::tr("Error loading scene %1").arg(toQString(scenePath))); + DVGui::error(QObject::tr("Error loading scene %1").arg(toQString(scenePath))); return TFilePath(); } if (!ret) { - MsgBox(CRITICAL, QObject::tr("It is not possible to export the scene %1 because it does not belong to any project.").arg(toQString(scenePath))); + DVGui::error(QObject::tr("It is not possible to export the scene %1 because it does not belong to any project.").arg(toQString(scenePath))); return TFilePath(); } @@ -613,7 +613,7 @@ void ExportScenePopup::onExport() DvDirModelFileFolderNode *node = (DvDirModelFileFolderNode *)m_projectTreeView->getCurrentNode(); if (!node || !pm->isProject(node->getPath())) { QApplication::restoreOverrideCursor(); - DVGui::MsgBox(DVGui::WARNING, tr("The folder you selected is not a project.")); + DVGui::warning(tr("The folder you selected is not a project.")); return; } projectPath = pm->projectFolderToProjectPath(node->getPath()); @@ -639,7 +639,7 @@ void ExportScenePopup::onExport() pm->setCurrentProjectPath(oldProjectPath); if (newScenes.empty()) { QApplication::restoreOverrideCursor(); - DVGui::MsgBox(DVGui::WARNING, tr("There was an error exporting the scene.")); + DVGui::warning(tr("There was an error exporting the scene.")); return; } for (i = 0; i < newScenes.size(); i++) @@ -656,17 +656,17 @@ TFilePath ExportScenePopup::createNewProject() TProjectManager *pm = TProjectManager::instance(); TFilePath projectName(m_newProjectName->text().toStdWString()); if (projectName == TFilePath()) { - DVGui::MsgBox(DVGui::WARNING, tr("The project name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); + DVGui::warning(tr("The project name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); return TFilePath(); } if (projectName.isAbsolute()) { // bad project name - DVGui::MsgBox(DVGui::WARNING, tr("The project name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); + DVGui::warning(tr("The project name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); return TFilePath(); } if (pm->getProjectPathByName(projectName) != TFilePath()) { // project already exists - DVGui::MsgBox(DVGui::WARNING, tr("The project name you specified is already used.")); + DVGui::warning(tr("The project name you specified is already used.")); return TFilePath(); } diff --git a/toonz/sources/toonz/filebrowser.cpp b/toonz/sources/toonz/filebrowser.cpp index 0cda4ee..49276ed 100644 --- a/toonz/sources/toonz/filebrowser.cpp +++ b/toonz/sources/toonz/filebrowser.cpp @@ -1012,14 +1012,14 @@ bool FileBrowser::renameFile(TFilePath &fp, QString newName) TFilePath newFp(newName.toStdWString()); if (newFp.getType() != "" && newFp.getType() != fp.getType()) { - MsgBox(CRITICAL, tr("Can't change file extension")); + DVGui::error(tr("Can't change file extension")); return false; } if (newFp.getType() == "") newFp = newFp.withType(fp.getType()); if (newFp.getFrame() != TFrameId::EMPTY_FRAME && newFp.getFrame() != TFrameId::NO_FRAME) { - MsgBox(CRITICAL, tr("Can't set a drawing number")); + DVGui::error(tr("Can't set a drawing number")); return false; } if (newFp.getDots() != fp.getDots()) { @@ -1035,7 +1035,7 @@ bool FileBrowser::renameFile(TFilePath &fp, QString newName) return false; if (TSystem::doesExistFileOrLevel(newFp)) { - MsgBox(CRITICAL, tr("Can't rename. File already exists: ") + toQString(newFp)); + DVGui::error(tr("Can't rename. File already exists: ") + toQString(newFp)); return false; } @@ -1057,7 +1057,7 @@ bool FileBrowser::renameFile(TFilePath &fp, QString newName) } } catch (...) { - MsgBox(CRITICAL, tr("Couldn't rename ") + toQString(fp) + " to " + toQString(newFp)); + DVGui::error(tr("Couldn't rename ") + toQString(fp) + " to " + toQString(newFp)); return false; } @@ -1496,7 +1496,7 @@ bool FileBrowser::drop(const QMimeData *mimeData) folderPath += TFilePath(levelName + toWideString(sl->getPath().getDottedType())); if (TSystem::doesExistFileOrLevel(folderPath)) { QString question = "Level " + toQString(folderPath) + " already exists\nDo you want to duplicate it?"; - int ret = MsgBox(question, QObject::tr("Duplicate"), QObject::tr("Don't Duplicate"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Duplicate"), QObject::tr("Don't Duplicate"), 0); if (ret == 2 || ret == 0) return false; TFilePath path = folderPath; @@ -1529,7 +1529,7 @@ bool FileBrowser::drop(const QMimeData *mimeData) TFilePath dstFp = srcFp.withParentDir(folderPath); if (dstFp != srcFp) { if (!TSystem::copyFileOrLevel(dstFp, srcFp)) - MsgBox(CRITICAL, tr("There was an error copying %1 to %2").arg(toQString(srcFp)).arg(toQString(dstFp))); + DVGui::error(tr("There was an error copying %1 to %2").arg(toQString(srcFp)).arg(toQString(dstFp))); } } refreshFolder(folderPath); @@ -1563,7 +1563,7 @@ void FileBrowser::loadResources() void RenameAsToonzPopup::onOk() { if (!isValidFileName(m_name->text())) { - MsgBox(CRITICAL, tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); + DVGui::error(tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); return; } accept(); @@ -1730,7 +1730,7 @@ void renameSingleFileOrToonzLevel(const QString &fullpath) string name = popup.getName().toStdString(); if (name == fpin.getName()) { - MsgBox(CRITICAL, QString(QObject::tr("The specified name is already assigned to the %1 file.").arg(fullpath))); + DVGui::error(QString(QObject::tr("The specified name is already assigned to the %1 file.").arg(fullpath))); return; } @@ -1772,7 +1772,7 @@ void doRenameAsToonzLevel(const QString &fullpath) TFilePath levelOut(levelOutStr.toStdWString()); if (TSystem::doesExistFileOrLevel(levelOut)) { QApplication::restoreOverrideCursor(); - int ret = MsgBox(QObject::tr("Warning: level %1 already exists; overwrite?").arg(toQString(levelOut)), QObject::tr("Yes"), QObject::tr("No"), 1); + int ret = DVGui::MsgBox(QObject::tr("Warning: level %1 already exists; overwrite?").arg(toQString(levelOut)), QObject::tr("Yes"), QObject::tr("No"), 1); QApplication::setOverrideCursor(Qt::WaitCursor); if (ret == 2 || ret == 0) return; @@ -1789,12 +1789,12 @@ void doRenameAsToonzLevel(const QString &fullpath) if (popup.doOverwrite()) { if (!QFile::rename(parentPath + "/" + pathIn[i], pathOut)) { QString tmp(parentPath + "/" + pathIn[i]); - MsgBox(CRITICAL, QString(QObject::tr("It is not possible to rename the %1 file.").arg(tmp))); + DVGui::error(QString(QObject::tr("It is not possible to rename the %1 file.").arg(tmp))); return; } } else if (!QFile::copy(parentPath + "/" + pathIn[i], pathOut)) { QString tmp(parentPath + "/" + pathIn[i]); - MsgBox(CRITICAL, QString(QObject::tr("It is not possible to copy the %1 file.").arg(tmp))); + DVGui::error(QString(QObject::tr("It is not possible to copy the %1 file.").arg(tmp))); return; } @@ -1849,7 +1849,7 @@ void FileBrowser::convertToUnpaintedTlv() if (TSystem::doesExistFileOrLevel(converter->m_levelOut)) { QApplication::restoreOverrideCursor(); - int ret = MsgBox(tr("Warning: level %1 already exists; overwrite?").arg(toQString(converter->m_levelOut)), tr("Yes"), tr("No"), 1); + int ret = DVGui::MsgBox(tr("Warning: level %1 already exists; overwrite?").arg(toQString(converter->m_levelOut)), tr("Yes"), tr("No"), 1); QApplication::setOverrideCursor(Qt::WaitCursor); if (ret == 2 || ret == 0) { delete converter; @@ -1873,7 +1873,7 @@ void FileBrowser::convertToUnpaintedTlv() string errorMessage; if (!converters[i]->init(errorMessage)) { converters[i]->abort(); - MsgBox(CRITICAL, QString::fromStdString(errorMessage)); + DVGui::error(QString::fromStdString(errorMessage)); delete converters[i]; converters[i] = 0; continue; @@ -1893,7 +1893,7 @@ void FileBrowser::convertToUnpaintedTlv() converters[i] = 0; } if (errorMessage != "") - MsgBox(CRITICAL, QString::fromStdString(errorMessage)); + DVGui::error(QString::fromStdString(errorMessage)); QApplication::restoreOverrideCursor(); FileBrowser::refreshFolder(filePaths[0].getParentDir()); return; @@ -1909,7 +1909,7 @@ void FileBrowser::convertToUnpaintedTlv() QApplication::restoreOverrideCursor(); pb.hide(); - MsgBox(INFORMATION, tr("Done: All Levels converted to TLV Format")); + DVGui::info(tr("Done: All Levels converted to TLV Format")); FileBrowser::refreshFolder(filePaths[0].getParentDir()); } @@ -1941,7 +1941,7 @@ void FileBrowser::convertToPaintedTlv() if (TSystem::doesExistFileOrLevel(converter->m_levelOut)) { QApplication::restoreOverrideCursor(); - int ret = MsgBox(tr("Warning: level %1 already exists; overwrite?").arg(toQString(converter->m_levelOut)), tr("Yes"), tr("No"), 1); + int ret = DVGui::MsgBox(tr("Warning: level %1 already exists; overwrite?").arg(toQString(converter->m_levelOut)), tr("Yes"), tr("No"), 1); QApplication::setOverrideCursor(Qt::WaitCursor); if (ret == 2 || ret == 0) { QApplication::restoreOverrideCursor(); @@ -1954,7 +1954,7 @@ void FileBrowser::convertToPaintedTlv() if (!converter->init(errorMessage)) { converter->abort(); delete converter; - MsgBox(CRITICAL, QString::fromStdString(errorMessage)); + DVGui::error(QString::fromStdString(errorMessage)); QApplication::restoreOverrideCursor(); return; } @@ -1969,7 +1969,7 @@ void FileBrowser::convertToPaintedTlv() converter->abort(); delete converter; if (errorMessage != "") - MsgBox(CRITICAL, QString::fromStdString(errorMessage)); + DVGui::error(QString::fromStdString(errorMessage)); QApplication::restoreOverrideCursor(); FileBrowser::refreshFolder(filePaths[0].getParentDir()); return; @@ -1984,7 +1984,7 @@ void FileBrowser::convertToPaintedTlv() QApplication::restoreOverrideCursor(); pb.hide(); - MsgBox(INFORMATION, tr("Done: 2 Levels converted to TLV Format")); + DVGui::info(tr("Done: 2 Levels converted to TLV Format")); fs->selectNone(); FileBrowser::refreshFolder(filePaths[0].getParentDir()); @@ -2125,7 +2125,7 @@ void FileBrowser::newFolder() TSystem::mkDir(folderPath); } catch (...) { - MsgBox(CRITICAL, tr("It is not possible to create the %1 folder.").arg(toQString(folderPath))); + DVGui::error(tr("It is not possible to create the %1 folder.").arg(toQString(folderPath))); return; } diff --git a/toonz/sources/toonz/filebrowserpopup.cpp b/toonz/sources/toonz/filebrowserpopup.cpp index f579c3b..54e2e33 100644 --- a/toonz/sources/toonz/filebrowserpopup.cpp +++ b/toonz/sources/toonz/filebrowserpopup.cpp @@ -232,7 +232,7 @@ void FileBrowserPopup::onOkPressed() // history // That means, TFilePath() represents if (*pt == TFilePath() || !pt->isAbsolute()) // the History folder? Really? That's lame... { - DVGui::MsgBox(DVGui::CRITICAL, tr("Invalid file")); + DVGui::error(tr("Invalid file")); return; } } else { @@ -276,7 +276,7 @@ void FileBrowserPopup::onApplyPressed() if (folder == TFilePath()) { // history if (*it == TFilePath() || !it->isAbsolute()) { - DVGui::MsgBox(DVGui::CRITICAL, tr("Invalid file")); + DVGui::error(tr("Invalid file")); return; } } else { @@ -467,12 +467,12 @@ bool LoadScenePopup::execute() const TFilePath &fp = *m_selectedPaths.begin(); if (fp.getType() != "tnz") { - DVGui::MsgBox(DVGui::CRITICAL, toQString(fp) + tr(" is not a scene file.")); + DVGui::error(toQString(fp) + tr(" is not a scene file.")); return false; } if (!TFileStatus(fp).doesExist()) { - DVGui::MsgBox(DVGui::CRITICAL, toQString(fp) + tr(" does not exist.")); + DVGui::error(toQString(fp) + tr(" does not exist.")); return false; } @@ -523,12 +523,12 @@ bool LoadSubScenePopup::execute() const TFilePath &fp = *m_selectedPaths.begin(); if (fp.getType() != "tnz") { - DVGui::MsgBox(DVGui::CRITICAL, toQString(fp) + tr(" is not a scene file.")); + DVGui::error(toQString(fp) + tr(" is not a scene file.")); return false; } if (!TFileStatus(fp).doesExist()) { - DVGui::MsgBox(DVGui::CRITICAL, toQString(fp) + tr(" does not exist.")); + DVGui::error(toQString(fp) + tr(" does not exist.")); return false; } @@ -1512,7 +1512,7 @@ void ReplaceLevelPopup::show() TCellSelection *cellSel = dynamic_cast(sel); TColumnSelection *columnSel = dynamic_cast(sel); if ((!cellSel && !columnSel) || sel->isEmpty()) { - DVGui::MsgBox(DVGui::CRITICAL, tr("Nothing to replace: no cells selected.")); + DVGui::error(tr("Nothing to replace: no cells selected.")); return; } @@ -1631,7 +1631,7 @@ bool SavePaletteAsPopup::execute() TPalette *palette = paletteHandle->getPalette(); if (!palette) { - DVGui::MsgBox(DVGui::WARNING, "No current palette exists"); + DVGui::warning("No current palette exists"); return true; } @@ -1776,7 +1776,7 @@ bool LoadColorModelPopup::execute() QList list; list.append(QObject::tr("Overwrite the destination palette.")); list.append(QObject::tr("Keep the destination palette and apply it to the color model.")); - int ret = RadioButtonMsgBox(DVGui::WARNING, question, list); + int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list); if (ret == 0) return false; if (ret == 2) @@ -1847,7 +1847,7 @@ void ReplaceParentDirectoryPopup::show() TCellSelection *cellSel = dynamic_cast(sel); TColumnSelection *columnSel = dynamic_cast(sel); if ((!cellSel && !columnSel) || sel->isEmpty()) { - DVGui::MsgBox(DVGui::CRITICAL, tr("Nothing to replace: no cells or columns selected.")); + DVGui::error(tr("Nothing to replace: no cells or columns selected.")); return; } if (cellSel) { @@ -1970,7 +1970,7 @@ bool ImportMagpieFilePopup::execute() const TFilePath &fp = *m_selectedPaths.begin(); if (!TSystem::doesExistFileOrLevel(fp)) { - DVGui::MsgBox(DVGui::CRITICAL, tr("%1 does not exist.").arg(toQString(fp))); + DVGui::error(tr("%1 does not exist.").arg(toQString(fp))); return false; } @@ -2015,7 +2015,7 @@ bool BrowserPopup::execute() if (!TSystem::doesExistFileOrLevel(fp)) { const QString &msg = tr("Path %1 doesn't exists.").arg(toQString(fp)); - MsgBox(DVGui::INFORMATION, msg); + DVGui::info(msg); return false; } diff --git a/toonz/sources/toonz/filebrowserversioncontrol.cpp b/toonz/sources/toonz/filebrowserversioncontrol.cpp index 41a4138..2e4b4a6 100644 --- a/toonz/sources/toonz/filebrowserversioncontrol.cpp +++ b/toonz/sources/toonz/filebrowserversioncontrol.cpp @@ -181,7 +181,7 @@ void FileBrowser::editVersionControl() } if (hasCurrentSceneFile) { - DVGui::MsgBox(DVGui::WARNING, tr("Some files that you want to edit are currently opened. Close them first.")); + DVGui::warning(tr("Some files that you want to edit are currently opened. Close them first.")); return; } @@ -404,7 +404,7 @@ void FileBrowser::unlockVersionControl() } if (hasCurrentSceneFile) { - DVGui::MsgBox(DVGui::WARNING, tr("Some files that you want to unlock are currently opened. Close them first.")); + DVGui::warning(tr("Some files that you want to unlock are currently opened. Close them first.")); return; } vc->unlock(this, path, files, sceneIconsCount); diff --git a/toonz/sources/toonz/filedata.cpp b/toonz/sources/toonz/filedata.cpp index 2e65436..446e63a 100644 --- a/toonz/sources/toonz/filedata.cpp +++ b/toonz/sources/toonz/filedata.cpp @@ -51,7 +51,7 @@ void FileData::getFiles(TFilePath folder, std::vector &newFiles) cons TFilePath path = folder + TFilePath(oldPath.getLevelNameW()); if (!TSystem::doesExistFileOrLevel(oldPath)) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to find the %1 level.").arg(QString::fromStdWString(oldPath.getWideString()))); + DVGui::warning(tr("It is not possible to find the %1 level.").arg(QString::fromStdWString(oldPath.getWideString()))); return; } @@ -67,7 +67,7 @@ void FileData::getFiles(TFilePath folder, std::vector &newFiles) cons newFiles.push_back(levelPathOut); else { QString msg = tr("There was an error copying %1").arg(toQString(oldPath)); - MsgBox(CRITICAL, msg); + DVGui::error(msg); return; } } diff --git a/toonz/sources/toonz/fileselection.cpp b/toonz/sources/toonz/fileselection.cpp index 68bc730..c4ee83a 100644 --- a/toonz/sources/toonz/fileselection.cpp +++ b/toonz/sources/toonz/fileselection.cpp @@ -289,7 +289,7 @@ void FileSelection::addToBatchRenderList() for (i = 0; i < files.size(); i++) BatchesController::instance()->addComposerTask(files[i]); - MsgBox(INFORMATION, QObject::tr(" Task added to the Batch Render List.")); + DVGui::info(QObject::tr(" Task added to the Batch Render List.")); #endif #endif } @@ -305,7 +305,7 @@ void FileSelection::addToBatchCleanupList() for (i = 0; i < files.size(); i++) BatchesController::instance()->addCleanupTask(files[i]); - MsgBox(INFORMATION, QObject::tr(" Task added to the Batch Cleanup List.")); + DVGui::info(QObject::tr(" Task added to the Batch Cleanup List.")); #endif } @@ -325,7 +325,7 @@ void FileSelection::deleteFiles() } else { question = QObject::tr("Deleting %n files. Are you sure?", "", (int)files.size()); } - int ret = MsgBox(question, QObject::tr("Delete"), QObject::tr("Cancel"), 1); + int ret = DVGui::MsgBox(question, QObject::tr("Delete"), QObject::tr("Cancel"), 1); if (ret == 2 || ret == 0) return; @@ -456,7 +456,7 @@ void FileSelection::convertFiles() static ConvertPopup *popup = new ConvertPopup(false); if (popup->isConverting()) { - DVGui::MsgBox(INFORMATION, QObject::tr("A convertion task is in progress! wait until it stops or cancel it")); + DVGui::info(QObject::tr("A convertion task is in progress! wait until it stops or cancel it")); return; } popup->setFiles(files); @@ -468,7 +468,7 @@ void FileSelection::convertFiles() void FileSelection::premultiplyFiles() { QString question = QObject::tr("You are going to premultiply selected files.\nThe operation cannot be undone: are you sure?"); - int ret = MsgBox(question, QObject::tr("Premultiply"), QObject::tr("Cancel"), 1); + int ret = DVGui::MsgBox(question, QObject::tr("Premultiply"), QObject::tr("Cancel"), 1); if (ret == 2 || ret == 0) return; @@ -545,11 +545,11 @@ void FileSelection::collectAssets() collectedAssets = ::collectAssets(files[0]); } if (collectedAssets == 0) - DVGui::MsgBox(INFORMATION, QObject::tr("There are no assets to collect")); + DVGui::info(QObject::tr("There are no assets to collect")); else if (collectedAssets == 1) - DVGui::MsgBox(INFORMATION, QObject::tr("One asset imported")); + DVGui::info(QObject::tr("One asset imported")); else - DVGui::MsgBox(INFORMATION, QObject::tr("%1 assets imported").arg(collectedAssets)); + DVGui::info(QObject::tr("%1 assets imported").arg(collectedAssets)); DvDirModel::instance()->refreshFolder(TProjectManager::instance()->getCurrentProjectPath().getParentDir()); } @@ -562,18 +562,18 @@ int importScene(TFilePath scenePath) try { IoCmd::loadScene(scene, scenePath, true); } catch (TException &e) { - MsgBox(CRITICAL, QObject::tr("Error loading scene %1 :%2").arg(toQString(scenePath)).arg(QString::fromStdWString(e.getMessage()))); + DVGui::error(QObject::tr("Error loading scene %1 :%2").arg(toQString(scenePath)).arg(QString::fromStdWString(e.getMessage()))); return 0; } catch (...) { // TNotifier::instance()->notify(TGlobalChange(true)); - MsgBox(CRITICAL, QObject::tr("Error loading scene %1").arg(toQString(scenePath))); + DVGui::error(QObject::tr("Error loading scene %1").arg(toQString(scenePath))); return 0; } try { scene.save(scene.getScenePath()); } catch (TException&) { - MsgBox(CRITICAL, QObject::tr("There was an error saving the %1 scene.").arg(toQString(scenePath))); + DVGui::error(QObject::tr("There was an error saving the %1 scene.").arg(toQString(scenePath))); return 0; } @@ -618,11 +618,11 @@ void FileSelection::importScenes() importedSceneCount += ret; } if (importedSceneCount == 0) - DVGui::MsgBox(INFORMATION, QObject::tr("No scene imported")); + DVGui::info(QObject::tr("No scene imported")); else if (importedSceneCount == 1) - DVGui::MsgBox(INFORMATION, QObject::tr("One scene imported")); + DVGui::info(QObject::tr("One scene imported")); else - DVGui::MsgBox(INFORMATION, QString::number(importedSceneCount) + QObject::tr("%1 scenes imported").arg(importedSceneCount)); + DVGui::info(QString::number(importedSceneCount) + QObject::tr("%1 scenes imported").arg(importedSceneCount)); #endif } //------------------------------------------------------------------------ diff --git a/toonz/sources/toonz/flipbook.cpp b/toonz/sources/toonz/flipbook.cpp index cb7d7c0..0c9c5ec 100644 --- a/toonz/sources/toonz/flipbook.cpp +++ b/toonz/sources/toonz/flipbook.cpp @@ -321,7 +321,7 @@ public: } break; case eEnd: { - MsgBox(DVGui::INFORMATION, m_str); + DVGui::info(m_str); delete Pd; Pd = 0; } break; @@ -616,7 +616,7 @@ bool FlipBook::doSaveImages(TFilePath fp) TDimension res = scene->getCurrentCamera()->getRes(); if (!AviCodecRestrictions::canWriteMovie(toWideString(codecName), res)) { QString msg(QObject::tr("The resolution of the output camera does not fit with the options chosen for the output file format.")); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); return false; } } @@ -627,12 +627,12 @@ bool FlipBook::doSaveImages(TFilePath fp) fp = fp.withType(ext); } if (fp.getName() == "") { - DVGui::MsgBox(DVGui::WARNING, tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); + DVGui::warning(tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); return false; } if (!formats.contains(QString::fromStdString(ext))) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to save because the selected file format is not supported.")); + DVGui::warning(tr("It is not possible to save because the selected file format is not supported.")); return false; } @@ -758,10 +758,10 @@ void FlipBook::onButtonPressed(FlipConsole::EGadget button) TImageP img = getCurrentImage(m_flipConsole->getCurrentFrame()); m_loadbox = loadbox; if (!img) { - DVGui::MsgBox(DVGui::WARNING, tr("There are no rendered images to save.")); + DVGui::warning(tr("There are no rendered images to save.")); return; } else if ((TVectorImageP)img) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to take or compare snapshots for Toonz vector levels.")); + DVGui::warning(tr("It is not possible to take or compare snapshots for Toonz vector levels.")); return; } TRasterImageP ri(img); @@ -775,7 +775,7 @@ void FlipBook::onButtonPressed(FlipConsole::EGadget button) } CASE FlipConsole::eCompare : if ((TVectorImageP)getCurrentImage(m_flipConsole->getCurrentFrame())) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to take or compare snapshots for Toonz vector levels.")); + DVGui::warning(tr("It is not possible to take or compare snapshots for Toonz vector levels.")); m_flipConsole->setChecked(FlipConsole::eCompare, false); return; } @@ -2194,7 +2194,7 @@ void viewFile(const TFilePath &path, int from, int to, int step, int shrink, path.getType() == "avi" || path.getType() == "3gp") && path.isLevelName()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("%1 has an invalid extension format.") + DVGui::warning(QObject::tr("%1 has an invalid extension format.") .arg(QString::fromStdString(path.getLevelName()))); return; } diff --git a/toonz/sources/toonz/insertfxpopup.cpp b/toonz/sources/toonz/insertfxpopup.cpp index 104d244..9ae2b44 100644 --- a/toonz/sources/toonz/insertfxpopup.cpp +++ b/toonz/sources/toonz/insertfxpopup.cpp @@ -543,7 +543,7 @@ void InsertFxPopup::removePreset() TFilePath path = TFilePath(itemRole.toStdWString()); QString question = QString(tr("Are you sure you want to delete %1?").arg(path.getName().c_str())); - int ret = MsgBox(question, tr("Yes"), tr("No"), 1); + int ret = DVGui::MsgBox(question, tr("Yes"), tr("No"), 1); if (ret == 2 || ret == 0) return; diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp index 2e701be..eade44a 100644 --- a/toonz/sources/toonz/iocommand.cpp +++ b/toonz/sources/toonz/iocommand.cpp @@ -1228,7 +1228,7 @@ bool IoCmd::saveSceneIfNeeded(QString msg) question = QObject::tr("%1: the current scene has been modified.\n" "Do you want to save your changes?") .arg(msg); - int ret = MsgBox(question, QObject::tr("Save"), QObject::tr("Discard"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Save"), QObject::tr("Discard"), QObject::tr("Cancel"), 0); if (ret == 0 || ret == 3) { // cancel (or closed message box window) return false; @@ -1261,7 +1261,7 @@ bool IoCmd::saveSceneIfNeeded(QString msg) } question += QObject::tr("\nAre you sure to ") + msg + QObject::tr(" anyway ?"); - int ret = MsgBox(question, QObject::tr("OK"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("OK"), QObject::tr("Cancel"), 0); if (ret == 0 || ret == 2) { // cancel (or closed message box window) return false; @@ -1275,7 +1275,7 @@ bool IoCmd::saveSceneIfNeeded(QString msg) //--- If both the level and scene is clean, then open the quit confirmation dialog if (!isLevelOrSceneIsDirty && msg == "Quit") { QString question("Are you sure ?"); - int ret = MsgBox(question, QObject::tr("OK"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("OK"), QObject::tr("Cancel"), 0); if (ret == 0 || ret == 2) { // cancel (or closed message box window) return false; @@ -1415,7 +1415,7 @@ bool IoCmd::saveScene(const TFilePath &path, int flags) QString question; question = QObject::tr("The scene %1 already exists.\nDo you want to overwrite it?").arg(QString::fromStdString(scenePath.getName())); - int ret = MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return false; } @@ -1448,9 +1448,9 @@ bool IoCmd::saveScene(const TFilePath &path, int flags) scene->save(scenePath, xsheet); TApp::instance()->getPaletteController()->getCurrentLevelPalette()->notifyPaletteChanged(); //non toglieva l'asterisco alla paletta...forse non va qua? vinz } catch (const TSystemException &se) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(se.getMessage())); + DVGui::warning(QString::fromStdWString(se.getMessage())); } catch (...) { - MsgBox(CRITICAL, QObject::tr("Couldn't save %1").arg(toQString(scenePath))); + DVGui::error(QObject::tr("Couldn't save %1").arg(toQString(scenePath))); } cp->assign(&oldCP); @@ -1589,7 +1589,7 @@ bool IoCmd::saveLevel(const TFilePath &fp, TXshSimpleLevel *sl, bool overwrite) if (!overwrite && fileDoesExist) { QString question; question = QObject::tr("The level %1 already exists.\nDo you want to overwrite it?").arg(toQString(fp)); - int ret = MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return false; } @@ -1608,7 +1608,7 @@ bool IoCmd::saveLevel(const TFilePath &fp, TXshSimpleLevel *sl, bool overwrite) { QString question; question = "Palette " + QString::fromStdWString(sl->getPalette()->getPaletteName()) + ".tpl has been modified. Do you want to overwrite palette as well ?"; - int ret = MsgBox(question, + int ret = DVGui::MsgBox(question, QObject::tr("Overwrite Palette") /*ret = 1*/, QObject::tr("Don't Overwrite Palette") /*ret = 2*/, 0); if (ret == 1) overwritePalette = true; @@ -1620,11 +1620,11 @@ bool IoCmd::saveLevel(const TFilePath &fp, TXshSimpleLevel *sl, bool overwrite) sl->save(fp, TFilePath(), overwritePalette); } catch (TSystemException se) { QApplication::restoreOverrideCursor(); - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(se.getMessage())); + DVGui::warning(QString::fromStdWString(se.getMessage())); return false; } catch (...) { QApplication::restoreOverrideCursor(); - MsgBox(CRITICAL, QObject::tr("Couldn't save %1").arg(toQString(fp))); + DVGui::error(QObject::tr("Couldn't save %1").arg(toQString(fp))); return false; } IconGenerator::instance()->invalidate(fp); @@ -1667,14 +1667,14 @@ bool IoCmd::saveSound(const TFilePath &fp, TXshSoundLevel *sl, bool overwrite) if (!overwrite && TSystem::doesExistFileOrLevel(fp)) { QString question; question = QObject::tr("The soundtrack %1 already exists.\nDo you want to overwrite it?").arg(toQString(fp)); - int ret = MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return false; } try { sl->save(fp); } catch (...) { - MsgBox(CRITICAL, QObject::tr("Couldn't save %1").arg(toQString(fp))); + DVGui::error(QObject::tr("Couldn't save %1").arg(toQString(fp))); return false; } QApplication::setOverrideCursor(Qt::WaitCursor); @@ -1732,7 +1732,7 @@ bool IoCmd::loadColorModel(const TFilePath &fp, int frame) list.append(QObject::tr("Overwrite the destination palette.")); list.append(QObject::tr("Keep the destination palette and apply it to the color model.")); - int ret = RadioButtonMsgBox(DVGui::WARNING, question, list); + int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list); if (ret == 0) return false; @@ -1807,7 +1807,7 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile, bool checkSa if (scenePath.getType() != "tnz") { QString msg; msg = QObject::tr("File %1 doesn't look like a TOONZ Scene").arg(QString::fromStdWString(scenePath.getWideString())); - MsgBox(CRITICAL, msg); + DVGui::error(msg); return false; } if (!TSystem::doesExistFileOrLevel(scenePath)) @@ -1818,7 +1818,7 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile, bool checkSa if (!sceneProject) { QString msg; msg = QObject::tr("It is not possible to load the scene %1 because it does not belong to any project.").arg(QString::fromStdWString(scenePath.getWideString())); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); } if (sceneProject && !sceneProject->isCurrent()) { QString currentProjectName = @@ -1834,7 +1834,7 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile, bool checkSa QString importAnswer = QObject::tr("Import Scene"); QString switchProjectAnswer = QObject::tr("Change Project"); QString cancelAnswer = QObject::tr("Cancel"); - int ret = MsgBox(question, importAnswer, switchProjectAnswer, cancelAnswer, 0); + int ret = DVGui::MsgBox(question, importAnswer, switchProjectAnswer, cancelAnswer, 0); if (ret == 3 || ret == 0) { newScene(); return false; @@ -1886,14 +1886,14 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile, bool checkSa msg = QObject::tr("The scene %1 was created with Toonz and cannot be loaded in LineTest.").arg(QString::fromStdWString(scenePath.getWideString())); else msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(scenePath.getWideString())); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); } #endif catch (...) { printf("%s:%s Exception ...:\n", __FILE__, __FUNCTION__); QString msg; msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(scenePath.getWideString())); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); } printf("%s:%s end load:\n", __FILE__, __FUNCTION__); TProject *project = scene->getProject(); @@ -1944,7 +1944,7 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile, bool checkSa if (forbiddenLevelCount > 0) { QString msg; msg = QObject::tr("There were problems loading the scene %1.\nSome levels have not been loaded because their version is not supported").arg(QString::fromStdWString(scenePath.getWideString())); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); } bool exist = TSystem::doesExistFileOrLevel(scene->decodeFilePath(scene->getScenePath())); @@ -2601,16 +2601,16 @@ public: #else TXshSimpleLevel *sl = TApp::instance()->getCurrentLevel()->getSimpleLevel(); if (!sl) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("No Current Level")); + DVGui::warning(QObject::tr("No Current Level")); return; } if (!sl->getPalette()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Toonz cannot Save this Level")); + DVGui::warning(QObject::tr("Toonz cannot Save this Level")); return; } ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); if (!scene) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("No Current Scene")); + DVGui::warning(QObject::tr("No Current Scene")); return; // non dovrebbe succedere mai } TFilePath levelPath = sl->getPath(); @@ -2642,14 +2642,14 @@ public: { QString question; question = QObject::tr("Are you sure you want to save the Default Settings?"); - int ret = MsgBox(question, QObject::tr("Save"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Save"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return; ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); try { TProjectManager::instance()->saveTemplate(scene); } catch (TSystemException se) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(se.getMessage())); + DVGui::warning(QString::fromStdWString(se.getMessage())); return; } } @@ -2691,7 +2691,7 @@ public: if (args.loadedLevels.empty()) { QString msg; msg = QObject::tr("It is not possible to load the %1 level.").arg(path); - MsgBox(CRITICAL, msg); + DVGui::error(msg); } } } openRecentLevelFileCommandHandler; @@ -2734,11 +2734,11 @@ public: TFilePath path = scene->getScenePath(); TFilePath decodePath = scene->decodeFilePath(scene->getScenePath()); if (!TSystem::doesExistFileOrLevel(decodePath)) { - MsgBox(DVGui::WARNING, QObject::tr("The scene %1 doesn't exist.").arg(toQString(decodePath))); + DVGui::warning(QObject::tr("The scene %1 doesn't exist.").arg(toQString(decodePath))); return; } if (sceneHandle->getDirtyFlag()) { - int ret = MsgBox(QString(QObject::tr("Revert: the current scene has been modified.\nAre you sure you want to revert to previous version?")), + int ret = DVGui::MsgBox(QString(QObject::tr("Revert: the current scene has been modified.\nAre you sure you want to revert to previous version?")), QString(QObject::tr("Revert")), QString(QObject::tr("Cancel"))); if (ret == 2 || ret == 0) return; @@ -2760,13 +2760,13 @@ public: TXshLevel *level = TApp::instance()->getCurrentLevel()->getLevel(); if (!level) { - DVGui::MsgBox(DVGui::WARNING, "No current level."); + DVGui::warning("No current level."); return; } TXshSimpleLevel *sl = level->getSimpleLevel(); TXshPaletteLevel *pl = level->getPaletteLevel(); if (!sl && !pl) { - DVGui::MsgBox(DVGui::WARNING, "Current level has no palette."); + DVGui::warning("Current level has no palette."); return; } /*-- SimpleLevel/PaletteLevelの場合毎にパレット/パスの取得の仕方を変える --*/ @@ -2776,7 +2776,7 @@ public: if (sl) { palette = sl->getPalette(); if (!palette) { - DVGui::MsgBox(DVGui::WARNING, "No current palette"); + DVGui::warning("No current palette"); return; } if (sl->getPath().getType() == "pli") @@ -2788,12 +2788,12 @@ public: else if (pl) { palette = pl->getPalette(); if (!palette) { - DVGui::MsgBox(DVGui::WARNING, "No current palette"); + DVGui::warning("No current palette"); return; } palettePath = pl->getPath(); } else { - DVGui::MsgBox(DVGui::WARNING, "This level is not SimpleLevel or PaletteLevel"); + DVGui::warning("This level is not SimpleLevel or PaletteLevel"); return; } @@ -2801,10 +2801,10 @@ public: int ret; if (sl && sl->getPath().getType() == "pli") { question = "Saving " + toQString(palettePath) + "\nThis command will ovewrite the level data as well. Are you sure ?"; - ret = MsgBox(question, QObject::tr("OK"), QObject::tr("Cancel"), 0); + ret = DVGui::MsgBox(question, QObject::tr("OK"), QObject::tr("Cancel"), 0); } else { question = "Do you want to overwrite current palette to " + toQString(palettePath) + " ?"; - ret = MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Don't Overwrite"), 0); + ret = DVGui::MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Don't Overwrite"), 0); } if (ret == 2 || ret == 0) return; diff --git a/toonz/sources/toonz/levelcreatepopup.cpp b/toonz/sources/toonz/levelcreatepopup.cpp index f5d44cb..4b823a4 100644 --- a/toonz/sources/toonz/levelcreatepopup.cpp +++ b/toonz/sources/toonz/levelcreatepopup.cpp @@ -445,7 +445,7 @@ bool LevelCreatePopup::apply() /*question = "Folder " +toQString(parentDir) + " doesn't exist.\nDo you want to create it?";*/ question = tr("Folder %1 doesn't exist.\nDo you want to create it?").arg(toQString(parentDir)); - int ret = MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); + int ret = DVGui::MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); if (ret == 0 || ret == 2) return false; try { diff --git a/toonz/sources/toonz/levelsettingspopup.cpp b/toonz/sources/toonz/levelsettingspopup.cpp index 5d7e4e1..d265baf 100644 --- a/toonz/sources/toonz/levelsettingspopup.cpp +++ b/toonz/sources/toonz/levelsettingspopup.cpp @@ -675,7 +675,7 @@ void LevelSettingsPopup::onPathChanged() question = "The path you entered for the level " + QString(toString(sl->getName()).c_str()) + "is already used: this may generate some conflicts in the file management.\nAre you sure you want to assign the same path to two different levels?"; - int ret = MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); + int ret = DVGui::MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); if (ret == 0 || ret == 2) { m_pathFld->setPath(toQString(m_sl->getPath())); return; @@ -773,11 +773,11 @@ void LevelSettingsPopup::onScanPathChanged() if (cleanupLevelPath != TFilePath()) { TFilePath codedCleanupLevelPath = TApp::instance()->getCurrentScene()->getScene()->codeFilePath(cleanupLevelPath); if (m_sl->getPath().getParentDir() != cleanupLevelPath && m_sl->getPath().getParentDir() != codedCleanupLevelPath) - DVGui::MsgBox(DVGui::WARNING, "\"Save In\" path of the Cleanup Settings does not match."); + DVGui::warning("\"Save In\" path of the Cleanup Settings does not match."); } else - DVGui::MsgBox(DVGui::WARNING, "Loading Cleanup Settings failed."); + DVGui::warning("Loading Cleanup Settings failed."); } else - DVGui::MsgBox(DVGui::WARNING, ".cln file for the Scanned Level not found."); + DVGui::warning(".cln file for the Scanned Level not found."); m_sl->setScannedPath(newScanPath); diff --git a/toonz/sources/toonz/linetestcapturepane.cpp b/toonz/sources/toonz/linetestcapturepane.cpp index 7719ca2..cc48599 100644 --- a/toonz/sources/toonz/linetestcapturepane.cpp +++ b/toonz/sources/toonz/linetestcapturepane.cpp @@ -607,13 +607,13 @@ CaptureParameters *CaptureSettingsPopup::getCaptureParameters() void CaptureSettingsPopup::defineDevice() { if (TnzCamera::instance()->isCameraConnected()) { - DVGui::MsgBox(DVGui::WARNING, tr("A Device is Connected.")); + DVGui::warning(tr("A Device is Connected.")); return; } QList cameras; bool ret = TnzCamera::instance()->findConnectedCameras(cameras); if (!ret) { - DVGui::MsgBox(DVGui::WARNING, tr("No cameras found.")); + DVGui::warning(tr("No cameras found.")); return; } @@ -650,14 +650,14 @@ void CaptureSettingsPopup::onKeepWhiteImage() { TnzCamera *camera = TnzCamera::instance(); if (!camera->isCameraConnected()) { - DVGui::MsgBox(DVGui::WARNING, tr("Device Disconnected.")); + DVGui::warning(tr("Device Disconnected.")); return; } TFilePath whiteImagePath = TEnv::getConfigDir() + TFilePath("whiteReferenceImage.0001.tif"); if (TSystem::doesExistFileOrLevel(whiteImagePath)) { QString question; question = "The White Image already exists.\nDo you want to overwrite it?"; - int ret = MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return; } @@ -670,7 +670,7 @@ void CaptureSettingsPopup::onImageWidthEditingFinished() { CaptureParameters *parameters = getCaptureParameters(); if (parameters->getDeviceName().empty()) { - DVGui::MsgBox(DVGui::WARNING, tr("No Device Defined.")); + DVGui::warning(tr("No Device Defined.")); m_imageWidthLineEdit->setValue(parameters->getResolution().lx); return; } @@ -691,7 +691,7 @@ void CaptureSettingsPopup::onImageHeightEditingFinished() { CaptureParameters *parameters = getCaptureParameters(); if (parameters->getDeviceName().empty()) { - DVGui::MsgBox(DVGui::WARNING, tr("No Device Defined.")); + DVGui::warning(tr("No Device Defined.")); m_imageHeightLineEdit->setValue(parameters->getResolution().ly); return; } @@ -1191,13 +1191,13 @@ void LineTestCapturePane::onConnectCheckboxStateChanged(int state) wstring deviceName = sceneProperties->getCaptureParameters()->getDeviceName(); if (deviceName.empty()) { - DVGui::MsgBox(DVGui::WARNING, tr("No Device Defined.")); + DVGui::warning(tr("No Device Defined.")); m_connectionCheckBox->setChecked(false); return; } bool ret = TnzCamera::instance()->cameraConnect(deviceName); if (!ret) { - DVGui::MsgBox(DVGui::WARNING, tr("Cannot connect Camera")); + DVGui::warning(tr("Cannot connect Camera")); m_connectionCheckBox->setChecked(false); } else TnzCamera::instance()->onViewfinder(m_imageView); @@ -1215,7 +1215,7 @@ void LineTestCapturePane::captureButton() return; if (!TnzCamera::instance()->isCameraConnected()) { - DVGui::MsgBox(DVGui::WARNING, tr("Device Disconnected.")); + DVGui::warning(tr("Device Disconnected.")); return; } QString clickPath = QString::fromStdString(TEnv::getApplicationName()) + QString(" ") + diff --git a/toonz/sources/toonz/loadfoldercommand.cpp b/toonz/sources/toonz/loadfoldercommand.cpp index a70be70..9540b36 100644 --- a/toonz/sources/toonz/loadfoldercommand.cpp +++ b/toonz/sources/toonz/loadfoldercommand.cpp @@ -429,8 +429,7 @@ struct import_Locals { boost::bind(copy, boost::cref(srcDir), boost::cref(dstDir), _1, overwrite)); } catch (const TException &e) { - DVGui::MsgBox(DVGui::CRITICAL, - QString::fromStdWString(e.getMessage())); + DVGui::error(QString::fromStdWString(e.getMessage())); } catch (...) { } } diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index e596b6e..ad9ecd4 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -160,14 +160,14 @@ void qt_mac_set_menubar_merge(bool enable); void fatalError(QString msg) { - MsgBoxInPopup(CRITICAL, msg + "\n" + QObject::tr("Installing %1 again could fix the problem.").arg(applicationFullName)); + DVGui::MsgBoxInPopup(CRITICAL, msg + "\n" + QObject::tr("Installing %1 again could fix the problem.").arg(applicationFullName)); exit(0); } //----------------------------------------------------------------------------- void lastWarningError(QString msg) { - MsgBox(CRITICAL, msg); + DVGui::error(msg); //exit(0); } //----------------------------------------------------------------------------- @@ -642,7 +642,7 @@ int main(int argc, char *argv[]) License::writeMacAddress(); //Controllo che la data della prima installazione contenuta nella sentinella sia minore della data corrente. if (License::isTemporaryLicense(license) && !License::isValidSentinel(license)) { - MsgBox(CRITICAL, QObject::tr("System date tampered.")); + DVGui::error(QObject::tr("System date tampered.")); return -1; } if (License::checkLicense(license) == License::INVALID_LICENSE || diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index 62f8437..4b36902 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -108,7 +108,7 @@ bool readRoomList(std::vector &roomPaths, if (!argumentLayoutFileName.isEmpty()) { fp = ToonzFolder::getModuleFile(argumentLayoutFileName.toStdString()); if (!TFileStatus(fp).doesExist()) { - DVGui::MsgBox(DVGui::WARNING, "Room layout file " + argumentLayoutFileName + " not found!"); + DVGui::warning("Room layout file " + argumentLayoutFileName + " not found!"); fp = ToonzFolder::getModuleFile(layoutsFileName); if (!TFileStatus(fp).doesExist()) return false; @@ -1073,7 +1073,7 @@ void MainWindow::resetRoomsLayout() } } - MsgBox(INFORMATION, QObject::tr("The rooms will be reset the next time you run Toonz.")); + DVGui::info(QObject::tr("The rooms will be reset the next time you run Toonz.")); } //----------------------------------------------------------------------------- @@ -1297,7 +1297,7 @@ void MainWindow::onUpdateCheckerDone(bool error) std::vector buttons; buttons.push_back(QString(tr("Visit Web Site"))); buttons.push_back(QString(tr("Cancel"))); - int ret = MsgBox(INFORMATION, QObject::tr("An update is available for this software.\nVisit the Web site for more information."), buttons); + int ret = DVGui::MsgBox(DVGui::INFORMATION, QObject::tr("An update is available for this software.\nVisit the Web site for more information."), buttons); if (ret == 1) QDesktopServices::openUrl(webPageUrl); @@ -1324,8 +1324,7 @@ void MainWindow::onLicenseCheckerDone(bool error) { if (!error) { if (!m_licenseChecker->isLicenseValid()) { - MsgBox(CRITICAL, - QObject::tr("The license validation process was not able to confirm the right to use this software on this computer.\n Please contact [ support@toonz.com ] for assistance.")); + DVGui::error(QObject::tr("The license validation process was not able to confirm the right to use this software on this computer.\n Please contact [ support@toonz.com ] for assistance.")); qApp->exit(0); } } @@ -1350,7 +1349,7 @@ void MainWindow::closeEvent(QCloseEvent *event) #ifdef BRAVODEMO QString question; question = "Quit: are you sure you want to quit?"; - int ret = MsgBox(question, QObject::tr("Quit"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Quit"), QObject::tr("Cancel"), 0); if (ret == 0 || ret == 2) { event->ignore(); return; diff --git a/toonz/sources/toonz/matchline.cpp b/toonz/sources/toonz/matchline.cpp index e870179..975a583 100644 --- a/toonz/sources/toonz/matchline.cpp +++ b/toonz/sources/toonz/matchline.cpp @@ -709,7 +709,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence, int Mer /*-- 左カラムに複数のLevelが入っている場合、警告を出して抜ける --*/ else if (level != cell[i].getSimpleLevel()) { getImageProgressBar->close(); - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to apply match lines to a column containing more than one level.")); + DVGui::warning(QObject::tr("It is not possible to apply match lines to a column containing more than one level.")); /*-- 前に遡ってキャッシュを消去 --*/ i--; for (; i >= 0; i--) { @@ -725,7 +725,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence, int Mer mLevel = mCell[i].getSimpleLevel(); else if (mLevel != mCell[i].getSimpleLevel()) { getImageProgressBar->close(); - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to use a match lines column containing more than one level.")); + DVGui::warning(QObject::tr("It is not possible to use a match lines column containing more than one level.")); /*-- 前に遡ってキャッシュを消去 --*/ i--; for (; i >= 0; i--) { @@ -752,7 +752,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence, int Mer //ラスタLevelじゃないとき、エラーを返す if (!timg || !tmatch) { getImageProgressBar->close(); - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Match lines can be applied to Toonz raster levels only.")); + DVGui::warning(QObject::tr("Match lines can be applied to Toonz raster levels only.")); /*-- 前に遡ってキャッシュを消去 --*/ i--; for (; i >= 0; i--) { @@ -779,7 +779,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence, int Mer getImageProgressBar->close(); if (matchingLevels.empty()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Match lines can be applied to Toonz raster levels only.")); + DVGui::warning(QObject::tr("Match lines can be applied to Toonz raster levels only.")); return; } @@ -787,7 +787,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence, int Mer { TPalette *plt = level->getPalette(); if (!plt) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The level you are using has not a valid palette.")); + DVGui::warning(QObject::tr("The level you are using has not a valid palette.")); return; } @@ -813,7 +813,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence, int Mer index = md->getInkIndex(); if (index >= styleCount) - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The style index you specified is not available in the palette of the destination level.")); + DVGui::warning(QObject::tr("The style index you specified is not available in the palette of the destination level.")); if (index != -1) LastMatchlineIndex = index; } @@ -1037,13 +1037,13 @@ void doDeleteMatchlines(TXshSimpleLevel *sl, const std::set &fids, boo return; indexes = md->getInkIndexes(); if (indexes.empty()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The style index range you specified is not valid: please separate values with a comma (e.g. 1,2,5) or with a dash (e.g. 4-7 will refer to indexes 4, 5, 6 and 7).")); + DVGui::warning(QObject::tr("The style index range you specified is not valid: please separate values with a comma (e.g. 1,2,5) or with a dash (e.g. 4-7 will refer to indexes 4, 5, 6 and 7).")); continue; } frames = md->getFrames(); if (frames.empty()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The frame range you specified is not valid: please separate values with a comma (e.g. 1,2,5) or with a dash (e.g. 4-7 will refer to frames 4, 5, 6 and 7).")); + DVGui::warning(QObject::tr("The frame range you specified is not valid: please separate values with a comma (e.g. 1,2,5) or with a dash (e.g. 4-7 will refer to frames 4, 5, 6 and 7).")); continue; } for (i = 0; i < frames.size(); i++) { @@ -1066,7 +1066,7 @@ void doDeleteMatchlines(TXshSimpleLevel *sl, const std::set &fids, boo } if (fidsToProcess.empty()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("No drawing is available in the frame range you specified.")); + DVGui::warning(QObject::tr("No drawing is available in the frame range you specified.")); return; } diff --git a/toonz/sources/toonz/matchlinecommand.cpp b/toonz/sources/toonz/matchlinecommand.cpp index d62fbf2..5343adf 100644 --- a/toonz/sources/toonz/matchlinecommand.cpp +++ b/toonz/sources/toonz/matchlinecommand.cpp @@ -102,12 +102,12 @@ public: std::set indices = selection ? selection->getIndices() : std::set(); if (indices.empty()) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to execute the merge column command because no column was selected.")); + DVGui::warning(tr("It is not possible to execute the merge column command because no column was selected.")); return; } if (indices.size() == 1) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to execute the merge column command because only one columns is selected.")); + DVGui::warning(tr("It is not possible to execute the merge column command because only one columns is selected.")); return; } @@ -130,14 +130,14 @@ public: { TColumnSelection *selection = dynamic_cast(TSelection::getCurrent()); if (!selection) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to apply the match lines because no column was selected.")); + DVGui::warning(tr("It is not possible to apply the match lines because no column was selected.")); return; } std::set indices = selection->getIndices(); if (indices.size() != 2) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to apply the match lines because two columns have to be selected.")); + DVGui::warning(tr("It is not possible to apply the match lines because two columns have to be selected.")); return; } @@ -177,11 +177,11 @@ bool checkColumnValidity(int column) level = cell[i].getSimpleLevel(); if (cell[i].getSimpleLevel()->getType() != TZP_XSHLEVEL) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Match lines can be applied to Toonz raster levels only.")); + DVGui::warning(QObject::tr("Match lines can be applied to Toonz raster levels only.")); return false; } if (level != cell[i].getSimpleLevel()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to merge tlv columns containing more than one level")); + DVGui::warning(QObject::tr("It is not possible to merge tlv columns containing more than one level")); return false; } } @@ -190,7 +190,7 @@ bool checkColumnValidity(int column) return false; if (!level->getPalette()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The level you are using has not a valid palette.")); + DVGui::warning(QObject::tr("The level you are using has not a valid palette.")); return false; } return true; @@ -402,14 +402,14 @@ public: { TColumnSelection *selection = dynamic_cast(TSelection::getCurrent()); if (!selection) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to merge tlv columns because no column was selected.")); + DVGui::warning(tr("It is not possible to merge tlv columns because no column was selected.")); return; } std::set indices = selection->getIndices(); if (indices.size() < 2) { - DVGui::MsgBox(DVGui::WARNING, tr("It is not possible to merge tlv columns because at least two columns have to be selected.")); + DVGui::warning(tr("It is not possible to merge tlv columns because at least two columns have to be selected.")); return; } @@ -486,14 +486,14 @@ void doDeleteCommand(bool isMatchline) TApp::instance()->getCurrentXsheet()->notifyXsheetChanged(); return; } else if (!columnSelection || (indices = columnSelection->getIndices()).size() != 1) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to delete lines because no column, cell or level strip frame was selected.")); + DVGui::warning(QObject::tr("It is not possible to delete lines because no column, cell or level strip frame was selected.")); return; } int from, to; int columnIndex = *indices.begin(); TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet(); if (!xsh->getCellRange(*indices.begin(), from, to)) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The selected column is empty.")); + DVGui::warning(QObject::tr("The selected column is empty.")); return; } r.y0 = from; @@ -503,7 +503,7 @@ void doDeleteCommand(bool isMatchline) sel->getSelectedCells(r.y0, r.x0, r.y1, r.x1); if (r.x0 != r.x1) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Selected cells must be in the same column.")); + DVGui::warning(QObject::tr("Selected cells must be in the same column.")); return; } @@ -514,11 +514,11 @@ void doDeleteCommand(bool isMatchline) for (i = r.y0; i <= r.y1; i++) { TXshCell cell = xsh->getCell(i, r.x0); if (cell.isEmpty()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to delete lines because no column, cell or level strip frame was selected.")); + DVGui::warning(QObject::tr("It is not possible to delete lines because no column, cell or level strip frame was selected.")); return; } if (cell.m_level->getType() != TZP_XSHLEVEL) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Match lines can be deleted from Toonz raster levels only")); + DVGui::warning(QObject::tr("Match lines can be deleted from Toonz raster levels only")); return; } } diff --git a/toonz/sources/toonz/mergecolumns.cpp b/toonz/sources/toonz/mergecolumns.cpp index 18d0756..bd2f697 100644 --- a/toonz/sources/toonz/mergecolumns.cpp +++ b/toonz/sources/toonz/mergecolumns.cpp @@ -68,7 +68,7 @@ void mergeRasterColumns(const vector &matchingLevels) TRaster32P ras = img->getRaster(); // img->getCMapped(false); TRaster32P matchRas = match->getRaster(); // match->getCMapped(true); if (!ras || !matchRas) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The merge command is not available for greytones images.")); + DVGui::warning(QObject::tr("The merge command is not available for greytones images.")); return; } TAffine aff = matchingLevels[i].m_imgAff.inv() * matchingLevels[i].m_matchAff; @@ -321,14 +321,14 @@ void mergeColumns(int column, int mColumn, bool isRedo) } else if (level != cell[i].getSimpleLevel()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to perform a merging involving more than one level per column.")); + DVGui::warning(QObject::tr("It is not possible to perform a merging involving more than one level per column.")); return; } if (!mLevel) mLevel = mCell[i].getSimpleLevel(); else if (mLevel != mCell[i].getSimpleLevel()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to perform a merging involving more than one level per column.")); + DVGui::warning(QObject::tr("It is not possible to perform a merging involving more than one level per column.")); return; } TImageP img = cell[i].getImage(true); @@ -347,17 +347,17 @@ void mergeColumns(int column, int mColumn, bool isRedo) if (timg) { if (!tmatch) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Only raster levels can be merged to a raster level.")); + DVGui::warning(QObject::tr("Only raster levels can be merged to a raster level.")); return; } areRasters = true; } else if (vimg) { if (!vmatch) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Only vector levels can be merged to a vector level.")); + DVGui::warning(QObject::tr("Only vector levels can be merged to a vector level.")); return; } } else { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is possible to merge only Toonz vector levels or standard raster levels.")); + DVGui::warning(QObject::tr("It is possible to merge only Toonz vector levels or standard raster levels.")); return; } @@ -375,7 +375,7 @@ void mergeColumns(int column, int mColumn, bool isRedo) } if (matchingLevels.empty()) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is possible to merge only Toonz vector levels or standard raster levels.")); + DVGui::warning(QObject::tr("It is possible to merge only Toonz vector levels or standard raster levels.")); return; } diff --git a/toonz/sources/toonz/meshifypopup.cpp b/toonz/sources/toonz/meshifypopup.cpp index 7213ec3..5df6e19 100644 --- a/toonz/sources/toonz/meshifypopup.cpp +++ b/toonz/sources/toonz/meshifypopup.cpp @@ -1277,13 +1277,13 @@ bool meshifySelection(const MeshifyOptions &options) CASE HAS_LEVEL_COLUMNS | HAS_MESH_COLUMNS : // Error message - DVGui::MsgBox(DVGui::CRITICAL, MeshifyPopup::tr("Current selection contains mixed image and mesh level types")); + DVGui::error(MeshifyPopup::tr("Current selection contains mixed image and mesh level types")); return false; DEFAULT: // Error message - DVGui::MsgBox(DVGui::CRITICAL, MeshifyPopup::tr("Current selection contains no image or mesh level types")); + DVGui::error(MeshifyPopup::tr("Current selection contains no image or mesh level types")); return false; } diff --git a/toonz/sources/toonz/overwritepopup.cpp b/toonz/sources/toonz/overwritepopup.cpp index 370bea0..1c5f74e 100644 --- a/toonz/sources/toonz/overwritepopup.cpp +++ b/toonz/sources/toonz/overwritepopup.cpp @@ -266,13 +266,13 @@ std::wstring OverwriteDialog::execute(ToonzScene *scene, const TFilePath &srcLev if (m_rename->isChecked()) { if (m_suffix->text() == "") { - DVGui::MsgBox(DVGui::WARNING, tr("The suffix field is empty. Please specify a suffix.")); + DVGui::warning(tr("The suffix field is empty. Please specify a suffix.")); return execute(scene, srcLevelPath, multiload); } levelPath = addSuffix(srcLevelPath); actualLevelPath = scene->decodeFilePath(levelPath); if (TSystem::doesExistFileOrLevel(actualLevelPath)) { - DVGui::MsgBox(DVGui::WARNING, tr("File %1 exists as well; please choose a different suffix.").arg(toQString(levelPath))); + DVGui::warning(tr("File %1 exists as well; please choose a different suffix.").arg(toQString(levelPath))); return execute(scene, srcLevelPath, multiload); } m_choice = RENAME; diff --git a/toonz/sources/toonz/previewer.cpp b/toonz/sources/toonz/previewer.cpp index 4c68e69..f72ccbc 100644 --- a/toonz/sources/toonz/previewer.cpp +++ b/toonz/sources/toonz/previewer.cpp @@ -773,7 +773,7 @@ public: } break; case eEnd: { - MsgBox(DVGui::INFORMATION, m_str); + DVGui::info(m_str); delete Pd; Pd = 0; } break; @@ -837,12 +837,12 @@ bool Previewer::Imp::doSaveRenderedFrames(TFilePath fp) fp = fp.withType(ext); } if (fp.getName() == "") { - DVGui::MsgBox(DVGui::WARNING, tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); + DVGui::warning(tr("The file name cannot be empty or contain any of the following characters:(new line) \\ / : * ? \" |")); return false; } if (!formats.contains(QString::fromStdString(ext))) { - DVGui::MsgBox(DVGui::WARNING, "Unsopporter raster format, cannot save"); + DVGui::warning("Unsopporter raster format, cannot save"); return false; } @@ -869,7 +869,7 @@ bool Previewer::Imp::doSaveRenderedFrames(TFilePath fp) if (TSystem::doesExistFileOrLevel(fp)) { QString question(tr("File %1 already exists.\nDo you want to overwrite it?").arg(toQString(fp))); - int ret = MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Overwrite"), QObject::tr("Cancel"), 0); if (ret == 2) return false; } diff --git a/toonz/sources/toonz/projectpopup.cpp b/toonz/sources/toonz/projectpopup.cpp index 671965b..10233fe 100644 --- a/toonz/sources/toonz/projectpopup.cpp +++ b/toonz/sources/toonz/projectpopup.cpp @@ -520,7 +520,7 @@ void ProjectSettingsPopup::onFolderChanged() try { project->save(); } catch (TSystemException se) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(se.getMessage())); + DVGui::warning(QString::fromStdWString(se.getMessage())); return; } DvDirModel::instance()->refreshFolder(project->getProjectFolder()); @@ -535,7 +535,7 @@ void ProjectSettingsPopup::onUseSceneChekboxChanged(int) try { project->save(); } catch (TSystemException se) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(se.getMessage())); + DVGui::warning(QString::fromStdWString(se.getMessage())); return; } DvDirModel::instance()->refreshFolder(project->getProjectFolder()); @@ -631,9 +631,9 @@ void ProjectCreatePopup::createProject() try { bool isSaved = project->save(projectPath); if (!isSaved) - MsgBox(CRITICAL, tr("It is not possible to create the %1 project.").arg(toQString(projectPath))); + DVGui::error(tr("It is not possible to create the %1 project.").arg(toQString(projectPath))); } catch (TSystemException se) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(se.getMessage())); + DVGui::warning(QString::fromStdWString(se.getMessage())); return; } pm->setCurrentProjectPath(projectPath); diff --git a/toonz/sources/toonz/rendercommand.cpp b/toonz/sources/toonz/rendercommand.cpp index 1d71b93..91cd2b7 100644 --- a/toonz/sources/toonz/rendercommand.cpp +++ b/toonz/sources/toonz/rendercommand.cpp @@ -196,7 +196,7 @@ public: { if (m_error) { m_error = false; - MsgBox(DVGui::CRITICAL, QObject::tr("There was an error saving frames for the %1 level.").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString()))); + DVGui::error(QObject::tr("There was an error saving frames for the %1 level.").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString()))); } bool isPreview = (m_fp.getType() == "noext"); @@ -214,7 +214,7 @@ public: if (!TSystem::showDocument(m_fp)) { QString msg(QObject::tr("It is not possible to display the file %1: no player associated with its format").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString()))); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); } } @@ -301,7 +301,7 @@ bool RenderCommand::init(bool isPreview) if (m_r1 >= scene->getFrameCount()) m_r1 = scene->getFrameCount() - 1; if (m_r1 < m_r0) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The command cannot be executed because the scene is empty.")); + DVGui::warning(QObject::tr("The command cannot be executed because the scene is empty.")); return false; // throw TException("empty scene"); // non so perche', ma termina il programma @@ -345,10 +345,10 @@ bool RenderCommand::init(bool isPreview) TSystem::mkDir(parent); DvDirModel::instance()->refreshFolder(parent.getParentDir()); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to create folder : %1").arg(QString::fromStdString(toString(e.getMessage())))); + DVGui::warning(QObject::tr("It is not possible to create folder : %1").arg(QString::fromStdString(toString(e.getMessage())))); return false; } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to create a folder.")); + DVGui::warning(QObject::tr("It is not possible to create a folder.")); return false; } } @@ -537,7 +537,7 @@ void RenderCommand::rasterRender(bool isPreview) TDimension res = scene->getCurrentCamera()->getRes(); if (!AviCodecRestrictions::canWriteMovie(toWideString(codecName), res)) { QString msg(QObject::tr("The resolution of the output camera does not fit with the options chosen for the output file format.")); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); return; } } @@ -747,7 +747,7 @@ void RenderCommand::multimediaRender() TDimension res = scene->getCurrentCamera()->getRes(); if (!AviCodecRestrictions::canWriteMovie(toWideString(codecName), res)) { QString msg(QObject::tr("The resolution of the output camera does not fit with the options chosen for the output file format.")); - DVGui::MsgBox(DVGui::WARNING, msg); + DVGui::warning(msg); return; } } @@ -846,7 +846,7 @@ void RenderCommand::doRender(bool isPreview) if (!isWritable) { string str = "It is not possible to write the output: the file"; str += isMultiFrame ? "s are read only." : " is read only."; - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(str)); + DVGui::warning(QString::fromStdString(str)); return; } @@ -865,9 +865,9 @@ void RenderCommand::doRender(bool isPreview) /*-- 通常のRendering --*/ rasterRender(isPreview); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to complete the rendering.")); + DVGui::warning(QObject::tr("It is not possible to complete the rendering.")); } } diff --git a/toonz/sources/toonz/scanpopup.cpp b/toonz/sources/toonz/scanpopup.cpp index b10bcb3..6c7dec0 100644 --- a/toonz/sources/toonz/scanpopup.cpp +++ b/toonz/sources/toonz/scanpopup.cpp @@ -63,7 +63,7 @@ void checkPaperFormat(TScannerParameters *parameters) if (parameters->getPaperOverflow()) { TScanner *scanner = TScanner::instance(); QString scannerName = scanner ? scanner->getName() : "no scanner"; - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The selected paper format is not available for %1.").arg(scannerName)); + DVGui::warning(QObject::tr("The selected paper format is not available for %1.").arg(scannerName)); } } @@ -78,7 +78,7 @@ bool defineScanner(const QString &scannerType) try { if (!TScanner::instance()->isDeviceAvailable()) { - DVGui::MsgBox(DVGui::WARNING, TScanner::m_isTwain ? QObject::tr("No TWAIN scanner is available") : QObject::tr("No scanner is available")); + DVGui::warning(TScanner::m_isTwain ? QObject::tr("No TWAIN scanner is available") : QObject::tr("No scanner is available")); /* FIXME: try/catch からの goto って合法じゃないだろ……。とりあえず応急処置したところ"例外ってナニ?"って感じになったのが indent も腐っておりつらいので後で直す */ //goto end; @@ -87,7 +87,7 @@ bool defineScanner(const QString &scannerType) } TScanner::instance()->selectDevice(); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(e.getMessage())); + DVGui::warning(QString::fromStdWString(e.getMessage())); QApplication::restoreOverrideCursor(); return false; //goto end; @@ -101,7 +101,7 @@ bool defineScanner(const QString &scannerType) try { scanParameters->adaptToCurrentScanner(); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(e.getMessage())); + DVGui::warning(QString::fromStdWString(e.getMessage())); //goto end; QApplication::restoreOverrideCursor(); return false; @@ -645,12 +645,12 @@ MyScannerListener::MyScannerListener(const ScanList &scanList) void MyScannerListener::onImage(const TRasterImageP &rasImg) { if (!rasImg || !rasImg->getRaster()) { - DVGui::MsgBox(DVGui::WARNING, tr("The pixel type is not supported.")); + DVGui::warning(tr("The pixel type is not supported.")); m_current += m_inc; return; } if (!m_isPreview && (m_current < 0 || m_current >= m_scanList.getFrameCount())) { - DVGui::MsgBox(DVGui::WARNING, tr("The scanning process is completed.")); + DVGui::warning(tr("The scanning process is completed.")); return; } if (m_isPreview) { @@ -665,7 +665,7 @@ void MyScannerListener::onImage(const TRasterImageP &rasImg) cl->setParameters(cp); TRasterImageP outImg = cl->autocenterOnly(rasImg, false, autocentered); if (!autocentered) - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The autocentering failed on the current drawing.")); + DVGui::warning(QObject::tr("The autocentering failed on the current drawing.")); else rasImg->setRaster(outImg->getRaster()); } @@ -696,7 +696,7 @@ void MyScannerListener::onError() { if (m_progressDialog) m_progressDialog->hide(); - DVGui::MsgBox(DVGui::WARNING, tr("There was an error during the scanning process.")); + DVGui::warning(tr("There was an error during the scanning process.")); } //----------------------------------------------------------------------------- @@ -705,10 +705,10 @@ void MyScannerListener::onNextPaper() { assert(!m_isPreview); if (TScanner::instance()->m_isTwain) - MsgBox(INFORMATION, tr("Please, place the next paper drawing on the scanner flatbed, then select the relevant command in the TWAIN interface.")); + DVGui::info(tr("Please, place the next paper drawing on the scanner flatbed, then select the relevant command in the TWAIN interface.")); else { QString question(tr("Please, place the next paper drawing on the scanner flatbed, then click the Scan button.")); - int ret = MsgBox(question, QObject::tr("Scan"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Scan"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) m_isCanceled = true; } @@ -757,7 +757,7 @@ void doScan() return; ScanList scanList; if (scanList.areScannedFramesSelected()) { - int ret = MsgBox(QObject::tr("Some of the selected drawings were already scanned. Do you want to scan them again?"), + int ret = DVGui::MsgBox(QObject::tr("Some of the selected drawings were already scanned. Do you want to scan them again?"), QObject::tr("Scan"), QObject::tr("Don't Scan"), QObject::tr("Cancel")); if (ret == 3) return; @@ -766,7 +766,7 @@ void doScan() scanList.update(true); if (scanList.getFrameCount() == 0) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("There are no frames to scan.")); + DVGui::warning(QObject::tr("There are no frames to scan.")); return; } @@ -775,7 +775,7 @@ void doScan() int rc = scanner->isDeviceAvailable(); if (!rc) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("TWAIN is not available.")); + DVGui::warning(QObject::tr("TWAIN is not available.")); return; } @@ -791,7 +791,7 @@ void doScan() if (cropboxCheck->isEnabled()) cropboxCheck->uncheck(); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(e.getMessage())); + DVGui::warning(QString::fromStdWString(e.getMessage())); } //If some levels were scanned successfully, their renumber table must be updated. @@ -870,7 +870,7 @@ public: int rc = scanner->isDeviceAvailable(); if (!rc) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("TWAIN is not available.")); + DVGui::warning(QObject::tr("TWAIN is not available.")); return; } @@ -895,7 +895,7 @@ public: if (resetCropAction) resetCropAction->setDisabled(false); } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdWString(e.getMessage())); + DVGui::warning(QString::fromStdWString(e.getMessage())); } } } setCropboxCommand; diff --git a/toonz/sources/toonz/sceneviewerevents.cpp b/toonz/sources/toonz/sceneviewerevents.cpp index dd22405..8d7d42b 100644 --- a/toonz/sources/toonz/sceneviewerevents.cpp +++ b/toonz/sources/toonz/sceneviewerevents.cpp @@ -144,7 +144,7 @@ void SceneViewer::onButtonPressed(FlipConsole::EGadget button) CASE FlipConsole::eSaveImg: { if (m_previewMode == NO_PREVIEW) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to save images in camera stand view.")); + DVGui::warning(QObject::tr("It is not possible to save images in camera stand view.")); return; } TApp *app = TApp::instance(); @@ -152,7 +152,7 @@ void SceneViewer::onButtonPressed(FlipConsole::EGadget button) Previewer *previewer = Previewer::instance(m_previewMode == SUBCAMERA_PREVIEW); if (!previewer->isFrameReady(row)) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The preview images are not ready yet.")); + DVGui::warning(QObject::tr("The preview images are not ready yet.")); return; } @@ -474,7 +474,7 @@ void SceneViewer::mouseReleaseEvent(QMouseEvent *event) if (!tool || !tool->isEnabled()) { if (!m_toolDisableReason.isEmpty() && m_mouseButton == Qt::LeftButton && !m_editPreviewSubCamera) - DVGui::MsgBox(DVGui::WARNING, m_toolDisableReason); + DVGui::warning(m_toolDisableReason); } if (m_freezedStatus != NO_FREEZED) diff --git a/toonz/sources/toonz/subscenecommand.cpp b/toonz/sources/toonz/subscenecommand.cpp index 076f950..4f64f99 100644 --- a/toonz/sources/toonz/subscenecommand.cpp +++ b/toonz/sources/toonz/subscenecommand.cpp @@ -2174,7 +2174,7 @@ void SubsceneCmd::collapse(std::set &indices) list.append(QObject::tr("Include relevant pegbars in the sub-xsheet as well.")); list.append(QObject::tr("Include only selected columns in the sub-xsheet.")); - int ret = RadioButtonMsgBox(DVGui::WARNING, question, list); + int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list); if (ret == 0) return; @@ -2277,7 +2277,7 @@ void SubsceneCmd::collapse(const QList &fxs) QList list; list.append(QObject::tr("Include relevant pegbars in the sub-xsheet as well.")); list.append(QObject::tr("Include only selected columns in the sub-xsheet.")); - int ret = RadioButtonMsgBox(DVGui::WARNING, question, list); + int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list); if (ret == 0) return; @@ -2351,7 +2351,7 @@ void SubsceneCmd::explode(int index) QList list; list.append(QObject::tr("Bring relevant pegbars in the main xsheet.")); list.append(QObject::tr("Bring only columns in the main xsheet.")); - int ret = RadioButtonMsgBox(DVGui::WARNING, question, list); + int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list); if (ret == 0) return; diff --git a/toonz/sources/toonz/tapp.cpp b/toonz/sources/toonz/tapp.cpp index 5576387..104a1b8 100644 --- a/toonz/sources/toonz/tapp.cpp +++ b/toonz/sources/toonz/tapp.cpp @@ -183,7 +183,7 @@ TApp::TApp() if (preferences->isRasterOptimizedMemory()) { if (!TBigMemoryManager::instance()->init((int)(/*15*1024*/ TSystem::getFreeMemorySize(true) * .8))) - MsgBox(DVGui::WARNING, tr("Error allocating memory: not enough memory.")); + DVGui::warning(tr("Error allocating memory: not enough memory.")); } ret = ret && connect(preferences, SIGNAL(stopAutoSave()), SLOT(onStopAutoSave())); ret = ret && connect(preferences, SIGNAL(startAutoSave()), SLOT(onStartAutoSave())); @@ -672,7 +672,7 @@ void TApp::autosave() m_autosaveSuspended = false; if (scene->isUntitled()) { - MsgBox(DVGui::WARNING, tr("It is not possible to save automatically an untitled scene.")); + DVGui::warning(tr("It is not possible to save automatically an untitled scene.")); return; } diff --git a/toonz/sources/toonz/tasksviewer.cpp b/toonz/sources/toonz/tasksviewer.cpp index c941c1a..e6e7fd8 100644 --- a/toonz/sources/toonz/tasksviewer.cpp +++ b/toonz/sources/toonz/tasksviewer.cpp @@ -1271,7 +1271,7 @@ void TaskTreeModel::start(bool) BatchesController::instance()->start(task->m_id); } } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } emit layoutChanged(); @@ -1304,7 +1304,7 @@ void TaskTreeModel::stop(bool) BatchesController::instance()->stop(task->m_id); } } catch (TException &e) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(toString(e.getMessage()))); + DVGui::warning(QString::fromStdString(toString(e.getMessage()))); } emit layoutChanged(); diff --git a/toonz/sources/toonz/tpanels.cpp b/toonz/sources/toonz/tpanels.cpp index 966a74c..0d0671f 100644 --- a/toonz/sources/toonz/tpanels.cpp +++ b/toonz/sources/toonz/tpanels.cpp @@ -274,7 +274,7 @@ public: { TFx *currentFx = TApp::instance()->getCurrentFx()->getFx(); if (!currentFx) { - DVGui::MsgBox(DVGui::WARNING, "Preview Fx : No Current Fx !"); + DVGui::warning("Preview Fx : No Current Fx !"); return; } /*-- @@ -284,7 +284,7 @@ public: TPaletteColumnFx *pfx = dynamic_cast(currentFx); TOutputFx *ofx = dynamic_cast(currentFx); if (pfx || ofx) { - DVGui::MsgBox(DVGui::WARNING, "Preview Fx command is not available on Palette or Output node !"); + DVGui::warning("Preview Fx command is not available on Palette or Output node !"); return; } diff --git a/toonz/sources/toonz/trackerpopup.cpp b/toonz/sources/toonz/trackerpopup.cpp index 240fa37..6c997e2 100644 --- a/toonz/sources/toonz/trackerpopup.cpp +++ b/toonz/sources/toonz/trackerpopup.cpp @@ -234,7 +234,7 @@ bool TrackerPopup::apply() m_tracker = new Tracker(threshold, sensibility, activeBackground, manageOcclusion, variationWindow, frameStart, framesNumber); if (m_tracker->getLastError() != 0) { - DVGui::MsgBox(DVGui::WARNING, m_tracker->getLastError()); + DVGui::warning(m_tracker->getLastError()); return false; } diff --git a/toonz/sources/toonz/versioncontrol.cpp b/toonz/sources/toonz/versioncontrol.cpp index e2fd6a4..4a27dde 100644 --- a/toonz/sources/toonz/versioncontrol.cpp +++ b/toonz/sources/toonz/versioncontrol.cpp @@ -486,7 +486,7 @@ void VersionControlManager::onError(const QString &text) m_levelSet = 0; } m_scene = 0; - DVGui::MsgBox(DVGui::WARNING, text); + DVGui::warning(text); } //============================================================================= @@ -543,7 +543,7 @@ bool VersionControl::testSetup() // Test configuration file if (repositoriesCount == 0) { - DVGui::MsgBox(DVGui::CRITICAL, tr("The version control configuration file is empty or wrongly defined.\nPlease refer to the user guide for details.")); + DVGui::error(tr("The version control configuration file is empty or wrongly defined.\nPlease refer to the user guide for details.")); return false; } @@ -554,7 +554,7 @@ bool VersionControl::testSetup() if (!path.isEmpty() && !QFile::exists(path + "/svn.exe")) #endif { - DVGui::MsgBox(DVGui::CRITICAL, tr("The version control client application specified on the configuration file cannot be found.\nPlease refer to the user guide for details.")); + DVGui::error(tr("The version control client application specified on the configuration file cannot be found.\nPlease refer to the user guide for details.")); return false; } @@ -571,12 +571,12 @@ bool VersionControl::testSetup() p.start("svn", QStringList("--version")); if (!p.waitForStarted()) { - DVGui::MsgBox(DVGui::CRITICAL, tr("The version control client application is not installed on your computer.\nSubversion 1.5 or later is required.\nPlease refer to the user guide for details.")); + DVGui::error(tr("The version control client application is not installed on your computer.\nSubversion 1.5 or later is required.\nPlease refer to the user guide for details.")); return false; } if (!p.waitForFinished()) { - DVGui::MsgBox(DVGui::CRITICAL, tr("The version control client application is not installed on your computer.\nSubversion 1.5 or later is required.\nPlease refer to the user guide for details.")); + DVGui::error(tr("The version control client application is not installed on your computer.\nSubversion 1.5 or later is required.\nPlease refer to the user guide for details.")); return false; } @@ -590,7 +590,7 @@ bool VersionControl::testSetup() double version = firstLine.left(3).toDouble(); if (version <= 1.5) { - DVGui::MsgBox(DVGui::WARNING, tr("The version control client application installed on your computer needs to be updated, otherwise some features may not be available.\nSubversion 1.5 or later is required.\nPlease refer to the user guide for details.")); + DVGui::warning(tr("The version control client application installed on your computer needs to be updated, otherwise some features may not be available.\nSubversion 1.5 or later is required.\nPlease refer to the user guide for details.")); return true; } } diff --git a/toonz/sources/toonz/xsheetcmd.cpp b/toonz/sources/toonz/xsheetcmd.cpp index 4992404..bbdc181 100644 --- a/toonz/sources/toonz/xsheetcmd.cpp +++ b/toonz/sources/toonz/xsheetcmd.cpp @@ -1683,7 +1683,7 @@ void PrintXsheetCommand::execute() copyCss(fp); QString str = QObject::tr("The %1 file has been generated").arg(toQString(fp)); - DVGui::MsgBox(DVGui::WARNING, str); + DVGui::warning(str); TSystem::showDocument(fp); } diff --git a/toonz/sources/toonzlib/tcleanupper.cpp b/toonz/sources/toonzlib/tcleanupper.cpp index 2ada536..fe39df8 100644 --- a/toonz/sources/toonzlib/tcleanupper.cpp +++ b/toonz/sources/toonzlib/tcleanupper.cpp @@ -573,7 +573,7 @@ CleanupPreprocessedImage *TCleanupper::process( bool isSameDpi = false; bool autocentered = getResampleValues(image, aff, blur, outDim, outDpi, isCameraTest, isSameDpi); if (m_parameters->m_autocenterType != AUTOCENTER_NONE && !autocentered) - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The autocentering failed on the current drawing.")); + DVGui::warning(QObject::tr("The autocentering failed on the current drawing.")); bool fromGr8 = (bool)TRasterGR8P(image->getRaster()); bool toGr8 = (m_parameters->m_lineProcessingMode == lpGrey); diff --git a/toonz/sources/toonzlib/tlog.cpp b/toonz/sources/toonzlib/tlog.cpp index 4aa6a46..c874d9e 100644 --- a/toonz/sources/toonzlib/tlog.cpp +++ b/toonz/sources/toonzlib/tlog.cpp @@ -216,7 +216,7 @@ TUserLogAppend::~TUserLogAppend() void TUserLogAppend::warning(const string &msg) { - DVGui::MsgBox(DVGui::WARNING, QString::fromStdString(msg)); + DVGui::warning(QString::fromStdString(msg)); string fullMsg(myGetCurrentTime()); fullMsg += " WRN:"; @@ -230,7 +230,7 @@ void TUserLogAppend::warning(const string &msg) void TUserLogAppend::error(const string &msg) { - DVGui::MsgBox(DVGui::CRITICAL, QString::fromStdString(msg)); + DVGui::error(QString::fromStdString(msg)); string fullMsg(myGetCurrentTime()); fullMsg += " ERR:"; fullMsg += "\n"; diff --git a/toonz/sources/toonzqt/camerasettingswidget.cpp b/toonz/sources/toonzqt/camerasettingswidget.cpp index 37732a7..320cb80 100644 --- a/toonz/sources/toonzqt/camerasettingswidget.cpp +++ b/toonz/sources/toonzqt/camerasettingswidget.cpp @@ -1024,7 +1024,7 @@ void CameraSettingsWidget::removePreset() return; // confirmation dialog - int ret = MsgBox(QObject::tr("Deleting \"%1\".\nAre you sure?").arg(m_presetListOm->currentText()), + int ret = DVGui::MsgBox(QObject::tr("Deleting \"%1\".\nAre you sure?").arg(m_presetListOm->currentText()), QObject::tr("Delete"), QObject::tr("Cancel")); if (ret == 0 || ret == 2) return; diff --git a/toonz/sources/toonzqt/dvdialog.cpp b/toonz/sources/toonzqt/dvdialog.cpp index 1fb34b9..0900b16 100644 --- a/toonz/sources/toonzqt/dvdialog.cpp +++ b/toonz/sources/toonzqt/dvdialog.cpp @@ -42,16 +42,16 @@ QPixmap getMsgBoxPixmap(MsgType type) QIcon msgBoxIcon; switch (type) { - case INFORMATION: + case DVGui::INFORMATION: msgBoxIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation); break; - case WARNING: + case DVGui::WARNING: msgBoxIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning); break; - case CRITICAL: + case DVGui::CRITICAL: msgBoxIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); break; - case QUESTION: + case DVGui::QUESTION: msgBoxIcon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion); break; default: @@ -70,16 +70,16 @@ QString getMsgBoxTitle(MsgType type) QString title = DialogTitle + " - "; switch (type) { - case INFORMATION: + case DVGui::INFORMATION: title.append(QObject::tr("Information")); break; - case WARNING: + case DVGui::WARNING: title.append(QObject::tr("Warning")); break; - case CRITICAL: + case DVGui::CRITICAL: title.append(QObject::tr("Critical")); break; - case QUESTION: + case DVGui::QUESTION: title.append(QObject::tr("Question")); break; default: @@ -781,7 +781,7 @@ int DVGui::RadioButtonMsgBox(MsgType type, const QString &labelText, const QList &radioButtonList, QWidget *parent) { RadioButtonDialog *dialog = new RadioButtonDialog(labelText, radioButtonList, parent); - QString msgBoxTitle = getMsgBoxTitle(WARNING); + QString msgBoxTitle = getMsgBoxTitle(DVGui::WARNING); dialog->setWindowTitle(msgBoxTitle); return dialog->exec(); } @@ -1086,7 +1086,7 @@ int DVGui::MsgBox(const QString &text, std::vector buttons; buttons.push_back(button1); buttons.push_back(button2); - return MsgBox(QUESTION, text, buttons, defaultButtonIndex, parent); + return DVGui::MsgBox(DVGui::QUESTION, text, buttons, defaultButtonIndex, parent); } //----------------------------------------------------------------------------- @@ -1259,8 +1259,8 @@ int DVGui::eraseStylesInDemand(TPalette *palette, std::vector styleIds, std::vector buttons(2); buttons[0] = QObject::tr("Ok"), buttons[1] = QObject::tr("Cancel"); - if (DVGui::MsgBox(DVGui::WARNING, QObject::tr("Deletion of Lines and Areas from raster-based levels is not undoable.\n" - "Are you sure?"), + if (DVGui::MsgBox(DVGui::WARNING, + QObject::tr("Deletion of Lines and Areas from raster-based levels is not undoable.\n""Are you sure?"), buttons) != 1) return 0; } @@ -1286,7 +1286,7 @@ void DVGui::featureNotAvelaible(QString webSiteName, QString url) Dialog dialog(0, true); dialog.setWindowFlags(dialog.windowFlags() | Qt::WindowStaysOnTopHint); dialog.setAlignment(Qt::AlignLeft); - QString msgBoxTitle = getMsgBoxTitle(WARNING); + QString msgBoxTitle = getMsgBoxTitle(DVGui::WARNING); dialog.setWindowTitle(msgBoxTitle); QVBoxLayout *mainLayout = new QVBoxLayout; @@ -1296,7 +1296,7 @@ void DVGui::featureNotAvelaible(QString webSiteName, QString url) QString msg = QObject::tr("This feature is not available in the demo version.\nFor more information visit the %1 site:").arg(webSiteName); QLabel *mainTextLabel = new QLabel(msg, &dialog); - QPixmap iconPixmap = getMsgBoxPixmap(WARNING); + QPixmap iconPixmap = getMsgBoxPixmap(DVGui::WARNING); if (!iconPixmap.isNull()) { QLabel *iconLabel = new QLabel(&dialog); iconLabel->setPixmap(iconPixmap); @@ -1338,7 +1338,7 @@ void DVGui::requestTrialLicense(QString url, QString mail) Dialog dialog(0, true); dialog.setWindowFlags(dialog.windowFlags() | Qt::WindowStaysOnTopHint); dialog.setAlignment(Qt::AlignLeft); - QString msgBoxTitle = getMsgBoxTitle(WARNING); + QString msgBoxTitle = getMsgBoxTitle(DVGui::WARNING); dialog.setWindowTitle(msgBoxTitle); QVBoxLayout *mainLayout = new QVBoxLayout; diff --git a/toonz/sources/toonzqt/functionsegmentviewer.cpp b/toonz/sources/toonzqt/functionsegmentviewer.cpp index 2e7fe8c..a674e64 100644 --- a/toonz/sources/toonzqt/functionsegmentviewer.cpp +++ b/toonz/sources/toonzqt/functionsegmentviewer.cpp @@ -607,7 +607,7 @@ void FunctionExpressionSegmentPage::apply() expr.setGrammar(curve->getGrammar()); expr.setText(expressionText); if (dependsOn(expr, curve)) { - DVGui::MsgBox(DVGui::WARNING, tr("There is a circular reference in the definition of the interpolation.")); + DVGui::warning(tr("There is a circular reference in the definition of the interpolation.")); return; } @@ -656,7 +656,7 @@ bool FunctionExpressionSegmentPage::getGuiValues(std::string &expressionText, expr.setGrammar(curve->getGrammar()); expr.setText(expressionText); if (dependsOn(expr, curve)) { - DVGui::MsgBox(DVGui::WARNING, tr("There is a circular reference in the definition of the interpolation.")); + DVGui::warning(tr("There is a circular reference in the definition of the interpolation.")); return false; } @@ -884,11 +884,11 @@ void SimilarShapeSegmentPage::apply() expr.setGrammar(curve->getGrammar()); expr.setText(expressionText); if (!expr.isValid()) { - DVGui::MsgBox(DVGui::WARNING, tr("There is a syntax error in the definition of the interpolation.")); + DVGui::warning(tr("There is a syntax error in the definition of the interpolation.")); return; } if (dependsOn(expr, curve)) { - DVGui::MsgBox(DVGui::WARNING, tr("There is a circular reference in the definition of the interpolation.")); + DVGui::warning(tr("There is a circular reference in the definition of the interpolation.")); return; } KeyframeSetter setter(curve, kIndex); diff --git a/toonz/sources/toonzqt/functionselection.cpp b/toonz/sources/toonzqt/functionselection.cpp index da71db1..883a76b 100644 --- a/toonz/sources/toonzqt/functionselection.cpp +++ b/toonz/sources/toonzqt/functionselection.cpp @@ -558,7 +558,7 @@ void FunctionSelection::doPaste() /*--- カーブの貼り付け時に循環参照をチェックして、駄目ならアラートを返す ---*/ for (int c = 0; c < columnCount; c++) { if (!data->isCircularReferenceFree(c, params[c])) { - DVGui::MsgBox(DVGui::WARNING, tr("There is a circular reference in the definition of the interpolation.")); + DVGui::warning(tr("There is a circular reference in the definition of the interpolation.")); return; } } diff --git a/toonz/sources/toonzqt/gutil.cpp b/toonz/sources/toonzqt/gutil.cpp index e44f932..be5687c 100644 --- a/toonz/sources/toonzqt/gutil.cpp +++ b/toonz/sources/toonzqt/gutil.cpp @@ -264,7 +264,7 @@ bool isValidFileName(const QString &fileName) bool isValidFileName_message(const QString &fileName) { - return isValidFileName(fileName) ? true : (MsgBox(CRITICAL, QObject::tr("The file name cannot be empty or contain any of the following " + return isValidFileName(fileName) ? true : (DVGui::error(QObject::tr("The file name cannot be empty or contain any of the following " "characters: (new line) \\ / : * ? \" |")), false); } diff --git a/toonz/sources/toonzqt/imageutils.cpp b/toonz/sources/toonzqt/imageutils.cpp index d77c9c4..c18ed89 100644 --- a/toonz/sources/toonzqt/imageutils.cpp +++ b/toonz/sources/toonzqt/imageutils.cpp @@ -143,7 +143,7 @@ TFilePath duplicate(const TFilePath &levelPath) return TFilePath(); if (!TSystem::doesExistFileOrLevel(levelPath)) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to find the %1 level.").arg(QString::fromStdWString(levelPath.getWideString()))); + DVGui::warning(QObject::tr("It is not possible to find the %1 level.").arg(QString::fromStdWString(levelPath.getWideString()))); return TFilePath(); } @@ -168,7 +168,7 @@ TFilePath duplicate(const TFilePath &levelPath) } } catch (...) { QString msg = QObject::tr("There was an error copying %1").arg(toQString(levelPath)); - DVGui::MsgBox(DVGui::CRITICAL, msg); + DVGui::error(msg); return TFilePath(); } @@ -176,7 +176,7 @@ TFilePath duplicate(const TFilePath &levelPath) // QString::fromStdWString(levelPath.withoutParentDir().getWideString()) + // QString(" to " + // QString::fromStdWString(levelPathOut.withoutParentDir().getWideString())); - // MsgBox(INFORMATION,msg); + // DVGui::info(msg); return levelPathOut; } @@ -189,21 +189,21 @@ void premultiply(const TFilePath &levelPath) return; if (!TSystem::doesExistFileOrLevel(levelPath)) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to find the level %1").arg(QString::fromStdWString(levelPath.getWideString()))); + DVGui::warning(QObject::tr("It is not possible to find the level %1").arg(QString::fromStdWString(levelPath.getWideString()))); return; } TFileType::Type type = TFileType::getInfo(levelPath); if (type == TFileType::CMAPPED_LEVEL) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Cannot premultiply the selected file.")); + DVGui::warning(QObject::tr("Cannot premultiply the selected file.")); return; } if (type == TFileType::VECTOR_LEVEL || type == TFileType::VECTOR_IMAGE) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Cannot premultiply a vector-based level.")); + DVGui::warning(QObject::tr("Cannot premultiply a vector-based level.")); return; } if (type != TFileType::RASTER_LEVEL && type != TFileType::RASTER_IMAGE) { - DVGui::MsgBox(DVGui::INFORMATION, QObject::tr("Cannot premultiply the selected file.")); + DVGui::info(QObject::tr("Cannot premultiply the selected file.")); return; } @@ -267,14 +267,14 @@ void premultiply(const TFilePath &levelPath) lw->save(level); } } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("Cannot premultiply the selected file.")); + DVGui::warning(QObject::tr("Cannot premultiply the selected file.")); QApplication::restoreOverrideCursor(); return; } QApplication::restoreOverrideCursor(); QString msg = QObject::tr("Level %1 premultiplied.").arg(QString::fromStdString(levelPath.getLevelName())); - DVGui::MsgBox(DVGui::INFORMATION, msg); + DVGui::info(msg); } //----------------------------------------------------------------------------- @@ -405,7 +405,7 @@ void convertFromCM(const TLevelReaderP &lr, const TPaletteP &plt, const TLevelWr } } catch (...) { //QString msg=QObject::tr("Frame %1 : conversion failed!").arg(QString::number(i+1)); - // MsgBox(INFORMATION,msg); + // DVGui::info(msg); } /*-- これはプログレスバーを進めるものなので、動画番号ではなく、完了したフレームの枚数を投げる --*/ frameNotifier->notifyFrameCompleted(100 * (i + 1) / frames.size()); @@ -429,7 +429,7 @@ void convertFromVI(const TLevelReaderP &lr, const TPaletteP &plt, const TLevelWr maxBbox += img->getBBox(); } catch (...) { msg = QObject::tr("Frame %1 : conversion failed!").arg(QString::fromStdString(frames[i].expand())); - DVGui::MsgBox(DVGui::INFORMATION, msg); + DVGui::info(msg); } } maxBbox = maxBbox.enlarge(2); @@ -457,7 +457,7 @@ void convertFromVI(const TLevelReaderP &lr, const TPaletteP &plt, const TLevelWr } } catch (...) { msg = QObject::tr("Frame %1 : conversion failed!").arg(QString::fromStdString(frames[i].expand())); - DVGui::MsgBox(DVGui::INFORMATION, msg); + DVGui::info(msg); } frameNotifier->notifyFrameCompleted(100 * (i + 1) / frames.size()); } @@ -533,7 +533,7 @@ void convertFromFullRaster(const TLevelReaderP &lr, const TLevelWriterP &lw, con } } catch (...) { //QString msg=QObject::tr("Frame %1 : conversion failed!").arg(QString::number(i+1)); - //MsgBox(INFORMATION,msg); + //DVGui::info(msg); } /*-- これはプログレスバーを進めるものなので、動画番号ではなく、完了したフレームの枚数を投げる --*/ frameNotifier->notifyFrameCompleted(100 * (i + 1) / frames.size()); @@ -578,7 +578,7 @@ void convertFromVector(const TLevelReaderP &lr, const TLevelWriterP &lw, const v } } catch (...) { //QString msg=QObject::tr("Frame %1 : conversion failed!").arg(QString::number(i+1)); - //MsgBox(INFORMATION,msg); + //DVGui::info(msg); } frameNotifier->notifyFrameCompleted(100 * (i + 1) / frames.size()); } @@ -696,7 +696,7 @@ void convertNaa2Tlv( TImageWriterP iw = lw->getFrameWriter(frames[f]); iw->save(dstImg); } else { - MsgBox(DVGui::WARNING, QObject::tr( + DVGui::warning(QObject::tr( "The source image seems not suitable for this kind of conversion")); frameNotifier->notifyError(); } diff --git a/toonz/sources/toonzqt/infoviewer.cpp b/toonz/sources/toonzqt/infoviewer.cpp index 2328c41..14635e9 100644 --- a/toonz/sources/toonzqt/infoviewer.cpp +++ b/toonz/sources/toonzqt/infoviewer.cpp @@ -584,7 +584,7 @@ bool InfoViewerImp::setItem(const TLevelP &level, TPalette *palette, const TFile assert(!m_level); if (!TSystem::doesExistFileOrLevel(m_path)) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("The file %1 does not exist.").arg(QString::fromStdWString(path.getWideString()))); + DVGui::warning(QObject::tr("The file %1 does not exist.").arg(QString::fromStdWString(path.getWideString()))); return false; } diff --git a/toonz/sources/toonzqt/lineedit.cpp b/toonz/sources/toonzqt/lineedit.cpp index 8c1c34b..debde80 100644 --- a/toonz/sources/toonzqt/lineedit.cpp +++ b/toonz/sources/toonzqt/lineedit.cpp @@ -45,7 +45,7 @@ void LineEdit::keyPressEvent(QKeyEvent *event) switch (event->key()) { CASE Qt::Key_Backslash : __OR Qt::Key_Slash : __OR Qt::Key_Colon : __OR Qt::Key_Asterisk : __OR Qt::Key_Question : __OR Qt::Key_QuoteDbl : __OR Qt::Key_Greater : __OR Qt::Key_Less : __OR Qt::Key_Bar : __OR Qt::Key_Period: { - DVGui::MsgBox(INFORMATION, tr("A file name cannot contains any of the following chracters: /\\:*?\"<>|.")); + DVGui::info(tr("A file name cannot contains any of the following chracters: /\\:*?\"<>|.")); return; } default: diff --git a/toonz/sources/toonzqt/menubarcommand.cpp b/toonz/sources/toonzqt/menubarcommand.cpp index 45193f4..6592ebf 100644 --- a/toonz/sources/toonzqt/menubarcommand.cpp +++ b/toonz/sources/toonzqt/menubarcommand.cpp @@ -317,7 +317,7 @@ void CommandManager::setShortcut(QAction *action, std::string shortcutString) assert(ks.count() == 1 || ks.count() == 0 && shortcut == ""); if (node->m_type == ZoomCommandType && ks.count() > 1) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to assing a shortcut with modifiers to the visualization commands.")); + DVGui::warning(QObject::tr("It is not possible to assing a shortcut with modifiers to the visualization commands.")); return; } // lo shortcut e' gia' assegnato? diff --git a/toonz/sources/toonzqt/paletteviewer.cpp b/toonz/sources/toonzqt/paletteviewer.cpp index 528f19e..f010fe2 100644 --- a/toonz/sources/toonzqt/paletteviewer.cpp +++ b/toonz/sources/toonzqt/paletteviewer.cpp @@ -866,19 +866,19 @@ void PaletteViewer::saveStudioPalette() StudioPalette *sp = StudioPalette::instance(); TPalette *palette = getPalette(); if (!palette) { - DVGui::MsgBox(DVGui::WARNING, "No current palette"); + DVGui::warning("No current palette"); return; } wstring gname = palette->getGlobalName(); if (gname.empty()) { StudioPaletteViewer *parentSPV = qobject_cast(parentWidget()); if (!parentSPV) { - DVGui::MsgBox(DVGui::WARNING, "No GlobalName"); + DVGui::warning("No GlobalName"); return; } else { TFilePath palettePath = parentSPV->getCurrentItemPath(); if (palettePath.isEmpty()) - DVGui::MsgBox(DVGui::WARNING, "No GlobalName, No Filepath"); + DVGui::warning("No GlobalName, No Filepath"); else { QString question; question = "Do you want to overwrite current palette to " + toQString(palettePath) + " ?"; diff --git a/toonz/sources/toonzqt/stageschematicscene.cpp b/toonz/sources/toonzqt/stageschematicscene.cpp index 12d334c..7408a84 100644 --- a/toonz/sources/toonzqt/stageschematicscene.cpp +++ b/toonz/sources/toonzqt/stageschematicscene.cpp @@ -1021,7 +1021,7 @@ void StageSchematicScene::onSaveSpline() os << p.x << p.y << p.thick; } } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to save the motion path.")); + DVGui::warning(QObject::tr("It is not possible to save the motion path.")); } #endif } @@ -1043,7 +1043,7 @@ void StageSchematicScene::onLoadSpline() if (!TFileStatus(fp).doesExist()) { QString msg; msg = "Motion path " + toQString(fp) + " doesn't exists."; - MsgBox(DVGui::INFORMATION, msg); + DVGui::info(msg); return; } assert(m_objHandle->isSpline()); @@ -1063,7 +1063,7 @@ void StageSchematicScene::onLoadSpline() IconGenerator::instance()->invalidate(spline); } } catch (...) { - DVGui::MsgBox(DVGui::WARNING, QObject::tr("It is not possible to load the motion path.")); + DVGui::warning(QObject::tr("It is not possible to load the motion path.")); } } diff --git a/toonz/sources/toonzqt/studiopaletteviewer.cpp b/toonz/sources/toonzqt/studiopaletteviewer.cpp index 8c2a55d..e29dbb1 100644 --- a/toonz/sources/toonzqt/studiopaletteviewer.cpp +++ b/toonz/sources/toonzqt/studiopaletteviewer.cpp @@ -482,7 +482,7 @@ void StudioPaletteTreeViewer::onCurrentItemChanged(QTreeWidgetItem *current, QTr wstring gname = m_currentPalette->getGlobalName(); QString question; question = "The current palette " + QString::fromStdWString(oldPath.getWideString()) + " \nin the studio palette has been modified. Do you want to save your changes?"; - int ret = MsgBox(question, QObject::tr("Save"), QObject::tr("Discard"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Save"), QObject::tr("Discard"), QObject::tr("Cancel"), 0); if (ret == 3) { setCurrentItem(getItem(oldPath)); return; @@ -564,7 +564,7 @@ void StudioPaletteTreeViewer::convertToStudioPalette() QString question; question = QString::fromStdWString(L"Convert " + path.getWideString() + L" to Studio Palette and Overwrite. \nAre you sure ?"); - int ret = MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); + int ret = DVGui::MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); if (ret == 0 || ret == 2) return; @@ -594,7 +594,7 @@ void StudioPaletteTreeViewer::deleteItem(QTreeWidgetItem *item) if (item->childCount() > 0) { QString question; question = tr("This folder is not empty. Delete anyway?"); - int ret = MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); + int ret = DVGui::MsgBox(question, QObject::tr("Yes"), QObject::tr("No")); if (ret == 0 || ret == 2) return; } @@ -688,7 +688,7 @@ public: //----------------------------------------------------------------------------- -class AdjustPaletteDialog : public Dialog +class AdjustPaletteDialog : public DVGui::Dialog { private: IntField *m_tolerance; @@ -771,7 +771,7 @@ void StudioPaletteTreeViewer::loadInCurrentPalette() return; if (palette->isLocked()) { - DVGui::MsgBox(DVGui::WARNING, "Palette is Locked!"); + DVGui::warning("Palette is Locked!"); return; } @@ -828,7 +828,7 @@ void StudioPaletteTreeViewer::replaceCurrentPalette() label = QString::fromStdWString(L"Replacing the palette \"" + dstPalette->getPaletteName() + L"\" with the palette \"" + current->getPaletteName() + L"\". \nAre you sure ?"); } - int ret = MsgBox(label, QObject::tr("Replace"), QObject::tr("Cancel"), 1); + int ret = DVGui::MsgBox(label, QObject::tr("Replace"), QObject::tr("Cancel"), 1); if (ret == 0 || ret == 2) return; diff --git a/toonz/sources/toonzqt/styleselection.cpp b/toonz/sources/toonzqt/styleselection.cpp index e757c27..2eb7e7a 100644 --- a/toonz/sources/toonzqt/styleselection.cpp +++ b/toonz/sources/toonzqt/styleselection.cpp @@ -1093,7 +1093,7 @@ void TStyleSelection::pasteStylesValues(bool pasteName, bool pasteColor) int dataStyleCount = data->getStyleCount(); if (dataStyleCount > (int)m_styleIndicesInPage.size()) { QString question = QObject::tr("There are more cut/copied styles than selected. Paste anyway (adding styles)?"); - int ret = MsgBox(question, QObject::tr("Paste"), QObject::tr("Cancel"), 0); + int ret = DVGui::MsgBox(question, QObject::tr("Paste"), QObject::tr("Cancel"), 0); if (ret == 2 || ret == 0) return; } diff --git a/toonz/sources/toonzqt/tmessageviewer.cpp b/toonz/sources/toonzqt/tmessageviewer.cpp index 897d77a..3a4c773 100644 --- a/toonz/sources/toonzqt/tmessageviewer.cpp +++ b/toonz/sources/toonzqt/tmessageviewer.cpp @@ -126,7 +126,7 @@ void TMessageRepository::messageReceived(int type, const QString &message) } if (type == DVGui::CRITICAL || (type == DVGui::WARNING && !TMessageViewer::isTMsgVisible())) - MsgBoxInPopup(DVGui::MsgType(type), message); + DVGui::MsgBoxInPopup(DVGui::MsgType(type), message); } //---------------------------------------------------------------------------------