Patch for visor support in the capplet



This patch adds visor support to the capplet.  You must apply my first
patch before you apply this one.

Cheers,
-dave

Index: capplet/gpilotd-capplet-strings.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/capplet/gpilotd-capplet-strings.c,v
retrieving revision 1.4
diff -u -r1.4 gpilotd-capplet-strings.c
--- capplet/gpilotd-capplet-strings.c	2000/05/11 21:55:54	1.4
+++ capplet/gpilotd-capplet-strings.c	2000/07/31 18:58:59
@@ -16,6 +16,7 @@
 gchar *s = N_("Name");
 gchar *s = N_("Port");
 gchar *s = N_("Speed");
+gchar *s = N_("Type");
 gchar *s = N_("Add...");
 gchar *s = N_("Edit...");
 gchar *s = N_("Delete");
@@ -27,16 +28,19 @@
 gchar *s = N_("Name");
 gchar *s = N_("Port");
 gchar *s = N_("Speed");
-gchar *s =    "/dev/pilot\n"
+gchar *s = N_("/dev/pilot\n"
               "/dev/ttyS0\n"
               "/dev/ttyS1\n"
               "/dev/ttyS2\n"
               "/dev/ttyS3\n"
               "/dev/ttyqe\n"
-              "";
-gchar *s =    "/dev/pilot";
-gchar *s =    "\n"
-              "";
+              "");
+gchar *s = N_("/dev/pilot");
+gchar *s = N_("\n"
+              "");
+gchar *s = N_("Type");
+gchar *s = N_("Serial");
+gchar *s = N_("Handspring USB");
 gchar *s = N_("Pilot Settings");
 gchar *s = N_("Pilot Identification");
 gchar *s = N_("User Name");
@@ -49,12 +53,12 @@
 gchar *s = N_("Pilot Name");
 gchar *s = N_("Local basedir");
 gchar *s = N_("Sync Action");
-gchar *s =    "\n"
-              "";
+gchar *s = N_("\n"
+              "");
 gchar *s = N_("Choose Device");
 gchar *s = N_("Choose Device");
-gchar *s =    "\n"
-              "";
+gchar *s = N_("\n"
+              "");
 gchar *s = N_("Gnome Pilot Settings");
 gchar *s = N_("Welcome to gnome-pilot!");
 gchar *s = N_("You seem to be running gnome-pilot for the first time.\n"
@@ -68,15 +72,18 @@
 gchar *s = N_("Name");
 gchar *s = N_("Port");
 gchar *s = N_("Speed");
-gchar *s =    "/dev/pilot\n"
+gchar *s = N_("/dev/pilot\n"
               "/dev/ttyS0\n"
               "/dev/ttyS1\n"
               "/dev/ttyS2\n"
               "/dev/ttyS3\n"
-              "";
+              "");
 gchar *s = N_("/dev/pilot");
-gchar *s =    "\n"
-              "";
+gchar *s = N_("\n"
+              "");
+gchar *s = N_("Type");
+gchar *s = N_("Serial");
+gchar *s = N_("Handspring USB");
 gchar *s = N_("Pilot Identification");
 gchar *s = N_("Yes, I've used sync software with this pilot before.");
 gchar *s = N_("No, I've never used sync software with this pilot before.");
@@ -88,8 +95,8 @@
 gchar *s = N_("Pilot Name");
 gchar *s = N_("Local basedir");
 gchar *s = N_("Sync Action");
-gchar *s =    "\n"
-              "";
+gchar *s = N_("\n"
+              "");
 gchar *s = N_("Success");
 gchar *s = N_("Congratulations!\n"
               "\n"
@@ -101,8 +108,8 @@
               "");
 gchar *s = N_("GnomePilot Conduits");
 gchar *s = N_("Pilot ");
-gchar *s =    "\n"
-              "";
+gchar *s = N_("\n"
+              "");
 gchar *s = N_("Conduit Name");
 gchar *s = N_("Sync Action");
 gchar *s = N_("Enable");
@@ -112,3 +119,7 @@
 gchar *s = N_("Delete this pilot");
 gchar *s = N_("Edit this device...");
 gchar *s = N_("Delete this device");
+gchar *s = N_("window1");
+gchar *s = N_("Name");
+gchar *s = N_("Port");
+gchar *s = N_("Speed");
Index: capplet/gpilotd-capplet.glade
===================================================================
RCS file: /cvs/gnome/gnome-pilot/capplet/gpilotd-capplet.glade,v
retrieving revision 1.3
diff -u -r1.3 gpilotd-capplet.glade
--- capplet/gpilotd-capplet.glade	2000/02/12 20:47:02	1.3
+++ capplet/gpilotd-capplet.glade	2000/07/31 18:59:06
@@ -10,17 +10,7 @@
   <language>C</language>
   <gnome_support>True</gnome_support>
   <gettext_support>True</gettext_support>
-  <use_widget_names>False</use_widget_names>
   <output_main_file>False</output_main_file>
-  <output_support_files>True</output_support_files>
-  <output_build_files>True</output_build_files>
-  <backup_source_files>True</backup_source_files>
-  <main_source_file>interface.c</main_source_file>
-  <main_header_file>interface.h</main_header_file>
-  <handler_source_file>callbacks.c</handler_source_file>
-  <handler_header_file>callbacks.h</handler_header_file>
-  <support_source_file>support.c</support_source_file>
-  <support_header_file>support.h</support_header_file>
   <output_translatable_strings>True</output_translatable_strings>
   <translatable_strings_file>gpilotd-capplet-strings.c</translatable_strings_file>
 </project>
@@ -210,8 +200,8 @@
 	  <class>GtkCList</class>
 	  <name>devices_clist</name>
 	  <can_focus>True</can_focus>
-	  <columns>3</columns>
-	  <column_widths>60,58,60</column_widths>
+	  <columns>4</columns>
+	  <column_widths>58,57,102,80</column_widths>
 	  <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
 	  <show_titles>True</show_titles>
 	  <shadow_type>GTK_SHADOW_IN</shadow_type>
@@ -219,7 +209,7 @@
 	  <widget>
 	    <class>GtkLabel</class>
 	    <child_name>CList:title</child_name>
-	    <name>label7</name>
+	    <name>label122</name>
 	    <label>Name</label>
 	    <justify>GTK_JUSTIFY_CENTER</justify>
 	    <wrap>False</wrap>
@@ -232,7 +222,7 @@
 	  <widget>
 	    <class>GtkLabel</class>
 	    <child_name>CList:title</child_name>
-	    <name>label8</name>
+	    <name>label123</name>
 	    <label>Port</label>
 	    <justify>GTK_JUSTIFY_CENTER</justify>
 	    <wrap>False</wrap>
@@ -245,7 +235,7 @@
 	  <widget>
 	    <class>GtkLabel</class>
 	    <child_name>CList:title</child_name>
-	    <name>label9</name>
+	    <name>label124</name>
 	    <label>Speed</label>
 	    <justify>GTK_JUSTIFY_CENTER</justify>
 	    <wrap>False</wrap>
@@ -254,6 +244,19 @@
 	    <xpad>0</xpad>
 	    <ypad>0</ypad>
 	  </widget>
+
+	  <widget>
+	    <class>GtkLabel</class>
+	    <child_name>CList:title</child_name>
+	    <name>label125</name>
+	    <label>Type</label>
+	    <justify>GTK_JUSTIFY_CENTER</justify>
+	    <wrap>False</wrap>
+	    <xalign>0.5</xalign>
+	    <yalign>0.5</yalign>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	  </widget>
 	</widget>
       </widget>
 
@@ -384,6 +387,40 @@
     </child>
 
     <widget>
+      <class>GtkHButtonBox</class>
+      <child_name>GnomeDialog:action_area</child_name>
+      <name>dialog-action_area1</name>
+      <layout_style>GTK_BUTTONBOX_EDGE</layout_style>
+      <spacing>8</spacing>
+      <child_min_width>85</child_min_width>
+      <child_min_height>27</child_min_height>
+      <child_ipad_x>7</child_ipad_x>
+      <child_ipad_y>0</child_ipad_y>
+      <child>
+	<padding>0</padding>
+	<expand>False</expand>
+	<fill>True</fill>
+	<pack>GTK_PACK_END</pack>
+      </child>
+
+      <widget>
+	<class>GtkButton</class>
+	<name>device_settings_ok</name>
+	<can_default>True</can_default>
+	<can_focus>True</can_focus>
+	<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+      </widget>
+
+      <widget>
+	<class>GtkButton</class>
+	<name>device_settings_cancel</name>
+	<can_default>True</can_default>
+	<can_focus>True</can_focus>
+	<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+      </widget>
+    </widget>
+
+    <widget>
       <class>GtkVBox</class>
       <name>vbox7</name>
       <homogeneous>False</homogeneous>
@@ -410,7 +447,7 @@
 	  <class>GtkTable</class>
 	  <name>table2</name>
 	  <border_width>6</border_width>
-	  <rows>3</rows>
+	  <rows>4</rows>
 	  <columns>2</columns>
 	  <homogeneous>False</homogeneous>
 	  <row_spacing>4</row_spacing>
@@ -582,14 +619,119 @@
 	      <yfill>False</yfill>
 	    </child>
 	  </widget>
+
+	  <widget>
+	    <class>GtkLabel</class>
+	    <name>label121</name>
+	    <label>Type</label>
+	    <justify>GTK_JUSTIFY_CENTER</justify>
+	    <wrap>False</wrap>
+	    <xalign>0.5</xalign>
+	    <yalign>0.5</yalign>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <child>
+	      <left_attach>0</left_attach>
+	      <right_attach>1</right_attach>
+	      <top_attach>3</top_attach>
+	      <bottom_attach>4</bottom_attach>
+	      <xpad>0</xpad>
+	      <ypad>0</ypad>
+	      <xexpand>False</xexpand>
+	      <yexpand>False</yexpand>
+	      <xshrink>False</xshrink>
+	      <yshrink>False</yshrink>
+	      <xfill>False</xfill>
+	      <yfill>False</yfill>
+	    </child>
+	  </widget>
+
+	  <widget>
+	    <class>GtkHBox</class>
+	    <name>hbox5</name>
+	    <homogeneous>False</homogeneous>
+	    <spacing>0</spacing>
+	    <child>
+	      <left_attach>1</left_attach>
+	      <right_attach>2</right_attach>
+	      <top_attach>3</top_attach>
+	      <bottom_attach>4</bottom_attach>
+	      <xpad>0</xpad>
+	      <ypad>0</ypad>
+	      <xexpand>False</xexpand>
+	      <yexpand>False</yexpand>
+	      <xshrink>False</xshrink>
+	      <yshrink>False</yshrink>
+	      <xfill>True</xfill>
+	      <yfill>True</yfill>
+	    </child>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>serial_radio</name>
+	      <can_focus>True</can_focus>
+	      <label>Serial</label>
+	      <active>True</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>type_group</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>usb_radio</name>
+	      <can_focus>True</can_focus>
+	      <label>Handspring USB</label>
+	      <active>False</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>type_group</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+	  </widget>
 	</widget>
       </widget>
     </widget>
+  </widget>
+</widget>
+
+<widget>
+  <class>GnomeDialog</class>
+  <name>PilotSettings</name>
+  <visible>False</visible>
+  <title>Pilot Settings</title>
+  <type>GTK_WINDOW_TOPLEVEL</type>
+  <position>GTK_WIN_POS_CENTER</position>
+  <modal>True</modal>
+  <allow_shrink>False</allow_shrink>
+  <allow_grow>False</allow_grow>
+  <auto_shrink>False</auto_shrink>
+  <auto_close>False</auto_close>
+  <hide_on_close>True</hide_on_close>
+
+  <widget>
+    <class>GtkVBox</class>
+    <child_name>GnomeDialog:vbox</child_name>
+    <name>dialog-vbox2</name>
+    <homogeneous>False</homogeneous>
+    <spacing>8</spacing>
+    <child>
+      <padding>4</padding>
+      <expand>True</expand>
+      <fill>True</fill>
+    </child>
 
     <widget>
       <class>GtkHButtonBox</class>
       <child_name>GnomeDialog:action_area</child_name>
-      <name>dialog-action_area1</name>
+      <name>dialog-action_area2</name>
       <layout_style>GTK_BUTTONBOX_EDGE</layout_style>
       <spacing>8</spacing>
       <child_min_width>85</child_min_width>
@@ -605,7 +747,7 @@
 
       <widget>
 	<class>GtkButton</class>
-	<name>device_settings_ok</name>
+	<name>pilot_settings_ok</name>
 	<can_default>True</can_default>
 	<can_focus>True</can_focus>
 	<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
@@ -613,40 +755,12 @@
 
       <widget>
 	<class>GtkButton</class>
-	<name>device_settings_cancel</name>
+	<name>pilot_settings_cancel</name>
 	<can_default>True</can_default>
 	<can_focus>True</can_focus>
 	<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
       </widget>
     </widget>
-  </widget>
-</widget>
-
-<widget>
-  <class>GnomeDialog</class>
-  <name>PilotSettings</name>
-  <visible>False</visible>
-  <title>Pilot Settings</title>
-  <type>GTK_WINDOW_TOPLEVEL</type>
-  <position>GTK_WIN_POS_CENTER</position>
-  <modal>True</modal>
-  <allow_shrink>False</allow_shrink>
-  <allow_grow>False</allow_grow>
-  <auto_shrink>False</auto_shrink>
-  <auto_close>False</auto_close>
-  <hide_on_close>True</hide_on_close>
-
-  <widget>
-    <class>GtkVBox</class>
-    <child_name>GnomeDialog:vbox</child_name>
-    <name>dialog-vbox2</name>
-    <homogeneous>False</homogeneous>
-    <spacing>8</spacing>
-    <child>
-      <padding>4</padding>
-      <expand>True</expand>
-      <fill>True</fill>
-    </child>
 
     <widget>
       <class>GtkVBox</class>
@@ -1000,40 +1114,6 @@
 	</widget>
       </widget>
     </widget>
-
-    <widget>
-      <class>GtkHButtonBox</class>
-      <child_name>GnomeDialog:action_area</child_name>
-      <name>dialog-action_area2</name>
-      <layout_style>GTK_BUTTONBOX_EDGE</layout_style>
-      <spacing>8</spacing>
-      <child_min_width>85</child_min_width>
-      <child_min_height>27</child_min_height>
-      <child_ipad_x>7</child_ipad_x>
-      <child_ipad_y>0</child_ipad_y>
-      <child>
-	<padding>0</padding>
-	<expand>False</expand>
-	<fill>True</fill>
-	<pack>GTK_PACK_END</pack>
-      </child>
-
-      <widget>
-	<class>GtkButton</class>
-	<name>pilot_settings_ok</name>
-	<can_default>True</can_default>
-	<can_focus>True</can_focus>
-	<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
-      </widget>
-
-      <widget>
-	<class>GtkButton</class>
-	<name>pilot_settings_cancel</name>
-	<can_default>True</can_default>
-	<can_focus>True</can_focus>
-	<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
-      </widget>
-    </widget>
   </widget>
 </widget>
 
@@ -1064,28 +1144,6 @@
     </child>
 
     <widget>
-      <class>GtkFrame</class>
-      <name>frame6</name>
-      <label>Choose Device</label>
-      <label_xalign>0.5</label_xalign>
-      <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-      <child>
-	<padding>0</padding>
-	<expand>True</expand>
-	<fill>True</fill>
-      </child>
-
-      <widget>
-	<class>GtkOptionMenu</class>
-	<name>device_menu</name>
-	<can_focus>True</can_focus>
-	<items>
-</items>
-	<initial_choice>0</initial_choice>
-      </widget>
-    </widget>
-
-    <widget>
       <class>GtkHButtonBox</class>
       <child_name>GnomeDialog:action_area</child_name>
       <name>dialog-action_area3</name>
@@ -1118,6 +1176,28 @@
 	<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
       </widget>
     </widget>
+
+    <widget>
+      <class>GtkFrame</class>
+      <name>frame6</name>
+      <label>Choose Device</label>
+      <label_xalign>0.5</label_xalign>
+      <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+      <child>
+	<padding>0</padding>
+	<expand>True</expand>
+	<fill>True</fill>
+      </child>
+
+      <widget>
+	<class>GtkOptionMenu</class>
+	<name>device_menu</name>
+	<can_focus>True</can_focus>
+	<items>
+</items>
+	<initial_choice>0</initial_choice>
+      </widget>
+    </widget>
   </widget>
 </widget>
 
@@ -1182,7 +1262,7 @@
 	  <class>GtkTable</class>
 	  <name>table4</name>
 	  <border_width>6</border_width>
-	  <rows>3</rows>
+	  <rows>4</rows>
 	  <columns>2</columns>
 	  <homogeneous>False</homogeneous>
 	  <row_spacing>4</row_spacing>
@@ -1358,6 +1438,83 @@
 	      <yfill>False</yfill>
 	    </child>
 	  </widget>
+
+	  <widget>
+	    <class>GtkLabel</class>
+	    <name>label120</name>
+	    <label>Type</label>
+	    <justify>GTK_JUSTIFY_CENTER</justify>
+	    <wrap>False</wrap>
+	    <xalign>0.5</xalign>
+	    <yalign>0.5</yalign>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <child>
+	      <left_attach>0</left_attach>
+	      <right_attach>1</right_attach>
+	      <top_attach>3</top_attach>
+	      <bottom_attach>4</bottom_attach>
+	      <xpad>0</xpad>
+	      <ypad>0</ypad>
+	      <xexpand>False</xexpand>
+	      <yexpand>False</yexpand>
+	      <xshrink>False</xshrink>
+	      <yshrink>False</yshrink>
+	      <xfill>False</xfill>
+	      <yfill>False</yfill>
+	    </child>
+	  </widget>
+
+	  <widget>
+	    <class>GtkHBox</class>
+	    <name>hbox4</name>
+	    <homogeneous>False</homogeneous>
+	    <spacing>0</spacing>
+	    <child>
+	      <left_attach>1</left_attach>
+	      <right_attach>2</right_attach>
+	      <top_attach>3</top_attach>
+	      <bottom_attach>4</bottom_attach>
+	      <xpad>0</xpad>
+	      <ypad>0</ypad>
+	      <xexpand>False</xexpand>
+	      <yexpand>False</yexpand>
+	      <xshrink>False</xshrink>
+	      <yshrink>False</yshrink>
+	      <xfill>True</xfill>
+	      <yfill>True</yfill>
+	    </child>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>serial_radio</name>
+	      <can_focus>True</can_focus>
+	      <label>Serial</label>
+	      <active>True</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>type_group</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+
+	    <widget>
+	      <class>GtkRadioButton</class>
+	      <name>usb_radio</name>
+	      <can_focus>True</can_focus>
+	      <label>Handspring USB</label>
+	      <active>False</active>
+	      <draw_indicator>True</draw_indicator>
+	      <group>type_group</group>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+	  </widget>
 	</widget>
       </widget>
     </widget>
@@ -1990,6 +2147,68 @@
     <name>devices_delete_menu</name>
     <label>Delete this device</label>
     <right_justify>False</right_justify>
+  </widget>
+</widget>
+
+<widget>
+  <class>GtkWindow</class>
+  <name>window1</name>
+  <title>window1</title>
+  <type>GTK_WINDOW_TOPLEVEL</type>
+  <position>GTK_WIN_POS_NONE</position>
+  <modal>False</modal>
+  <allow_shrink>False</allow_shrink>
+  <allow_grow>True</allow_grow>
+  <auto_shrink>False</auto_shrink>
+
+  <widget>
+    <class>GtkCList</class>
+    <name>devices_clistd</name>
+    <can_focus>True</can_focus>
+    <columns>3</columns>
+    <column_widths>60,58,60</column_widths>
+    <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
+    <show_titles>True</show_titles>
+    <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+    <widget>
+      <class>GtkLabel</class>
+      <child_name>CList:title</child_name>
+      <name>label7</name>
+      <label>Name</label>
+      <justify>GTK_JUSTIFY_CENTER</justify>
+      <wrap>False</wrap>
+      <xalign>0.5</xalign>
+      <yalign>0.5</yalign>
+      <xpad>0</xpad>
+      <ypad>0</ypad>
+    </widget>
+
+    <widget>
+      <class>GtkLabel</class>
+      <child_name>CList:title</child_name>
+      <name>label8</name>
+      <label>Port</label>
+      <justify>GTK_JUSTIFY_CENTER</justify>
+      <wrap>False</wrap>
+      <xalign>0.5</xalign>
+      <yalign>0.5</yalign>
+      <xpad>0</xpad>
+      <ypad>0</ypad>
+    </widget>
+
+    <widget>
+      <class>GtkLabel</class>
+      <child_name>CList:title</child_name>
+      <name>label9</name>
+      <label>Speed</label>
+      <justify>GTK_JUSTIFY_CENTER</justify>
+      <wrap>False</wrap>
+      <xalign>0.5</xalign>
+      <yalign>0.5</yalign>
+      <xpad>0</xpad>
+      <ypad>0</ypad>
+    </widget>
   </widget>
 </widget>
 
Index: capplet/gpilotd-control-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/capplet/gpilotd-control-applet.c,v
retrieving revision 1.64
diff -u -r1.64 gpilotd-control-applet.c
--- capplet/gpilotd-control-applet.c	2000/07/01 00:58:49	1.64
+++ capplet/gpilotd-control-applet.c	2000/07/31 18:59:11
@@ -670,6 +670,11 @@
 				gtk_clist_set_text(GTK_CLIST(clist),devices_selected,1,device->port);
 				g_snprintf(buf,sizeof(buf),"%d",device->speed);
 				gtk_clist_set_text(GTK_CLIST(clist),devices_selected,2,buf);
+				if (device->type == PILOT_DEVICE_SERIAL) 
+				    gtk_clist_set_text(GTK_CLIST(clist),devices_selected,3,_("Serial"));
+				else 
+				   gtk_clist_set_text(GTK_CLIST(clist),devices_selected,3,_("Handspring USB"));
+				
 				capplet_widget_state_changed(CAPPLET_WIDGET (capplet), TRUE);
 				break;
 			}
@@ -681,7 +686,7 @@
 devices_add_cb(GtkButton* button,gpointer whatever) 
 {
 	gchar buf[20];
-	const gchar *row[3];
+	const gchar *row[4];
 	gint i;	
 	GPilotDevice *device;
 
@@ -702,6 +707,11 @@
 			row[1]=device->port;
 			g_snprintf(buf,sizeof(buf),"%d",device->speed);
 			row[2]=buf;
+			if (device->type == PILOT_DEVICE_SERIAL) 
+			    row[3]=_("Serial");
+			else 
+			    row[3]=_("Handspring USB");
+			
 			i=gtk_clist_append(GTK_CLIST(deviceCfgWindow),(gchar **)row);
 			gtk_clist_set_row_data(GTK_CLIST(deviceCfgWindow),i,device);
 			curState->devices=g_list_append(curState->devices,device);
@@ -806,7 +816,7 @@
 static void
 configureDeviceDialog(GtkWidget* dialog, GladeXML*xml)
 {
-	GtkWidget *entry,*optionMenu;
+	GtkWidget *entry,*optionMenu,*usb_radio;
 	entry = glade_xml_get_widget(xml,"device_name_entry");
 	gtk_object_set_data(GTK_OBJECT(dialog),"name_entry",entry);
 	
@@ -815,6 +825,8 @@
 	gtk_signal_connect(GTK_OBJECT(entry),"insert_text",
 			   GTK_SIGNAL_FUNC(insert_device_callback),
 			   NULL);
+	usb_radio=glade_xml_get_widget(xml,"usb_radio");
+	gtk_object_set_data(GTK_OBJECT(dialog),"usb_radio",usb_radio);
 
 	optionMenu= glade_xml_get_widget(xml,"device_speed_menu");
 	gtk_object_set_data(GTK_OBJECT(dialog),"speed_menu",optionMenu);
@@ -839,7 +851,7 @@
 {
 	GList *tmp;
 	gint i=0;
-	gchar *row[3];
+	gchar *row[4];
 	
 	gtk_clist_clear(GTK_CLIST(devcfg));
 	
@@ -849,6 +861,11 @@
 		row[0]=dev->name;
 		row[1]=dev->port;
 		row[2]=g_strdup_printf("%d",dev->speed);
+		if (dev->type == PILOT_DEVICE_SERIAL) 
+		    row[3]=_("Serial");
+		else 
+		    row[3]=_("Handspring USB");
+		
 		gtk_clist_append(GTK_CLIST(devcfg),row);
 		gtk_clist_set_row_data(GTK_CLIST(devcfg),i,dev);
 		tmp=tmp->next;
@@ -905,12 +922,13 @@
 setDeviceDialogCfg(GtkWidget *devcfg, GPilotDevice *device)
 {	
 	GtkOptionMenu *speed_menu;
-	GtkWidget *port_entry, *name_entry;
+	GtkWidget *port_entry, *name_entry,*usb_radio;
 	gint i;
 
 	port_entry  = gtk_object_get_data(GTK_OBJECT(devcfg), "port_entry");
 	name_entry  = gtk_object_get_data(GTK_OBJECT(devcfg), "name_entry");
 	speed_menu = gtk_object_get_data(GTK_OBJECT(devcfg), "speed_menu");
+	usb_radio = gtk_object_get_data(GTK_OBJECT(devcfg), "usb_radio");
 
 	if (device) {
 		gtk_entry_set_text(GTK_ENTRY(name_entry), device->name);
@@ -920,6 +938,8 @@
 		if(speedList[i]==0) i=DEFAULT_SPEED_INDEX;
 		gtk_option_menu_set_history(speed_menu,i);
 		gtk_object_set_data(GTK_OBJECT(devcfg),"speed",GINT_TO_POINTER(speedList[i]));
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (usb_radio),
+					      device->type);
 	} else {
 		gchar *name =next_cradle_name();
 		gtk_entry_set_text(GTK_ENTRY(name_entry), name);
@@ -928,6 +948,9 @@
 		gtk_entry_set_text(GTK_ENTRY(port_entry), "/dev/pilot");
 		gtk_object_set_data(GTK_OBJECT(devcfg),"speed",GINT_TO_POINTER(speedList[DEFAULT_SPEED_INDEX]));
 		gtk_option_menu_set_history(speed_menu,DEFAULT_SPEED_INDEX);
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (usb_radio),
+					      FALSE);
+		
 	}
 }
 
@@ -935,12 +958,13 @@
 static void
 readDeviceDialogCfg(GtkWidget *devcfg, GPilotDevice* device)
 {
-	GtkWidget *port_entry, *speed_menu, *name_entry;
+	GtkWidget *port_entry, *speed_menu, *name_entry, *usb_radio;
 	g_return_if_fail(device!=NULL);
 
 	port_entry  = gtk_object_get_data(GTK_OBJECT(devcfg), "port_entry");
 	name_entry  = gtk_object_get_data(GTK_OBJECT(devcfg), "name_entry");
 	speed_menu = gtk_object_get_data(GTK_OBJECT(devcfg), "speed_menu");
+	usb_radio = gtk_object_get_data(GTK_OBJECT(devcfg), "usb_radio");
 
 	if (device->port)
 		g_free(device->port);
@@ -951,6 +975,8 @@
 	device->name= g_strdup(gtk_entry_get_text(GTK_ENTRY(name_entry)));
 	if (device->name==NULL) device->name = g_strdup("Cradle"); 
 	device->speed=GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(devcfg),"speed"));
+
+	device->type = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (usb_radio));
 }
 
 /* object data:                        */
Index: capplet/pilot.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/capplet/pilot.c,v
retrieving revision 1.12
diff -u -r1.12 pilot.c
--- capplet/pilot.c	2000/02/12 20:47:02	1.12
+++ capplet/pilot.c	2000/07/31 18:59:12
@@ -21,6 +21,7 @@
     device2->name=g_strdup(device->name);
     device2->port=g_strdup(device->port);
     device2->speed=device->speed;
+    device2->type=device->type;
     dest->devices=g_list_append(dest->devices,device2);
 }
 
@@ -112,6 +113,14 @@
 		  g_message("cradle device name -> %s",device->name);
 		  device->speed = gnome_config_get_int("speed=9600");
 		  g_message("Pilot Speed  -> %d",device->speed);  
+		  device->type = gnome_config_get_int ("type=0");
+		  if (device->type == PILOT_DEVICE_SERIAL) {
+		      g_message("Cradle Type -> Serial");
+		  } else if (device->type == PILOT_DEVICE_USB_VISOR) {
+		      g_message("Cradle Type -> Handspring USB");
+		  } else {
+		      g_warning ("Unknown Cradle Type");
+		  }
 		  gnome_config_pop_prefix();
 		  g_free(prefix);
 		  p->devices = g_list_append(p->devices,device);
@@ -225,6 +234,7 @@
 	  gnome_config_set_string("device", device->port);
 	  gnome_config_set_string("name", device->name);
 	  gnome_config_set_int("speed", device->speed);
+	  gnome_config_set_int("type", device->type);
 	  gnome_config_pop_prefix();
 	  g_free(prefix);
 	  tmp=tmp->next;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]