Skip to content

Commit f45010b

Browse files
committed
Settings -> Config for a bit more consistency
1 parent 63a0510 commit f45010b

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/gui.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ pub enum GuiRequest {
2424
OpenUrl {
2525
url: String,
2626
},
27-
SaveSettings {
27+
SaveConfig {
2828
decimal: bool,
2929
compression: String,
3030
excludes: String,
3131
},
32-
ResetSettings,
32+
ResetConfig,
3333
ChooseFolder,
3434
Compress,
3535
Decompress,
@@ -48,7 +48,7 @@ pub enum GuiResponse {
4848
date: String,
4949
version: String,
5050
},
51-
Settings {
51+
Config {
5252
decimal: bool,
5353
compression: String,
5454
excludes: String,
@@ -76,7 +76,7 @@ impl<T> GuiWrapper<T> {
7676
pub fn new(handle: Handle<T>) -> Self {
7777
let gui = Self(handle);
7878
gui.version();
79-
gui.settings();
79+
gui.config();
8080
gui
8181
}
8282

@@ -98,9 +98,9 @@ impl<T> GuiWrapper<T> {
9898
self.send(&version);
9999
}
100100

101-
pub fn settings(&self) {
101+
pub fn config(&self) {
102102
let s = config().read().unwrap().current();;
103-
self.send(&GuiResponse::Settings {
103+
self.send(&GuiResponse::Config {
104104
decimal: s.decimal,
105105
compression: s.compression.to_string(),
106106
excludes: s.excludes.join("\n"),
@@ -192,7 +192,7 @@ pub fn spawn_gui() {
192192
Ok(GuiRequest::OpenUrl { url }) => {
193193
let _ = open::that(url);
194194
}
195-
Ok(GuiRequest::SaveSettings {
195+
Ok(GuiRequest::SaveConfig {
196196
decimal,
197197
compression,
198198
excludes,
@@ -208,7 +208,7 @@ pub fn spawn_gui() {
208208
} else {
209209
message_dispatch(
210210
&mut webview,
211-
&GuiResponse::Settings {
211+
&GuiResponse::Config {
212212
decimal: s.decimal,
213213
compression: s.compression.to_string(),
214214
excludes: s.excludes.join("\n"),
@@ -225,12 +225,12 @@ pub fn spawn_gui() {
225225
}
226226
}
227227
}
228-
Ok(GuiRequest::ResetSettings) => {
228+
Ok(GuiRequest::ResetConfig) => {
229229
let s = Config::default();
230230

231231
message_dispatch(
232232
&mut webview,
233-
&GuiResponse::Settings {
233+
&GuiResponse::Config {
234234
decimal: s.decimal,
235235
compression: s.compression.to_string(),
236236
excludes: s.excludes.join("\n"),

src/ui/app.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ var Action = (function() {
151151
external.invoke(JSON.stringify({ type: 'OpenUrl', url: url }));
152152
},
153153

154-
reset_settings: function() {
155-
external.invoke(JSON.stringify({ type: 'ResetSettings' }));
154+
reset_config: function() {
155+
external.invoke(JSON.stringify({ type: 'ResetConfig' }));
156156
},
157157

158-
save_settings: function(settings) {
159-
settings.type = 'SaveSettings';
160-
external.invoke(JSON.stringify(settings));
158+
save_config: function(config) {
159+
config.type = 'SaveConfig';
160+
external.invoke(JSON.stringify(config));
161161
},
162162

163163
choose_folder: function() {
@@ -201,7 +201,7 @@ var Response = (function() {
201201
return {
202202
dispatch: function(msg) {
203203
switch(msg.type) {
204-
case "Settings":
204+
case "Config":
205205
Gui.set_decimal(msg.decimal);
206206
Gui.set_compression(msg.compression);
207207
Gui.set_excludes(msg.excludes);
@@ -248,15 +248,15 @@ var Gui = (function() {
248248
});
249249

250250
$("#Button_Save").on("click", function() {
251-
Action.save_settings({
251+
Action.save_config({
252252
decimal: $("#SI_Units").val() == "D",
253253
compression: $("#Compression_Mode").val(),
254254
excludes: $("#Excludes").val()
255255
});
256256
});
257257

258258
$("#Button_Reset").on("click", function() {
259-
Action.reset_settings();
259+
Action.reset_config();
260260
});
261261
},
262262

0 commit comments

Comments
 (0)