fix: Game count for each gamelsit view is shown from the start in the list combobox.

Previously the game count was shown when a gamelist view was selected.
This commit is contained in:
lantzelot-swe 2023-08-03 15:02:26 +02:00
parent 41aac24112
commit 27b097b7dc
3 changed files with 12 additions and 8 deletions

View File

@ -54,9 +54,9 @@ public class PCUAEManager
mainWindow.setSize(Math.min(width, 1500), Math.min(height - 40, 825));
mainWindow.setMinimumSize(new Dimension(Math.min(width, 1300), Math.min(height - 40, 700)));
mainWindow.setVisible(true);
mainWindow.setLocationRelativeTo(null);
mainWindow.initialize();
mainWindow.setVisible(true);
//Make sure all folders are available
try

View File

@ -1,5 +1,6 @@
package se.lantz.gui;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
@ -1243,9 +1244,11 @@ public class MenuManager
private void reloadAll()
{
this.mainWindow.setWaitCursor(true);
//Refresh game views
uiModel.reloadGameViews();
this.mainWindow.refreshMenuAndUI();
this.mainWindow.setWaitCursor(false);
}
private void backupDb()

View File

@ -219,15 +219,16 @@ public class MainViewModel extends AbstractModel
for (GameView gameView : gameViewList)
{
gameViewModel.addElement(gameView);
//Select each gameview to load all games so that the game count is shown directly (may be a performance issue?)
gameViewModel.setSelectedItem(gameView);
}
gameViewModel.setSelectedItem(allGameView);
}
public void reloadGameViews()
{
this.disableChangeNotification(true);
gameViewModel.removeAllElements();
setupGameViews();
this.disableChangeNotification(false);
}
public GameListModel getGameListModel()
@ -495,7 +496,7 @@ public class MainViewModel extends AbstractModel
this.disableChangeNotification(false);
logger.debug("...done.");
}
public int getFileCount(List<GameListData> gamesList)
{
int fileCount = 0;
@ -755,7 +756,7 @@ public class MainViewModel extends AbstractModel
//Reload the current view
reloadCurrentGameView();
}
public void deleteAllGameListViews()
{
dbConnector.deleteAllGameListViews();
@ -957,7 +958,7 @@ public class MainViewModel extends AbstractModel
{
favorites10Count = toggleFavorite(data, 10, favorites10Count, favorites10View);
}
public void setViewTag(GameListData data, String viewTag)
{
if (data != null && !data.getGameId().isEmpty())
@ -1012,12 +1013,12 @@ public class MainViewModel extends AbstractModel
{
dbConnector.resetJoystickConfigsForView(getSelectedGameView());
}
public void enableAccurateDiskForAllGamesInCurrentView()
{
dbConnector.setAccurateDiskForView(getSelectedGameView(), true);
}
public void disableAccurateDiskForAllGamesInCurrentView()
{
dbConnector.setAccurateDiskForView(getSelectedGameView(), false);