Skip to content

Commit e32e6d9

Browse files
committed
added version string. logging version on start. updated readme
1 parent 455b63c commit e32e6d9

File tree

6 files changed

+26
-25
lines changed

6 files changed

+26
-25
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828
logs/
2929
*.jar
3030

31-
config.xml
31+
config.xml
32+
db/

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# KeepTime
2-
Readme is WIP\
32
Project is Beta\
4-
You will most probably have to reconfigure the application with your details if a newer version will appear.\
53

64
# Use
75
Application to track your time spent on different projects each day. Aim was to create an easy and fast way to track the doings over the day. In the end you get a summary for the day.
@@ -22,7 +20,7 @@ Main view (when you hover over the app):\
2220
**You need to close the application manualy before you shutdown your PC. Otherwise the last running project is not saved to database.**
2321

2422
# Install
25-
Download and execute .jar file (see releases). You should put the .jar in an extra folder as a *logs* folder will be created next to it.\
23+
Download and execute .jar file (see releases). You should put the .jar in an extra folder as a *logs* and a *db* folder will be created next to it.\
2624
It is recommended to run the application at windows start.
2725
* Copy the keeptime.bat file from this repo next to the *.jar*. Adapt the path inside the *keeptime.bat* to the name of the *.jar* file (if needed). Try starting the application by executing the *keeptime.bat* file. Close the app.
2826
* Open the autostart folder: Press *Windows+R*, execute *shell:startup*.

src/main/java/de/doubleslash/keeptime/Main.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,20 @@
3636
@SpringBootApplication
3737
public class Main extends Application {
3838

39-
private ConfigurableApplicationContext springContext;
39+
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
4040

41-
public static Stage stage;
42-
Stage popupViewStage;
41+
public static final String VERSION = "v0.0.2";
4342

44-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
43+
private ConfigurableApplicationContext springContext;
44+
45+
private Stage popupViewStage;
4546

4647
private Model model;
4748
private Controller controller;
4849

4950
@Override
5051
public void init() throws Exception {
52+
LOG.info("Starting KeepTime {}", VERSION);
5153
final DefaultExceptionHandler defaultExceptionHandler = new DefaultExceptionHandler();
5254
defaultExceptionHandler.register();
5355

@@ -60,8 +62,6 @@ public void init() throws Exception {
6062
@Override
6163
public void start(final Stage primaryStage) throws Exception {
6264

63-
stage = primaryStage;
64-
6565
LOG.debug("Reading configuration");
6666

6767
// TODO there should just be one instance of settings in the repo
@@ -95,8 +95,6 @@ public void start(final Stage primaryStage) throws Exception {
9595
LOG.info("Found {} past work items", todaysWorkItems.size());
9696
model.pastWorkItems.addAll(todaysWorkItems);
9797

98-
// createProjects();
99-
10098
final List<Project> projects = model.projectRepository.findAll();
10199

102100
LOG.debug("Found '{}' projects", projects.size());

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.slf4j.Logger;
66
import org.slf4j.LoggerFactory;
77

8+
import de.doubleslash.keeptime.Main;
89
import de.doubleslash.keeptime.common.ConfigParser;
910
import de.doubleslash.keeptime.controller.Controller;
1011
import de.doubleslash.keeptime.model.Model;
@@ -14,6 +15,7 @@
1415
import javafx.scene.control.Button;
1516
import javafx.scene.control.CheckBox;
1617
import javafx.scene.control.ColorPicker;
18+
import javafx.scene.control.Label;
1719
import javafx.stage.Stage;
1820

1921
public class SettingsController {
@@ -52,18 +54,22 @@ public class SettingsController {
5254
@FXML
5355
private Button cancelButton;
5456

55-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
56-
5757
@FXML
5858
private Button parseConfigButton;
5959

60+
@FXML
61+
private Label versionLabel;
62+
63+
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
64+
6065
private Model model;
6166
private Controller controller;
6267
private Stage thisStage;
6368
private static final String INPUT_FILE = "config.xml";
6469

6570
@FXML
6671
private void initialize() {
72+
versionLabel.setText(Main.VERSION);
6773

6874
saveButton.setOnAction(ae -> {
6975
LOG.info("Save clicked");

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.slf4j.LoggerFactory;
1515
import org.springframework.stereotype.Component;
1616

17-
import de.doubleslash.keeptime.Main;
1817
import de.doubleslash.keeptime.common.ColorHelper;
1918
import de.doubleslash.keeptime.common.DateFormatter;
2019
import de.doubleslash.keeptime.common.Resources;
@@ -130,6 +129,7 @@ class Delta {
130129

131130
private final Delta dragDelta = new Delta();
132131

132+
private Stage mainStage;
133133
private Controller controller;
134134
private Model model;
135135

@@ -184,23 +184,23 @@ private void initialize() throws IOException {
184184
mouseHoveringProperty.addListener((a, b, c) -> {
185185
// TODO fix the not so nice jumping..
186186
projectsVBox.setManaged(c);
187-
final double beforeWidth = Main.stage.getWidth();
188-
Main.stage.sizeToScene();
189-
final double afterWidth = Main.stage.getWidth();
187+
final double beforeWidth = mainStage.getWidth();
188+
mainStage.sizeToScene();
189+
final double afterWidth = mainStage.getWidth();
190190
projectsVBox.setVisible(c);
191191
final double offset = afterWidth - beforeWidth;
192192
if (!model.displayProjectsRight.get()) {
193193
// we only need to move the stage if the node on the left is hidden
194-
Main.stage.setX(Main.stage.getX() - offset);
194+
mainStage.setX(mainStage.getX() - offset);
195195
}
196196
});
197197

198198
minimizeButton.setOnAction((ae) -> {
199-
Main.stage.setIconified(true);
199+
mainStage.setIconified(true);
200200
});
201201
minimizeButton.textFillProperty().bind(fontColorProperty);
202202
closeButton.setOnAction((ae) -> {
203-
Main.stage.close();
203+
mainStage.close();
204204
});
205205
closeButton.textFillProperty().bind(fontColorProperty);
206206

@@ -790,7 +790,7 @@ private void updateTaskbarIcon(final long currentWorkSeconds) {
790790
final BufferedImage bi = SwingFXUtils.fromFXImage(image, null);
791791
final Image icon = SwingFXUtils.toFXImage(bi, null);
792792

793-
final ObservableList<Image> icons = Main.stage.getIcons();
793+
final ObservableList<Image> icons = mainStage.getIcons();
794794
icons.addAll(icon);
795795
if (icons.size() > 1) {
796796
icons.remove(0);
@@ -818,8 +818,6 @@ public static String changeStyleAttribute(final String style, final String attri
818818
return newStyle;
819819
}
820820

821-
Stage mainStage;
822-
823821
public void setStage(final Stage primaryStage) {
824822
this.mainStage = primaryStage;
825823
}

src/main/resources/settings.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,6 @@
123123
</HBox>
124124
</children>
125125
</VBox>
126-
<Label alignment="CENTER_RIGHT" disable="true" layoutX="245.0" layoutY="260.0" prefHeight="17.0" prefWidth="52.0" text="v 1.0.0" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="5.0" />
126+
<Label fx:id="versionLabel" alignment="CENTER_RIGHT" disable="true" layoutX="245.0" layoutY="260.0" prefHeight="17.0" prefWidth="52.0" text="v1.0.0" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="5.0" />
127127
</children>
128128
</AnchorPane>

0 commit comments

Comments
 (0)