Additional changes to 05d4304

This commit is contained in:
Birunthan Mohanathas 2012-08-18 09:45:16 +03:00
parent 05d43047db
commit 1d75adc265
4 changed files with 10 additions and 13 deletions

View File

@ -1513,9 +1513,10 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam)
int sel = ListBox_GetCurSel(item);
const std::vector<std::wstring>& themes = Rainmeter->GetAllThemes();
std::wstring args = Rainmeter->GetThemePath();
std::wstring args = L"\"" + Rainmeter->GetThemePath();
args += themes[sel];
args += L"\\Rainmeter.thm";
args += L'"';
RunFile(Rainmeter->GetSkinEditor().c_str(), args.c_str());
}
break;

View File

@ -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)};
si.hwnd = NULL;
si.lpVerb = asAdmin ? L"runas" : L"open";
si.lpVerb = L"open";
si.lpFile = file;
si.nShow = SW_SHOWNORMAL;

View File

@ -50,7 +50,7 @@ void LogWithArgs(int nLevel, const WCHAR* format, ...);
void LogError(CError& error);
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);
std::wstring GetFormattedString(UINT id, ...);

View File

@ -1283,21 +1283,18 @@ void CRainmeter::ReloadSettings()
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());
}
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 += iniFile;
bool writable = CSystem::IsFileWritable(args.c_str());
args = L"\"" + args + L"\"";
// Execute as admin if in protected location
RunFile(m_SkinEditor.c_str(), args.c_str(), !writable);
RunFile(m_SkinEditor.c_str(), args.c_str());
}
void CRainmeter::OpenSkinFolder(const std::wstring& name)