Noise Gate plugin: Use SettingsPane 'Defaults' button instead of it's own 'Reset to defaults' (keep the UI consistent)
This commit is contained in:
parent
a2a197de18
commit
cfa485ac67
@ -208,7 +208,18 @@ void NoiseGateSettings::CancelSettings()
|
|||||||
|
|
||||||
bool NoiseGateSettings::HasDefaults() const
|
bool NoiseGateSettings::HasDefaults() const
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NoiseGateSettings::SetDefaults()
|
||||||
|
{
|
||||||
|
if(MessageBox(hwnd, Str("Plugins.NoiseGate.ConfirmReset"), Str("Plugins.NoiseGate.ResetToDefaults"), MB_YESNO) == IDYES)
|
||||||
|
{
|
||||||
|
parent->LoadDefaults();
|
||||||
|
RefreshConfig();
|
||||||
|
parent->SaveSettings();
|
||||||
|
SetChangedSettings(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -368,15 +379,6 @@ INT_PTR NoiseGateSettings::MsgClicked(int controlId, int code, HWND controlHwnd)
|
|||||||
SetWindowText(controlHwnd, Str("Plugins.NoiseGate.DisablePreview"));
|
SetWindowText(controlHwnd, Str("Plugins.NoiseGate.DisablePreview"));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case IDC_RESETTODEFAULTS:
|
|
||||||
// Display message box as resetting to defaults overrides our settings in memory
|
|
||||||
if(MessageBox(hwnd, Str("Plugins.NoiseGate.ConfirmReset"), Str("Plugins.NoiseGate.ResetToDefaults"), MB_YESNO) == IDYES) {
|
|
||||||
parent->LoadDefaults();
|
|
||||||
RefreshConfig();
|
|
||||||
parent->SaveSettings(); // Be consistent by also writing to file
|
|
||||||
SetChangedSettings(false);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -107,6 +107,7 @@ public:
|
|||||||
virtual void ApplySettings();
|
virtual void ApplySettings();
|
||||||
virtual void CancelSettings();
|
virtual void CancelSettings();
|
||||||
virtual bool HasDefaults() const;
|
virtual bool HasDefaults() const;
|
||||||
|
virtual void SetDefaults();
|
||||||
};
|
};
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
@ -25,7 +25,6 @@ FONT 8, "Ms Shell Dlg", 0, 0, 1
|
|||||||
EDITTEXT IDC_ATTACKTIME_EDIT, 252, 30, 42, 14, ES_AUTOHSCROLL | ES_NUMBER
|
EDITTEXT IDC_ATTACKTIME_EDIT, 252, 30, 42, 14, ES_AUTOHSCROLL | ES_NUMBER
|
||||||
EDITTEXT IDC_HOLDTIME_EDIT, 252, 48, 42, 14, ES_AUTOHSCROLL | ES_NUMBER
|
EDITTEXT IDC_HOLDTIME_EDIT, 252, 48, 42, 14, ES_AUTOHSCROLL | ES_NUMBER
|
||||||
EDITTEXT IDC_RELEASETIME_EDIT, 252, 66, 42, 14, ES_AUTOHSCROLL | ES_NUMBER
|
EDITTEXT IDC_RELEASETIME_EDIT, 252, 66, 42, 14, ES_AUTOHSCROLL | ES_NUMBER
|
||||||
PUSHBUTTON "Plugins.NoiseGate.ResetToDefaults", IDC_RESETTODEFAULTS, 6, 318, 78, 14
|
|
||||||
GROUPBOX "Plugins.NoiseGate.Thresholds", IDC_STATIC, 6, 6, 102, 216
|
GROUPBOX "Plugins.NoiseGate.Thresholds", IDC_STATIC, 6, 6, 102, 216
|
||||||
GROUPBOX "Plugins.NoiseGate.General", IDC_STATIC, 114, 6, 306, 84
|
GROUPBOX "Plugins.NoiseGate.General", IDC_STATIC, 114, 6, 306, 84
|
||||||
RTEXT "Plugins.NoiseGate.AttackTime", IDC_STATIC, 126, 33, 124, 8, SS_RIGHT
|
RTEXT "Plugins.NoiseGate.AttackTime", IDC_STATIC, 126, 33, 124, 8, SS_RIGHT
|
||||||
|
@ -13,4 +13,3 @@
|
|||||||
#define IDC_ATTACKTIME_EDIT 1026
|
#define IDC_ATTACKTIME_EDIT 1026
|
||||||
#define IDC_OPENTHRES_DB 1028
|
#define IDC_OPENTHRES_DB 1028
|
||||||
#define IDC_CLOSETHRES_DB 1029
|
#define IDC_CLOSETHRES_DB 1029
|
||||||
#define IDC_RESETTODEFAULTS 1031
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user