mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Manage:
- Fixed that the selected skin isn't loaded when clicking "Load" button or menu. - Fixed that the selected skin tab isn't disabled correctly when unloading the skin via the skin context menu.
This commit is contained in:
parent
2e128c75be
commit
3518dbf07e
@ -411,7 +411,7 @@ void CDialogManage::CTabSkins::Update(CMeterWindow* meterWindow, bool deleted)
|
|||||||
{
|
{
|
||||||
if (meterWindow)
|
if (meterWindow)
|
||||||
{
|
{
|
||||||
if (m_IgnoreUpdate)
|
if (!deleted && m_IgnoreUpdate)
|
||||||
{
|
{
|
||||||
// Changed setting from dialog, no need to update
|
// Changed setting from dialog, no need to update
|
||||||
m_IgnoreUpdate = false;
|
m_IgnoreUpdate = false;
|
||||||
@ -881,10 +881,10 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
if (!m_SkinWindow)
|
if (!m_SkinWindow)
|
||||||
{
|
{
|
||||||
CMeterWindow* mw = Rainmeter->GetMeterWindow(m_SkinName);
|
// Skin not active, load
|
||||||
if (mw)
|
std::pair<int, int> indexes = Rainmeter->GetMeterWindowIndex(m_SkinName, m_FileName);
|
||||||
|
if (indexes.first != -1 && indexes.second != -1)
|
||||||
{
|
{
|
||||||
std::pair<int, int> indexes = Rainmeter->GetMeterWindowIndex(mw);
|
|
||||||
Rainmeter->ActivateConfig(indexes.first, indexes.second);
|
Rainmeter->ActivateConfig(indexes.first, indexes.second);
|
||||||
|
|
||||||
// Fake selection change to update controls
|
// Fake selection change to update controls
|
||||||
@ -984,6 +984,8 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
WritePrivateProfileString(m_SkinName.c_str(), L"LoadOrder", buffer, Rainmeter->GetIniFile().c_str());
|
WritePrivateProfileString(m_SkinName.c_str(), L"LoadOrder", buffer, Rainmeter->GetIniFile().c_str());
|
||||||
std::pair<int, int> indexes = Rainmeter->GetMeterWindowIndex(m_SkinWindow);
|
std::pair<int, int> indexes = Rainmeter->GetMeterWindowIndex(m_SkinWindow);
|
||||||
|
if (indexes.first != -1)
|
||||||
|
{
|
||||||
Rainmeter->SetLoadOrder(indexes.first, value);
|
Rainmeter->SetLoadOrder(indexes.first, value);
|
||||||
|
|
||||||
std::multimap<int, CMeterWindow*> windows;
|
std::multimap<int, CMeterWindow*> windows;
|
||||||
@ -1000,6 +1002,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON:
|
case IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON:
|
||||||
|
@ -2325,11 +2325,11 @@ void CRainmeter::ClearDeleteLaterList()
|
|||||||
if ((*iter).second == meterWindow)
|
if ((*iter).second == meterWindow)
|
||||||
{
|
{
|
||||||
m_Meters.erase(iter);
|
m_Meters.erase(iter);
|
||||||
CDialogManage::UpdateSkins(meterWindow, true);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CDialogManage::UpdateSkins(meterWindow, true);
|
||||||
delete meterWindow;
|
delete meterWindow;
|
||||||
}
|
}
|
||||||
while (!m_DelayDeleteList.empty());
|
while (!m_DelayDeleteList.empty());
|
||||||
@ -2422,24 +2422,26 @@ CMeterWindow* CRainmeter::GetMeterWindowByINI(const std::wstring& ini_searching)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<int, int> CRainmeter::GetMeterWindowIndex(CMeterWindow* meterWindow)
|
std::pair<int, int> CRainmeter::GetMeterWindowIndex(const std::wstring& config, const std::wstring& iniFile)
|
||||||
{
|
{
|
||||||
std::pair<int, int> indexes;
|
std::pair<int, int> indexes;
|
||||||
|
|
||||||
for (int i = 0, isize = (int)m_ConfigStrings.size(); i < isize; ++i)
|
for (int i = 0, isize = (int)m_ConfigStrings.size(); i < isize; ++i)
|
||||||
{
|
{
|
||||||
if (_wcsicmp(m_ConfigStrings[i].config.c_str(), meterWindow->GetSkinName().c_str()) == 0)
|
if (_wcsicmp(m_ConfigStrings[i].config.c_str(), config.c_str()) == 0)
|
||||||
{
|
{
|
||||||
for (int j = 0, jsize = (int)m_ConfigStrings[i].iniFiles.size(); j < jsize; ++j)
|
for (int j = 0, jsize = (int)m_ConfigStrings[i].iniFiles.size(); j < jsize; ++j)
|
||||||
{
|
{
|
||||||
if (_wcsicmp(m_ConfigStrings[i].iniFiles[j].c_str(), meterWindow->GetSkinIniFile().c_str()) == 0)
|
if (_wcsicmp(m_ConfigStrings[i].iniFiles[j].c_str(), iniFile.c_str()) == 0)
|
||||||
{
|
{
|
||||||
indexes = std::make_pair(i, j);
|
indexes = std::make_pair(i, j);
|
||||||
|
return indexes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indexes = std::make_pair(-1, -1); // error
|
||||||
return indexes;
|
return indexes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,8 @@ public:
|
|||||||
|
|
||||||
CMeterWindow* GetMeterWindow(const std::wstring& config);
|
CMeterWindow* GetMeterWindow(const std::wstring& config);
|
||||||
CMeterWindow* GetMeterWindowByINI(const std::wstring& ini_searching);
|
CMeterWindow* GetMeterWindowByINI(const std::wstring& ini_searching);
|
||||||
std::pair<int, int> GetMeterWindowIndex(CMeterWindow* meterWindow);
|
std::pair<int, int> GetMeterWindowIndex(const std::wstring& config, const std::wstring& iniFile);
|
||||||
|
std::pair<int, int> GetMeterWindowIndex(CMeterWindow* meterWindow) { return GetMeterWindowIndex(meterWindow->GetSkinName(), meterWindow->GetSkinIniFile()); }
|
||||||
|
|
||||||
CMeterWindow* GetMeterWindow(HWND hwnd);
|
CMeterWindow* GetMeterWindow(HWND hwnd);
|
||||||
void GetMeterWindowsByLoadOrder(std::multimap<int, CMeterWindow*>& windows, const std::wstring& group = L"");
|
void GetMeterWindowsByLoadOrder(std::multimap<int, CMeterWindow*>& windows, const std::wstring& group = L"");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user