[AFV], Ref T731 allow to open the drashdump directory from menu/launcher tools

This commit is contained in:
Klaus Basan
2019-10-18 16:36:15 +02:00
parent 7cfcc61bd3
commit 40eb531a3a
4 changed files with 45 additions and 19 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -88,7 +88,7 @@
<item>
<widget class="QToolBox" name="tb_Launcher">
<property name="currentIndex">
<number>2</number>
<number>4</number>
</property>
<property name="tabSpacing">
<number>6</number>
@@ -98,8 +98,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>309</height>
<width>135</width>
<height>109</height>
</rect>
</property>
<attribute name="label">
@@ -153,8 +153,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>309</height>
<width>163</width>
<height>52</height>
</rect>
</property>
<attribute name="label">
@@ -218,8 +218,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>309</height>
<width>233</width>
<height>166</height>
</rect>
</property>
<attribute name="label">
@@ -350,8 +350,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>309</height>
<width>98</width>
<height>237</height>
</rect>
</property>
<attribute name="label">
@@ -432,8 +432,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>126</height>
<width>98</width>
<height>31</height>
</rect>
</property>
<layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea">
@@ -536,6 +536,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_DumpDir">
<property name="text">
<string>dump files</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>