mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-11 17:37:22 +10:00
Revert "Auto-detect when setting is back to default value"
This reverts commit 998d83c15c.
This change was wrong and it shouldn't get merged in first place.
See https://github.com/Open-Shell/Open-Shell-Menu/pull/829#issuecomment-907667829 for further explanation.
Fixes #1135.
This commit is contained in:
@@ -793,10 +793,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
|
||||
}
|
||||
string.push_back(0);
|
||||
pSetting->value=CComVariant(&string[0]);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -809,10 +806,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
|
||||
if (pSetting->type>=CSetting::TYPE_STRING)
|
||||
{
|
||||
pSetting->value=value;
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_BOOL || (pSetting->type==CSetting::TYPE_INT && pSetting[1].type!=CSetting::TYPE_RADIO) || pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY || pSetting->type==CSetting::TYPE_COLOR)
|
||||
{
|
||||
@@ -821,10 +815,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
|
||||
pSetting->value=CComVariant(val?1:0);
|
||||
else
|
||||
pSetting->value=CComVariant(val);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_INT && pSetting[1].type==CSetting::TYPE_RADIO)
|
||||
{
|
||||
@@ -834,10 +825,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
|
||||
if (_wcsicmp(pRadio->name,value.bstrVal)==0)
|
||||
{
|
||||
pSetting->value=CComVariant(val);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1828,10 +1828,7 @@ void CCustomTreeDlg::SerializeData( void )
|
||||
if ((m_pSetting->flags&CSetting::FLAG_DEFAULT) || wcscmp(strNew,strOld)!=0)
|
||||
SetSettingsDirty();
|
||||
m_pSetting->value=CComVariant(strNew);
|
||||
if (m_pSetting->value==m_pSetting->defValue)
|
||||
m_pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
ItemsChanged();
|
||||
}
|
||||
|
||||
@@ -2811,10 +2808,7 @@ void CTreeSettingsDlg::ToggleItem( HTREEITEM hItem, bool bDefault )
|
||||
{
|
||||
CSettingsLockWrite lock;
|
||||
pSetting->value=CComVariant(state?0:1);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
if (pSetting->flags&CSetting::FLAG_CALLBACK)
|
||||
@@ -2838,10 +2832,7 @@ void CTreeSettingsDlg::ToggleItem( HTREEITEM hItem, bool bDefault )
|
||||
{
|
||||
CSettingsLockWrite lock;
|
||||
pTarget->value=CComVariant(val);
|
||||
if (pTarget->value==pTarget->defValue)
|
||||
pTarget->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pTarget->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pTarget->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
if (pParent->flags&CSetting::FLAG_CALLBACK)
|
||||
@@ -3052,10 +3043,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
|
||||
{
|
||||
pSetting->value=CComVariant(val);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_COLOR)
|
||||
@@ -3065,10 +3053,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
|
||||
{
|
||||
pSetting->value=CComVariant(val);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY)
|
||||
@@ -3076,10 +3061,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=g_HotKey)
|
||||
{
|
||||
pSetting->value=CComVariant(g_HotKey);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
else if (pSetting->type==CSetting::TYPE_DIRECTORY)
|
||||
@@ -3101,10 +3083,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
|
||||
if (pSetting->value.vt!=VT_BSTR || str!=pSetting->value.bstrVal)
|
||||
{
|
||||
pSetting->value=CComVariant(str);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
SetSettingsDirty();
|
||||
|
||||
@@ -3624,10 +3624,7 @@ void CCustomMenuDlg7::SerializeData( void )
|
||||
stringBuilder.push_back(0);
|
||||
CSettingsLockWrite lock;
|
||||
m_pSetting->value=CComVariant(&stringBuilder[0]);
|
||||
if (m_pSetting->value==m_pSetting->defValue)
|
||||
m_pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
|
||||
@@ -3854,10 +3851,7 @@ LRESULT CMenuStyleDlg::OnClick( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
|
||||
CheckDlgButton(IDC_RADIO_CLASSIC,pSetting->value.intVal==MENU_CLASSIC1?BST_CHECKED:BST_UNCHECKED);
|
||||
CheckDlgButton(IDC_RADIO_TWO_COLUMNS,pSetting->value.intVal==MENU_CLASSIC2?BST_CHECKED:BST_UNCHECKED);
|
||||
CheckDlgButton(IDC_RADIO_WIN7,pSetting->value.intVal==MENU_WIN7?BST_CHECKED:BST_UNCHECKED);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
|
||||
SetSettingsStyle(styleFlag,CSetting::FLAG_MENU_MASK);
|
||||
@@ -3875,10 +3869,7 @@ LRESULT CMenuStyleDlg::OnEnabled( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
|
||||
CSettingsLockWrite lock;
|
||||
CSetting *pSetting=FindSetting(L"EnableStartButton");
|
||||
pSetting->value=CComVariant(bEnabled);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
Update(false);
|
||||
@@ -3917,10 +3908,7 @@ LRESULT CMenuStyleDlg::OnButtonStyle( WORD wNotifyCode, WORD wID, HWND hWndCtl,
|
||||
CSettingsLockWrite lock;
|
||||
CSetting *pSetting=FindSetting(L"StartButtonType");
|
||||
pSetting->value=CComVariant(style);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
Update(false);
|
||||
@@ -3944,10 +3932,7 @@ LRESULT CMenuStyleDlg::OnPick( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& b
|
||||
CSettingsLockWrite lock;
|
||||
CSetting *pSetting=FindSetting(L"StartButtonPath");
|
||||
pSetting->value=CComVariant(path);
|
||||
if (pSetting->value==pSetting->defValue)
|
||||
pSetting->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSetting->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsDirty();
|
||||
}
|
||||
Update(true);
|
||||
@@ -4586,10 +4571,7 @@ void UpgradeSettings( bool bShared )
|
||||
items.Replace(L"Command=recent_items\n",L"Command=recent_programs\n");
|
||||
items.Replace(L"Command=control_panel_categories\n",L"Command=control_panel\n");
|
||||
pSettingItems->value=items;
|
||||
if (pSettingItems->value==pSettingItems->defValue)
|
||||
pSettingItems->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingItems->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingItems->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
|
||||
// set initial menu style
|
||||
@@ -4597,10 +4579,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSettingStyle->IsLocked())
|
||||
{
|
||||
pSettingStyle->value=(bTwoColumns?1:0);
|
||||
if (pSettingStyle->value==pSettingStyle->defValue)
|
||||
pSettingStyle->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingStyle->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingStyle->flags&=~CSetting::FLAG_DEFAULT;
|
||||
SetSettingsStyle(bTwoColumns?CSetting::FLAG_MENU_CLASSIC2:CSetting::FLAG_MENU_CLASSIC1,CSetting::FLAG_MENU_MASK);
|
||||
}
|
||||
|
||||
@@ -4612,10 +4591,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSetting->IsDefault())
|
||||
{
|
||||
pSettingSkin->value=pSetting->value;
|
||||
if (pSettingSkin->value==pSettingSkin->defValue)
|
||||
pSettingSkin->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
CSetting *pSettingOpt=FindSetting(bTwoColumns?L"SkinOptionsC2":L"SkinOptionsC1");
|
||||
@@ -4625,10 +4601,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSetting->IsDefault())
|
||||
{
|
||||
pSettingOpt->value=pSetting->value;
|
||||
if (pSettingOpt->value==pSettingOpt->defValue)
|
||||
pSettingOpt->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
CSetting *pSettingVar=FindSetting(bTwoColumns?L"SkinVariationC2":L"SkinVariationC1");
|
||||
@@ -4638,10 +4611,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSetting->IsDefault())
|
||||
{
|
||||
pSettingVar->value=pSetting->value;
|
||||
if (pSettingVar->value==pSettingVar->defValue)
|
||||
pSettingVar->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingVar->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingVar->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4653,10 +4623,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSetting->IsDefault())
|
||||
{
|
||||
pSettingSkin->value=pSetting->value;
|
||||
if (pSettingSkin->value==pSettingSkin->defValue)
|
||||
pSettingSkin->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
pSettingOpt=FindSetting(L"SkinOptionsA");
|
||||
@@ -4666,10 +4633,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSetting->IsDefault())
|
||||
{
|
||||
pSettingOpt->value=pSetting->value;
|
||||
if (pSettingOpt->value==pSettingOpt->defValue)
|
||||
pSettingOpt->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
pSettingVar=FindSetting(L"SkinVariationA");
|
||||
@@ -4679,10 +4643,7 @@ void UpgradeSettings( bool bShared )
|
||||
if (!pSetting->IsDefault())
|
||||
{
|
||||
pSettingVar->value=pSetting->value;
|
||||
if (pSettingVar->value==pSettingVar->defValue)
|
||||
pSettingVar->flags|=CSetting::FLAG_DEFAULT;
|
||||
else
|
||||
pSettingVar->flags&=~CSetting::FLAG_DEFAULT;
|
||||
pSettingVar->flags&=~CSetting::FLAG_DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user