Skip to content

Commit 2e8be1a

Browse files
authored
Merge pull request #22 from doubleSlashde/feature/custom_font
Feature/custom font
2 parents b6e3d4c + ee1dd73 commit 2e8be1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3756
-351
lines changed

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

assembly.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
3+
4+
<id>bin</id>
5+
6+
<formats>
7+
<format>zip</format>
8+
</formats>
9+
10+
<includeBaseDirectory>false</includeBaseDirectory>
11+
12+
<fileSets>
13+
<fileSet>
14+
<directory>${project.basedir}/src/main/resources/licenses</directory>
15+
<outputDirectory>licenses</outputDirectory>
16+
</fileSet>
17+
</fileSets>
18+
19+
<dependencySets>
20+
<dependencySet>
21+
<includes>
22+
<include>de.doubleslash:keeptime</include>
23+
</includes>
24+
</dependencySet>
25+
</dependencySets>
26+
</assembly>

pom.xml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<version>5.1.4</version>
4949
</dependency>
5050

51-
5251
<dependency>
5352
<groupId>com.1stleg</groupId>
5453
<artifactId>jnativehook</artifactId>
@@ -69,7 +68,14 @@
6968
<artifactId>commons-lang3</artifactId>
7069
<version>3.8</version>
7170
</dependency>
72-
71+
72+
<!-- maven assembly plugin -->
73+
<dependency>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-assembly-plugin</artifactId>
76+
<version>3.1.1</version>
77+
<type>maven-plugin</type>
78+
</dependency>
7379
</dependencies>
7480

7581
<build>
@@ -78,6 +84,25 @@
7884
<groupId>org.springframework.boot</groupId>
7985
<artifactId>spring-boot-maven-plugin</artifactId>
8086
</plugin>
87+
88+
<plugin>
89+
<artifactId>maven-assembly-plugin</artifactId>
90+
<executions>
91+
<execution>
92+
<id>create-keeptime-zip</id>
93+
<phase>package</phase>
94+
<goals>
95+
<goal>single</goal>
96+
</goals>
97+
<configuration>
98+
<descriptors>
99+
<descriptor>./assembly.xml</descriptor>
100+
</descriptors>
101+
<finalName>keeptime-${project.version}</finalName>
102+
</configuration>
103+
</execution>
104+
</executions>
105+
</plugin>
81106
</plugins>
82107
</build>
83108

@@ -107,7 +132,6 @@
107132
<suppressionFile>dependency-check-report_suppressions.xml</suppressionFile>
108133
</configuration>
109134
</plugin>
110-
111135
</plugins>
112136
</reporting>
113137
</project>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime;
218

319
import java.lang.Thread.UncaughtExceptionHandler;

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime;
218

319
import java.io.IOException;
@@ -14,6 +30,7 @@
1430
import org.springframework.boot.autoconfigure.SpringBootApplication;
1531
import org.springframework.context.ConfigurableApplicationContext;
1632

33+
import de.doubleslash.keeptime.common.FontProvider;
1734
import de.doubleslash.keeptime.common.Resources;
1835
import de.doubleslash.keeptime.common.Resources.RESOURCE;
1936
import de.doubleslash.keeptime.controller.Controller;
@@ -75,7 +92,7 @@ public void init() throws Exception {
7592
public void start(final Stage primaryStage) {
7693
LOG.info("Initialising the UI");
7794
try {
78-
initUI(primaryStage);
95+
initialiseApplication(primaryStage);
7996
LOG.info("UI successfully initialised.");
8097
} catch (final Exception e) {
8198
LOG.error("There was an error while initialising the UI", e);
@@ -112,8 +129,8 @@ public void start(final Stage primaryStage) {
112129
}
113130
}
114131

115-
private void initUI(final Stage primaryStage) throws Exception {
116-
132+
private void initialiseApplication(final Stage primaryStage) throws Exception {
133+
FontProvider.loadFonts();
117134
readSettings();
118135

119136
final List<Work> todaysWorkItems = model.getWorkRepository().findByCreationDate(LocalDate.now());
@@ -165,7 +182,7 @@ private void readSettings() {
165182
settings.setHoverFontColor(Model.ORIGINAL_HOVER_Font_COLOR);
166183
settings.setUseHotkey(false);
167184
settings.setDisplayProjectsRight(false);
168-
settings.setHideProjectsOnMouseExit(true);
185+
settings.setHideProjectsOnMouseExit(false);
169186
model.getSettingsRepository().save(settings);
170187
} else {
171188
settings = settingsList.get(0);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH.
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
package de.doubleslash.keeptime.common;
18+
19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
21+
22+
public class BrowserHelper {
23+
24+
public static final Logger LOG = LoggerFactory.getLogger(BrowserHelper.class);
25+
26+
private BrowserHelper() {}
27+
28+
public static void openURL(final String url) {
29+
final Runtime rt = Runtime.getRuntime();
30+
31+
if (OS.isWindows()) {
32+
executeCommandWindows(rt, url);
33+
} else if (OS.isLinux()) {
34+
executeCommandLinux(rt, url);
35+
} else {
36+
LOG.warn("OS is not supported");
37+
}
38+
}
39+
40+
private static void executeCommandWindows(final Runtime rt, final String url) {
41+
try {
42+
final String command = "rundll32 url.dll,FileProtocolHandler " + url;
43+
LOG.debug("execute command: {}", command);
44+
45+
rt.exec(command);
46+
} catch (final Exception e) {
47+
LOG.error(e.getMessage());
48+
}
49+
}
50+
51+
private static void executeCommandLinux(final Runtime rt, final String url) {
52+
try {
53+
final String command = "xdg-open " + url;
54+
LOG.debug("execute command: {}", command);
55+
56+
rt.exec(command);
57+
} catch (final Exception e) {
58+
LOG.warn(e.getMessage());
59+
}
60+
}
61+
}

src/main/java/de/doubleslash/keeptime/common/ColorHelper.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime.common;
218

319
import javafx.scene.paint.Color;

src/main/java/de/doubleslash/keeptime/common/ConfigParser.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime.common;
218

319
import java.io.File;

src/main/java/de/doubleslash/keeptime/common/DateFormatter.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime.common;
218

319
import java.time.Duration;

src/main/java/de/doubleslash/keeptime/common/DateProvider.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2019 doubleSlash Net Business GmbH
2+
//
3+
// This file is part of KeepTime.
4+
// KeepTime is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
117
package de.doubleslash.keeptime.common;
218

319
import java.time.LocalDateTime;

0 commit comments

Comments
 (0)