From b40f940b51a528d3270e87d76bfa63f6d4bd0243 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 13 May 2017 20:47:47 -0700 Subject: [PATCH] UI: Add option to show stats on startup to general --- UI/data/locale/en-US.ini | 1 + UI/forms/OBSBasicSettings.ui | 207 ++++++++++++++++++----------------- UI/window-basic-main.cpp | 3 + UI/window-basic-settings.cpp | 8 ++ 4 files changed, 119 insertions(+), 100 deletions(-) diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index 9af0ca87f..cc9001a40 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -518,6 +518,7 @@ Basic.Settings.General="General" Basic.Settings.General.Theme="Theme" Basic.Settings.General.Language="Language" Basic.Settings.General.EnableAutoUpdates="Automatically check for updates on startup" +Basic.Settings.General.OpenStatsOnStartup="Open stats dialog on startup" Basic.Settings.General.WarnBeforeStartingStream="Show confirmation dialog when starting streams" Basic.Settings.General.WarnBeforeStoppingStream="Show confirmation dialog when stopping streams" Basic.Settings.General.Projectors="Projectors" diff --git a/UI/forms/OBSBasicSettings.ui b/UI/forms/OBSBasicSettings.ui index 00b8afc19..191f0bb60 100644 --- a/UI/forms/OBSBasicSettings.ui +++ b/UI/forms/OBSBasicSettings.ui @@ -200,16 +200,6 @@ - - - - Basic.Settings.General.EnableAutoUpdates - - - true - - - @@ -226,6 +216,23 @@ + + + + Basic.Settings.General.EnableAutoUpdates + + + true + + + + + + + Basic.Settings.General.OpenStatsOnStartup + + + @@ -3501,8 +3508,8 @@ 0 0 - 803 - 738 + 593 + 761 @@ -4284,8 +4291,8 @@ setCurrentIndex(int) - 159 - 30 + 310 + 29 241 @@ -4316,12 +4323,12 @@ setVisible(bool) - 240 - 46 + 250 + 39 - 240 - 44 + 250 + 39 @@ -4332,12 +4339,12 @@ setVisible(bool) - 240 - 46 + 250 + 39 - 160 - 44 + 250 + 39 @@ -4348,12 +4355,12 @@ setVisible(bool) - 240 - 46 + 250 + 39 - 240 - 43 + 250 + 39 @@ -4364,12 +4371,12 @@ setVisible(bool) - 240 - 46 + 250 + 39 - 160 - 43 + 250 + 39 @@ -4385,7 +4392,7 @@ 241 - 53 + 30 @@ -4396,12 +4403,12 @@ setEnabled(bool) - 168 - 67 + 259 + 60 - 250 - 67 + 228 + 50 @@ -4412,12 +4419,12 @@ setEnabled(bool) - 168 - 52 + 259 + 39 - 232 - 52 + 228 + 29 @@ -4432,8 +4439,8 @@ 56 - 232 - 56 + 228 + 50 @@ -4460,12 +4467,12 @@ setVisible(bool) - 240 - 46 + 250 + 39 - 240 - 45 + 250 + 39 @@ -4476,12 +4483,12 @@ setEnabled(bool) - 730 - 556 + 950 + 579 - 746 - 579 + 950 + 602 @@ -4492,12 +4499,12 @@ setEnabled(bool) - 830 - 556 + 950 + 579 - 826 - 602 + 950 + 625 @@ -4508,12 +4515,12 @@ setEnabled(bool) - 403 - 642 + 250 + 39 - 403 - 665 + 250 + 39 @@ -4524,12 +4531,12 @@ setEnabled(bool) - 733 - 317 + 950 + 340 347 - 343 + 366 @@ -4540,12 +4547,12 @@ setEnabled(bool) - 774 - 317 + 950 + 340 - 782 - 343 + 950 + 366 @@ -4556,12 +4563,12 @@ setEnabled(bool) - 820 - 317 + 950 + 340 - 837 - 366 + 950 + 389 @@ -4572,12 +4579,12 @@ setEnabled(bool) - 881 - 317 + 950 + 340 - 890 - 389 + 950 + 412 @@ -4588,12 +4595,12 @@ setEnabled(bool) - 928 - 317 + 950 + 340 - 915 - 412 + 950 + 435 @@ -4604,12 +4611,12 @@ setEnabled(bool) - 803 - 199 + 950 + 222 - 820 - 222 + 950 + 245 @@ -4620,12 +4627,12 @@ setEnabled(bool) - 747 - 245 + 950 + 268 - 753 - 268 + 950 + 291 @@ -4636,12 +4643,12 @@ setEnabled(bool) - 431 - 422 + 250 + 39 - 356 - 443 + 250 + 39 @@ -4652,12 +4659,12 @@ setEnabled(bool) - 465 - 420 + 250 + 39 - 463 - 447 + 250 + 39 @@ -4668,12 +4675,12 @@ setEnabled(bool) - 533 - 420 + 250 + 39 - 557 - 446 + 250 + 39 @@ -4684,12 +4691,12 @@ setEnabled(bool) - 504 - 420 + 250 + 39 - 494 - 465 + 250 + 39 diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 9e1495040..edcb991de 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1454,6 +1454,9 @@ void OBSBasic::OBSInit() QTStr("Basic.AutoConfig"), msg); } } + + if (config_get_bool(basicConfig, "General", "OpenStatsOnStartup")) + on_stats_triggered(); } void OBSBasic::InitHotkeys() diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 9d3988f26..dcd671355 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -291,6 +291,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) HookWidget(ui->language, COMBO_CHANGED, GENERAL_CHANGED); HookWidget(ui->theme, COMBO_CHANGED, GENERAL_CHANGED); HookWidget(ui->enableAutoUpdates, CHECK_CHANGED, GENERAL_CHANGED); + HookWidget(ui->openStatsOnStartup, CHECK_CHANGED, GENERAL_CHANGED); HookWidget(ui->warnBeforeStreamStart,CHECK_CHANGED, GENERAL_CHANGED); HookWidget(ui->warnBeforeStreamStop, CHECK_CHANGED, GENERAL_CHANGED); HookWidget(ui->hideProjectorCursor, CHECK_CHANGED, GENERAL_CHANGED); @@ -957,6 +958,9 @@ void OBSBasicSettings::LoadGeneralSettings() "General", "EnableAutoUpdates"); ui->enableAutoUpdates->setChecked(enableAutoUpdates); #endif + bool openStatsOnStartup = config_get_bool(main->Config(), + "General", "OpenStatsOnStartup"); + ui->openStatsOnStartup->setChecked(openStatsOnStartup); bool recordWhenStreaming = config_get_bool(GetGlobalConfig(), "BasicWindow", "RecordWhenStreaming"); @@ -2438,6 +2442,10 @@ void OBSBasicSettings::SaveGeneralSettings() "EnableAutoUpdates", ui->enableAutoUpdates->isChecked()); #endif + if (WidgetChanged(ui->openStatsOnStartup)) + config_set_bool(main->Config(), "General", + "OpenStatsOnStartup", + ui->openStatsOnStartup->isChecked()); if (WidgetChanged(ui->snappingEnabled)) config_set_bool(GetGlobalConfig(), "BasicWindow", "SnappingEnabled",