mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
More tweaks.
This commit is contained in:
parent
852163bf68
commit
a1e722181e
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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__);
|
||||
}
|
||||
|
||||
|
@ -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())
|
||||
@ -759,15 +759,15 @@ void CMeter::UpdateToolTip()
|
||||
{
|
||||
if (_wcsicmp(m_ToolTipIcon.c_str(), L"INFO") == 0)
|
||||
{
|
||||
hIcon = (HICON) TTI_INFO;
|
||||
hIcon = (HICON)TTI_INFO;
|
||||
}
|
||||
else if (_wcsicmp(m_ToolTipIcon.c_str(), L"WARNING") == 0)
|
||||
{
|
||||
hIcon = (HICON) TTI_WARNING;
|
||||
hIcon = (HICON)TTI_WARNING;
|
||||
}
|
||||
else if (_wcsicmp(m_ToolTipIcon.c_str(), L"ERROR") == 0)
|
||||
{
|
||||
hIcon = (HICON) TTI_ERROR;
|
||||
hIcon = (HICON)TTI_ERROR;
|
||||
}
|
||||
else if (_wcsicmp(m_ToolTipIcon.c_str(), L"QUESTION") == 0)
|
||||
{
|
||||
@ -779,14 +779,14 @@ void CMeter::UpdateToolTip()
|
||||
}
|
||||
else
|
||||
{
|
||||
hIcon = (HICON) LoadImage(NULL, m_ToolTipIcon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
|
||||
hIcon = (HICON)LoadImage(NULL, m_ToolTipIcon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
|
||||
destroy = true;
|
||||
}
|
||||
}
|
||||
|
||||
text = m_ToolTipTitle;
|
||||
ReplaceToolTipMeasures(text);
|
||||
SendMessage(hwndTT, TTM_SETTITLE, (WPARAM) hIcon, (LPARAM) text.c_str());
|
||||
SendMessage(hwndTT, TTM_SETTITLE, (WPARAM) hIcon, (LPARAM)text.c_str());
|
||||
|
||||
if (destroy)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
//}
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user