From 2f9908b54e3f10926707962f2bbfd10122e4aa15 Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Sat, 11 Jan 2025 13:46:32 -0500 Subject: [PATCH] move check_privilege.* to main --- scwx-qt/scwx-qt.cmake | 8 ++++---- scwx-qt/source/scwx/qt/{util => main}/check_privilege.cpp | 7 ++++--- scwx-qt/source/scwx/qt/{util => main}/check_privilege.hpp | 4 ++-- scwx-qt/source/scwx/qt/main/main.cpp | 5 ++--- 4 files changed, 12 insertions(+), 12 deletions(-) rename scwx-qt/source/scwx/qt/{util => main}/check_privilege.cpp (95%) rename scwx-qt/source/scwx/qt/{util => main}/check_privilege.hpp (84%) diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake index a386d8b9..dece221d 100644 --- a/scwx-qt/scwx-qt.cmake +++ b/scwx-qt/scwx-qt.cmake @@ -51,9 +51,11 @@ find_package(Qt${QT_VERSION_MAJOR} set(SRC_EXE_MAIN source/scwx/qt/main/main.cpp) set(HDR_MAIN source/scwx/qt/main/application.hpp + source/scwx/qt/main/check_privilege.hpp source/scwx/qt/main/main_window.hpp source/scwx/qt/main/process_validation.hpp) set(SRC_MAIN source/scwx/qt/main/application.cpp + source/scwx/qt/main/check_privilege.cpp source/scwx/qt/main/main_window.cpp source/scwx/qt/main/process_validation.cpp) set(UI_MAIN source/scwx/qt/main/main_window.ui) @@ -356,8 +358,7 @@ set(SRC_UI_SETUP source/scwx/qt/ui/setup/audio_codec_page.cpp source/scwx/qt/ui/setup/map_provider_page.cpp source/scwx/qt/ui/setup/setup_wizard.cpp source/scwx/qt/ui/setup/welcome_page.cpp) -set(HDR_UTIL source/scwx/qt/util/check_privilege.hpp - source/scwx/qt/util/color.hpp +set(HDR_UTIL source/scwx/qt/util/color.hpp source/scwx/qt/util/file.hpp source/scwx/qt/util/geographic_lib.hpp source/scwx/qt/util/imgui.hpp @@ -371,8 +372,7 @@ set(HDR_UTIL source/scwx/qt/util/check_privilege.hpp source/scwx/qt/util/q_file_input_stream.hpp source/scwx/qt/util/time.hpp source/scwx/qt/util/tooltip.hpp) -set(SRC_UTIL source/scwx/qt/util/check_privilege.cpp - source/scwx/qt/util/color.cpp +set(SRC_UTIL source/scwx/qt/util/color.cpp source/scwx/qt/util/file.cpp source/scwx/qt/util/geographic_lib.cpp source/scwx/qt/util/imgui.cpp diff --git a/scwx-qt/source/scwx/qt/util/check_privilege.cpp b/scwx-qt/source/scwx/qt/main/check_privilege.cpp similarity index 95% rename from scwx-qt/source/scwx/qt/util/check_privilege.cpp rename to scwx-qt/source/scwx/qt/main/check_privilege.cpp index 62a4c4d0..25f29f22 100644 --- a/scwx-qt/source/scwx/qt/util/check_privilege.cpp +++ b/scwx-qt/source/scwx/qt/main/check_privilege.cpp @@ -1,5 +1,5 @@ #include "scwx/qt/settings/general_settings.hpp" -#include "scwx/qt/util/check_privilege.hpp" +#include "scwx/qt/main/check_privilege.hpp" #include #include #include @@ -13,7 +13,7 @@ # include #endif -namespace scwx::qt::util +namespace scwx::qt::main { bool is_high_privilege() @@ -76,6 +76,7 @@ public: hasAppData_ = std::filesystem::exists(appDataPath); dialog_.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + dialog_.setDefaultButton(QMessageBox::No); dialog_.setCheckBox(checkBox_); }; @@ -131,4 +132,4 @@ bool PrivilegeChecker::second_check() } } -} // namespace scwx::qt::util +} // namespace scwx::qt::main diff --git a/scwx-qt/source/scwx/qt/util/check_privilege.hpp b/scwx-qt/source/scwx/qt/main/check_privilege.hpp similarity index 84% rename from scwx-qt/source/scwx/qt/util/check_privilege.hpp rename to scwx-qt/source/scwx/qt/main/check_privilege.hpp index 7935e54a..34da5bfc 100644 --- a/scwx-qt/source/scwx/qt/util/check_privilege.hpp +++ b/scwx-qt/source/scwx/qt/main/check_privilege.hpp @@ -2,7 +2,7 @@ #include -namespace scwx::qt::util +namespace scwx::qt::main { bool is_high_privilege(); @@ -22,4 +22,4 @@ private: std::unique_ptr p; }; -} // namespace scwx::qt::util +} // namespace scwx::qt::main diff --git a/scwx-qt/source/scwx/qt/main/main.cpp b/scwx-qt/source/scwx/qt/main/main.cpp index 4212050e..dde35cbb 100644 --- a/scwx-qt/source/scwx/qt/main/main.cpp +++ b/scwx-qt/source/scwx/qt/main/main.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -82,7 +81,7 @@ int main(int argc, char* argv[]) } // Test to see if scwx was run with high privilege - scwx::qt::util::PrivilegeChecker privilegeChecker; + scwx::qt::main::PrivilegeChecker privilegeChecker; if (privilegeChecker.first_check()) { return 0;