Skip to content

Commit

Permalink
Add support to open multiple files at once (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: mohammad <[email protected]>
  • Loading branch information
AlahmadiQ8 and mohammad authored Mar 13, 2023
1 parent 5e24c18 commit 0b21d45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ class MainController : CoroutineScope, Initializable {
private fun openFile() {
val fileChooser = FileChooser()
fileChooser.title = "Select File"
fileChooser.extensionFilters.add(FileChooser.ExtensionFilter("CSV Files", "*.csv"))
val file: File? = fileChooser.showOpenDialog(null)
openFile(file)
fileChooser.extensionFilters.addAll(FileChooser.ExtensionFilter("CSV Files", "*.csv"))
val files = fileChooser.showOpenMultipleDialog(null)
files.forEach { openFile(it) }
}

private fun openFile(file: File?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</font>
</Label>
<HBox alignment="TOP_CENTER" prefHeight="50.0" prefWidth="200.0" spacing="10.0">
<Button mnemonicParsing="false" onAction="#openFile" text="Open File"/>
<Button mnemonicParsing="false" onAction="#openFile" text="Open File(s)"/>
<Button mnemonicParsing="false" onAction="#loadExample" text="Load example"/>
</HBox>
<Label fx:id="recentFilesLabel" maxWidth="100" alignment="TOP_LEFT" prefWidth="350" style="&#10;" text="Recent files" textAlignment="CENTER" textFill="#9f9f9f" wrapText="true">
Expand Down

0 comments on commit 0b21d45

Please sign in to comment.