summary history branches tags files
commit:7f628d709546598ab9de6ab3bbaf6ddf7bb10cdb
author:Trevor Bentley
committer:Trevor Bentley
date:Sun Mar 25 16:25:27 2018 +0200
parents:f113c6567a0629377badc1b7869cf00a7716dc71
Update Win32 to support submenu API.  Not implemented yet.
diff --git a/src/http/mod.rs b/src/http/mod.rs
line changes: +8/-7
index 27b472a..2f652e6
--- a/src/http/mod.rs
+++ b/src/http/mod.rs
@@ -254,13 +254,14 @@ pub fn config_request_local_webserver(port: u32, form: String, reply: String) ->
             let mut post_bytes: u32 = 0;
             let re = Regex::new(r"Content-Length: ([0-9 ]+)").unwrap();
             for line in reader.by_ref().lines() {
-                let line_str = line.unwrap();
-                if re.is_match(line_str.as_str()) {
-                    post_bytes = re.captures(line_str.as_str()).unwrap()[1].parse::<u32>().unwrap();
-                }
-                response.push(line_str.clone());
-                if line_str == "" {
-                    break;
+                if let Ok(line_str) = line {
+                    if re.is_match(line_str.as_str()) {
+                        post_bytes = re.captures(line_str.as_str()).unwrap()[1].parse::<u32>().unwrap();
+                    }
+                    response.push(line_str.clone());
+                    if line_str == "" {
+                        break;
+                    }
                 }
             }
             match post_bytes {

diff --git a/src/win/mod.rs b/src/win/mod.rs
line changes: +5/-1
index ee55328..c0a3030
--- a/src/win/mod.rs
+++ b/src/win/mod.rs
@@ -53,6 +53,10 @@ impl TStatusBar for WindowsStatusBar {
         };
         let _ = win.set_tooltip(&tooltip);
     }
+    fn add_submenu(&mut self, _label: &str, _callback: NSCallback) -> *mut Object {
+        // TODO: implement submenu support on Windows
+        0 as *mut Object
+    }
     fn add_label(&mut self, label: &str) {
         let ref mut win = &mut self.app.window;
         let idx = win.add_menu_item(&label.to_string(), false, |_| {});
@@ -70,7 +74,7 @@ impl TStatusBar for WindowsStatusBar {
         let ref mut win = &mut self.app.window;
         let _ = win.add_menu_separator();
     }
-    fn add_item(&mut self, item: &str, callback: NSCallback, selected: bool) -> *mut Object {
+    fn add_item(&mut self, _menu: Option<*mut Object>, item: &str, callback: NSCallback, selected: bool) -> *mut Object {
         let ref mut win = &mut self.app.window;
         let idx = self.idx.get();
         self.idx.set(idx+1);