diff --git a/src/currency_core/currency_config.h b/src/currency_core/currency_config.h index bda8f652..4dfa5e12 100644 --- a/src/currency_core/currency_config.h +++ b/src/currency_core/currency_config.h @@ -211,7 +211,7 @@ #define MINER_CONFIG_FILENAME "miner_conf.json" #define GUI_SECURE_CONFIG_FILENAME "gui_secure_conf.bin" #define GUI_CONFIG_FILENAME "gui_settings.json" -#define GUI_INTERNAL_CONFIG "gui_internal_config.bin" +#define GUI_INTERNAL_CONFIG2 "gui_internal_config.json" diff --git a/src/gui/qt-daemon/application/mainwindow.cpp b/src/gui/qt-daemon/application/mainwindow.cpp index 7f509188..acdaef1c 100644 --- a/src/gui/qt-daemon/application/mainwindow.cpp +++ b/src/gui/qt-daemon/application/mainwindow.cpp @@ -387,9 +387,9 @@ void MainWindow::changeEvent(QEvent *e) bool MainWindow::store_app_config() { TRY_ENTRY(); - std::string conf_path = m_backend.get_config_folder() + "/" + GUI_INTERNAL_CONFIG; - LOG_PRINT_L0("storing gui internal config from " << conf_path); - CHECK_AND_ASSERT_MES(tools::serialize_obj_to_file(m_config, conf_path), false, "failed to store gui internal config"); + std::string conf_path = m_backend.get_config_folder() + "/" + GUI_INTERNAL_CONFIG2; + LOG_PRINT_L0("storing gui internal config to " << conf_path); + CHECK_AND_ASSERT_MES(epee::serialization::store_t_to_json_file(m_config, conf_path), false, "failed to store gui internal config"); return true; CATCH_ENTRY2(false); } @@ -397,9 +397,9 @@ bool MainWindow::store_app_config() bool MainWindow::load_app_config() { TRY_ENTRY(); - std::string conf_path = m_backend.get_config_folder() + "/" + GUI_INTERNAL_CONFIG; + std::string conf_path = m_backend.get_config_folder() + "/" + GUI_INTERNAL_CONFIG2; LOG_PRINT_L0("loading gui internal config from " << conf_path); - bool r = tools::unserialize_obj_from_file(m_config, conf_path); + bool r = epee::serialization::load_t_from_json_file(m_config, conf_path); LOG_PRINT_L0("gui internal config " << (r ? "loaded ok" : "was not loaded")); return r; CATCH_ENTRY2(false); diff --git a/src/gui/qt-daemon/application/mainwindow.h b/src/gui/qt-daemon/application/mainwindow.h index 3c67b509..57fcf129 100644 --- a/src/gui/qt-daemon/application/mainwindow.h +++ b/src/gui/qt-daemon/application/mainwindow.h @@ -8,6 +8,7 @@ #include #include "wallet/view_iface.h" +#include "serialization/keyvalue_helper_structs.h" #ifndef Q_MOC_RUN #include "wallet/wallets_manager.h" @@ -60,11 +61,20 @@ public: struct app_config { - std::pair m_window_position; - std::pair m_window_size; + + epee::kvserializable_pair m_window_position; + epee::kvserializable_pair m_window_size; bool is_maximazed; bool is_showed; bool disable_notifications; + + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(m_window_position) + KV_SERIALIZE(m_window_size) + KV_SERIALIZE(is_maximazed) + KV_SERIALIZE(is_showed) + KV_SERIALIZE(disable_notifications) + END_KV_SERIALIZE_MAP() }; protected slots: