Use proper HTTP response for web config reply. Quit Windows cleanly.
"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));
use self::systray::api::api::MenuEnableFlag;
+use std::process;
use std::collections::BTreeMap;
use std::sync::mpsc::Sender;
}
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;