Augment get_gui_runtime_info() with additional information about the U3 device Wiresh...
authorgal <gal@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 4 Feb 2007 12:39:07 +0000 (12:39 +0000)
committergal <gal@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 4 Feb 2007 12:39:07 +0000 (12:39 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20711 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/main.c
gtk/u3.c
gtk/u3.h

index ca7abdee60c7e0958f89b9f967dadc60fe2e34ed..09d156db841e89e80ea8263c568d2278f2d4be31 100644 (file)
@@ -2062,6 +2062,12 @@ get_gui_runtime_info(GString *str
   g_string_append(str, ", ");
   get_runtime_airpcap_version(str);
 #endif
+
+  if(u3_active()) {
+    g_string_append(str, ", ");
+    u3_runtime_info(str);
+  }
+
 }
 
 /* And now our feature presentation... [ fade to music ] */
index e10a3204804a09b35ac10c9f7905b13958740bad..16633a0b121b439bc92dff306cff923a08d10bad 100644 (file)
--- a/gtk/u3.c
+++ b/gtk/u3.c
@@ -72,6 +72,40 @@ gboolean u3_active()
 
 }
 
+void u3_runtime_info(GString *str)
+{
+
+  char *u3devicepath = NULL;
+  char *u3deviceproduct = NULL;
+
+  if((u3deviceproduct = 
+#ifdef _WIN32
+      getenv_utf8
+#else
+      getenv
+#endif 
+      ("U3_DEVICE_PRODUCT")) != NULL) {
+    g_string_append(str, " from the ");
+    g_string_append(str, u3deviceproduct);
+  } else {
+    g_string_append(str, " from a ");
+  }
+
+  g_string_append(str, " U3 device");
+
+  if((u3devicepath = 
+#ifdef _WIN32
+      getenv_utf8
+#else
+      getenv
+#endif 
+      ("U3_DEVICE_PATH")) != NULL) {
+    g_string_append(str, " in drive ");
+    g_string_append(str, u3devicepath);
+  }
+
+}
+
 void u3_register_pid()
 {
   int  pid;
index 25ffc45d2bbc4d169c2bf0f5f158edb5be29f708..9f90d66aeada629627dee598deb51d7f21f8bfa2 100644 (file)
--- a/gtk/u3.h
+++ b/gtk/u3.h
@@ -24,6 +24,8 @@
 
 gboolean u3_active();
 
+void u3_runtime_info(GString *str);
+
 void u3_register_pid(void);
 void u3_deregister_pid(void);