Skip to content

Commit 200a86a

Browse files
ddamkeddamke
authored andcommitted
add text to content of alert add fileChooser filter
1 parent a02a023 commit 200a86a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/de/doubleslash/keeptime/view/SettingsController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ private void initImportButton(){
257257
Alert confirmationAlert = new Alert(AlertType.CONFIRMATION , "", ButtonType.YES, ButtonType.NO);
258258
confirmationAlert.setTitle("Import");
259259
confirmationAlert.setHeaderText("Do you want to Override current Data ?");
260+
confirmationAlert.setContentText("Import previously exported .sql file. This will overwrite the currently used database contents - all current data will be lost!\n" +
261+
"\n" +
262+
"If you do not have a .sql file yet you need to open the previous version of KeepTime and in the settings dialog press \"Export\".\n" +
263+
"\n" +
264+
"You will need to restart the application after this action. If you proceed you need to select the previouls exported .sql file.");
260265
confirmationAlert.showAndWait();
261266

262267
if(confirmationAlert.getResult()==ButtonType.NO){
@@ -266,12 +271,12 @@ private void initImportButton(){
266271

267272
final FileChooser fileChooser = new FileChooser();
268273
fileChooser.setTitle("Open Exported SQl Script");
274+
fileChooser.getExtensionFilters().add(new ExtensionFilter("SQL script files.", "*.sql"));
269275
File file = fileChooser.showOpenDialog(thisStage);
270276
if (file == null) {
271277
LOG.info("User canceled import.");
272278
return;
273279
}
274-
LOG.info(file.toString());
275280

276281
final String url = applicationProperties.getSpringDataSourceUrl();
277282
final String username = applicationProperties.getSpringDataSourceUserName();

0 commit comments

Comments
 (0)