From 40eb531a3a109f552679e456fd9d0b1a256d77fd Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 18 Oct 2019 16:36:15 +0200 Subject: [PATCH] [AFV], Ref T731 allow to open the drashdump directory from menu/launcher tools --- src/blackgui/guiapplication.cpp | 25 ++++++++++++++++++++----- src/blackgui/guiapplication.h | 3 +++ src/swiftlauncher/swiftlauncher.cpp | 7 ++++--- src/swiftlauncher/swiftlauncher.ui | 29 ++++++++++++++++++----------- 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 85e9bf84a..8c23e78bf 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -683,6 +683,14 @@ namespace BlackGui }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); + a = menu.addAction(CIcons::disk16(), "Crash dumps directory"); + c = connect(a, &QAction::triggered, this, [ = ]() + { + if (!sGui || sGui->isShuttingDown()) { return; } + this->openStandardCrashDumpDirectory(); + }); + Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); + a = menu.addAction(CIcons::swift24(), "Check for updates"); c = connect(a, &QAction::triggered, this, &CGuiApplication::checkNewVersionMenu); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); @@ -701,7 +709,7 @@ namespace BlackGui } }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - Q_UNUSED(c); + Q_UNUSED(c) } void CGuiApplication::addMenuForStyleSheets(QMenu &menu) @@ -722,7 +730,7 @@ namespace BlackGui this->openStandardWidgetStyleSheet(); }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - Q_UNUSED(c); + Q_UNUSED(c) } void CGuiApplication::addMenuFile(QMenu &menu) @@ -755,7 +763,7 @@ namespace BlackGui }, Qt::QueuedConnection); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - Q_UNUSED(c); + Q_UNUSED(c) } void CGuiApplication::addMenuInternals(QMenu &menu) @@ -818,7 +826,7 @@ namespace BlackGui this->displayTextInConsole(getAllUserMetatypesTypes()); }, Qt::QueuedConnection); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - Q_UNUSED(c); + Q_UNUSED(c) } void CGuiApplication::addMenuWindow(QMenu &menu) @@ -862,7 +870,7 @@ namespace BlackGui this->toggleStayOnTop(); }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - Q_UNUSED(c); + Q_UNUSED(c) } void CGuiApplication::addMenuHelp(QMenu &menu) @@ -966,6 +974,13 @@ namespace BlackGui return QDesktopServices::openUrl(QUrl::fromLocalFile(path)); } + bool CGuiApplication::openStandardCrashDumpDirectory() + { + const QString path(QDir::toNativeSeparators(CDirectoryUtils::crashpadDatabaseDirectory())); + if (!QDir(path).exists()) { return false; } + return QDesktopServices::openUrl(QUrl::fromLocalFile(path)); + } + bool CGuiApplication::updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor) { return m_styleSheetUtility.updateFont(fontFamily, fontSize, fontStyle, fontWeight, fontColor); diff --git a/src/blackgui/guiapplication.h b/src/blackgui/guiapplication.h index 3f8625970..1def9ddd0 100644 --- a/src/blackgui/guiapplication.h +++ b/src/blackgui/guiapplication.h @@ -193,6 +193,9 @@ namespace BlackGui //! Opens the standard log directory bool openStandardLogDirectory(); + //! Opens the standard dumps directory + bool openStandardCrashDumpDirectory(); + //! Update the fonts bool updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor); diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index b07dd3140..53a0c4b38 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -75,9 +75,10 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) : connect(ui->comp_DBusSelector, &CDBusServerAddressSelector::editingFinished, this, &CSwiftLauncher::onDBusEditingFinished, Qt::QueuedConnection); connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftLauncher::onStyleSheetsChanged, Qt::QueuedConnection); - connect(ui->pb_Log, &QPushButton::released, this, &CSwiftLauncher::showLogPage, Qt::QueuedConnection); - connect(ui->pb_Log, &QPushButton::released, this, &CSwiftLauncher::showLogPage, Qt::QueuedConnection); - connect(ui->pb_LogDir, &QPushButton::released, sGui, &CGuiApplication::openStandardLogDirectory, Qt::QueuedConnection); + connect(ui->pb_Log, &QPushButton::released, this, &CSwiftLauncher::showLogPage, Qt::QueuedConnection); + connect(ui->pb_Log, &QPushButton::released, this, &CSwiftLauncher::showLogPage, Qt::QueuedConnection); + connect(ui->pb_LogDir, &QPushButton::released, sGui, &CGuiApplication::openStandardLogDirectory, Qt::QueuedConnection); + connect(ui->pb_DumpDir, &QPushButton::released, sGui, &CGuiApplication::openStandardCrashDumpDirectory, Qt::QueuedConnection); connect(ui->pb_FSXConfigDirs, &QPushButton::released, this, &CSwiftLauncher::showSimulatorConfigDirs, Qt::QueuedConnection); connect(ui->pb_P3DConfigDirs, &QPushButton::released, this, &CSwiftLauncher::showSimulatorConfigDirs, Qt::QueuedConnection); diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index 97347b01e..bd3a9fb50 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -88,7 +88,7 @@ - 2 + 4 6 @@ -98,8 +98,8 @@ 0 0 - 392 - 309 + 135 + 109 @@ -153,8 +153,8 @@ 0 0 - 392 - 309 + 163 + 52 @@ -218,8 +218,8 @@ 0 0 - 392 - 309 + 233 + 166 @@ -350,8 +350,8 @@ 0 0 - 392 - 309 + 98 + 237 @@ -432,8 +432,8 @@ 0 0 - 376 - 126 + 98 + 31 @@ -536,6 +536,13 @@ + + + + dump files + + +