mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
Add Developer > Display Crash Options menu item
Is enabled by default. Disabling it stops the display of the crash handling options dialog at start-up.
This commit is contained in:
parent
9c782f6a6d
commit
f6cf77ae68
6 changed files with 21 additions and 11 deletions
|
@ -257,6 +257,8 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
// Set build version
|
||||
QCoreApplication::setApplicationVersion(BUILD_VERSION);
|
||||
|
||||
Setting::preInit();
|
||||
|
||||
CrashHandler::checkForAndHandleCrash();
|
||||
CrashHandler::writeRunningMarkerFiler();
|
||||
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
||||
|
|
|
@ -22,14 +22,20 @@
|
|||
#include <QStandardPaths>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Menu.h"
|
||||
|
||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||
|
||||
void CrashHandler::checkForAndHandleCrash() {
|
||||
QFile runningMarkerFile(runningMarkerFilePath());
|
||||
if (runningMarkerFile.exists()) {
|
||||
Action action = promptUserForAction();
|
||||
if (action != DO_NOTHING) {
|
||||
handleCrash(action);
|
||||
QSettings settings;
|
||||
settings.beginGroup("Developer");
|
||||
if (settings.value(MenuOption::DisplayCrashOptions).toBool()) {
|
||||
Action action = promptUserForAction();
|
||||
if (action != DO_NOTHING) {
|
||||
handleCrash(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,9 +99,5 @@ void CrashHandler::deleteRunningMarkerFile() {
|
|||
}
|
||||
|
||||
const QString CrashHandler::runningMarkerFilePath() {
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
|
||||
applicationInfo.beginGroup("INFO");
|
||||
QCoreApplication::setOrganizationName(applicationInfo.value("organizationName").toString());
|
||||
return QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + RUNNING_MARKER_FILENAME;
|
||||
}
|
||||
|
|
|
@ -575,6 +575,7 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowOwned);
|
||||
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowHulls);
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true);
|
||||
addActionToQMenuAndActionHash(developerMenu, MenuOption::CrashInterface, 0, qApp, SLOT(crashApplication()));
|
||||
|
||||
MenuWrapper* helpMenu = addMenu("Help");
|
||||
|
|
|
@ -173,6 +173,7 @@ namespace MenuOption {
|
|||
const QString DisableLightEntities = "Disable Light Entities";
|
||||
const QString DisableNackPackets = "Disable Entity NACK Packets";
|
||||
const QString DiskCacheEditor = "Disk Cache Editor";
|
||||
const QString DisplayCrashOptions = "Display Crash Options";
|
||||
const QString DisplayHands = "Show Hand Info";
|
||||
const QString DisplayHandTargets = "Show Hand Targets";
|
||||
const QString DisplayModelBounds = "Display Model Bounds";
|
||||
|
|
|
@ -35,9 +35,9 @@ namespace Setting {
|
|||
settingsManagerThread->quit();
|
||||
settingsManagerThread->wait();
|
||||
}
|
||||
|
||||
// Sets up the settings private instance. Should only be run once at startup
|
||||
void init() {
|
||||
|
||||
// Set up application settings. Should only be run once at startup.
|
||||
void preInit() {
|
||||
// read the ApplicationInfo.ini file for Name/Version/Domain information
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
|
||||
|
@ -46,7 +46,10 @@ namespace Setting {
|
|||
QCoreApplication::setApplicationName(applicationInfo.value("name").toString());
|
||||
QCoreApplication::setOrganizationName(applicationInfo.value("organizationName").toString());
|
||||
QCoreApplication::setOrganizationDomain(applicationInfo.value("organizationDomain").toString());
|
||||
|
||||
}
|
||||
|
||||
// Sets up the settings private instance. Should only be run once at startup. preInit() must be run beforehand,
|
||||
void init() {
|
||||
// Let's set up the settings Private instance on its own thread
|
||||
QThread* thread = new QThread();
|
||||
Q_CHECK_PTR(thread);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <QVariant>
|
||||
|
||||
namespace Setting {
|
||||
void preInit();
|
||||
void init();
|
||||
void cleanupSettings();
|
||||
|
||||
|
|
Loading…
Reference in a new issue