]> err.no Git - mapper/commitdiff
Fix menu(s) under hildon. Fix color dialog value handling.
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 6 Aug 2007 15:37:01 +0000 (18:37 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 6 Aug 2007 15:37:01 +0000 (18:37 +0300)
src/hildon-mapper.h
src/settings-gui.c
src/ui-common.c

index ddc11ba2738f08eea1dd0f4a61d87b1185dac8fe..6f64303036292cde8b01d7a8b03a05765414154e 100644 (file)
 #ifdef WITH_HILDONFM
 #include <hildon/hildon-file-chooser-dialog.h>
 #endif
+
+#ifdef WITH_DEVICE_770
+#include <device_symbols.h>
+#include <hildon/hildon-input-mode-hint.h>
+#endif
+
 #else
+
 #include <hildon-widgets/hildon-program.h>
 #include <hildon-widgets/hildon-program.h>
 #include <hildon-widgets/hildon-controlbar.h>
 #include <hildon-widgets/hildon-color-button.h>
 #include <hildon-widgets/hildon-number-editor.h>
 #include <hildon-widgets/hildon-banner.h>
+
 #ifdef WITH_HILDONFM
 #include <hildon-widgets/hildon-file-chooser-dialog.h>
 #endif
-#endif
 
 #ifdef WITH_DEVICE_770
 #include <device_symbols.h>
-#include <hildon/hildon-input-mode-hint.h>
+#include <hildon-widgets/hildon-input-mode-hint.h>
+#endif
+
 #endif
 
 #endif
index 2279a09618bad79b7c4bbc3f7f154b9ee3d531cf..989d93b6be348e222dfb58034001669b9b31fafd 100644 (file)
@@ -319,37 +319,16 @@ settings_dialog_colors(GtkWidget * widget, GtkWidget * parent)
        gtk_widget_show_all(dialog);
 
        if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
-               GdkColor *color=NULL;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]),color);
-               _color[COLORABLE_MARK] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]) ,color);
-               _color[COLORABLE_MARK_VELOCITY] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]),color);
-               _color[COLORABLE_MARK_OLD] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]),color);
-               _color[COLORABLE_TRACK] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]),color);
-               _color[COLORABLE_TRACK_MARK] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),color);
-               _color[COLORABLE_TRACK_BREAK] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),color);
-               _color[COLORABLE_ROUTE] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),color);
-               _color[COLORABLE_ROUTE_WAY] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),color);
-               _color[COLORABLE_ROUTE_BREAK] = *color;
-
-               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),color);
-               _color[COLORABLE_POI] = *color;
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]), &_color[COLORABLE_MARK]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]), &_color[COLORABLE_MARK_VELOCITY]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]), &_color[COLORABLE_MARK_OLD]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]), &_color[COLORABLE_TRACK]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]), &_color[COLORABLE_TRACK_MARK]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),&_color[COLORABLE_TRACK_BREAK]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),&_color[COLORABLE_ROUTE]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),&_color[COLORABLE_ROUTE_WAY]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),&_color[COLORABLE_ROUTE_BREAK]);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),&_color[COLORABLE_POI]);
 
                update_gcs();
        }
index 7e3d5a1fe86728e98a3d0bdb70657955f225b505..ec0c422a3b3dda33688e17a18b947d07e3190632 100644 (file)
@@ -258,6 +258,7 @@ static void menu_init()
        GtkWidget *submenu_track;
        GtkWidget *submenu;
        GtkWidget *menu_item;
+       GtkWidget *file_item;
        printf("%s()\n", __PRETTY_FUNCTION__);
 
        /* Get the menu of our view. */
@@ -266,8 +267,6 @@ static void menu_init()
 #ifdef WITH_HILDON
        hildon_window_set_menu(HILDON_WINDOW(_window), menu);
 #else
-       GtkWidget *file_item;
-
        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));
@@ -503,14 +502,17 @@ static void menu_init()
        g_signal_connect(G_OBJECT(_menu_close_item), "activate",
                         G_CALLBACK(gtk_main_quit), NULL);
 
+       gtk_widget_show_all(GTK_WIDGET(menu));
+#ifndef WITH_HILDON
+       gtk_widget_show_all(GTK_WIDGET(_menu_bar));
+#endif
+
        /* Setup the context menu. */
        menu = GTK_MENU(gtk_menu_new());
 
        /* Setup the map context menu. */
-       gtk_menu_append(menu, menu_item
-                       = gtk_menu_item_new_with_label(_("Location")));
-       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(_("Location")));
+       gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new());
 
        /* Setup the map context menu. */
        gtk_menu_append(submenu, _cmenu_loc_show_latlon_item
@@ -637,9 +639,6 @@ static void menu_init()
                         G_CALLBACK(menu_cb_goto_nearpoi), NULL);
 
        gtk_widget_show_all(GTK_WIDGET(menu));
-#ifndef WITH_HILDON
-       gtk_widget_show_all(GTK_WIDGET(_menu_bar));
-#endif
 
 #ifdef WITH_DEVICE_770
        gtk_widget_tap_and_hold_setup(_map_widget, GTK_WIDGET(menu), NULL, 0);