From 4635e8ed2ccdaa98561b9799200fb565da6d27ac Mon Sep 17 00:00:00 2001 From: justburner Date: Aug 12 2022 06:28:38 +0000 Subject: Add `Open Reports Folder` button --- diff --git a/toonz/sources/toonz/crashhandler.cpp b/toonz/sources/toonz/crashhandler.cpp index 3e1f5d4..9ee1b07 100644 --- a/toonz/sources/toonz/crashhandler.cpp +++ b/toonz/sources/toonz/crashhandler.cpp @@ -276,9 +276,11 @@ CrashHandler::CrashHandler(QWidget *parent, TFilePath crashFile, QString crashRe QPushButton *copyBtn = new QPushButton(tr("Copy to Clipboard")); QPushButton *webBtn = new QPushButton(tr("Open Issue Webpage")); + QPushButton *folderBtn = new QPushButton(tr("Open Reports Folder")); QPushButton *closeBtn = new QPushButton(tr("Close Application")); buttonsLay->addWidget(copyBtn); buttonsLay->addWidget(webBtn); + buttonsLay->addWidget(folderBtn); buttonsLay->addWidget(closeBtn); mainLayout->addWidget(headtext); @@ -286,8 +288,9 @@ CrashHandler::CrashHandler(QWidget *parent, TFilePath crashFile, QString crashRe mainLayout->addLayout(buttonsLay); bool ret = connect(copyBtn, SIGNAL(clicked()), this, SLOT(copyClipboard())); - ret = ret && connect(webBtn, SIGNAL(clicked()), this, SLOT(openWebpage())); - ret = ret && connect(closeBtn, SIGNAL(clicked()), this, SLOT(accept())); + ret = ret && connect(webBtn, SIGNAL(clicked()), this, SLOT(openWebpage())); + ret = ret && connect(folderBtn, SIGNAL(clicked()), this, SLOT(openFolder())); + ret = ret && connect(closeBtn, SIGNAL(clicked()), this, SLOT(accept())); if (!ret) throw TException(); setWindowTitle(tr("OpenToonz crashed!")); @@ -297,7 +300,7 @@ CrashHandler::CrashHandler(QWidget *parent, TFilePath crashFile, QString crashRe void CrashHandler::reject() { QStringList sl; sl.append(tr("Application is in unstable state and must be restarted.")); - sl.append(tr("Resuming is not recommended, it may lead to an unrecoverable crash.")); + sl.append(tr("Resuming is not recommended and may lead to an unrecoverable crash.")); sl.append(tr("Ignore advice and try to resume program?")); QMessageBox::StandardButton reply = @@ -323,6 +326,13 @@ void CrashHandler::openWebpage() { //----------------------------------------------------------------------------- +void CrashHandler::openFolder() { + TFilePath fp = ToonzFolder::getCrashReportFolder(); + QDesktopServices::openUrl(QUrl("file:///" + fp.getQString())); +} + +//----------------------------------------------------------------------------- + void CrashHandler::install() { signal(SIGABRT, signal_handler); signal(SIGFPE, signal_handler); diff --git a/toonz/sources/toonz/crashhandler.h b/toonz/sources/toonz/crashhandler.h index b204228..8398e53 100644 --- a/toonz/sources/toonz/crashhandler.h +++ b/toonz/sources/toonz/crashhandler.h @@ -25,6 +25,7 @@ public: public slots: void copyClipboard(); void openWebpage(); + void openFolder(); }; #endif // CRASHHANDLER_INCLUDED