26 #include "gui.h" |
26 #include "gui.h" |
27 |
27 |
28 config* g_configPointers[MAX_CONFIG]; |
28 config* g_configPointers[MAX_CONFIG]; |
29 static ushort g_cfgPointerCursor = 0; |
29 static ushort g_cfgPointerCursor = 0; |
30 |
30 |
31 static const char* g_ConfigTypeNames[] = { |
|
32 "None", |
|
33 "Integer", |
|
34 "String", |
|
35 "Float", |
|
36 "Boolean", |
|
37 "Key sequence", |
|
38 }; |
|
39 |
|
40 // ============================================================================= |
31 // ============================================================================= |
41 // Load the configuration from file |
32 // Load the configuration from file |
42 bool config::load () { |
33 bool config::load () { |
43 print ("config::load: Loading configuration file...\n"); |
34 print ("config::load: Loading configuration file...\n"); |
44 print ("config::load: Path to configuration is %1\n", filepath ()); |
35 print ("config::load: Path to configuration is %1\n", filepath ()); |
141 |
132 |
142 File f (filepath (), File::Write); |
133 File f (filepath (), File::Write); |
143 print ("writing cfg to %1\n", filepath ()); |
134 print ("writing cfg to %1\n", filepath ()); |
144 |
135 |
145 if (!f) { |
136 if (!f) { |
146 critical (fmt ("Cannot save configuration, cannot open %1 for writing\n", filepath ())); |
137 critical( fmt( QObject::tr( "Cannot save configuration, cannot open %1 for writing: %2\n" ), |
|
138 filepath(), strerror( errno ))); |
147 return false; |
139 return false; |
148 } |
140 } |
149 |
141 |
150 fprint (f, "# Configuration file for " APPNAME "\n"); |
142 fprint (f, "# Configuration file for " APPNAME "\n"); |
151 |
143 |