summary history branches tags files
commit:1f0b1486a4405ad1a2a09a94ae43edf148e1f678
author:Trevor Bentley
committer:Trevor Bentley
date:Thu Aug 3 19:41:02 2017 +0200
parents:0eb3b4bb73ffb85212ca0adc9a97f1f3492ab7e2
Use proper HTTP response for web config reply.  Quit Windows cleanly.
diff --git a/src/settings/mod.rs b/src/settings/mod.rs
line changes: +2/-1
index a1e3f23..98a5adb
--- a/src/settings/mod.rs
+++ b/src/settings/mod.rs
@@ -83,7 +83,8 @@ If something goes wrong or changes, edit or delete that file.</small>
                        "HTTP/1.1 200 OK\r\n\r\n",
                        PORT,
                        default_inifile());
-    let reply = format!("Configuration saved.  You can close this window.");
+    let reply = format!("{}Configuration saved.  You can close this window.",
+                        "HTTP/1.1 200 OK\r\n\r\n");
     let mut config = BTreeMap::<String,String>::new();
     config.insert("port".to_string(), PORT.to_string());
     config.append(&mut http::config_request_local_webserver(WEB_PORT, form, reply));

diff --git a/src/win/mod.rs b/src/win/mod.rs
line changes: +5/-2
index a7bd1cd..ee55328
--- a/src/win/mod.rs
+++ b/src/win/mod.rs
@@ -5,6 +5,7 @@ pub use ::NSCallback;
 
 use self::systray::api::api::MenuEnableFlag;
 
+use std::process;
 use std::collections::BTreeMap;
 use std::sync::mpsc::Sender;
 
@@ -59,9 +60,11 @@ impl TStatusBar for WindowsStatusBar {
     }
     fn add_quit(&mut self, label: &str) {
         let ref mut win = &mut self.app.window;
-        // TODO: shutdown without a panic
         let _ = win.add_menu_item(&label.to_string(), false,
-                                  |window| { window.quit(); panic!(""); });
+                                  |window| {
+                                      window.quit();
+                                      process::exit(0);
+                                  });
     }
     fn add_separator(&mut self) {
         let ref mut win = &mut self.app.window;