mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Minor fixes
This commit is contained in:
parent
c9ae008cd7
commit
6456b6adb3
@ -937,11 +937,14 @@ void CDialogAbout::CTabPlugins::Initialize()
|
|||||||
|
|
||||||
WIN32_FIND_DATA fd;
|
WIN32_FIND_DATA fd;
|
||||||
HANDLE hSearch = FindFirstFile(filter.c_str(), &fd);
|
HANDLE hSearch = FindFirstFile(filter.c_str(), &fd);
|
||||||
|
if (hSearch == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (hSearch == INVALID_HANDLE_VALUE) break; // No more files found
|
|
||||||
|
|
||||||
// Try to get the version and author
|
// Try to get the version and author
|
||||||
std::wstring tmpSz = path + fd.cFileName;
|
std::wstring tmpSz = path + fd.cFileName;
|
||||||
const WCHAR* path = tmpSz.c_str();
|
const WCHAR* path = tmpSz.c_str();
|
||||||
|
@ -1583,45 +1583,43 @@ void CDialogManage::CTabSettings::Initialize()
|
|||||||
|
|
||||||
// Scan for languages
|
// Scan for languages
|
||||||
HWND item = GetDlgItem(m_Window, IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX);
|
HWND item = GetDlgItem(m_Window, IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX);
|
||||||
WIN32_FIND_DATA fd; // Data structure describes the file found
|
|
||||||
HANDLE hSearch; // Search handle returned by FindFirstFile
|
|
||||||
|
|
||||||
std::wstring files = Rainmeter->GetPath() + L"Languages\\*.dll";
|
std::wstring files = Rainmeter->GetPath() + L"Languages\\*.dll";
|
||||||
hSearch = FindFirstFile(files.c_str(), &fd);
|
WIN32_FIND_DATA fd;
|
||||||
do
|
HANDLE hSearch = FindFirstFile(files.c_str(), &fd);
|
||||||
|
if (hSearch != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
if (hSearch == INVALID_HANDLE_VALUE) break; // No more files found
|
do
|
||||||
|
|
||||||
WCHAR* pos = wcschr(fd.cFileName, L'.');
|
|
||||||
if (pos)
|
|
||||||
{
|
{
|
||||||
LCID lcid = (LCID)wcstoul(fd.cFileName, &pos, 10);
|
WCHAR* pos = wcschr(fd.cFileName, L'.');
|
||||||
if (pos != fd.cFileName &&
|
if (pos)
|
||||||
_wcsicmp(pos, L".dll") == 0 &&
|
|
||||||
GetLocaleInfo(lcid, LOCALE_SENGLISHLANGUAGENAME, fd.cFileName, MAX_PATH) > 0)
|
|
||||||
{
|
{
|
||||||
// Strip brackets in language name
|
LCID lcid = (LCID)wcstoul(fd.cFileName, &pos, 10);
|
||||||
std::wstring text = fd.cFileName;
|
if (pos != fd.cFileName &&
|
||||||
text += L" - ";
|
_wcsicmp(pos, L".dll") == 0 &&
|
||||||
GetLocaleInfo(lcid, LOCALE_SNATIVELANGUAGENAME, fd.cFileName, MAX_PATH);
|
GetLocaleInfo(lcid, LOCALE_SENGLISHLANGUAGENAME, fd.cFileName, MAX_PATH) > 0)
|
||||||
|
|
||||||
// Some native language names don't start with a uppercase char..
|
|
||||||
LCMapString(LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, &fd.cFileName[0], 1, &fd.cFileName[0], 1);
|
|
||||||
text += fd.cFileName;
|
|
||||||
|
|
||||||
int index = ComboBox_AddString(item, text.c_str());
|
|
||||||
ComboBox_SetItemData(item, index, (LPARAM)lcid);
|
|
||||||
|
|
||||||
if (lcid == Rainmeter->GetResourceLCID())
|
|
||||||
{
|
{
|
||||||
ComboBox_SetCurSel(item, index);
|
// Strip brackets in language name
|
||||||
|
std::wstring text = fd.cFileName;
|
||||||
|
text += L" - ";
|
||||||
|
|
||||||
|
GetLocaleInfo(lcid, LOCALE_SNATIVELANGUAGENAME, fd.cFileName, MAX_PATH);
|
||||||
|
text += fd.cFileName;
|
||||||
|
|
||||||
|
int index = ComboBox_AddString(item, text.c_str());
|
||||||
|
ComboBox_SetItemData(item, index, (LPARAM)lcid);
|
||||||
|
|
||||||
|
if (lcid == Rainmeter->GetResourceLCID())
|
||||||
|
{
|
||||||
|
ComboBox_SetCurSel(item, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
while (FindNextFile(hSearch, &fd));
|
||||||
while (FindNextFile(hSearch, &fd));
|
|
||||||
|
|
||||||
FindClose(hSearch);
|
FindClose(hSearch);
|
||||||
|
}
|
||||||
|
|
||||||
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX), !Rainmeter->GetDisableVersionCheck());
|
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX), !Rainmeter->GetDisableVersionCheck());
|
||||||
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX), Rainmeter->GetDisableDragging());
|
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX), Rainmeter->GetDisableDragging());
|
||||||
|
Loading…
Reference in New Issue
Block a user