Index: gnopernicus/braille/libbrl/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/Makefile.am,v
retrieving revision 1.19
diff -u -r1.19 Makefile.am
--- gnopernicus/braille/libbrl/Makefile.am	23 Mar 2005 08:47:46 -0000	1.19
+++ gnopernicus/braille/libbrl/Makefile.am	16 Aug 2005 12:48:48 -0000
@@ -6,8 +6,6 @@
 	   -I$(top_srcdir)/srutil		\
 	   -I$(top_srcdir)/srconf/libsrconf 	\
 	   -DBRAILLE_TRANS_TABLES_DIR=\"$(sysconfdir)/gnopernicus-1.0/translation_tables/\" \
-	   -DTTYNAME0=\"$(TTYNAME_0)\" -DTTYNAME1=\"$(TTYNAME_1)\" \
-	   -DTTYNAME2=\"$(TTYNAME_2)\" -DTTYNAME3=\"$(TTYNAME_3)\" \
 	   $(BRLTTY_ACTIVE)			\
 	   $(LIBBRL_CFLAGS) 			\
 	   $(BRLTTY_INCLUDE)			\
Index: gnopernicus/braille/libbrl/alvabrl.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/alvabrl.c,v
retrieving revision 1.12
diff -u -r1.12 alvabrl.c
--- gnopernicus/braille/libbrl/alvabrl.c	25 Jul 2005 14:21:47 -0000	1.12
+++ gnopernicus/braille/libbrl/alvabrl.c	16 Aug 2005 12:48:48 -0000
@@ -457,7 +457,7 @@
 
 gint 
 alva_brl_open_device (gchar          *device_name, 
-		      gshort         port, 
+		      gchar          *port, 
 		      BRLDevCallback device_callback,
 		      BRLDevice      *device)
 {
Index: gnopernicus/braille/libbrl/alvabrl.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/alvabrl.h,v
retrieving revision 1.4
diff -u -r1.4 alvabrl.h
--- gnopernicus/braille/libbrl/alvabrl.h	25 Jul 2005 14:21:47 -0000	1.4
+++ gnopernicus/braille/libbrl/alvabrl.h	16 Aug 2005 12:48:48 -0000
@@ -26,7 +26,7 @@
 #include "braille.h"
 
 gint alva_brl_open_device (gchar          *device_name, 
-			  gshort          port,
+			  gchar           *port,
 			  BRLDevCallback  device_callback, 
 			  BRLDevice       *device);
 
Index: gnopernicus/braille/libbrl/baumbrl.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/baumbrl.c,v
retrieving revision 1.20
diff -u -r1.20 baumbrl.c
--- gnopernicus/braille/libbrl/baumbrl.c	25 Jul 2005 14:21:47 -0000	1.20
+++ gnopernicus/braille/libbrl/baumbrl.c	16 Aug 2005 12:48:49 -0000
@@ -1024,7 +1024,7 @@
 
 gint
 baum_brl_open_device (gchar          *device_name,
-		      gshort         port,
+		      gchar          *port,
 		      BRLDevCallback device_callback,
 		      BRLDevice      *device)
 {
Index: gnopernicus/braille/libbrl/baumbrl.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/baumbrl.h,v
retrieving revision 1.5
diff -u -r1.5 baumbrl.h
--- gnopernicus/braille/libbrl/baumbrl.h	25 Jul 2005 14:21:47 -0000	1.5
+++ gnopernicus/braille/libbrl/baumbrl.h	16 Aug 2005 12:48:49 -0000
@@ -26,7 +26,7 @@
 #include "braille.h"
 
 gint baum_brl_open_device (gchar          *device_name, 
-			  gshort          port,
+			  gchar           *port,
 			  BRLDevCallback  device_callback,
 			  BRLDevice       *device);
 
Index: gnopernicus/braille/libbrl/braille.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/braille.c,v
retrieving revision 1.25
diff -u -r1.25 braille.c
--- gnopernicus/braille/libbrl/braille.c	25 Jul 2005 14:21:47 -0000	1.25
+++ gnopernicus/braille/libbrl/braille.c	16 Aug 2005 12:48:49 -0000
@@ -124,7 +124,7 @@
 /* API Functions */
 gint
 brl_open_device (gchar        *device_name,
-	         gint         port,
+	         gchar         *port,
 		 BRLEventProc event_proc)
 {
     gint rv = 1;
Index: gnopernicus/braille/libbrl/braille.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/braille.h,v
retrieving revision 1.9
diff -u -r1.9 braille.h
--- gnopernicus/braille/libbrl/braille.h	25 Jul 2005 14:21:47 -0000	1.9
+++ gnopernicus/braille/libbrl/braille.h	16 Aug 2005 12:48:49 -0000
@@ -126,7 +126,7 @@
 
 /* DEVICE LEVEL */
 gint   brl_open_device   (gchar       *device_name, 
-		         gint         port,
+		         gchar         *port,
 		         BRLEventProc braille_event_proc);	
 gint   brl_get_device    (BRLDevice   *device);
 void   brl_close_device  ();
Index: gnopernicus/braille/libbrl/brlxml.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/brlxml.c,v
retrieving revision 1.24
diff -u -r1.24 brlxml.c
--- gnopernicus/braille/libbrl/brlxml.c	26 Jul 2005 11:31:04 -0000	1.24
+++ gnopernicus/braille/libbrl/brlxml.c	16 Aug 2005 12:48:49 -0000
@@ -1062,7 +1062,7 @@
 
 gint
 brl_xml_init (gchar           *device_name,
-	      gint            port,
+	      gchar           *port,
 	      BRLXmlInputProc input_callback_proc)
 {
     gint rv = 1;
Index: gnopernicus/braille/libbrl/brlxmlapi.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/brlxmlapi.h,v
retrieving revision 1.5
diff -u -r1.5 brlxmlapi.h
--- gnopernicus/braille/libbrl/brlxmlapi.h	25 Jul 2005 14:21:47 -0000	1.5
+++ gnopernicus/braille/libbrl/brlxmlapi.h	16 Aug 2005 12:48:49 -0000
@@ -28,7 +28,7 @@
 				 gint   len);
 
 gint  brl_xml_init     (gchar          *device_name,
-		       gint            port,
+		       gchar           *port,
 		       BRLXmlInputProc input_callback_proc);
 void brl_xml_terminate (void);
 void brl_xml_output    (gchar          *buffer,
Index: gnopernicus/braille/libbrl/ecobrl.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/ecobrl.c,v
retrieving revision 1.2
diff -u -r1.2 ecobrl.c
--- gnopernicus/braille/libbrl/ecobrl.c	15 Feb 2005 10:22:35 -0000	1.2
+++ gnopernicus/braille/libbrl/ecobrl.c	16 Aug 2005 12:48:49 -0000
@@ -339,7 +339,7 @@
 
 gint 
 eco_brl_open_device (gchar          *device_name,
-                     gshort         port,
+                     gchar          *port,
                      BRLDevCallback device_callback,
                      BRLDevice      *device)
 {
Index: gnopernicus/braille/libbrl/ecobrl.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/ecobrl.h,v
retrieving revision 1.1
diff -u -r1.1 ecobrl.h
--- gnopernicus/braille/libbrl/ecobrl.h	10 Jan 2005 10:24:03 -0000	1.1
+++ gnopernicus/braille/libbrl/ecobrl.h	16 Aug 2005 12:48:50 -0000
@@ -24,7 +24,7 @@
 #include "braille.h"
 
 gint eco_brl_open_device (gchar           *device_name, 
-			  gshort          port,
+			  gchar           *port,
 			  BRLDevCallback  device_callback, 
 			  BRLDevice       *device);
 
Index: gnopernicus/braille/libbrl/handybrl.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/handybrl.c,v
retrieving revision 1.4
diff -u -r1.4 handybrl.c
--- gnopernicus/braille/libbrl/handybrl.c	25 Jul 2005 14:21:47 -0000	1.4
+++ gnopernicus/braille/libbrl/handybrl.c	16 Aug 2005 12:48:50 -0000
@@ -808,7 +808,7 @@
 /* open braille driver */
 gint 
 handy_brl_open_device (gchar          *device_name, 
-		       gshort         port,
+		       gchar          *port,
 		       BRLDevCallback device_callback,
 		       BRLDevice      *device) 
 {
Index: gnopernicus/braille/libbrl/handybrl.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/handybrl.h,v
retrieving revision 1.3
diff -u -r1.3 handybrl.h
--- gnopernicus/braille/libbrl/handybrl.h	25 Jul 2005 14:21:47 -0000	1.3
+++ gnopernicus/braille/libbrl/handybrl.h	16 Aug 2005 12:48:50 -0000
@@ -26,7 +26,7 @@
 #include "braille.h"
 
 gint handy_brl_open_device (gchar               *device_name,
-			   gshort               port,
+			   gchar                *port,
 			   BRLDevCallback       device_callback,
 			   BRLDevice            *device);
 
Index: gnopernicus/braille/libbrl/sercomm.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/sercomm.c,v
retrieving revision 1.25
diff -u -r1.25 sercomm.c
--- gnopernicus/braille/libbrl/sercomm.c	25 Jul 2005 14:21:47 -0000	1.25
+++ gnopernicus/braille/libbrl/sercomm.c	16 Aug 2005 12:48:50 -0000
@@ -49,40 +49,16 @@
 
 /* Functions */
 gint 
-brl_ser_open_port (gint port)
+brl_ser_open_port (gchar *port)
 {
-	
-    gchar *pname; /* port name */
+    if (!port || !port[0])
+	return 0;
 
-    switch (port)
-    {
-	case 0:
-	    pname = TTYNAME0; 	
-	break;
-    
-	case 1:
-	    pname = TTYNAME1;
-	break;
-	
-	case 2:
-	    pname = TTYNAME2; 	
-	break;
-    
-	case 3:
-	    pname = TTYNAME3;
-	break;
-
-	default:
-	    fprintf (stderr, "\nbrl_open_port: Invalid serial port number %d", port);
-	    return 0;
-	break;
-    }
-
-    fd_serial = open(pname, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK);		
+    fd_serial = open(port, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK);		
                    	
     if (fd_serial == -1)
     {
-	fprintf (stderr, "\nbrl_open_port: Unable to open the serial port (%s).", pname);
+	fprintf (stderr, "\nbrl_open_port: Unable to open the serial port (%s).", port);
 	return 0;
     }
 
Index: gnopernicus/braille/libbrl/sercomm.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/braille/libbrl/sercomm.h,v
retrieving revision 1.9
diff -u -r1.9 sercomm.h
--- gnopernicus/braille/libbrl/sercomm.h	25 Jul 2005 14:21:47 -0000	1.9
+++ gnopernicus/braille/libbrl/sercomm.h	16 Aug 2005 12:48:50 -0000
@@ -32,7 +32,7 @@
 			     gint    max_len);
 
 /* API */
-gint  brl_ser_open_port      (gint   port);
+gint  brl_ser_open_port      (gchar   *port);
 gint  handy_set_comm_param   ();            /* for HandyTech devices */
 gint  eco_set_comm_param     ();            /* for Eco devices */
 gint  brl_ser_set_comm_param (glong  baud_rate,
Index: gnopernicus/gnopi/brlconf.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/gnopi/brlconf.c,v
retrieving revision 1.41
diff -u -r1.41 brlconf.c
--- gnopernicus/gnopi/brlconf.c	25 Jul 2005 14:21:48 -0000	1.41
+++ gnopernicus/gnopi/brlconf.c	16 Aug 2005 12:48:50 -0000
@@ -120,6 +120,7 @@
     value->attributes   	= brlconf_attributes_get ();
     value->translation_table	= brlconf_translation_table_get ();
     value->port_no		= brlconf_port_no_get ();
+    value->port			= brlconf_port_get ();
     value->status_cell		= brlconf_status_cell_get ();
     value->optical	 	= brlconf_optical_sensor_get ();
     value->position	 	= brlconf_position_sensor_get ();
@@ -227,6 +228,23 @@
 	braille->port_no = DEFAULT_BRAILLE_PORT_NO;
 
     value = gconf_client_get_default_from_schema (gnopernicus_client, 
+						CONFIG_PATH BRAILLE_KEY_PATH BRAILLE_PORT, 
+						NULL);
+    if (value)
+    {
+    	braille->port = g_strdup (gconf_value_get_string (value));
+	gconf_value_free (value);
+	value = NULL;
+    }
+    else
+    {
+	if (DEFAULT_BRAILLE_PORT)
+	    braille->port = g_strdup (DEFAULT_BRAILLE_PORT);
+	else
+	    braille->port = NULL;
+    }
+
+    value = gconf_client_get_default_from_schema (gnopernicus_client, 
 						CONFIG_PATH BRAILLE_KEY_PATH BRAILLE_TRANSLATION, 
 						NULL);
     if (value)
@@ -371,6 +389,7 @@
 {
     brlconf_cursor_style_set	(braille->cursor_style);
     brlconf_port_no_set		(braille->port_no);
+    brlconf_port_set		(braille->port);
     brlconf_attributes_set	(braille->attributes);
     brlconf_style_set		(braille->braille_style);
     brlconf_translation_table_set(braille->translation_table);
@@ -434,6 +453,15 @@
     }
 }
 
+void
+brlconf_port_set (const gchar *port)
+{
+    if (!gnopiconf_set_string (port, CONFIG_PATH BRAILLE_KEY_PATH BRAILLE_PORT))
+    {
+        sru_warning (_("Failed to set serial port : %s."), port);
+    }
+}
+
 
 void 
 brlconf_translation_table_set (const gchar *table)
@@ -568,7 +596,14 @@
 brlconf_port_no_get (void)
 {
     return gnopiconf_get_int_with_default (CONFIG_PATH BRAILLE_KEY_PATH BRAILLE_PORT_NO, 
-					DEFAULT_BRAILLE_OPTICAL_SENSOR);
+					DEFAULT_BRAILLE_PORT_NO);
+}
+
+gchar* 
+brlconf_port_get (void)
+{
+    return gnopiconf_get_string_with_default (CONFIG_PATH BRAILLE_KEY_PATH BRAILLE_PORT, 
+					DEFAULT_BRAILLE_PORT);
 }
 
 gint 
Index: gnopernicus/gnopi/brlconf.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/gnopi/brlconf.h,v
retrieving revision 1.26
diff -u -r1.26 brlconf.h
--- gnopernicus/gnopi/brlconf.h	25 Jul 2005 14:21:48 -0000	1.26
+++ gnopernicus/gnopi/brlconf.h	16 Aug 2005 12:48:51 -0000
@@ -32,6 +32,7 @@
 typedef struct
     {
 	gint 	port_no;
+	gchar 	*port;
 	gchar 	*translation_table;
 	gchar  	*braille_style;
 	gchar 	*cursor_style;
@@ -61,6 +62,7 @@
 void 		brlconf_device_set 		(const gchar *device);
 void 		brlconf_fill_char_set 		(const gchar *texture);
 void 		brlconf_port_no_set 		(gint port_no);
+void 		brlconf_port_set 		(const gchar *port);
 void 		brlconf_optical_sensor_set 	(gint sensor);
 void 		brlconf_position_sensor_set 	(gint sensor);
 void 		brlconf_status_cell_set 	(const gchar *status);
@@ -75,6 +77,7 @@
 gchar* 		brlconf_device_get 		(void);
 gchar* 		brlconf_fill_char_get 		(void);
 gint 		brlconf_port_no_get 		(void);
+gchar*		brlconf_port_get 		(void);
 gint 		brlconf_optical_sensor_get 	(void);
 gint 		brlconf_position_sensor_get 	(void);
 gchar* 		brlconf_status_cell_get 	(void);
Index: gnopernicus/gnopi/brlui.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/gnopi/brlui.c,v
retrieving revision 1.54
diff -u -r1.54 brlui.c
--- gnopernicus/gnopi/brlui.c	5 Aug 2005 13:01:18 -0000	1.54
+++ gnopernicus/gnopi/brlui.c	16 Aug 2005 12:48:51 -0000
@@ -335,6 +335,7 @@
     else
         braille_setting->port_no = -1;
     brlconf_port_no_set (braille_setting->port_no);
+    brlconf_port_set (braille_setting->port);
 }
 
 static void
@@ -346,15 +347,28 @@
     gdouble min_val, max_val;
 #endif 
     gboolean 	sensitivity;
+    gboolean	active_port_ck, active_port_et, active_port_no;
     sru_return_if_fail (braille_setting);    
     
     if (!strcmp (BRLTTY, gtk_entry_get_text (GTK_ENTRY (entry))))
 	sensitivity = FALSE;
     else
 	sensitivity = TRUE;
-	
-    gtk_widget_set_sensitive (GTK_WIDGET (lb_port), sensitivity);
-    gtk_widget_set_sensitive (GTK_WIDGET (cb_port), sensitivity);
+
+    active_port_ck = active_port_et = active_port_no = FALSE;
+    if (sensitivity)
+    {
+	active_port_ck = TRUE;
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ck_man_port)))
+	    active_port_et = TRUE;
+	else
+	    active_port_no = TRUE;
+    }
+
+    gtk_widget_set_sensitive (GTK_WIDGET (lb_port), active_port_no);
+    gtk_widget_set_sensitive (GTK_WIDGET (cb_port), active_port_no);
+    gtk_widget_set_sensitive (GTK_WIDGET (et_man_port), active_port_et);
+    gtk_widget_set_sensitive (GTK_WIDGET (ck_man_port), active_port_ck);
     
 #if 0    /* remove when it need to select the tty number */
     if (!strcmp (BRLTTY, gtk_entry_get_text (GTK_ENTRY (entry))))
@@ -410,10 +424,32 @@
 brlui_braille_device_ck_man_port_toggled (GtkToggleButton *button, 
 					  gpointer user_data)
 {
-    gboolean state = gtk_toggle_button_get_active (button);
-    
-    gtk_widget_set_sensitive (et_man_port, state);
-    /* will be kept in gconf also & stuff */
+    if (GTK_WIDGET_SENSITIVE (button))
+    {
+	gboolean state = gtk_toggle_button_get_active (button);
+
+	gtk_widget_set_sensitive (et_man_port, state);
+	gtk_widget_set_sensitive (lb_port, !state);
+	gtk_widget_set_sensitive (cb_port, !state);
+	if (!state)
+	{
+	    g_free (braille_setting->port);
+	    braille_setting->port = g_strdup ("");
+	    gtk_entry_set_text (GTK_ENTRY (et_man_port), "");
+//	    brlconf_port_set (gtk_entry_get_text (GTK_ENTRY (et_man_port)));
+	}
+    }
+}
+static gboolean
+brlui_braille_device_et_man_port_changed (GtkWidget *widget,
+                                            GdkEventFocus *event,
+                                            gpointer user_data)
+{
+    g_free (braille_setting->port);
+    braille_setting->port = g_strdup (gtk_entry_get_text (GTK_ENTRY (et_man_port)));
+//    brlconf_port_set (braille_setting->port);
+
+    return FALSE;
 }
 
 void 
@@ -439,6 +475,9 @@
     glade_xml_signal_connect (xml,"on_ck_man_port_toggled",		
 			    GTK_SIGNAL_FUNC (brlui_braille_device_ck_man_port_toggled));
 
+    glade_xml_signal_connect (xml,"on_et_man_port_focus_out_event",		
+			    GTK_SIGNAL_FUNC (brlui_braille_device_et_man_port_changed));
+
     gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (cb_braille_device)->entry), FALSE);
 }
 
@@ -533,6 +572,13 @@
     };
     if (found || hasnone)
 	gtk_combo_box_set_active_iter (GTK_COMBO_BOX (cb_port), &iter_found);
+    gtk_entry_set_text (GTK_ENTRY (et_man_port), braille_setting->port);
+    if (braille_setting->port && braille_setting->port[0])
+    {
+	gtk_widget_set_sensitive (GTK_WIDGET (lb_port), FALSE);
+	gtk_widget_set_sensitive (GTK_WIDGET (cb_port), FALSE);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ck_man_port), TRUE);
+    }
 
     return TRUE;
 }
Index: gnopernicus/gnopi/gnopiconf.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/gnopi/gnopiconf.c,v
retrieving revision 1.18
diff -u -r1.18 gnopiconf.c
--- gnopernicus/gnopi/gnopiconf.c	25 Jul 2005 14:21:49 -0000	1.18
+++ gnopernicus/gnopi/gnopiconf.c	16 Aug 2005 12:48:52 -0000
@@ -253,9 +253,7 @@
     
     if (!val)
 	val = "";
-	
     ret = gconf_client_set_string (gnopernicus_client, key, val, &error);
-
     if (error != NULL)
     {
 	sru_warning (_(error->message));
Index: gnopernicus/gnopi/gnopi_files/Braille_Settings/braille_device.glade2
===================================================================
RCS file: /cvs/gnome/gnopernicus/gnopi/gnopi_files/Braille_Settings/braille_device.glade2,v
retrieving revision 1.21
diff -u -r1.21 braille_device.glade2
--- gnopernicus/gnopi/gnopi_files/Braille_Settings/braille_device.glade2	5 Aug 2005 13:01:19 -0000	1.21
+++ gnopernicus/gnopi/gnopi_files/Braille_Settings/braille_device.glade2	16 Aug 2005 12:48:52 -0000
@@ -201,6 +201,7 @@
 	      <property name="has_frame">True</property>
 	      <property name="invisible_char" translatable="yes">*</property>
 	      <property name="activates_default">False</property>
+	      <signal name="focus_out_event" handler="on_et_man_port_focus_out_event" last_modification_time="Tue, 16 Aug 2005 09:42:00 GMT"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">3</property>
Index: gnopernicus/srconf/libsrconf/libsrconf.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/srconf/libsrconf/libsrconf.h,v
retrieving revision 1.72
diff -u -r1.72 libsrconf.h
--- gnopernicus/srconf/libsrconf/libsrconf.h	25 Jul 2005 14:21:53 -0000	1.72
+++ gnopernicus/srconf/libsrconf/libsrconf.h	16 Aug 2005 12:48:53 -0000
@@ -55,6 +55,7 @@
 #define DEFAULT_BRAILLE_DEVICE_INDEX 		0
 #define DEFAULT_BRAILLE_DEVICE_COUNT		0
 #define DEFAULT_BRAILLE_PORT_NO 		-1
+#define DEFAULT_BRAILLE_PORT 			NULL
 #define DEFAULT_BRAILLE_FILL_CHAR 		"##"
 #define DEFAULT_BRAILLE_STATUS_CELL 		"CursorPos"
 #define DEFAULT_BRAILLE_OPTICAL_SENSOR 		0
@@ -205,6 +206,7 @@
 #define BRAILLE_TRANSLATION 			"translation_table"
 #define BRAILLE_DEVICE 				"device"
 #define BRAILLE_PORT_NO 			"port_no"
+#define BRAILLE_PORT 				"port"
 #define BRAILLE_FILL_CHAR 			"fill_char"
 #define BRAILLE_STATUS_CELL 			"status"
 #define BRAILLE_OPTICAL_SENSOR 			"optical"
Index: gnopernicus/srcore/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnopernicus/srcore/Makefile.am,v
retrieving revision 1.29
diff -u -r1.29 Makefile.am
--- gnopernicus/srcore/Makefile.am	5 Nov 2004 12:08:42 -0000	1.29
+++ gnopernicus/srcore/Makefile.am	16 Aug 2005 12:48:53 -0000
@@ -13,6 +13,8 @@
 	   -DBRLMON_DIR=\"$(libexecdir)/\" \
 	   $(SRCORE_CFLAGS)  			\
 	   -DG_LOG_DOMAIN=\"gnopernicus\"	\
+	   -DTTYNAME0=\"$(TTYNAME_0)\" -DTTYNAME1=\"$(TTYNAME_1)\" \
+	   -DTTYNAME2=\"$(TTYNAME_2)\" -DTTYNAME3=\"$(TTYNAME_3)\" \
 	   -DSRS_NO_MARKERS_SUPPORTED
 
 
Index: gnopernicus/srcore/srbrl.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/srcore/srbrl.c,v
retrieving revision 1.60
diff -u -r1.60 srbrl.c
--- gnopernicus/srcore/srbrl.c	26 Jul 2005 11:31:05 -0000	1.60
+++ gnopernicus/srcore/srbrl.c	16 Aug 2005 12:48:54 -0000
@@ -54,7 +54,7 @@
     gchar 	 *cursor_style;	
     gchar 	 *translation_table;
     
-    gint  	 port;
+    gchar  	 *port;
     gint  	 position_sensor;
     gint  	 optical_sensor;
     gint  	 offset;
@@ -642,7 +642,7 @@
 src_braille_restart ()
 {
     gchar *device = g_strdup (src_braille->device);
-    gint port = src_braille->port;
+    gchar *port = g_strdup (src_braille->port);
 
     if (src_use_braille)
 	src_braille_terminate ();
@@ -650,11 +650,9 @@
 	
     src_braille->device = device;
     src_braille->port = port;	
+
     src_use_braille = src_braille_init ();
 
-    if (src_use_braille_monitor)
-    {
-    }
     return src_use_braille;
 }
 
@@ -759,10 +757,55 @@
     return braille;
 }
 
+static gchar*
+src_braille_get_port_from_no (gint port_no)
+{
+    gchar *port = NULL;
+
+    if (MIN_SERIAL_PORT_NO > port_no ||
+	    MAX_SERIAL_PORT_NO < port_no) 
+    {
+	port_no = DEFAULT_BRAILLE_PORT_NO;
+    	SET_BRAILLE_CONFIG_DATA (BRAILLE_PORT_NO, CFGT_INT, &port_no);
+    }   
+    switch (port_no)
+    {
+	case -1: port = NULL; 	break;
+	case  0: port = g_strdup (TTYNAME0); 	break;
+	case  1: port = g_strdup (TTYNAME1);	break;
+	case  2: port = g_strdup (TTYNAME2); 	break;
+	case  3: port = g_strdup (TTYNAME3);	break;
+	default:
+	    fprintf (stderr, "\nbrl_open_port: Invalid serial port number %d", port_no);
+	    break;
+    }
+    if (!port && DEFAULT_BRAILLE_PORT)
+	port = g_strdup (DEFAULT_BRAILLE_PORT);
+
+    return port;
+}
+
+
+static gchar*
+src_braille_get_port ()
+{
+    gchar *port = DEFAULT_BRAILLE_PORT;
+
+    GET_BRAILLE_CONFIG_DATA_WITH_DEFAULT (BRAILLE_PORT, CFGT_STRING, 
+					      &port, &port);
+    if (!port || !port[0])
+    {
+	gint port_no = DEFAULT_BRAILLE_PORT_NO;
+        GET_BRAILLE_CONFIG_DATA_WITH_DEFAULT (BRAILLE_PORT_NO, CFGT_INT, 
+					      &port_no, &port_no);
+	port = src_braille_get_port_from_no (port_no);
+    }
+    return port;
+}
+
 static void
 src_braille_load_values (SRCBraille *braille)
 {
-    gint default_port = DEFAULT_BRAILLE_PORT_NO;
     gchar *default_braille_transaltion_table;
     gchar *default_braille_style;
     gchar *default_braille_cursor_style;
@@ -778,18 +821,8 @@
 					      &braille->device, 
 					      default_device);
     }
-        
-    
-    GET_BRAILLE_CONFIG_DATA_WITH_DEFAULT (BRAILLE_PORT_NO, CFGT_INT, 
-					      &braille->port, 
-					      &default_port);
-    
-    if (MIN_SERIAL_PORT_NO > braille->port || 
-    	    MAX_SERIAL_PORT_NO < braille->port) 
-    {
-	braille->port = DEFAULT_BRAILLE_PORT_NO;
-    	SET_BRAILLE_CONFIG_DATA (BRAILLE_PORT_NO, CFGT_INT, &braille->port);
-    }    
+    g_free (braille->port);
+    braille->port = src_braille_get_port ();
     
     default_braille_transaltion_table = DEFAULT_BRAILLE_TRANSLATION;
     GET_BRAILLE_CONFIG_DATA_WITH_DEFAULT (BRAILLE_TRANSLATION, CFGT_STRING, 
@@ -843,15 +876,15 @@
     if (!brl_xml_init(src_braille->device, src_braille->port, brl_xml_input_proc)) /* take Braille display from Gnopi... */
     {
 	brlval = FALSE;
-	fprintf(stderr, "\n** BRAILLE initialization failed for %s on port %d",
-					src_braille->device, src_braille->port);
+	fprintf(stderr, "\n** BRAILLE initialization failed for %s on port %s",
+					src_braille->device, src_braille->port ? src_braille->port : "<NONE>");
 	fprintf (stderr, "\n   To change one or more settings use gnopernicus UI\n");
     }
     else
     {
 	brlval = TRUE;
 	fprintf (stderr, "\n** BRAILLE initialization succeded for %s device"
-				    " on port %d.", src_braille->device, src_braille->port);
+				    " on port %s.", src_braille->device, src_braille->port ? src_braille->port : "<NONE>");
 	fprintf (stderr, "\n   To see something you must have a Braille device"
 				    " connected to your computer.");
 	fprintf (stderr, "\n   To change one or more settings use gnopernicus UI.\n");
@@ -878,7 +911,7 @@
     brl_in_xml_terminate ();
 	
     g_free (src_braille->device);
-    src_braille->port = -1;
+    g_free (src_braille->port);
 }
 
 static SRCBraille* 
@@ -908,20 +941,47 @@
 }
 
 gboolean
-src_braille_set_port_no (gint port)
+src_braille_change_port (gchar *nport)
 {
     SRCBraille *braille;
-    
+
     braille = src_braille_get_global_settings ();
     sru_assert (braille);
-    
-    if (braille->port != port)
+
+    if (!nport || !braille->port || strcmp (braille->port, nport) != 0)
     {
-	braille->port = port;
+	g_free (braille->port);
+	braille->port = nport ? g_strdup (nport) : NULL;
 	src_use_braille = src_braille_restart ();
-	return TRUE;
-    }    
-    return FALSE;
+	return src_use_braille;
+    }
+
+    return TRUE;
+}
+
+
+gboolean
+src_braille_set_port ()
+{
+    gboolean rv;
+    gchar *nport = src_braille_get_port ();
+
+    rv = src_braille_change_port (nport);
+    g_free (nport);
+
+    return rv;
+}
+
+gboolean
+src_braille_set_port_no (gint port_no)
+{
+    gboolean rv;
+    gchar *nport = src_braille_get_port_from_no (port_no);
+
+    rv = src_braille_change_port (nport);
+    g_free (nport);
+
+    return rv;
 }
 
 gboolean
@@ -1071,17 +1131,6 @@
     sru_assert (braille);
     
     return braille->position_sensor;
-}
-
-gint
-src_braille_get_port_no ()
-{
-    SRCBraille *braille;
-    
-    braille = src_braille_get_global_settings ();
-    sru_assert (braille);
-    
-    return braille->port;
 }
 
 gchar*
Index: gnopernicus/srcore/srbrl.h
===================================================================
RCS file: /cvs/gnome/gnopernicus/srcore/srbrl.h,v
retrieving revision 1.27
diff -u -r1.27 srbrl.h
--- gnopernicus/srcore/srbrl.h	25 Jul 2005 14:21:54 -0000	1.27
+++ gnopernicus/srcore/srbrl.h	16 Aug 2005 12:48:54 -0000
@@ -60,7 +60,8 @@
 gboolean src_braille_set_cursor_style 	   (gchar *cursor_style);
 gboolean src_braille_set_translation_table (gchar *translation_table);
 
-gboolean src_braille_set_port_no 	   (gint port);
+gboolean src_braille_set_port 	   	   ();
+gboolean src_braille_set_port_no 	   (gint port_no);
 gboolean src_braille_set_optical_sensor	   (gint optical_sensor);
 gboolean src_braille_set_position_sensor   (gint position_sensor);
 gboolean src_braille_set_offset 	   (gint offset);
Index: gnopernicus/srcore/srmain.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/srcore/srmain.c,v
retrieving revision 1.161
diff -u -r1.161 srmain.c
--- gnopernicus/srcore/srmain.c	26 Jul 2005 11:31:05 -0000	1.161
+++ gnopernicus/srcore/srmain.c	16 Aug 2005 12:48:55 -0000
@@ -691,9 +691,11 @@
     }
     else if (strcmp (config->key, BRAILLE_PORT_NO) == 0)
     {
-    	sru_assert (config->newvalue && config->type == CFGT_INT);
-	
-	src_braille_set_port_no (*((gint*)config->newvalue));
+    	src_braille_set_port ();
+    }
+    else if (strcmp (config->key, BRAILLE_PORT) == 0)
+    {
+    	src_braille_set_port ();
     }
     else
 /*    if (config->key && strcmp (config->key, BRAILLE_ATTRIBUTES) == 0)
