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.setSize(Math.min(width, 1500), Math.min(height - 40, 825));
mainWindow.setMinimumSize(new Dimension(Math.min(width, 1300), Math.min(height - 40, 700))); mainWindow.setMinimumSize(new Dimension(Math.min(width, 1300), Math.min(height - 40, 700)));
mainWindow.setVisible(true);
mainWindow.setLocationRelativeTo(null); mainWindow.setLocationRelativeTo(null);
mainWindow.initialize(); mainWindow.initialize();
mainWindow.setVisible(true);
//Make sure all folders are available //Make sure all folders are available
try try

View File

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

View File

@ -219,15 +219,16 @@ public class MainViewModel extends AbstractModel
for (GameView gameView : gameViewList) for (GameView gameView : gameViewList)
{ {
gameViewModel.addElement(gameView); 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() public void reloadGameViews()
{ {
this.disableChangeNotification(true);
gameViewModel.removeAllElements(); gameViewModel.removeAllElements();
setupGameViews(); setupGameViews();
this.disableChangeNotification(false);
} }
public GameListModel getGameListModel() public GameListModel getGameListModel()