moserial r29 - in trunk: . doc/C src



Author: mjc
Date: Wed Mar 18 14:10:37 2009
New Revision: 29
URL: http://svn.gnome.org/viewvc/moserial?rev=29&view=rev

Log:
2009-03-18  Michael J. Chudobiak  <mjc svn gnome org>

        * doc/C/moserial.xml:
        * src/SettingsDialog.vala:
        Added support for /dev/rfcomm ports.



Modified:
   trunk/ChangeLog
   trunk/doc/C/moserial.xml
   trunk/src/SettingsDialog.vala

Modified: trunk/doc/C/moserial.xml
==============================================================================
--- trunk/doc/C/moserial.xml	(original)
+++ trunk/doc/C/moserial.xml	Wed Mar 18 14:10:37 2009
@@ -161,8 +161,9 @@
         any system default settings for the port.
       </para>
       <para>
-        The &app; port setup dialog will only list the /dev/ttySnn and /dev/ttyUSBnn ports
-        that actually exist on the system, for values of "nn" between 0 and 31.
+        The &app; port setup dialog will only list the /dev/ttySnn, /dev/ttyUSBnn,
+        and /dev/rfcommnn ports that actually exist on the system, for values of "nn"
+        between 0 and 31.
       </para>
       <para>
         A local echo can be enabled from this dialog. If enabled, all data that &app;

Modified: trunk/src/SettingsDialog.vala
==============================================================================
--- trunk/src/SettingsDialog.vala	(original)
+++ trunk/src/SettingsDialog.vala	Wed Mar 18 14:10:37 2009
@@ -49,28 +49,26 @@
         }
 
         private void populateDevices(){
+		List<string> deviceTypes = new List<string> ();
+		deviceTypes.append ("/dev/ttyS");
+		deviceTypes.append ("/dev/ttyUSB");
+		deviceTypes.append ("/dev/rfcomm");
+
                 var ls = new ListStore(2, typeof(string), typeof(string));
                 
                 deviceCombo.set_model(ls);
                 deviceCombo.set_text_column(1);
                 TreeIter iter;
-	
-		for (int i = 0; i < max_devices; i++) {
-			string dev = "/dev/ttyS%d".printf(i);
-			if (FileUtils.test (dev, FileTest.EXISTS)) {
-		 		ls.append(out iter);
-        		        ls.set(iter, 0, "", 1, dev, -1);
+		
+		foreach (string devType in deviceTypes) {
+			for (int i = 0; i < max_devices; i++) {
+				string dev = "%s%d".printf(devType,i);
+				if (FileUtils.test (dev, FileTest.EXISTS)) {
+		 			ls.append(out iter);
+        		        	ls.set(iter, 0, "", 1, dev, -1);
+				}
 			}
 		}
-                
-                for (int i = 0; i < max_devices; i++) {
-                        string dev = "/dev/ttyUSB%d".printf(i);
-                        if (FileUtils.test (dev, FileTest.EXISTS)) {
-	                        ls.append(out iter);
-        	                ls.set(iter, 0, "", 1, dev, -1);
-			}
-                }
-                
         }
 
         public void show(Settings settings) {



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