- gtk_combo_box_append_text (w->ser_b, "/dev/ttyS0");
- gtk_combo_box_append_text (w->ser_b, "/dev/ttyS1");
- gtk_combo_box_append_text (w->ser_b, "/dev/ttyUSB0");
- gtk_combo_box_append_text (w->ser_b, "/dev/ttyUSB1");
+ /* Here just try to see if the device is available which gets passed onto gpsbabel
+ List USB devices first as these will generally only be present if autogenerated by udev or similar
+ User is still able to set their own free text entry */
+ if (g_access ("/dev/ttyUSB0", R_OK) == 0)
+ gtk_combo_box_append_text (w->ser_b, "/dev/ttyUSB0");
+ if (g_access ("/dev/ttyUSB1", R_OK) == 0)
+ gtk_combo_box_append_text (w->ser_b, "/dev/ttyUSB1");
+ if (g_access ("/dev/ttyS0", R_OK) == 0)
+ gtk_combo_box_append_text (w->ser_b, "/dev/ttyS0");
+ if (g_access ("/dev/ttyS1", R_OK) == 0)
+ gtk_combo_box_append_text (w->ser_b, "/dev/ttyS1");