]> err.no Git - mapper/commitdiff
misc
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 11 Jun 2007 15:01:21 +0000 (18:01 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 11 Jun 2007 15:01:21 +0000 (18:01 +0300)
src/cb.c
src/cb.h
src/mapper.c
src/poi.h
src/ui-common.c

index f8bc6d1536d0f399e3e080ab1667c476e27d3678..1f3e5a70a7ba10c564484b4e67ae03e3271e4edd 100644 (file)
--- a/src/cb.c
+++ b/src/cb.c
@@ -594,12 +594,17 @@ gboolean cb_zoomout(GtkAction * action)
        return TRUE;
 }
 
+gboolean cb_fullscreen_click(GtkAction * action)
+{
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item), !_fullscreen);
+       return TRUE;
+}
+
 gboolean cb_fullscreen(GtkAction * action)
 {
        printf("%s()\n", __PRETTY_FUNCTION__);
 
-       if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM
-                                           (_menu_fullscreen_item))))
+       if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item))))
                gtk_window_fullscreen(GTK_WINDOW(_window));
        else
                gtk_window_unfullscreen(GTK_WINDOW(_window));
@@ -622,8 +627,7 @@ gboolean menu_cb_enable_gps(GtkAction * action)
                        rcvr_connect_now();
                } else {
                        popup_error(_window,
-                                   _
-                                   ("Cannot enable GPS until a GPS Receiver MAC "
+                                   _("Cannot enable GPS until a GPS Receiver MAC "
                                     "is set in the Settings dialog box."));
                        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
                                                       (_menu_enable_gps_item),
@@ -638,8 +642,7 @@ gboolean menu_cb_enable_gps(GtkAction * action)
        }
        map_move_mark();
        gps_show_info();
-       gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item),
-                                _enable_gps);
+       gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item), _enable_gps);
        gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_reset_item), _enable_gps);
 
        vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
@@ -651,12 +654,10 @@ gboolean menu_cb_auto_download(GtkAction * action)
        printf("%s()\n", __PRETTY_FUNCTION__);
 
        if ((_auto_download =
-            gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM
-                                           (_menu_auto_download_item)))) {
+            gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_auto_download_item)))) {
                if (_curr_repo->url == REPOTYPE_NONE)
                        popup_error(_window,
-                                   _
-                                   ("NOTE: You must set a Map URI in the current repository in "
+                                   _("NOTE: You must set a Map URI in the current repository in "
                                     "order to download maps."));
                map_force_redraw();
        }
@@ -826,9 +827,7 @@ gboolean window_cb_key_press(GtkWidget * widget, GdkEventKey * event)
                break;
 
        case CUSTOM_ACTION_TOGGLE_FULLSCREEN:
-               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
-                                              (_menu_fullscreen_item),
-                                              !_fullscreen);
+               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item), !_fullscreen);
                break;
 
        case CUSTOM_ACTION_TOGGLE_TRACKS:
index 7c22e7fed8e0b742fe8168ecdb0c155ea509048f..8306265a4537b085c0ee29dc6f73075809b7530a 100644 (file)
--- a/src/cb.h
+++ b/src/cb.h
@@ -55,6 +55,7 @@ gboolean cb_zoom_base(GtkAction * action);
 gboolean cb_zoomin(GtkAction * action);
 gboolean cb_zoomout(GtkAction * action);
 gboolean cb_fullscreen(GtkAction * action);
+gboolean cb_fullscreen_click(GtkAction * action);
 gboolean menu_cb_show_scale(GtkAction * action);
 gboolean menu_cb_show_routes(GtkAction * action);
 gboolean menu_cb_show_tracks(GtkAction * action);
index 3cab0bff1ad5d6c94edc9e5aea777c725b66e20b..e605a4b18262e04827a73ba1e5ba33c98df8f768 100644 (file)
@@ -32,7 +32,6 @@
 #include <string.h>
 #include <strings.h>
 #include <stddef.h>
-#include <locale.h>
 #include <math.h>
 #include <errno.h>
 #include <sys/wait.h>
@@ -45,7 +44,6 @@
 #include <libgnomevfs/gnome-vfs.h>
 #include <curl/multi.h>
 #include <gconf/gconf-client.h>
-#include <libxml/parser.h>
 
 #ifdef WITH_HILDON
 #include <libosso.h>
@@ -68,8 +66,6 @@
 #include <libintl.h>
 #include <locale.h>
 
-#include <sqlite3.h>
-
 #include "utils.h"
 #include "poi.h"
 #include "route.h"
 #include "mapper-types.h"
 #include "bt.h"
 #include "ui-common.h"
-
-/* Callbacks */
 #include "cb.h"
 
-gfloat UNITS_CONVERT[] = {
-       1.85200,
-       1.15077945,
-       1.f,
-};
+gfloat UNITS_CONVERT[] = {1.85200,1.15077945,1.f,};
 
 GdkColor COLORABLE_DEFAULT[COLORABLE_ENUM_COUNT] = {
        {0, 0x0000, 0x0000, 0xc000}
@@ -239,7 +229,7 @@ void mapper_destroy(void)
 
 void set_var_defaults(void)
 {
-       _conn_state = RCVR_OFF;
+_conn_state = RCVR_OFF;
 }
 
 gint mapper_osso_init(void)
@@ -276,7 +266,6 @@ localtime_r(&time1, &time2);
 _gmtoffset = time2.tm_gmtoff;
 }
 
-
 gint main(gint argc, gchar * argv[])
 {
        printf("%s()\n", __PRETTY_FUNCTION__);
@@ -289,15 +278,10 @@ gint main(gint argc, gchar * argv[])
 
        g_thread_init(NULL);
        g_type_init();
-
        if (mapper_osso_init()!=0)
                return 1;
-
-       set_var_defaults();
-       
-#ifdef WITH_GSTREAMER
+       set_var_defaults();     
        gst_init(&argc, &argv);
-#endif
        gtk_init(&argc, &argv);
        gconf_init(argc, argv, NULL);
        gnome_vfs_init();
@@ -309,11 +293,9 @@ gint main(gint argc, gchar * argv[])
                return 1;
        gtk_main();
        mapper_destroy();
-
 #ifdef WITH_HILDON
        osso_deinitialize(_osso);
 #endif
-
        vprintf("%s(): return\n", __PRETTY_FUNCTION__);
        return 0;
 }
index dfa48b0cfa6bd676892d44386690fc5f5ff17e7a..a38b2adfa280a283c597643ee6606c8bbb846c92 100644 (file)
--- a/src/poi.h
+++ b/src/poi.h
@@ -29,14 +29,38 @@ create table poi (
 -- Shared categories for POIs and landmarks
 create table category (
        cat_id integer PRIMARY KEY,
+       pcat_id int,
        priority int,
-       label text, 
-       desc text, 
+       label text,
+       desc text,
        color char(6),
        icon varchar(32),
        enabled integer
 );
 
+Categories:
+Fuel
+       - Esso, Teboil, BP, Nest, etc
+Parking
+Residence
+Dining
+       - Restaurant
+Fast food
+Shopping/Services
+Recreation
+Transportation
+       - Bus
+       - Train
+       - Boat/Ferry
+       - Plane
+Lodging
+       - Hotell
+       - Motell
+School
+Business
+Landmark
+Other
+
 */
 
 #ifndef _MAPPER_POI_H
index edc46d021cb52d643a6eaec86f5723d915fecebd..858febc82c473d76c0aea60fb64c37ce0cd59842 100644 (file)
@@ -177,7 +177,7 @@ void progress_update_info_free(ProgressUpdateInfo * pui)
 }
 
 /**
- * Call gtk_window_present() on Maemo Mapper.  This also checks the
+ * Call gtk_window_present() on Mapper.  This also checks the
  * configuration and brings up the Settings dialog if the GPS Receiver is
  * not set up, the first time it is called.
  */
@@ -195,37 +195,29 @@ gboolean window_present()
                        gtk_window_present(GTK_WINDOW(_window));
 
 #ifdef WITH_HILDON
-                       confirm =
-                           hildon_note_new_confirmation(GTK_WINDOW(_window),
-                                                        _
+                       confirm = hildon_note_new_confirmation(GTK_WINDOW(_window),
                                                         ("It looks like this is your first time running"
-                                                         " Maemo Mapper.  Press OK to view the the help pages."
+                                                         " Mapper.  Press OK to view the the help pages."
                                                          " Otherwise, press Cancel to continue."));
 
-                       if (GTK_RESPONSE_OK ==
-                           gtk_dialog_run(GTK_DIALOG(confirm)))
+                       if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm)))
                                ossohelp_show(_osso, HELP_ID_INTRO, 0);
                        gtk_widget_destroy(confirm);
 #endif
                        if (settings_dialog()) {
                                popup_error(_window,
-                                           _
-                                           ("OpenStreetMap.org provides public, free-to-use maps.  "
+                                           _("OpenStreetMap.org provides public, free-to-use maps.  "
                                             "You can also download a sample set of repositories from "
                                             " the internet by using the \"Download...\" button."));
                                repoman_dialog();
                                if (_curr_repo->type != REPOTYPE_NONE) {
-                                       confirm =
-                                           hildon_note_new_confirmation
+                                       confirm = hildon_note_new_confirmation
                                            (GTK_WINDOW(_window),
-                                            _
-                                            ("You will now see a blank screen.  You can download"
+                                            _("You will now see a blank screen.  You can download"
                                              " maps using the \"Manage Maps\" menu item in the"
                                              " \"Maps\" menu.  Or, press OK to enable"
                                              " Auto-Download."));
-                                       if (GTK_RESPONSE_OK ==
-                                           gtk_dialog_run(GTK_DIALOG(confirm)))
-                                       {
+                                       if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) {
                                                gtk_check_menu_item_set_active
                                                    (GTK_CHECK_MENU_ITEM
                                                     (_menu_auto_download_item),
@@ -745,7 +737,7 @@ gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1);
 
 item = gtk_tool_button_new_from_stock (GTK_STOCK_FULLSCREEN);
 gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1);
-g_signal_connect (item, "clicked", G_CALLBACK (cb_fullscreen), NULL);
+g_signal_connect (item, "clicked", G_CALLBACK (cb_fullscreen_click), NULL);
 
 item = gtk_separator_tool_item_new();
 gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1);
@@ -919,7 +911,7 @@ void mapper_init(gint argc, gchar ** argv)
        gtk_box_pack_start(GTK_BOX(vbox_main), _toolbar, FALSE, FALSE, 0);
 
        hbox = gtk_hbox_new(FALSE, 0);
-       gtk_notebook_append_page(notebook, hbox, label);
+       gtk_notebook_append_page(GTK_WIDGET(notebook), hbox, label);
        gtk_box_pack_start(GTK_BOX(vbox_main), notebook, TRUE, TRUE, 0);
 
        _status_bar = gtk_statusbar_new();
@@ -1153,11 +1145,9 @@ void mapper_init(gint argc, gchar ** argv)
                        popup_error(_window, buffer);
                } else {
                        if (parse_gpx(&_route, buffer, size, 0)) {
-                               MACRO_BANNER_SHOW_INFO(_window,
-                                                      _("Route Opened"));
+                               MACRO_BANNER_SHOW_INFO(_window, _("Route Opened"));
                        } else
-                               popup_error(_window,
-                                           _("Error parsing GPX file."));
+                               popup_error(_window, _("Error parsing GPX file."));
                        g_free(buffer);
                }
                g_free(file_uri);