From 2de6f796354ad029e9e786027210fcf1b02868e2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 26 Oct 2012 15:52:39 -0700 Subject: Improve the dive computer device selection We try to identify devices that are connected and their matching device names (and mount paths in the case of the Uemis Zurich). Those are presented as a drop down menu to choose from. The user can still override this by simply entering a different device / path name. On Windows this is not functional. How do I find out which drive letter corresponds to the USB device named "UEMISSDA"? Similarly we need code that finds serial ports that are present. For now we once again default to COM3 (so this isn't a step back, but of course it's far from what we want). Signed-off-by: Dirk Hohndel --- windows.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'windows.c') diff --git a/windows.c b/windows.c index 2127614bd..df136085f 100644 --- a/windows.c +++ b/windows.c @@ -119,9 +119,18 @@ void subsurface_close_conf(void) RegCloseKey(hkey); } -const char *subsurface_USB_name() +int subsurface_fill_device_list(GtkListStore *store) { - return "COM3"; + GtkTreeIter iter; + int index = -1; + + /* if we can't find anything, use the default */ + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, + 0, "COM3", -1); + if (is_default_dive_computer_device("COM3")) + index = 0; + return index; } const char *subsurface_icon_name() -- cgit v1.2.3-70-g09d2