Skip to content

Commit 31ad0d3

Browse files
authored
Merge pull request #226 from walkero-gr/fixing-list-load-when-sidebar-is-not-enabled
Fixing list load when sidebar is not enabled
2 parents e28b354 + 6bc620b commit 31ad0d3

File tree

3 files changed

+32
-21
lines changed

3 files changed

+32
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixed
66
- Fixed the generated genre list titles after a rescan of the repository
77
- Fixed more memory leaks
8+
- Fixed the load of the list of items when the side panel is hidden
89

910
## iGame 2.4.3 - [2023-09-01]
1011
### Fixed

src/funcs.c

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,15 @@ void app_start(void)
372372
set(app->WI_MainWindow, MUIA_Window_Sleep, TRUE);
373373
slavesListLoadFromCSV(csvFilename);
374374

375-
populateGenresList();
376-
populateChipsetList();
375+
if (!current_settings->hide_side_panel)
376+
{
377+
populateGenresList();
378+
populateChipsetList();
379+
}
380+
if (current_settings->hide_side_panel)
381+
{
382+
filter_change();
383+
}
377384
set(app->WI_MainWindow, MUIA_Window_Sleep, FALSE);
378385
set(app->WI_MainWindow, MUIA_Window_ActiveObject, app->LV_GamesList);
379386
}
@@ -391,27 +398,30 @@ void filter_change(void)
391398
return;
392399
}
393400

394-
DoMethod(app->LV_GenresList, MUIM_List_GetEntry,
395-
MUIV_List_GetEntry_Active, &genreSelection);
396-
397401
if (title && strlen(title) > 0)
398402
{
399403
string_to_lower(title);
400404
strncpy(filters.title, title, sizeof(filters.title));
401405
}
402406
else filters.title[0] = '\0';
403407

404-
if (genreSelection)
405-
strncpy(filters.showGenre, genreSelection, sizeof(filters.showGenre));
408+
if (!current_settings->hide_side_panel)
409+
{
410+
DoMethod(app->LV_GenresList, MUIM_List_GetEntry,
411+
MUIV_List_GetEntry_Active, &genreSelection);
412+
413+
if (genreSelection)
414+
strncpy(filters.showGenre, genreSelection, sizeof(filters.showGenre));
406415

407-
if (!genreSelection || !strcmp(genreSelection, GetMBString(MSG_FilterShowAll)))
408-
filters.showGenre[0] = '\0';
416+
if (!genreSelection || !strcmp(genreSelection, GetMBString(MSG_FilterShowAll)))
417+
filters.showGenre[0] = '\0';
409418

410-
// Get selected chipset from the cycle box
411-
int chipsetIndex = get_cycle_index(app->CY_ChipsetList);
412-
strncpy(filters.showChipset, app->CY_ChipsetListContent[chipsetIndex], sizeof(filters.showChipset));
413-
if (chipsetIndex == 0)
414-
filters.showChipset[0] = '\0';
419+
// Get selected chipset from the cycle box
420+
int chipsetIndex = get_cycle_index(app->CY_ChipsetList);
421+
strncpy(filters.showChipset, app->CY_ChipsetListContent[chipsetIndex], sizeof(filters.showChipset));
422+
if (chipsetIndex == 0)
423+
filters.showChipset[0] = '\0';
424+
}
415425

416426
showSlavesList();
417427
}
@@ -628,7 +638,7 @@ static void showSlavesList(void)
628638
goto nextItem;
629639
}
630640

631-
// Decide from where the item name will be taken
641+
// Decide where the item name will be taken from
632642
if(!isStringEmpty(currPtr->user_title))
633643
{
634644
snprintf(buf, bufSize, "%s", currPtr->user_title);

src/iGameGUI.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
548548
MUIA_NListview_Vert_ScrollBar, MUIV_NListview_VSB_FullAuto,
549549
End;
550550

551+
object->CY_FilterList = CycleObject,
552+
MUIA_HelpNode, "CY_FilterList",
553+
MUIA_Frame, MUIV_Frame_Button,
554+
MUIA_Cycle_Entries, object->CY_FilterListContent,
555+
End;
551556

552557
if (!current_settings->hide_side_panel)
553558
{
@@ -579,12 +584,6 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
579584

580585
object->Space_Sidepanel = VSpace(1);
581586

582-
object->CY_FilterList = CycleObject,
583-
MUIA_HelpNode, "CY_FilterList",
584-
MUIA_Frame, MUIV_Frame_Button,
585-
MUIA_Cycle_Entries, object->CY_FilterListContent,
586-
End;
587-
588587
object->CY_ChipsetList = CycleObject,
589588
MUIA_HelpNode, "CY_ChipsetList",
590589
MUIA_Frame, MUIV_Frame_Button,
@@ -644,6 +643,7 @@ MakeStaticHook(SettingUseIgameDataTitleHook, settingUseIgameDataTitleChanged);
644643
{
645644
GR_main = GroupObject,
646645
MUIA_HelpNode, "GR_main",
646+
Child, object->CY_FilterList,
647647
Child, object->LV_GamesList,
648648
End;
649649
}

0 commit comments

Comments
 (0)