mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Manage Themes: Fixed that loading backup just reloaded current setup.
This commit is contained in:
parent
6f2a7211c2
commit
559d2d2d17
@ -1363,7 +1363,11 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam)
|
||||
case IDC_MANAGETHEMES_NAME_TEXT:
|
||||
if (HIWORD(wParam) == EN_CHANGE)
|
||||
{
|
||||
BOOL state = (Edit_GetTextLength((HWND)lParam) != 0);
|
||||
WCHAR buffer[32];
|
||||
Edit_GetText((HWND)lParam, buffer, 32);
|
||||
|
||||
// Disable save button if no text or if name is "Backup"
|
||||
BOOL state = (wcslen(buffer) != 0 && _wcsicmp(buffer, L"Backup") != 0);
|
||||
EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_SAVE_BUTTON), state);
|
||||
}
|
||||
break;
|
||||
|
@ -3565,10 +3565,18 @@ void CRainmeter::LoadTheme(const std::wstring& name)
|
||||
// Delete all meter windows
|
||||
DeleteMeterWindow(NULL, false);
|
||||
|
||||
// Make a copy of current Rainmeter.ini
|
||||
std::wstring backup = GetSettingsPath() + L"Themes\\Backup";
|
||||
CreateDirectory(backup.c_str(), NULL);
|
||||
backup += L"\\Rainmeter.thm";
|
||||
|
||||
if (_wcsicmp(name.c_str(), L"Backup") == 0)
|
||||
{
|
||||
// Just load the backup
|
||||
CSystem::CopyFiles(backup, m_IniFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make a copy of current Rainmeter.ini
|
||||
CSystem::CopyFiles(m_IniFile, backup);
|
||||
|
||||
// Replace Rainmeter.ini with theme
|
||||
@ -3594,6 +3602,7 @@ void CRainmeter::LoadTheme(const std::wstring& name)
|
||||
{
|
||||
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
ReloadSettings();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user