Skip to content

Commit 7c39038

Browse files
Implement function error_dialog_show to error handling friendly
1 parent 113719b commit 7c39038

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/front_end/theme_manager.cxx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ using std::cout;
1919
#endif
2020

2121
using namespace Lazyboard::ffi;
22+
using Lazyboard::front_end_utils::error_dialog_show;
2223
using Lazyboard::front_end_utils::error_to_string;
2324
using Lazyboard::front_end_utils::ErrorTypes;
2425
using Lazyboard::front_end_utils::is_valid_hex_color;
@@ -51,14 +52,10 @@ auto Self::gui_settings(RawAppConfig *raw_app_config) noexcept -> GuiSettings {
5152
}
5253

5354
void Self::on_invalid_hex_color_error(QMainWindow *main_window) {
54-
// clang-format off
55-
const auto error_name = error_to_string(ErrorTypes::INVALID_HEX_COLOR);
56-
const auto error_message = QString(R"(
57-
Invalid HEX color, please check your TOML configuration
58-
Error name: %1
59-
)").arg(error_name.data()); // clang-format on
55+
using E = ErrorTypes;
6056

61-
QMessageBox::critical(main_window, "Error", error_message);
57+
const auto message = "Invalid HEX Color in your TOML configuration";
58+
error_dialog_show(main_window, message, E::INVALID_HEX_COLOR);
6259
}
6360

6461
void Self::set_main_window_theme(QMainWindow *main_window,

0 commit comments

Comments
 (0)