Skip to content

Commit

Permalink
hotfix for missing default collection
Browse files Browse the repository at this point in the history
  • Loading branch information
mindolph committed Oct 2, 2024
1 parent 85ac4bc commit 431bb2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ public class MainController extends BaseController implements Initializable,
public void initialize(URL location, ResourceBundle resources) {
log.info("initialize main scene controller");
menuBar.setUseSystemMenuBar(true);
collectionToggleGroup = new ToggleGroup();
rmiCollectionDefault.setToggleGroup(collectionToggleGroup);
rmiCollectionDefault.setUserData("default");

// handle the file collections.
this.loadCollections();
Expand Down Expand Up @@ -210,7 +207,7 @@ public void initialize(URL location, ResourceBundle resources) {

EventBus.getIns().subscribeLocateInWorkspace(nodeData -> {
splitPane.showAll(); // show project view if hidden
log.debug("Select file in workspace view: " + nodeData.getFile());
log.debug("Select file in workspace view: %s".formatted(nodeData.getFile()));
Platform.runLater(() -> {
tabWorkspaces.getTabPane().getSelectionModel().select(tabWorkspaces);
workspaceView.selectByNodeDataInAppropriateWorkspace(nodeData);
Expand Down Expand Up @@ -274,6 +271,11 @@ public void onWorkspacesRestore(WorkspaceList workspaceList) {
* @since 1.9.x
*/
private void loadCollections() {
collectionToggleGroup = new ToggleGroup();
rmiCollectionDefault = new RadioMenuItem("default");
rmiCollectionDefault.setToggleGroup(collectionToggleGroup);
menuCollections.getItems().add(rmiCollectionDefault);

Map<String, List<String>> fileCollectionMap = this.cm.getFileCollectionMap();
if (fileCollectionMap.isEmpty()) {
// init the default collection from opened file list for the first time.
Expand Down
1 change: 0 additions & 1 deletion code/mindolph-fx/src/main/resources/main.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
<MenuItem onAction="#onSaveCollection" text="Save Collection"/>
<MenuItem onAction="#onRemoveCollection" text="Remove Collection"/>
<SeparatorMenuItem/>
<RadioMenuItem fx:id="rmiCollectionDefault" onAction="#onDefaultCollection" text="default" selected="true"/>
</Menu>
<Menu mnemonicParsing="true" text="_Help">
<MenuItem mnemonicParsing="true" onAction="#onMenuShortcuts" text="_Key Reference..."/>
Expand Down

0 comments on commit 431bb2c

Please sign in to comment.