aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-15 17:19:34 +0000
committersaturneric <[email protected]>2024-01-15 17:19:34 +0000
commit34b51c5e0915cbb11c80029aaa05d96c7115fac3 (patch)
treeabb530d5d93ab09ff95844b000958b79c07cd3c5 /src
parentfix: reload ui should not destroy core and module system (diff)
downloadGpgFrontend-34b51c5e0915cbb11c80029aaa05d96c7115fac3.tar.gz
GpgFrontend-34b51c5e0915cbb11c80029aaa05d96c7115fac3.zip
fix: slove the languange settings issue
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt82
-rw-r--r--src/core/GpgCoreInit.cpp11
-rw-r--r--src/init.cpp4
-rw-r--r--src/ui/GpgFrontendUIInit.cpp13
-rw-r--r--src/ui/dialog/Wizard.cpp8
-rw-r--r--src/ui/dialog/gnupg/GnuPGControllerDialog.cpp28
-rw-r--r--src/ui/dialog/key_generate/KeygenDialog.cpp2
-rw-r--r--src/ui/dialog/key_generate/SubkeyGenerateDialog.cpp2
-rw-r--r--src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp2
-rw-r--r--src/ui/dialog/settings/SettingsGeneral.cpp29
-rw-r--r--src/ui/dialog/settings/SettingsGeneral.h13
-rw-r--r--src/ui/main_window/MainWindow.cpp6
-rw-r--r--src/ui/main_window/MainWindowFileSlotFunction.cpp10
-rw-r--r--src/ui/widgets/KeyList.cpp4
-rw-r--r--src/ui/widgets/TextEdit.cpp2
15 files changed, 95 insertions, 121 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ef262dd1..cedb2dae 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -132,48 +132,46 @@ endif ()
file(GLOB_RECURSE ALL_SOURCE_FILES RELACTIVE ${CMAKE_SOURCE_DIR}/src/*.cpp)
# i18n
-if (SUPPORT_MULTI_LANG)
- message(STATUS "Build Multiply Languages Support")
- # Set Translation Files
- find_package(Gettext REQUIRED)
- FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
- FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
-
- set(LOCALE_OUTPUT_PATH ${RESOURCE_OUTPUT_DIRECTORY}/locales)
-
- if (NOT GETTEXT_MSGFMT_EXECUTABLE OR NOT GETTEXT_XGETTEXT_EXECUTABLE)
- message(ERROR "msgfmt or xgettext not found. Translations will *not* be installed")
- else()
- message(STATUS "Setting target translations")
- add_custom_target(translations)
- set(OUTPUT_POT_PATH ${CMAKE_SOURCE_DIR}/resource/lfs/locale/template/${PROJECT_NAME}.pot)
+message(STATUS "Build Multiply Languages Support")
+# Set Translation Files
+find_package(Gettext REQUIRED)
+FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
+FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
+
+set(LOCALE_OUTPUT_PATH ${RESOURCE_OUTPUT_DIRECTORY}/locales)
+
+if (NOT GETTEXT_MSGFMT_EXECUTABLE OR NOT GETTEXT_XGETTEXT_EXECUTABLE)
+ message(ERROR "msgfmt or xgettext not found. Translations will *not* be installed")
+else()
+ message(STATUS "Setting target translations")
+ add_custom_target(translations)
+ set(OUTPUT_POT_PATH ${CMAKE_SOURCE_DIR}/resource/lfs/locale/template/${PROJECT_NAME}.pot)
+ add_custom_command(
+ TARGET translations
+ COMMAND find ${CMAKE_SOURCE_DIR}/src -iname \"*.cpp\" | xargs xgettext --package-name=${PROJECT_NAME} --copyright-holder=Saturneric --package-version=${PROJECT_VERSION} [email protected] --add-comments="/*" --c++ -k_ -o ${OUTPUT_POT_PATH}
+ )
+
+ file(GLOB ALL_PO_FILES ${CMAKE_SOURCE_DIR}/resource/lfs/locale/po/*.po)
+ SET(GMO_FILES)
+
+ foreach (_poFile ${ALL_PO_FILES})
+ GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
+ string(REGEX REPLACE "\\.[^.]*$" "" _langName ${_poFileName})
+ message(STATUS "GNU gettext po file ${_langName}")
+ make_directory(${RESOURCE_OUTPUT_DIRECTORY}/locales)
+ make_directory(${RESOURCE_OUTPUT_DIRECTORY}/locales/${_langName}/LC_MESSAGES)
add_custom_command(
TARGET translations
- COMMAND find ${CMAKE_SOURCE_DIR}/src -iname \"*.cpp\" | xargs xgettext --package-name=${PROJECT_NAME} --copyright-holder=Saturneric --package-version=${PROJECT_VERSION} [email protected] --add-comments="/*" --c++ -k_ -o ${OUTPUT_POT_PATH}
+ COMMAND echo Processing po LANG ${_langName}
)
-
- file(GLOB ALL_PO_FILES ${CMAKE_SOURCE_DIR}/resource/lfs/locale/po/*.po)
- SET(GMO_FILES)
-
- foreach (_poFile ${ALL_PO_FILES})
- GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
- string(REGEX REPLACE "\\.[^.]*$" "" _langName ${_poFileName})
- message(STATUS "GNU gettext po file ${_langName}")
- make_directory(${RESOURCE_OUTPUT_DIRECTORY}/locales)
- make_directory(${RESOURCE_OUTPUT_DIRECTORY}/locales/${_langName}/LC_MESSAGES)
- add_custom_command(
- TARGET translations
- COMMAND echo Processing po LANG ${_langName}
- )
- add_custom_command(
- TARGET translations
- COMMAND msgfmt --check --verbose --output-file ${LOCALE_OUTPUT_PATH}/${_langName}/LC_MESSAGES/GpgFrontend.mo ${_poFile}
- )
- endforeach ()
-
- endif ()
+ add_custom_command(
+ TARGET translations
+ COMMAND msgfmt --check --verbose --output-file ${LOCALE_OUTPUT_PATH}/${_langName}/LC_MESSAGES/GpgFrontend.mo ${_poFile}
+ )
+ endforeach ()
endif ()
+
if (BASIC_ENV_CONFIG)
# Set Build Information
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h @ONLY)
@@ -354,9 +352,7 @@ endif ()
if (BUILD_APPLICATION)
set(RESOURCE_FILES ${CMAKE_SOURCE_DIR}/gpgfrontend.qrc ${APP_ICON_RESOURCE_WINDOWS} ${QON_QM_FILES})
add_custom_target(resources ALL DEPENDS ${RESOURCE_FILES})
- if (SUPPORT_MULTI_LANG)
- add_dependencies(resources translations)
- endif ()
+ add_dependencies(resources translations)
endif ()
if (BUILD_APPLICATION)
@@ -534,10 +530,8 @@ if (LINUX AND LINUX_INSTALL_SOFTWARE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/lfs/hicolor/
DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/icons/hicolor/)
endif ()
- if (SUPPORT_MULTI_LANG)
- install(DIRECTORY ${LOCALE_OUTPUT_PATH}/
- DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR})
- endif ()
+ install(DIRECTORY ${LOCALE_OUTPUT_PATH}/
+ DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR})
endif ()
message(STATUS "Resource Files: ${RESOURCE_OUTPUT_DIRECTORY}")
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index a30a407a..7691ff21 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -214,25 +214,24 @@ void InitGpgFrontendCore(CoreInitArgs args) {
.toBool();
auto use_custom_key_database_path =
- settings.value("general/use_custom_key_database_path", false)
+ settings.value("basic/use_custom_key_database_path", false)
.toBool();
auto custom_key_database_path =
- settings.value("general/custom_key_database_path", QString{})
+ settings.value("basic/custom_key_database_path", QString{})
.toString();
auto use_custom_gnupg_install_path =
- settings.value("general/use_custom_gnupg_install_path", false)
+ settings.value("basic/use_custom_gnupg_install_path", false)
.toBool();
auto custom_gnupg_install_path =
- settings.value("general/custom_gnupg_install_path", QString{})
+ settings.value("basic/custom_gnupg_install_path", QString{})
.toString();
auto use_pinentry_as_password_input_dialog =
settings
- .value("general/use_pinentry_as_password_input_dialog",
- false)
+ .value("basic/use_pinentry_as_password_input_dialog", false)
.toBool();
GF_CORE_LOG_DEBUG("core loaded if use custom key databse path: {}",
diff --git a/src/init.cpp b/src/init.cpp
index 3720056e..6f30791f 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -78,13 +78,13 @@ void InitGlobalPathEnv() {
bool use_custom_gnupg_install_path =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/use_custom_gnupg_install_path", false)
+ .value("basic/use_custom_gnupg_install_path", false)
.toBool();
QString custom_gnupg_install_path =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/custom_gnupg_install_path")
+ .value("basic/custom_gnupg_install_path")
.toString();
// add custom gnupg install path into env $PATH
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp
index 83de2a0e..f8901e1d 100644
--- a/src/ui/GpgFrontendUIInit.cpp
+++ b/src/ui/GpgFrontendUIInit.cpp
@@ -32,7 +32,6 @@
#include <qcoreapplication.h>
#include <QtNetwork>
-#include <string>
#include "core/GpgConstants.h"
#include "core/function/CoreSignalStation.h"
@@ -225,15 +224,13 @@ void InitLocale() {
auto settings =
GpgFrontend::GlobalSettingStation::GetInstance().GetSettings();
- GF_UI_LOG_DEBUG("current system locale: {}", setlocale(LC_ALL, nullptr));
+ GF_UI_LOG_INFO("current system locale: {}", setlocale(LC_ALL, nullptr));
// read from settings file
- auto lang = settings.value("general/lang", QString{}).toString();
-
- GF_UI_LOG_DEBUG("lang from settings: {}", lang);
- GF_UI_LOG_DEBUG("project name: {}", PROJECT_NAME);
- GF_UI_LOG_DEBUG(
- "locales path: {}",
+ auto lang = settings.value("basic/lang").toString();
+ GF_UI_LOG_INFO("current language settings: {}", lang);
+ GF_UI_LOG_INFO(
+ "current locales path: {}",
GpgFrontend::GlobalSettingStation::GetInstance().GetLocaleDir());
#ifndef WINDOWS
diff --git a/src/ui/dialog/Wizard.cpp b/src/ui/dialog/Wizard.cpp
index 65a5d822..dd23fcc0 100644
--- a/src/ui/dialog/Wizard.cpp
+++ b/src/ui/dialog/Wizard.cpp
@@ -91,18 +91,16 @@ IntroPage::IntroPage(QWidget* parent) : QWizardPage(parent) {
topLabel->setWordWrap(true);
// QComboBox for language selection
- auto* langLabel =
+ auto* lang_label =
new QLabel(_("If it supports the language currently being used in your "
"system, GpgFrontend will automatically set it."));
- langLabel->setWordWrap(true);
+ lang_label->setWordWrap(true);
// set layout and add widgets
auto* layout = new QVBoxLayout;
layout->addWidget(topLabel);
layout->addStretch();
-#ifdef SUPPORT_MULTI_LANG
- layout->addWidget(langLabel);
-#endif
+ layout->addWidget(lang_label);
setLayout(layout);
}
diff --git a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
index 70aa2f92..43dbcf1e 100644
--- a/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
+++ b/src/ui/dialog/gnupg/GnuPGControllerDialog.cpp
@@ -106,8 +106,8 @@ GnuPGControllerDialog::GnuPGControllerDialog(QWidget* parent)
auto settings = GlobalSettingStation::GetInstance().GetSettings();
// update settings
- if (!settings.contains("general/custom_key_database_path")) {
- settings.setValue("general/custom_key_database_path",
+ if (!settings.contains("basic/custom_key_database_path")) {
+ settings.setValue("basic/custom_key_database_path",
selected_custom_key_database_path);
}
@@ -135,8 +135,8 @@ GnuPGControllerDialog::GnuPGControllerDialog(QWidget* parent)
}
auto settings = GlobalSettingStation::GetInstance().GetSettings();
- if (!settings.contains("general/custom_gnupg_install_path")) {
- settings.setValue("general/custom_gnupg_install_path",
+ if (!settings.contains("basic/custom_gnupg_install_path")) {
+ settings.setValue("basic/custom_gnupg_install_path",
selected_custom_gnupg_install_path);
}
@@ -203,7 +203,7 @@ void GnuPGControllerDialog::slot_update_custom_key_database_path_label(
QString custom_key_database_path =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/custom_key_database_path")
+ .value("basic/custom_key_database_path")
.toString();
GF_UI_LOG_DEBUG("selected_custom_key_database_path from settings: {}",
@@ -242,7 +242,7 @@ void GnuPGControllerDialog::slot_update_custom_gnupg_install_path_label(
QString custom_gnupg_install_path =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/custom_gnupg_install_path")
+ .value("basic/custom_gnupg_install_path")
.toString();
GF_UI_LOG_DEBUG("custom_gnupg_install_path from settings: {}",
@@ -266,14 +266,14 @@ void GnuPGControllerDialog::set_settings() {
auto& settings_station = GlobalSettingStation::GetInstance();
bool non_ascii_when_export = settings_station.GetSettings()
- .value("general/non_ascii_when_export", true)
+ .value("basic/non_ascii_when_export", true)
.toBool();
GF_UI_LOG_DEBUG("non_ascii_when_export: {}", non_ascii_when_export);
if (non_ascii_when_export) ui_->asciiModeCheckBox->setCheckState(Qt::Checked);
bool const use_custom_key_database_path =
settings_station.GetSettings()
- .value("general/use_custom_key_database_path", false)
+ .value("basic/use_custom_key_database_path", false)
.toBool();
if (use_custom_key_database_path) {
ui_->keyDatabseUseCustomCheckBox->setCheckState(Qt::Checked);
@@ -284,7 +284,7 @@ void GnuPGControllerDialog::set_settings() {
bool const use_custom_gnupg_install_path =
settings_station.GetSettings()
- .value("general/use_custom_gnupg_install_path", false)
+ .value("basic/use_custom_gnupg_install_path", false)
.toBool();
if (use_custom_gnupg_install_path) {
ui_->useCustomGnuPGInstallPathCheckBox->setCheckState(Qt::Checked);
@@ -292,7 +292,7 @@ void GnuPGControllerDialog::set_settings() {
bool const use_pinentry_as_password_input_dialog =
settings_station.GetSettings()
- .value("general/use_pinentry_as_password_input_dialog", false)
+ .value("basic/use_pinentry_as_password_input_dialog", false)
.toBool();
if (use_pinentry_as_password_input_dialog) {
ui_->usePinentryAsPasswordInputDialogCheckBox->setCheckState(Qt::Checked);
@@ -308,13 +308,13 @@ void GnuPGControllerDialog::apply_settings() {
auto settings =
GpgFrontend::GlobalSettingStation::GetInstance().GetSettings();
- settings.setValue("general/non_ascii_when_export",
+ settings.setValue("basic/non_ascii_when_export",
ui_->asciiModeCheckBox->isChecked());
- settings.setValue("general/use_custom_key_database_path",
+ settings.setValue("basic/use_custom_key_database_path",
ui_->keyDatabseUseCustomCheckBox->isChecked());
- settings.setValue("general/use_custom_gnupg_install_path",
+ settings.setValue("basic/use_custom_gnupg_install_path",
ui_->useCustomGnuPGInstallPathCheckBox->isChecked());
- settings.setValue("general/use_pinentry_as_password_input_dialog",
+ settings.setValue("basic/use_pinentry_as_password_input_dialog",
ui_->usePinentryAsPasswordInputDialogCheckBox->isChecked());
}
diff --git a/src/ui/dialog/key_generate/KeygenDialog.cpp b/src/ui/dialog/key_generate/KeygenDialog.cpp
index e6495481..29ea74b6 100644
--- a/src/ui/dialog/key_generate/KeygenDialog.cpp
+++ b/src/ui/dialog/key_generate/KeygenDialog.cpp
@@ -51,7 +51,7 @@ KeyGenDialog::KeyGenDialog(QWidget* parent)
bool const longer_expiration_date =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/longer_expiration_date", false)
+ .value("basic/longer_expiration_date", false)
.toBool();
max_date_time_ = longer_expiration_date
diff --git a/src/ui/dialog/key_generate/SubkeyGenerateDialog.cpp b/src/ui/dialog/key_generate/SubkeyGenerateDialog.cpp
index ab538366..1036f9fa 100644
--- a/src/ui/dialog/key_generate/SubkeyGenerateDialog.cpp
+++ b/src/ui/dialog/key_generate/SubkeyGenerateDialog.cpp
@@ -46,7 +46,7 @@ SubkeyGenerateDialog::SubkeyGenerateDialog(const KeyId& key_id, QWidget* parent)
bool longer_expiration_date =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/longer_expiration_date", false)
+ .value("basic/longer_expiration_date", false)
.toBool();
max_date_time_ = longer_expiration_date
diff --git a/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp b/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp
index d44341a4..76d24a12 100644
--- a/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeySetExpireDateDialog.cpp
@@ -102,7 +102,7 @@ void KeySetExpireDateDialog::init() {
GpgFrontend::GlobalSettingStation::GetInstance().GetSettings();
bool longer_expiration_date = longer_expiration_date =
- settings.value("general/longer_expiration_date").toBool();
+ settings.value("basic/longer_expiration_date").toBool();
auto max_date_time =
longer_expiration_date
diff --git a/src/ui/dialog/settings/SettingsGeneral.cpp b/src/ui/dialog/settings/SettingsGeneral.cpp
index ba8ce7ca..4c9c0368 100644
--- a/src/ui/dialog/settings/SettingsGeneral.cpp
+++ b/src/ui/dialog/settings/SettingsGeneral.cpp
@@ -28,13 +28,9 @@
#include "SettingsGeneral.h"
+#include "SettingsDialog.h"
#include "core/GpgModel.h"
#include "core/function/GlobalSettingStation.h"
-
-#ifdef SUPPORT_MULTI_LANG
-#include "SettingsDialog.h"
-#endif
-
#include "ui_GeneralSettings.h"
namespace GpgFrontend::UI {
@@ -70,14 +66,12 @@ GeneralTab::GeneralTab(QWidget* parent)
QString(_("Clear All Data Objects (Total Size: %1)"))
.arg(GlobalSettingStation::GetInstance().GetDataObjectsFilesSize()));
-#ifdef SUPPORT_MULTI_LANG
lang_ = SettingsDialog::ListLanguages();
for (const auto& l : lang_) {
ui_->langSelectBox->addItem(l);
}
connect(ui_->langSelectBox, qOverload<int>(&QComboBox::currentIndexChanged),
this, &GeneralTab::slot_language_changed);
-#endif
connect(ui_->clearAllLogFilesButton, &QPushButton::clicked, this, [=]() {
GlobalSettingStation::GetInstance().ClearAllLogFiles();
@@ -110,26 +104,26 @@ void GeneralTab::SetSettings() {
auto settings = GlobalSettingStation::GetInstance().GetSettings();
bool clear_gpg_password_cache =
- settings.value("general/clear_gpg_password_cache", true).toBool();
+ settings.value("basic/clear_gpg_password_cache", true).toBool();
ui_->clearGpgPasswordCacheCheckBox->setCheckState(
clear_gpg_password_cache ? Qt::Checked : Qt::Unchecked);
bool restore_text_editor_page =
- settings.value("general/restore_text_editor_page", true).toBool();
+ settings.value("basic/restore_text_editor_page", true).toBool();
ui_->restoreTextEditorPageCheckBox->setCheckState(
restore_text_editor_page ? Qt::Checked : Qt::Unchecked);
bool longer_expiration_date =
- settings.value("general/longer_expiration_date", false).toBool();
+ settings.value("basic/longer_expiration_date", false).toBool();
ui_->longerKeyExpirationDateCheckBox->setCheckState(
longer_expiration_date ? Qt::Checked : Qt::Unchecked);
bool confirm_import_keys =
- settings.value("general/confirm_import_keys", false).toBool();
+ settings.value("basic/confirm_import_keys", false).toBool();
ui_->importConfirmationCheckBox->setCheckState(
confirm_import_keys ? Qt::Checked : Qt::Unchecked);
- QString lang_key = settings.value("general/lang").toString();
+ QString lang_key = settings.value("basic/lang").toString();
QString lang_value = lang_.value(lang_key);
GF_UI_LOG_DEBUG("lang settings current: {}", lang_value.toStdString());
if (!lang_.empty()) {
@@ -144,16 +138,15 @@ void GeneralTab::ApplySettings() {
auto settings =
GpgFrontend::GlobalSettingStation::GetInstance().GetSettings();
- settings.setValue("general/longer_expiration_date",
+ settings.setValue("basic/longer_expiration_date",
ui_->longerKeyExpirationDateCheckBox->isChecked());
- settings.setValue("general/clear_gpg_password_cache",
+ settings.setValue("basic/clear_gpg_password_cache",
ui_->clearGpgPasswordCacheCheckBox->isChecked());
- settings.setValue("general/restore_text_editor_page",
+ settings.setValue("basic/restore_text_editor_page",
ui_->restoreTextEditorPageCheckBox->isChecked());
- settings.setValue("general/confirm_import_keys",
+ settings.setValue("basic/confirm_import_keys",
ui_->importConfirmationCheckBox->isChecked());
- settings.setValue("general/lang",
- lang_.key(ui_->langSelectBox->currentText()));
+ settings.setValue("basic/lang", lang_.key(ui_->langSelectBox->currentText()));
}
void GeneralTab::slot_language_changed() { emit SignalRestartNeeded(true); }
diff --git a/src/ui/dialog/settings/SettingsGeneral.h b/src/ui/dialog/settings/SettingsGeneral.h
index b7c61e52..284843d4 100644
--- a/src/ui/dialog/settings/SettingsGeneral.h
+++ b/src/ui/dialog/settings/SettingsGeneral.h
@@ -80,23 +80,16 @@ class GeneralTab : public QWidget {
private:
std::shared_ptr<Ui_GeneralSettings> ui_; ///<
-
-#ifdef SUPPORT_MULTI_LANG
- QHash<QString, QString> lang_; ///<
-#endif
-
- std::vector<QString> key_ids_list_; ///<
-
- KeyList* m_key_list_{}; ///<
+ QHash<QString, QString> lang_; ///<
+ std::vector<QString> key_ids_list_; ///<
+ KeyList* m_key_list_{}; ///<
private slots:
-#ifdef SUPPORT_MULTI_LANG
/**
* @brief
*
*/
void slot_language_changed();
-#endif
};
} // namespace GpgFrontend::UI
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp
index 0ae6d409..cdeb597a 100644
--- a/src/ui/main_window/MainWindow.cpp
+++ b/src/ui/main_window/MainWindow.cpp
@@ -129,7 +129,7 @@ void MainWindow::Init() noexcept {
if (GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/clear_gpg_password_cache", false)
+ .value("basic/clear_gpg_password_cache", false)
.toBool()) {
if (GpgFrontend::GpgAdvancedOperator::ClearGpgPasswordCache()) {
GF_UI_LOG_DEBUG("clear gpg password cache done");
@@ -178,8 +178,8 @@ void MainWindow::restore_settings() {
if (key_server.default_server < 0) key_server.default_server = 0;
auto settings = GlobalSettingStation::GetInstance().GetSettings();
- if (!settings.contains("general/non_ascii_when_export")) {
- settings.setValue("general/non_ascii_when_export", true);
+ if (!settings.contains("basic/non_ascii_when_export")) {
+ settings.setValue("basic/non_ascii_when_export", true);
}
// set appearance
diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp
index c4cce04f..80390b13 100644
--- a/src/ui/main_window/MainWindowFileSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp
@@ -53,7 +53,7 @@ void MainWindow::SlotFileEncrypt(const QString& path) {
bool const non_ascii_when_export =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/non_ascii_when_export", true)
+ .value("basic/non_ascii_when_export", true)
.toBool();
auto out_path =
SetExtensionOfOutputFile(path, kENCRYPT, !non_ascii_when_export);
@@ -161,7 +161,7 @@ void MainWindow::SlotDirectoryEncrypt(const QString& path) {
bool const non_ascii_when_export =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/non_ascii_when_export", true)
+ .value("basic/non_ascii_when_export", true)
.toBool();
auto out_path = SetExtensionOfOutputFileForArchive(path, kENCRYPT,
!non_ascii_when_export);
@@ -385,7 +385,7 @@ void MainWindow::SlotFileSign(const QString& path) {
bool const non_ascii_when_export =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/non_ascii_when_export", true)
+ .value("basic/non_ascii_when_export", true)
.toBool();
auto sig_file_path =
SetExtensionOfOutputFile(path, kSIGN, !non_ascii_when_export);
@@ -536,7 +536,7 @@ void MainWindow::SlotFileEncryptSign(const QString& path) {
bool const non_ascii_when_export =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/non_ascii_when_export", true)
+ .value("basic/non_ascii_when_export", true)
.toBool();
auto out_path =
SetExtensionOfOutputFile(path, kENCRYPT_SIGN, !non_ascii_when_export);
@@ -637,7 +637,7 @@ void MainWindow::SlotDirectoryEncryptSign(const QString& path) {
bool const non_ascii_when_export =
GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/non_ascii_when_export", true)
+ .value("basic/non_ascii_when_export", true)
.toBool();
auto out_path = SetExtensionOfOutputFileForArchive(path, kENCRYPT_SIGN,
!non_ascii_when_export);
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp
index ea33e494..ba3e983b 100644
--- a/src/ui/widgets/KeyList.cpp
+++ b/src/ui/widgets/KeyList.cpp
@@ -362,7 +362,7 @@ void KeyList::dropEvent(QDropEvent* event) {
bool confirm_import_keys = GlobalSettingStation::GetInstance()
.GetSettings()
- .value("general/confirm_import_keys", true)
+ .value("basic/confirm_import_keys", true)
.toBool();
if (confirm_import_keys) check_box->setCheckState(Qt::Checked);
@@ -384,7 +384,7 @@ void KeyList::dropEvent(QDropEvent* event) {
if (dialog->result() == QDialog::Rejected) return;
auto settings = GlobalSettingStation::GetInstance().GetSettings();
- settings.setValue("general/confirm_import_keys", check_box->isChecked());
+ settings.setValue("basic/confirm_import_keys", check_box->isChecked());
}
if (event->mimeData()->hasUrls()) {
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp
index 61fdd609..1812dd23 100644
--- a/src/ui/widgets/TextEdit.cpp
+++ b/src/ui/widgets/TextEdit.cpp
@@ -613,7 +613,7 @@ void TextEdit::slot_save_status_to_cache_for_revovery() {
GpgFrontend::GlobalSettingStation::GetInstance().GetSettings();
bool restore_text_editor_page =
- settings.value("general/restore_text_editor_page", false).toBool();
+ settings.value("basic/restore_text_editor_page", false).toBool();
if (!restore_text_editor_page) {
GF_UI_LOG_DEBUG("restore_text_editor_page is false, ignoring...");
return;