Skip to content

Commit 793933c

Browse files
DavidDamkeddamke
andauthored
Bug/dialog dont show full text linux (#112)
* show full dialog text in Linux (and windows) * organize imports * format code Co-authored-by: ddamke <[email protected]>
1 parent 965d8c2 commit 793933c

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

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

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@
2929
import org.springframework.stereotype.Component;
3030

3131
import de.doubleslash.keeptime.ApplicationProperties;
32-
import de.doubleslash.keeptime.common.BrowserHelper;
33-
import de.doubleslash.keeptime.common.FileOpenHelper;
34-
import de.doubleslash.keeptime.common.Licenses;
35-
import de.doubleslash.keeptime.common.OS;
36-
import de.doubleslash.keeptime.common.Resources;
32+
import de.doubleslash.keeptime.common.*;
3733
import de.doubleslash.keeptime.common.Resources.RESOURCE;
38-
import de.doubleslash.keeptime.common.SvgNodeProvider;
3934
import de.doubleslash.keeptime.controller.Controller;
4035
import de.doubleslash.keeptime.model.Model;
4136
import de.doubleslash.keeptime.model.Settings;
@@ -45,20 +40,11 @@
4540
import javafx.collections.ObservableList;
4641
import javafx.fxml.FXML;
4742
import javafx.fxml.FXMLLoader;
48-
import javafx.scene.control.Alert;
43+
import javafx.scene.control.*;
4944
import javafx.scene.control.Alert.AlertType;
50-
import javafx.scene.control.Button;
51-
import javafx.scene.control.ButtonType;
52-
import javafx.scene.control.CheckBox;
53-
import javafx.scene.control.ColorPicker;
54-
import javafx.scene.control.Hyperlink;
55-
import javafx.scene.control.Label;
56-
import javafx.scene.control.TableCell;
57-
import javafx.scene.control.TableColumn;
58-
import javafx.scene.control.TableView;
5945
import javafx.scene.control.cell.PropertyValueFactory;
60-
import javafx.scene.input.MouseButton;
6146
import javafx.scene.image.Image;
47+
import javafx.scene.input.MouseButton;
6248
import javafx.scene.layout.AnchorPane;
6349
import javafx.scene.layout.Region;
6450
import javafx.scene.paint.Color;
@@ -378,12 +364,13 @@ private void initImportButton() {
378364

379365
confirmationAlert.setTitle("Import");
380366
confirmationAlert.setHeaderText("Do you want to Override current Data ?");
381-
confirmationAlert.setContentText(
382-
"Import previously exported .sql file. This will overwrite the currently used database contents - all current data will be lost!\n"
383-
+ "\n"
384-
+ "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"
385-
+ "\n"
386-
+ "You will need to restart the application after this action. If you proceed you need to select the previous exported .sql file.");
367+
confirmationAlert.getDialogPane()
368+
.setContent(new Label(
369+
"Import previously exported .sql file. This will overwrite the currently used database contents - all current data will be lost!\n"
370+
+ "\n"
371+
+ "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"
372+
+ "\n"
373+
+ "You will need to restart the application after this action. If you proceed you need to select the previous exported .sql file."));
387374
confirmationAlert.showAndWait();
388375

389376
if (confirmationAlert.getResult() == ButtonType.NO) {
@@ -415,8 +402,9 @@ private void initImportButton() {
415402

416403
informationDialog.setTitle("Import done");
417404
informationDialog.setHeaderText("The data was imported.");
418-
informationDialog.setContentText(
419-
"KeepTime will now be CLOSED! You have to RESTART it again to see the changes");
405+
informationDialog.getDialogPane()
406+
.setContent(new Label("KeepTime will now be CLOSED!\n"
407+
+ "You have to RESTART it again to see the changes"));
420408
informationDialog.showAndWait();
421409
Platform.exit();
422410

@@ -464,8 +452,7 @@ private void initExportButton() {
464452
Alert informationDialog = new Alert(AlertType.INFORMATION);
465453
informationDialog.setTitle("Export done");
466454
informationDialog.setHeaderText("The current data was exported.");
467-
informationDialog.setContentText("The data was exported to '" + fileToSave + "'.");
468-
455+
informationDialog.getDialogPane().setContent(new Label("The data was exported to '\n" + fileToSave + "'."));
469456
informationDialog.showAndWait();
470457
} catch (final SQLException e) {
471458
LOG.error("Could not export db to script file.", e);

0 commit comments

Comments
 (0)