@ -24,8 +24,8 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
SetConfiguration ( ) ;
if ( Settings : : IsConfiguringGlobal ( ) ) {
connect ( ui - > toggle_ frame _limit, & QCheckBox : : clicked , ui - > frame _limit,
[ this ] ( ) { ui - > frame _limit- > setEnabled ( ui - > toggle_ frame _limit- > isChecked ( ) ) ; } ) ;
connect ( ui - > toggle_ speed _limit, & QCheckBox : : clicked , ui - > speed _limit,
[ this ] ( ) { ui - > speed _limit- > setEnabled ( ui - > toggle_ speed _limit- > isChecked ( ) ) ; } ) ;
}
connect ( ui - > button_reset_defaults , & QPushButton : : clicked , this ,
@ -45,16 +45,16 @@ void ConfigureGeneral::SetConfiguration() {
ui - > toggle_background_pause - > setChecked ( UISettings : : values . pause_when_in_background . GetValue ( ) ) ;
ui - > toggle_hide_mouse - > setChecked ( UISettings : : values . hide_mouse . GetValue ( ) ) ;
ui - > toggle_ frame _limit- > setChecked ( Settings : : values . use_ frame _limit. GetValue ( ) ) ;
ui - > frame _limit- > setValue ( Settings : : values . frame _limit. GetValue ( ) ) ;
ui - > toggle_ speed _limit- > setChecked ( Settings : : values . use_ speed _limit. GetValue ( ) ) ;
ui - > speed _limit- > setValue ( Settings : : values . speed _limit. GetValue ( ) ) ;
ui - > button_reset_defaults - > setEnabled ( runtime_lock ) ;
if ( Settings : : IsConfiguringGlobal ( ) ) {
ui - > frame _limit- > setEnabled ( Settings : : values . use_ frame _limit. GetValue ( ) ) ;
ui - > speed _limit- > setEnabled ( Settings : : values . use_ speed _limit. GetValue ( ) ) ;
} else {
ui - > frame _limit- > setEnabled ( Settings : : values . use_ frame _limit. GetValue ( ) & &
use_ frame _limit ! = ConfigurationShared : : CheckState : : Global ) ;
ui - > speed _limit- > setEnabled ( Settings : : values . use_ speed _limit. GetValue ( ) & &
use_ speed _limit ! = ConfigurationShared : : CheckState : : Global ) ;
}
}
@ -88,19 +88,19 @@ void ConfigureGeneral::ApplyConfiguration() {
UISettings : : values . hide_mouse = ui - > toggle_hide_mouse - > isChecked ( ) ;
// Guard if during game and set to game-specific value
if ( Settings : : values . use_ frame _limit. UsingGlobal ( ) ) {
Settings : : values . use_ frame_limit. SetValue ( ui - > toggle_frame _limit- > checkState ( ) = =
if ( Settings : : values . use_ speed _limit. UsingGlobal ( ) ) {
Settings : : values . use_ speed_limit. SetValue ( ui - > toggle_speed _limit- > checkState ( ) = =
Qt : : Checked ) ;
Settings : : values . frame_limit. SetValue ( ui - > frame _limit- > value ( ) ) ;
Settings : : values . speed_limit. SetValue ( ui - > speed _limit- > value ( ) ) ;
}
} else {
bool global_ frame_limit = use_frame _limit = = ConfigurationShared : : CheckState : : Global ;
Settings : : values . use_ frame_limit. SetGlobal ( global_frame _limit) ;
Settings : : values . frame_limit. SetGlobal ( global_frame _limit) ;
if ( ! global_ frame _limit) {
Settings : : values . use_ frame_limit. SetValue ( ui - > toggle_frame _limit- > checkState ( ) = =
bool global_ speed_limit = use_speed _limit = = ConfigurationShared : : CheckState : : Global ;
Settings : : values . use_ speed_limit. SetGlobal ( global_speed _limit) ;
Settings : : values . speed_limit. SetGlobal ( global_speed _limit) ;
if ( ! global_ speed _limit) {
Settings : : values . use_ speed_limit. SetValue ( ui - > toggle_speed _limit- > checkState ( ) = =
Qt : : Checked ) ;
Settings : : values . frame_limit. SetValue ( ui - > frame _limit- > value ( ) ) ;
Settings : : values . speed_limit. SetValue ( ui - > speed _limit- > value ( ) ) ;
}
}
}
@ -122,8 +122,8 @@ void ConfigureGeneral::SetupPerGameUI() {
// Disables each setting if:
// - A game is running (thus settings in use), and
// - A non-global setting is applied.
ui - > toggle_ frame _limit- > setEnabled ( Settings : : values . use_ frame _limit. UsingGlobal ( ) ) ;
ui - > frame _limit- > setEnabled ( Settings : : values . frame _limit. UsingGlobal ( ) ) ;
ui - > toggle_ speed _limit- > setEnabled ( Settings : : values . use_ speed _limit. UsingGlobal ( ) ) ;
ui - > speed _limit- > setEnabled ( Settings : : values . speed _limit. UsingGlobal ( ) ) ;
return ;
}
@ -135,13 +135,13 @@ void ConfigureGeneral::SetupPerGameUI() {
ui - > button_reset_defaults - > setVisible ( false ) ;
ConfigurationShared : : SetColoredTristate ( ui - > toggle_ frame _limit,
Settings : : values . use_ frame_limit, use_frame _limit) ;
ConfigurationShared : : SetColoredTristate ( ui - > toggle_ speed _limit,
Settings : : values . use_ speed_limit, use_speed _limit) ;
ConfigurationShared : : SetColoredTristate ( ui - > use_multi_core , Settings : : values . use_multi_core ,
use_multi_core ) ;
connect ( ui - > toggle_ frame _limit, & QCheckBox : : clicked , ui - > frame _limit, [ this ] ( ) {
ui - > frame _limit- > setEnabled ( ui - > toggle_ frame _limit- > isChecked ( ) & &
( use_ frame _limit ! = ConfigurationShared : : CheckState : : Global ) ) ;
connect ( ui - > toggle_ speed _limit, & QCheckBox : : clicked , ui - > speed _limit, [ this ] ( ) {
ui - > speed _limit- > setEnabled ( ui - > toggle_ speed _limit- > isChecked ( ) & &
( use_ speed _limit ! = ConfigurationShared : : CheckState : : Global ) ) ;
} ) ;
}