File tree 3 files changed +20
-3
lines changed
src/main/java/com/bobrust
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public static void main(String[] args) {
25
25
LOGGER .info (" Lwjgl : {}" , hasLwjgl );
26
26
LOGGER .info ("" );
27
27
28
+ // TODO: Make sure logs and properties can be saved without admin rights.
28
29
// TODO: Do not draw outside the image region +- the radius of the largest shape.
29
30
// TODO: Maybe remove the monitor button and only make it choose the screen you
30
31
// expanded the window on?
Original file line number Diff line number Diff line change 5
5
import java .util .Objects ;
6
6
import java .util .Properties ;
7
7
8
+ import javax .swing .JOptionPane ;
9
+
8
10
import org .apache .logging .log4j .LogManager ;
9
11
import org .apache .logging .log4j .Logger ;
10
12
@@ -76,7 +78,7 @@ protected void loadSettings() {
76
78
setSettingsAutosaveInterval (getSettingInteger (Settings .SETTINGS_AUTOSAVE_INTERVAL ));
77
79
78
80
allowSaving = true ;
79
- saveSettings ();
81
+ saveSettings (true );
80
82
}
81
83
82
84
private Integer getSettingInteger (Settings key ) {
@@ -105,11 +107,25 @@ private String getSettingsProperty(Settings key) {
105
107
}
106
108
107
109
private void saveSettings () {
110
+ saveSettings (false );
111
+ }
112
+
113
+ private void saveSettings (boolean giveMessage ) {
108
114
if (!allowSaving ) return ;
109
115
110
116
try (FileOutputStream stream = new FileOutputStream (CONFIG_FILE )) {
111
117
properties .store (stream , "" );
112
118
} catch (IOException e ) {
119
+ if (giveMessage ) {
120
+ JOptionPane .showMessageDialog (
121
+ null ,
122
+ "This tool does not have the permission to update the config file\n " +
123
+ "Try run the application as an Administrator if you want to fix this" ,
124
+ "Importaint" ,
125
+ JOptionPane .WARNING_MESSAGE
126
+ );
127
+ }
128
+
113
129
LOGGER .error ("Error saving config file: {}" , e );
114
130
LOGGER .throwing (e );
115
131
e .printStackTrace ();
Original file line number Diff line number Diff line change 1
- # Sat Nov 13 00:10:45 CET 2021
2
- build_id =41
1
+ # Thu Jan 13 19:31:44 CET 2022
2
+ build_id =45
You can’t perform that action at this time.
0 commit comments