From: Alexandru C. <cs...@us...> - 2003-05-09 15:10:59
|
Update of /cvsroot/groundstation/grig/src In directory sc8-pr-cvs1:/tmp/cvs-serv4105 Modified Files: grig-utils.c grig-utils.h Log Message: Added function to create a gtk-menu containing serial speeds. Index: grig-utils.c =================================================================== RCS file: /cvsroot/groundstation/grig/src/grig-utils.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** grig-utils.c 13 Aug 2002 21:51:37 -0000 1.2 --- grig-utils.c 9 May 2003 15:10:56 -0000 1.3 *************** *** 61,62 **** --- 61,126 ---- return button; } + + + + GtkWidget * + grig_utils_create_serial_rate_menu () + { + /* This function creates a Gtk-menu that contains + a list of possible serial speeds. This is used + by both the radio and rotator config interface. + Default means use the speed that Hamlib finds + convenient. + + WARNING: The serial values are hardcoded from + hamlib/src/serial.c + + */ + + GtkWidget *menu; + GtkWidget *item; + + menu = gtk_menu_new (); + + item = gtk_menu_item_new_with_label (_("Default")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (0)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("300")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (300)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("1200")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (1200)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("2400")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (2400)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("4800")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (4800)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("9600")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (9600)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("19200")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (19200)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("38400")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (38400)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("57600")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (57600)); + gtk_menu_append (GTK_MENU (menu), item); + + item = gtk_menu_item_new_with_label (_("115200")); + gtk_object_set_data (GTK_OBJECT (item), "speed", GUINT_TO_POINTER (115200)); + gtk_menu_append (GTK_MENU (menu), item); + + return menu; + } Index: grig-utils.h =================================================================== RCS file: /cvsroot/groundstation/grig/src/grig-utils.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** grig-utils.h 13 Aug 2002 21:51:37 -0000 1.2 --- grig-utils.h 9 May 2003 15:10:56 -0000 1.3 *************** *** 34,38 **** ! GtkWidget *grig_utils_pixmap_button (const gchar *label, const gchar *stock_pixmap, const gchar *tooltips); #endif --- 34,42 ---- ! GtkWidget *grig_utils_pixmap_button (const gchar *label, ! const gchar *stock_pixmap, ! const gchar *tooltips); ! ! GtkWidget *grig_utils_create_serial_rate_menu (void); #endif |