More tweaks.

This commit is contained in:
Birunthan Mohanathas 2011-11-08 19:11:31 +00:00
parent 852163bf68
commit a1e722181e
7 changed files with 18 additions and 57 deletions

View File

@ -1236,7 +1236,7 @@ void CConfigParser::SetValue(const std::wstring& strSection, const std::wstring&
{
// LogWithArgs(LOG_DEBUG, L"[%s] %s=%s (size: %i)", strSection.c_str(), strKey.c_str(), strValue.c_str(), (int)m_Values.size());
std::wstring strTmp = strSection + L"::";
std::wstring strTmp = strSection + L"~";
strTmp += strKey;
m_Values[StrToLowerC(strTmp)] = strValue;
@ -1252,7 +1252,7 @@ void CConfigParser::SetValue(const std::wstring& strSection, const std::wstring&
*/
void CConfigParser::DeleteValue(const std::wstring& strSection, const std::wstring& strKey)
{
std::wstring strTmp = strSection + L"::";
std::wstring strTmp = strSection + L"~";
strTmp += strKey;
std::unordered_map<std::wstring, std::wstring>::iterator iter = m_Values.find(StrToLowerC(strTmp));
@ -1273,7 +1273,7 @@ void CConfigParser::DeleteValue(const std::wstring& strSection, const std::wstri
*/
const std::wstring& CConfigParser::GetValue(const std::wstring& strSection, const std::wstring& strKey, const std::wstring& strDefault)
{
std::wstring strTmp = strSection + L"::";
std::wstring strTmp = strSection + L"~";
strTmp += strKey;
std::unordered_map<std::wstring, std::wstring>::const_iterator iter = m_Values.find(StrToLowerC(strTmp));

View File

@ -405,9 +405,6 @@ void CDialogManage::CTabSkins::Initialize()
SetWindowLong(item, GWL_EXSTYLE, GetWindowLong(item, GWL_EXSTYLE) &~ WS_EX_CLIENTEDGE);
SetWindowPos(item, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER);
item = GetDlgItem(m_Window, IDC_MANAGESKINS_ADDMETADATA_LINK);
ShowWindow(item, SW_HIDE);
item = GetDlgItem(m_Window, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON);
tmpSz = GetString(ID_STR_DISPLAYMONITOR);
if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA)

View File

@ -833,9 +833,9 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons
// Error
std::wstring error = L"Measure=";
error += measure;
error += L" is not valid in section [";
error += L" is not valid in [";
error += name;
error += L"].";
error += L"]";
throw CError(error, __LINE__, __FILE__);
return NULL;

View File

@ -151,9 +151,9 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section)
else
{
std::wstring error = L"HKEY=" + keyname;
error += L" is not valid in measure [";
error += L" is not valid in [";
error += m_Name;
error += L"].";
error += L"]";
throw CError(error, __LINE__, __FILE__);
}

View File

@ -740,14 +740,14 @@ void CMeter::UpdateToolTip()
TOOLINFO ti = {sizeof(TOOLINFO)};
ti.hwnd = m_MeterWindow->GetWindow();
SendMessage(hwndTT, TTM_GETTOOLINFO, NULL, (LPARAM) (LPTOOLINFO) &ti);
SendMessage(hwndTT, TTM_GETTOOLINFO, NULL, (LPARAM)&ti);
std::wstring text = m_ToolTipText;
ReplaceToolTipMeasures(text);
ti.lpszText = (PTSTR) text.c_str();
ti.lpszText = (LPTSTR)text.c_str();
ti.rect = GetMeterRect();
SendMessage(hwndTT, TTM_SETTOOLINFO, NULL, (LPARAM) (LPTOOLINFO) &ti);
SendMessage(hwndTT, TTM_SETTOOLINFO, NULL, (LPARAM)&ti);
SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, NULL, m_ToolTipWidth);
if (!m_ToolTipTitle.empty())

View File

@ -3528,22 +3528,14 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
std::wstring command = m_SkinPath + m_SkinName;
command += L"\\";
command += m_SkinIniFile;
HANDLE file = CreateFile(command.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
bool writable = CSystem::IsFileWritable(command.c_str());
command.insert(0, L" \"");
command.insert(0, m_Rainmeter->GetConfigEditor());
command += L"\"";
if (file == INVALID_HANDLE_VALUE)
{
// File is in protected location, so execute as admin
RunCommand(NULL, command.c_str(), SW_SHOWNORMAL, true);
}
else
{
CloseHandle(file);
RunCommand(NULL, command.c_str(), SW_SHOWNORMAL);
}
// Execute as admin if in protected location
RunCommand(NULL, command.c_str(), SW_SHOWNORMAL, !writable);
}
else if (wParam == ID_CONTEXT_SKINMENU_REFRESH)
{

View File

@ -215,31 +215,3 @@ void LuaScript::RunString(const char* str)
}
}
}
//void LuaScript::BindVariable(const char* p_strName, void* p_pValue, const char* p_strTypeName)
//{
// PushTable();
//
// /*
// // Push the variable name we want to put a value in.
// lua_pushstring(m_State, p_strName);
// // Push the value
// tolua_pushusertype(m_State, p_pValue, p_strTypeName);
// // Bind the variable
// lua_settable(m_State, -3);
//
// // Pop our table off of the stack
// lua_pop(m_State, 1);
//
// */
//
// // Push the variable name we want to put a value in.
// lua_pushstring(m_State, "SKIN");
// // Push the value
// tolua_pushusertype(m_State, p_pValue, "CMeterWindow");
// // Bind the variable
// lua_settable(m_State, -3);
//
// //lua_pop(m_pLuaScript->GetState(), 1);
//}
//