|
11 | 11 |
|
12 | 12 | #if defined(LAZY_DEBUG) |
13 | 13 | #include <iostream> |
14 | | - |
15 | | - #include "include/error_debug.hxx" |
16 | 14 | using std::cout; |
17 | 15 | #endif |
18 | 16 |
|
| 17 | +#include "../front_end_utils/include/error_types.hxx" |
19 | 18 | using namespace Lazyboard::ffi; |
| 19 | +using Lazyboard::front_end_utils::error_to_string; |
| 20 | +using Lazyboard::front_end_utils::ErrorTypes; |
20 | 21 |
|
21 | 22 | using std::make_unique; |
22 | 23 | using std::string; |
@@ -52,18 +53,21 @@ void Self::set_main_window_theme(QMainWindow *main_window, |
52 | 53 | if (!bg_hex.isValid() || !fg_hex.isValid() || !bg_btn_hex.isValid() || |
53 | 54 | !fg_btn_hex.isValid() || !bg_header_table_hex.isValid() || |
54 | 55 | !fg_header_table_hex.isValid()) { |
55 | | - QMessageBox::critical( |
56 | | - main_window, "Error", |
57 | | - "Invalid HEX color, please check your configuration"); |
| 56 | + // clang-format off |
| 57 | + const auto error_name = error_to_string(ErrorTypes::INVALID_HEX_COLOR); |
| 58 | + const auto error_message = QString(R"( |
| 59 | +Invalid HEX color, please check your TOML configuration |
| 60 | +Error name: %1 |
| 61 | + )").arg(error_name.data()); // clang-format on |
| 62 | + |
| 63 | + QMessageBox::critical(main_window, "Error", error_message); |
58 | 64 |
|
59 | 65 | // clang-format off |
60 | 66 | #if defined (LAZY_DEBUG) |
61 | | - const auto &type_err = error_type().at(ErrorDebugType::INVALID_HEX_COLOR); |
62 | | - |
63 | 67 | stringstream string_stream_debug; |
64 | 68 | string_stream_debug |
65 | 69 | << "[DEBUG] Found error when load TOML configuration:\n" |
66 | | - << "[DEBUG] Error Type: " << type_err << "\n" |
| 70 | + << "[DEBUG] Error Type: " << error_name << "\n" |
67 | 71 | << "[DEBUG] " << bg_color << "\n" |
68 | 72 | << "[DEBUG] " << fg_color << "\n" |
69 | 73 | << "[DEBUG] " << bg_button_color << "\n" |
|
0 commit comments