]> err.no Git - mapper/commitdiff
Split out some more menus for non-hildon case
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 6 Aug 2007 13:51:49 +0000 (16:51 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 6 Aug 2007 13:51:49 +0000 (16:51 +0300)
src/ui-common.c

index a6c94e6655482f91b7487c48b74b9dca007c5409..40dd079d4058df116fa3ec6d44e0574b4fb2c329 100644 (file)
@@ -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. */