From: Kaj-Michael Lang Date: Mon, 6 Aug 2007 13:51:49 +0000 (+0300) Subject: Split out some more menus for non-hildon case X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64b61c47507694fabfbf23527a589415de5f0458;p=mapper Split out some more menus for non-hildon case --- diff --git a/src/ui-common.c b/src/ui-common.c index a6c94e6..40dd079 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -325,7 +325,12 @@ static void menu_init() gtk_menu_append(menu, gtk_separator_menu_item_new()); /* The "View" submenu. */ - gtk_menu_append(menu, menu_item = gtk_menu_item_new_with_label(_("View"))); + menu_item = gtk_menu_item_new_with_label(_("View")); +#ifdef WITH_HILDON + gtk_menu_append(menu, menu_item); +#else + gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(menu_item)); +#endif gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new()); gtk_menu_append(submenu, _menu_zoomin_item = gtk_menu_item_new_with_label(_("Zoom In"))); gtk_menu_append(submenu, _menu_zoomout_item = gtk_menu_item_new_with_label(_("Zoom Out"))); @@ -348,24 +353,22 @@ static void menu_init() /* The "Auto-Center" submenu. */ gtk_menu_append(menu, menu_item = gtk_menu_item_new_with_label(_("Auto-Center"))); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new()); - gtk_menu_append(submenu, _menu_ac_latlon_item - = gtk_radio_menu_item_new_with_label(NULL, _("Lat/Lon"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_ac_latlon_item), - _center_mode == CENTER_LATLON); - gtk_menu_append(submenu, _menu_ac_lead_item = - gtk_radio_menu_item_new_with_label_from_widget + gtk_menu_append(submenu, _menu_ac_latlon_item = gtk_radio_menu_item_new_with_label(NULL, _("Lat/Lon"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_ac_latlon_item), _center_mode == CENTER_LATLON); + gtk_menu_append(submenu, _menu_ac_lead_item = gtk_radio_menu_item_new_with_label_from_widget (GTK_RADIO_MENU_ITEM(_menu_ac_latlon_item), _("Lead"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_ac_lead_item), - _center_mode == CENTER_LEAD); - gtk_menu_append(submenu, _menu_ac_none_item = - gtk_radio_menu_item_new_with_label_from_widget + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_ac_lead_item), _center_mode == CENTER_LEAD); + gtk_menu_append(submenu, _menu_ac_none_item = gtk_radio_menu_item_new_with_label_from_widget (GTK_RADIO_MENU_ITEM(_menu_ac_latlon_item), _("None"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_ac_none_item), - _center_mode < 0); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_ac_none_item), _center_mode < 0); /* The "Go to" submenu. */ - gtk_menu_append(menu, menu_item = gtk_menu_item_new_with_label(_("Go to"))); + menu_item = gtk_menu_item_new_with_label(_("Go to")); +#ifdef WITH_HILDON + gtk_menu_append(menu, menu_item); +#else + gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(menu_item)); +#endif gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new()); gtk_menu_append(submenu, _menu_goto_home = gtk_menu_item_new_with_label(_("Home"))); gtk_menu_append(submenu, _menu_goto_latlon = gtk_menu_item_new_with_label(_("Lat/Lon..."))); @@ -374,22 +377,19 @@ static void menu_init() gtk_menu_append(submenu, _menu_goto_nearpoi = gtk_menu_item_new_with_label(_("Nearest POI"))); /* The "GPS" submenu. */ - gtk_menu_append(menu, menu_item - = gtk_menu_item_new_with_label(_("GPS"))); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), - submenu = gtk_menu_new()); - gtk_menu_append(submenu, _menu_enable_gps_item - = gtk_check_menu_item_new_with_label(_("Enable GPS"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_enable_gps_item), _enable_gps); - gtk_menu_append(submenu, _menu_gps_show_info_item = - gtk_check_menu_item_new_with_label(_("Show Information"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_gps_show_info_item), _gps_info); - gtk_menu_append(submenu, _menu_gps_details_item = - gtk_menu_item_new_with_label(_("Details..."))); - gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item), - _enable_gps); + menu_item = gtk_menu_item_new_with_label(_("GPS")); +#ifdef WITH_HILDON + gtk_menu_append(menu, menu_item); +#else + gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(menu_item)); +#endif + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new()); + gtk_menu_append(submenu, _menu_enable_gps_item = gtk_check_menu_item_new_with_label(_("Enable GPS"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_enable_gps_item), _enable_gps); + gtk_menu_append(submenu, _menu_gps_show_info_item = gtk_check_menu_item_new_with_label(_("Show Information"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_gps_show_info_item), _gps_info); + gtk_menu_append(submenu, _menu_gps_details_item = gtk_menu_item_new_with_label(_("Details..."))); + gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item), _enable_gps); gtk_menu_append(menu, gtk_separator_menu_item_new()); /* The other menu items. */