mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Additional changes to 05d4304
This commit is contained in:
parent
05d43047db
commit
1d75adc265
@ -1513,9 +1513,10 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||||||
int sel = ListBox_GetCurSel(item);
|
int sel = ListBox_GetCurSel(item);
|
||||||
const std::vector<std::wstring>& themes = Rainmeter->GetAllThemes();
|
const std::vector<std::wstring>& themes = Rainmeter->GetAllThemes();
|
||||||
|
|
||||||
std::wstring args = Rainmeter->GetThemePath();
|
std::wstring args = L"\"" + Rainmeter->GetThemePath();
|
||||||
args += themes[sel];
|
args += themes[sel];
|
||||||
args += L"\\Rainmeter.thm";
|
args += L"\\Rainmeter.thm";
|
||||||
|
args += L'"';
|
||||||
RunFile(Rainmeter->GetSkinEditor().c_str(), args.c_str());
|
RunFile(Rainmeter->GetSkinEditor().c_str(), args.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -82,11 +82,10 @@ void RunCommand(std::wstring command)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunFile(const WCHAR* file, const WCHAR* args, bool asAdmin)
|
void RunFile(const WCHAR* file, const WCHAR* args)
|
||||||
{
|
{
|
||||||
SHELLEXECUTEINFO si = {sizeof(SHELLEXECUTEINFO)};
|
SHELLEXECUTEINFO si = {sizeof(SHELLEXECUTEINFO)};
|
||||||
si.hwnd = NULL;
|
si.lpVerb = L"open";
|
||||||
si.lpVerb = asAdmin ? L"runas" : L"open";
|
|
||||||
si.lpFile = file;
|
si.lpFile = file;
|
||||||
si.nShow = SW_SHOWNORMAL;
|
si.nShow = SW_SHOWNORMAL;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ void LogWithArgs(int nLevel, const WCHAR* format, ...);
|
|||||||
void LogError(CError& error);
|
void LogError(CError& error);
|
||||||
|
|
||||||
void RunCommand(std::wstring command);
|
void RunCommand(std::wstring command);
|
||||||
void RunFile(const WCHAR* file, const WCHAR* args = NULL, bool asAdmin = false);
|
void RunFile(const WCHAR* file, const WCHAR* args = NULL);
|
||||||
|
|
||||||
WCHAR* GetString(UINT id);
|
WCHAR* GetString(UINT id);
|
||||||
std::wstring GetFormattedString(UINT id, ...);
|
std::wstring GetFormattedString(UINT id, ...);
|
||||||
|
@ -1283,21 +1283,18 @@ void CRainmeter::ReloadSettings()
|
|||||||
|
|
||||||
void CRainmeter::EditSettings()
|
void CRainmeter::EditSettings()
|
||||||
{
|
{
|
||||||
std::wstring file = L"\"" + m_IniFile + L"\"";
|
std::wstring file = L"\"" + m_IniFile;
|
||||||
|
file += L'"';
|
||||||
RunFile(m_SkinEditor.c_str(), file.c_str());
|
RunFile(m_SkinEditor.c_str(), file.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRainmeter::EditSkinFile(const std::wstring& name, const std::wstring& iniFile)
|
void CRainmeter::EditSkinFile(const std::wstring& name, const std::wstring& iniFile)
|
||||||
{
|
{
|
||||||
std::wstring args = m_SkinPath + name;
|
std::wstring args = L"\"" + m_SkinPath;
|
||||||
|
args += name;
|
||||||
args += L'\\';
|
args += L'\\';
|
||||||
args += iniFile;
|
args += iniFile;
|
||||||
bool writable = CSystem::IsFileWritable(args.c_str());
|
RunFile(m_SkinEditor.c_str(), args.c_str());
|
||||||
|
|
||||||
args = L"\"" + args + L"\"";
|
|
||||||
|
|
||||||
// Execute as admin if in protected location
|
|
||||||
RunFile(m_SkinEditor.c_str(), args.c_str(), !writable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRainmeter::OpenSkinFolder(const std::wstring& name)
|
void CRainmeter::OpenSkinFolder(const std::wstring& name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user