Update RomBrowserClass.cpp
Fix title case, add some spacing, rom > ROM, fix some typos, remove some punctuation, capitalize abbreviated code, adjust some wording
This commit is contained in:
parent
911c85b162
commit
a95d48d0d1
|
@ -93,7 +93,7 @@ int32_t CRomBrowser::CalcSortPosition(uint32_t lParam)
|
||||||
SortFieldInfo.Key = index;
|
SortFieldInfo.Key = index;
|
||||||
SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex);
|
SortFieldInfo.KeyAscend = UISettingsLoadBoolIndex(RomBrowser_SortAscendingIndex, SortIndex);
|
||||||
|
|
||||||
//calc new start and end
|
// Calculate new start and end
|
||||||
int32_t LastTestPos = -1;
|
int32_t LastTestPos = -1;
|
||||||
while (Start < End)
|
while (Start < End)
|
||||||
{
|
{
|
||||||
|
@ -256,7 +256,7 @@ void CRomBrowser::RomAddedToList(int32_t ListPos)
|
||||||
int32_t index = SendMessage(m_hRomList, LVM_INSERTITEM, 0, (LPARAM)&lvItem);
|
int32_t index = SendMessage(m_hRomList, LVM_INSERTITEM, 0, (LPARAM)&lvItem);
|
||||||
int32_t iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
|
int32_t iItem = ListView_GetNextItem(m_hRomList, -1, LVNI_SELECTED);
|
||||||
|
|
||||||
//if the last rom then highlight the item
|
// If the last ROM then highlight the item
|
||||||
if (iItem < 0 && _stricmp(m_RomInfo[ListPos].szFullFileName, m_LastRom.c_str()) == 0)
|
if (iItem < 0 && _stricmp(m_RomInfo[ListPos].szFullFileName, m_LastRom.c_str()) == 0)
|
||||||
{
|
{
|
||||||
ListView_SetItemState(m_hRomList, index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
|
ListView_SetItemState(m_hRomList, index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
|
||||||
|
@ -322,7 +322,7 @@ void CRomBrowser::HighLightLastRom(void)
|
||||||
}
|
}
|
||||||
m_LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, 0);
|
m_LastRom = UISettingsLoadStringIndex(File_RecentGameFileIndex, 0);
|
||||||
|
|
||||||
//Make sure Rom browser is visible
|
// Make sure ROM browser is visible
|
||||||
if (!RomBrowserVisible()) { return; }
|
if (!RomBrowserVisible()) { return; }
|
||||||
|
|
||||||
LVITEM lvItem;
|
LVITEM lvItem;
|
||||||
|
@ -335,7 +335,7 @@ void CRomBrowser::HighLightLastRom(void)
|
||||||
lvItem.iItem = index;
|
lvItem.iItem = index;
|
||||||
if (!SendMessage(m_hRomList, LVM_GETITEM, 0, (LPARAM)&lvItem)) { return; }
|
if (!SendMessage(m_hRomList, LVM_GETITEM, 0, (LPARAM)&lvItem)) { return; }
|
||||||
|
|
||||||
//Get the rom info for that item
|
// Get the ROM info for that item
|
||||||
if (lvItem.lParam < 0 || lvItem.lParam >= (LPARAM)m_RomInfo.size())
|
if (lvItem.lParam < 0 || lvItem.lParam >= (LPARAM)m_RomInfo.size())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -347,7 +347,7 @@ void CRomBrowser::HighLightLastRom(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the last rom then highlight the item
|
// If the last ROM then highlight the item
|
||||||
if (_stricmp(pRomInfo->szFullFileName, m_LastRom.c_str()) == 0)
|
if (_stricmp(pRomInfo->szFullFileName, m_LastRom.c_str()) == 0)
|
||||||
{
|
{
|
||||||
ListView_SetItemState(m_hRomList, index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
|
ListView_SetItemState(m_hRomList, index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
|
||||||
|
@ -387,7 +387,7 @@ void CRomBrowser::ResetRomBrowserColomuns(void)
|
||||||
|
|
||||||
GetFieldInfo(m_Fields);
|
GetFieldInfo(m_Fields);
|
||||||
|
|
||||||
//Remove all current coloumns
|
// Remove all current columns
|
||||||
memset(&lvColumn, 0, sizeof(lvColumn));
|
memset(&lvColumn, 0, sizeof(lvColumn));
|
||||||
lvColumn.mask = LVCF_FMT;
|
lvColumn.mask = LVCF_FMT;
|
||||||
while (ListView_GetColumn(m_hRomList, 0, &lvColumn))
|
while (ListView_GetColumn(m_hRomList, 0, &lvColumn))
|
||||||
|
@ -395,7 +395,7 @@ void CRomBrowser::ResetRomBrowserColomuns(void)
|
||||||
ListView_DeleteColumn(m_hRomList, 0);
|
ListView_DeleteColumn(m_hRomList, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add Colomuns
|
// Add Columns
|
||||||
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
||||||
lvColumn.fmt = LVCFMT_LEFT;
|
lvColumn.fmt = LVCFMT_LEFT;
|
||||||
lvColumn.pszText = szString;
|
lvColumn.pszText = szString;
|
||||||
|
@ -879,7 +879,7 @@ void CRomBrowser::RomList_PopupMenu(uint32_t /*pnmh*/)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the current Mouse location
|
// Get the current mouse location
|
||||||
POINT Mouse;
|
POINT Mouse;
|
||||||
GetCursorPos(&Mouse);
|
GetCursorPos(&Mouse);
|
||||||
|
|
||||||
|
@ -949,8 +949,8 @@ int32_t CALLBACK CRomBrowser::SelectRomDirCallBack(HWND hwnd, uint32_t uMsg, uin
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case BFFM_INITIALIZED:
|
case BFFM_INITIALIZED:
|
||||||
// WParam is TRUE since you are passing a path.
|
// WParam is TRUE since you are passing a path
|
||||||
// It would be FALSE if you were passing a pidl.
|
// It would be FALSE if you were passing a PIDL
|
||||||
if (lpData)
|
if (lpData)
|
||||||
{
|
{
|
||||||
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
|
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
|
||||||
|
@ -1006,7 +1006,7 @@ void CRomBrowser::SelectRomDir(void)
|
||||||
|
|
||||||
void CRomBrowser::FixRomListWindow(void)
|
void CRomBrowser::FixRomListWindow(void)
|
||||||
{
|
{
|
||||||
//Change the window Style
|
// Change the window style
|
||||||
long Style = GetWindowLong(m_MainWindow, GWL_STYLE) | WS_SIZEBOX | WS_MAXIMIZEBOX;
|
long Style = GetWindowLong(m_MainWindow, GWL_STYLE) | WS_SIZEBOX | WS_MAXIMIZEBOX;
|
||||||
SetWindowLong(m_MainWindow, GWL_STYLE, Style);
|
SetWindowLong(m_MainWindow, GWL_STYLE, Style);
|
||||||
|
|
||||||
|
@ -1014,7 +1014,7 @@ void CRomBrowser::FixRomListWindow(void)
|
||||||
RECT rect;
|
RECT rect;
|
||||||
GetWindowRect(m_MainWindow, &rect);
|
GetWindowRect(m_MainWindow, &rect);
|
||||||
|
|
||||||
//We find the middle position of the screen, we use this if theres no setting
|
// We find the middle position of the screen, we use this if there is no setting
|
||||||
int32_t X = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
int32_t X = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
||||||
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
int32_t Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||||
|
|
||||||
|
@ -1070,7 +1070,7 @@ void CRomBrowser::ShowRomList(void)
|
||||||
|
|
||||||
InvalidateRect(m_hRomList, NULL, TRUE);
|
InvalidateRect(m_hRomList, NULL, TRUE);
|
||||||
|
|
||||||
//Start thread to watch for dir changed
|
// Start thread to watch for directory change
|
||||||
WatchThreadStart();
|
WatchThreadStart();
|
||||||
m_ShowingRomBrowser = false;
|
m_ShowingRomBrowser = false;
|
||||||
}
|
}
|
||||||
|
@ -1086,7 +1086,7 @@ void CRomBrowser::HideRomList(void)
|
||||||
// Make sure the window does disappear
|
// Make sure the window does disappear
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
|
|
||||||
//Disable the rom list
|
// Disable the ROM list
|
||||||
EnableWindow(m_hRomList, FALSE);
|
EnableWindow(m_hRomList, FALSE);
|
||||||
ShowWindow(m_hRomList, SW_HIDE);
|
ShowWindow(m_hRomList, SW_HIDE);
|
||||||
|
|
||||||
|
@ -1118,11 +1118,11 @@ bool CRomBrowser::RomDirNeedsRefresh(void)
|
||||||
{
|
{
|
||||||
bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId());
|
bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId());
|
||||||
|
|
||||||
//Get Old MD5 of file names
|
// Get old MD5 of file names
|
||||||
stdstr FileName = g_Settings->LoadStringVal(RomList_RomListCache);
|
stdstr FileName = g_Settings->LoadStringVal(RomList_RomListCache);
|
||||||
if (!CPath(FileName).Exists())
|
if (!CPath(FileName).Exists())
|
||||||
{
|
{
|
||||||
//if file does not exist then refresh the data
|
// If file does not exist then refresh the data
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1137,7 +1137,7 @@ bool CRomBrowser::RomDirNeedsRefresh(void)
|
||||||
hFile.Read(&CurrentFileMD5, sizeof(CurrentFileMD5));
|
hFile.Read(&CurrentFileMD5, sizeof(CurrentFileMD5));
|
||||||
hFile.Close();
|
hFile.Close();
|
||||||
|
|
||||||
//Get Current MD5 of file names
|
// Get current MD5 of file names
|
||||||
strlist FileNames;
|
strlist FileNames;
|
||||||
if (!GetRomFileNames(FileNames, CPath(g_Settings->LoadStringVal(RomList_GameDir)), stdstr(""), InWatchThread))
|
if (!GetRomFileNames(FileNames, CPath(g_Settings->LoadStringVal(RomList_GameDir)), stdstr(""), InWatchThread))
|
||||||
{
|
{
|
||||||
|
@ -1205,7 +1205,7 @@ void CRomBrowser::WatchThreadStart(void)
|
||||||
{
|
{
|
||||||
if (m_WatchThread != NULL)
|
if (m_WatchThread != NULL)
|
||||||
{
|
{
|
||||||
// thread already running
|
// Thread already running
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
WriteTrace(TraceUserInterface, TraceDebug, "1");
|
||||||
|
|
Loading…
Reference in New Issue