Skip to content

Commit

Permalink
Showing notification when config was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Jun 24, 2022
1 parent 52d1d3a commit cb7aa14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/client/windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace {

void update_config(bool check_modified = true) {
if (g_config_file.update(check_modified)) {
verbose("Configuration updated");
message("Configuration updated");
send_config();
}
}
Expand Down
16 changes: 10 additions & 6 deletions src/common/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@ namespace {
std::fflush(stdout);
}

if (notify) {
auto buffer = std::array<char, 1024>();
std::vsnprintf(buffer.data(), buffer.size(), format, args);
return show_notification(buffer.data());
}
auto buffer = std::array<char, 1024>();
std::vsnprintf(buffer.data(), buffer.size(), format, args);
if (notify)
show_notification(buffer.data());

#if !defined(NDEBUG)
OutputDebugStringA(buffer.data());
OutputDebugStringA("\n");
#endif
}
} // namespace

void message(const char* format, ...) {
va_list args;
va_start(args, format);
vprint(false, format, args);
vprint(true, format, args);
va_end(args);
}

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/Key.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ enum class Key : uint16_t {
NumpadDivide = 0x0062,
PrintScreen = 0x0063,
AltRight = 0x0064,
Cancel = 0x0065,
Cancel = 0x0065,
Home = 0x0066,
ArrowUp = 0x0067,
PageUp = 0x0068,
Expand Down

0 comments on commit cb7aa14

Please sign in to comment.