Naming changes and clang format

This commit is contained in:
vitor-k 2019-09-14 18:14:23 -03:00
parent 356fd60520
commit 66b1e419c3
5 changed files with 10 additions and 9 deletions

View File

@ -384,7 +384,8 @@ void Config::ReadValues() {
UISettings::values.first_start = ReadSetting("firstStart", true).toBool(); UISettings::values.first_start = ReadSetting("firstStart", true).toBool();
UISettings::values.callout_flags = ReadSetting("calloutFlags", 0).toUInt(); UISettings::values.callout_flags = ReadSetting("calloutFlags", 0).toUInt();
UISettings::values.show_console = ReadSetting("showConsole", false).toBool(); UISettings::values.show_console = ReadSetting("showConsole", false).toBool();
UISettings::values.pause_when_on_background = ReadSetting("pauseWhenOnBackground", false).toBool(); UISettings::values.pause_when_in_background =
ReadSetting("pauseWhenInBackground", false).toBool();
qt_config->beginGroup("Multiplayer"); qt_config->beginGroup("Multiplayer");
UISettings::values.nickname = ReadSetting("nickname", "").toString(); UISettings::values.nickname = ReadSetting("nickname", "").toString();
@ -637,7 +638,7 @@ void Config::SaveValues() {
WriteSetting("firstStart", UISettings::values.first_start, true); WriteSetting("firstStart", UISettings::values.first_start, true);
WriteSetting("calloutFlags", UISettings::values.callout_flags, 0); WriteSetting("calloutFlags", UISettings::values.callout_flags, 0);
WriteSetting("showConsole", UISettings::values.show_console, false); WriteSetting("showConsole", UISettings::values.show_console, false);
WriteSetting("pauseWhenOnBackground", UISettings::values.pause_when_on_background, false); WriteSetting("pauseWhenInBackground", UISettings::values.pause_when_in_background, false);
qt_config->beginGroup("Multiplayer"); qt_config->beginGroup("Multiplayer");
WriteSetting("nickname", UISettings::values.nickname, ""); WriteSetting("nickname", UISettings::values.nickname, "");

View File

@ -26,7 +26,7 @@ ConfigureGeneral::~ConfigureGeneral() = default;
void ConfigureGeneral::SetConfiguration() { void ConfigureGeneral::SetConfiguration() {
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing);
ui->toggle_background_pause->setChecked(UISettings::values.pause_when_on_background); ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background);
ui->toggle_update_check->setChecked(UISettings::values.check_for_update_on_start); ui->toggle_update_check->setChecked(UISettings::values.check_for_update_on_start);
ui->toggle_auto_update->setChecked(UISettings::values.update_on_close); ui->toggle_auto_update->setChecked(UISettings::values.update_on_close);
@ -54,7 +54,7 @@ void ConfigureGeneral::ResetDefaults() {
void ConfigureGeneral::ApplyConfiguration() { void ConfigureGeneral::ApplyConfiguration() {
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
UISettings::values.pause_when_on_background = ui->toggle_background_pause->isChecked(); UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked();
UISettings::values.check_for_update_on_start = ui->toggle_update_check->isChecked(); UISettings::values.check_for_update_on_start = ui->toggle_update_check->isChecked();
UISettings::values.update_on_close = ui->toggle_auto_update->isChecked(); UISettings::values.update_on_close = ui->toggle_auto_update->isChecked();

View File

@ -499,8 +499,8 @@ void GMainWindow::RestoreUIState() {
statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked());
} }
void GMainWindow::OnLoseFocus(Qt::ApplicationState state) { void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
if (UISettings::values.pause_when_on_background) { if (UISettings::values.pause_when_in_background) {
if (ui.action_Pause->isEnabled() && if (ui.action_Pause->isEnabled() &&
(state == Qt::ApplicationSuspended || (state == Qt::ApplicationSuspended ||
state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
@ -2030,7 +2030,7 @@ int main(int argc, char* argv[]) {
main_window.show(); main_window.show();
QObject::connect(&app, &QGuiApplication::applicationStateChanged, &main_window, QObject::connect(&app, &QGuiApplication::applicationStateChanged, &main_window,
&GMainWindow::OnLoseFocus); &GMainWindow::OnAppFocusStateChanged);
int result = app.exec(); int result = app.exec();
detached_tasks.WaitForAllTasks(); detached_tasks.WaitForAllTasks();

View File

@ -69,7 +69,7 @@ public:
std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc; std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc;
public slots: public slots:
void OnLoseFocus(Qt::ApplicationState state); void OnAppFocusStateChanged(Qt::ApplicationState state);
signals: signals:
/** /**

View File

@ -72,7 +72,7 @@ struct Values {
bool confirm_before_closing; bool confirm_before_closing;
bool first_start; bool first_start;
bool pause_when_on_background; bool pause_when_in_background;
bool updater_found; bool updater_found;
bool update_on_close; bool update_on_close;