From a5ccdd0410e3ac88958823da344709c40065b72a Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 2 Aug 2007 12:54:05 +0300 Subject: [PATCH] misc --- src/ui-common.c | 126 ++++++++++++++++-------------------------------- 1 file changed, 41 insertions(+), 85 deletions(-) diff --git a/src/ui-common.c b/src/ui-common.c index 8ed9f7f..85cb30b 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -302,12 +302,9 @@ static void menu_init() gtk_menu_append(submenu, _menu_route_save_item = gtk_menu_item_new_with_label(_("Save..."))); gtk_menu_append(submenu, _menu_route_distnext_item - = - gtk_menu_item_new_with_label(_ - ("Show Distance to Next Waypoint"))); + = gtk_menu_item_new_with_label(_("Show Distance to Next Waypoint"))); gtk_menu_append(submenu, _menu_route_distlast_item = - gtk_menu_item_new_with_label(_ - ("Show Distance to End of Route"))); + gtk_menu_item_new_with_label(_("Show Distance to End of Route"))); gtk_menu_append(submenu, _menu_route_reset_item = gtk_menu_item_new_with_label(_("Reset"))); gtk_menu_append(submenu, _menu_route_clear_item = @@ -327,12 +324,9 @@ static void menu_init() gtk_menu_append(submenu, _menu_track_insert_mark_item = gtk_menu_item_new_with_label(_("Insert Mark..."))); gtk_menu_append(submenu, _menu_track_distlast_item - = - gtk_menu_item_new_with_label(_ - ("Show Distance from Last Mark"))); + = gtk_menu_item_new_with_label(_("Show Distance from Last Mark"))); gtk_menu_append(submenu, _menu_track_distfirst_item = - gtk_menu_item_new_with_label(_ - ("Show Distance from Beginning"))); + gtk_menu_item_new_with_label(_("Show Distance from Beginning"))); gtk_menu_append(submenu, _menu_track_clear_item = gtk_menu_item_new_with_label(_("Clear"))); @@ -358,54 +352,31 @@ 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"))); - 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"))); - gtk_menu_append(submenu, _menu_fullscreen_item - = gtk_check_menu_item_new_with_label(_("Full Screen"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_fullscreen_item), _fullscreen); + gtk_menu_append(menu, menu_item = gtk_menu_item_new_with_label(_("View"))); + 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"))); + gtk_menu_append(submenu, _menu_fullscreen_item = gtk_check_menu_item_new_with_label(_("Full Screen"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item), _fullscreen); gtk_menu_append(submenu, gtk_separator_menu_item_new()); - gtk_menu_append(submenu, _menu_show_scale_item - = gtk_check_menu_item_new_with_label(_("Scale"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_show_scale_item), _show_scale); - gtk_menu_append(submenu, _menu_show_routes_item = - gtk_check_menu_item_new_with_label(_("Route"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_show_routes_item), - _show_tracks & ROUTES_MASK); - gtk_menu_append(submenu, _menu_show_tracks_item = - gtk_check_menu_item_new_with_label(_("Track"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_show_tracks_item), - _show_tracks & TRACKS_MASK); - gtk_menu_append(submenu, _menu_show_velvec_item = - gtk_check_menu_item_new_with_label(_ - ("Velocity Vector"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM - (_menu_show_velvec_item), _show_velvec); - gtk_menu_append(submenu, _menu_show_poi_item = - gtk_check_menu_item_new_with_label(_("POIs"))); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_show_poi_item), - _show_poi); - gtk_menu_append(submenu, _menu_poi_item = - gtk_menu_item_new_with_label(_("POI Categories..."))); + gtk_menu_append(submenu, _menu_show_scale_item = gtk_check_menu_item_new_with_label(_("Scale"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_show_scale_item), _show_scale); + gtk_menu_append(submenu, _menu_show_routes_item = gtk_check_menu_item_new_with_label(_("Route"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_show_routes_item), _show_tracks & ROUTES_MASK); + gtk_menu_append(submenu, _menu_show_tracks_item = gtk_check_menu_item_new_with_label(_("Track"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_show_tracks_item), _show_tracks & TRACKS_MASK); + gtk_menu_append(submenu, _menu_show_velvec_item = gtk_check_menu_item_new_with_label(_("Velocity Vector"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_show_velvec_item), _show_velvec); + gtk_menu_append(submenu, _menu_show_poi_item = gtk_check_menu_item_new_with_label(_("POIs"))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_show_poi_item), _show_poi); + gtk_menu_append(submenu, _menu_poi_item = gtk_menu_item_new_with_label(_("POI Categories..."))); gtk_widget_set_sensitive(_menu_poi_item, _db != NULL); /* 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(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_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); @@ -421,20 +392,13 @@ static void menu_init() _center_mode < 0); /* The "Go to" submenu. */ - gtk_menu_append(menu, menu_item - = gtk_menu_item_new_with_label(_("Go to"))); - 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..."))); - gtk_menu_append(submenu, _menu_goto_gps - = gtk_menu_item_new_with_label(_("GPS Location"))); - gtk_menu_append(submenu, _menu_goto_nextway - = gtk_menu_item_new_with_label(_("Next Waypoint"))); - gtk_menu_append(submenu, _menu_goto_nearpoi - = gtk_menu_item_new_with_label(_("Nearest POI"))); + gtk_menu_append(menu, menu_item = gtk_menu_item_new_with_label(_("Go to"))); + 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..."))); + gtk_menu_append(submenu, _menu_goto_gps = gtk_menu_item_new_with_label(_("GPS Location"))); + gtk_menu_append(submenu, _menu_goto_nextway = gtk_menu_item_new_with_label(_("Next Waypoint"))); + gtk_menu_append(submenu, _menu_goto_nearpoi = gtk_menu_item_new_with_label(_("Nearest POI"))); /* The "GPS" submenu. */ gtk_menu_append(menu, menu_item @@ -446,8 +410,7 @@ static void menu_init() 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_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 = @@ -457,15 +420,11 @@ static void menu_init() gtk_menu_append(menu, gtk_separator_menu_item_new()); /* The other menu items. */ - gtk_menu_append(menu, _menu_settings_item - = gtk_menu_item_new_with_label(_("Settings..."))); + gtk_menu_append(menu, _menu_settings_item = gtk_menu_item_new_with_label(_("Settings..."))); gtk_menu_append(menu, gtk_separator_menu_item_new()); - gtk_menu_append(menu, _menu_help_item - = gtk_menu_item_new_with_label(_("Help..."))); - gtk_menu_append(menu, _menu_about_item - = gtk_menu_item_new_with_label(_("About..."))); - gtk_menu_append(menu, _menu_close_item - = gtk_menu_item_new_with_label(_("Close"))); + gtk_menu_append(menu, _menu_help_item = gtk_menu_item_new_with_label(_("Help..."))); + gtk_menu_append(menu, _menu_about_item = gtk_menu_item_new_with_label(_("About..."))); + gtk_menu_append(menu, _menu_close_item = gtk_menu_item_new_with_label(_("Quit"))); /* We need to show menu items. */ gtk_widget_show_all(GTK_WIDGET(menu)); @@ -473,18 +432,15 @@ static void menu_init() #ifdef WITH_HILDON hildon_window_set_menu(HILDON_WINDOW(_window), menu); #else - GtkWidget *_file_item; + GtkWidget *file_item; - _file_item = gtk_menu_item_new_with_label("File"); -#if 1 - gtk_menu_item_set_submenu(GTK_MENU_ITEM(_file_item), GTK_WIDGET(menu)); - gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(_file_item)); -#else - gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), menu); -#endif + file_item = gtk_menu_item_new_with_label("File"); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(file_item), GTK_WIDGET(menu)); + gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(file_item)); gtk_widget_show_all(GTK_WIDGET(_menu_bar)); #endif + /* Connect the "Route" signals. */ g_signal_connect(G_OBJECT(_menu_route_open_item), "activate", G_CALLBACK(menu_cb_route_open), NULL); -- 2.39.5