From 3d394bc4bb4b0b18701f594eed9ec5b908ef9afd Mon Sep 17 00:00:00 2001 From: BigBahss Date: Wed, 3 Feb 2021 11:24:07 -0500 Subject: [PATCH] Add option to open config folder --- forms/mainwindow.ui | 6 ++++++ include/mainwindow.h | 1 + src/mainwindow.cpp | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui index ce31269f..8b4a5dd4 100644 --- a/forms/mainwindow.ui +++ b/forms/mainwindow.ui @@ -2650,6 +2650,7 @@ + @@ -2950,6 +2951,11 @@ Open Log File + + + Open Config Folder + + diff --git a/include/mainwindow.h b/include/mainwindow.h index d6754f1b..bf3a4d40 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -223,6 +223,7 @@ private slots: void on_toolButton_CollapseAll_clicked(); void on_actionAbout_Porymap_triggered(); void on_actionOpen_Log_File_triggered(); + void on_actionOpen_Config_Folder_triggered(); void on_pushButton_AddCustomHeaderField_clicked(); void on_pushButton_DeleteCustomHeaderField_clicked(); void on_tableWidget_CustomHeaderFields_cellChanged(int row, int column); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 853d0a2b..14a8fc3d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -85,6 +85,7 @@ void MainWindow::setWindowDisabled(bool disabled) { ui->menuHelp->setDisabled(false); ui->actionAbout_Porymap->setDisabled(false); ui->actionOpen_Log_File->setDisabled(false); + ui->actionOpen_Config_Folder->setDisabled(false); if (!disabled) togglePreferenceSpecificUi(); } @@ -2698,6 +2699,10 @@ void MainWindow::on_actionOpen_Log_File_triggered() { editor->openInTextEditor(logPath, lineCount); } +void MainWindow::on_actionOpen_Config_Folder_triggered() { + QDesktopServices::openUrl(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)); +} + void MainWindow::on_actionEdit_Preferences_triggered() { if (!preferenceEditor) { preferenceEditor = new PreferenceEditor(this);