From f611be2fd62e9083c68b3953c50abf9483737927 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Fri, 26 Oct 2007 13:40:43 +0300 Subject: [PATCH] Use help.c wrappers --- src/Makefile.am | 1 + src/cb.c | 9 +++------ src/map-repo.c | 13 ++++--------- src/poi-gui.c | 12 +++++------- src/route.c | 9 +++------ src/settings-gui.c | 10 ++++------ src/ui-maemo.h | 10 ---------- 7 files changed, 20 insertions(+), 44 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0616c4a..4564113 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -72,6 +72,7 @@ mapper_SOURCES = utils.c \ config-gconf.c \ speak.c \ audio-note.c \ + help.c \ mapper.c osm2db_CFLAGS = $(EXPAT_CFLAGS) $(SQLITE_CFLAGS) $(GLIBGTK_CFLAGS) diff --git a/src/cb.c b/src/cb.c index 96be5f8..b7ba0c4 100644 --- a/src/cb.c +++ b/src/cb.c @@ -34,6 +34,8 @@ #include "cb.h" #include "gps-panels.h" +#include "help.h" + gboolean menu_cb_route_download(GtkAction * action) { @@ -540,12 +542,7 @@ return TRUE; gboolean menu_cb_help(GtkAction * action) { -#ifdef WITH_OSSO_HELP -ossohelp_show(_osso, HELP_ID_INTRO, 0); -#endif -#ifdef WITH_HILDON_HELP -hildon_help_show(_osso, HELP_ID_INTRO, 0); -#endif +help_topic_display(HELP_ID_INTRO, 0); return TRUE; } diff --git a/src/map-repo.c b/src/map-repo.c index f4fd282..3ab6ed6 100644 --- a/src/map-repo.c +++ b/src/map-repo.c @@ -25,6 +25,8 @@ #include "mapper-types.h" #include "ui-common.h" +#include "help.h" + #define MAP_REPO_LIST_URL "http://www.gnuite.com/nokia770/maemo-mapper/repos.txt" typedef struct _RepoManInfo RepoManInfo; @@ -567,11 +569,7 @@ repoman_dialog() GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); -#ifdef WITH_OSSO_HELP - /* Enable the help button. */ - ossohelp_dialog_help_enable(GTK_DIALOG(rmi.dialog), HELP_ID_REPOMAN, - _osso); -#endif + help_dialog_help_enable(GTK_DIALOG(rmi.dialog), HELP_ID_REPOMAN); /* Reset button. */ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(rmi.dialog)->action_area), @@ -982,10 +980,7 @@ gboolean menu_cb_mapman(GtkAction * action) GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); - /* Enable the help button. */ -#ifdef WITH_OSSO_HELP - ossohelp_dialog_help_enable(GTK_DIALOG(mapman_info.dialog), HELP_ID_MAPMAN, _osso); -#endif + help_dialog_help_enable(GTK_DIALOG(mapman_info.dialog), HELP_ID_MAPMAN); /* Clear button. */ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), diff --git a/src/poi-gui.c b/src/poi-gui.c index 8cdd453..045c553 100644 --- a/src/poi-gui.c +++ b/src/poi-gui.c @@ -27,6 +27,8 @@ #include "poi-gui.h" #include "osm.h" +#include "help.h" + #define POI_QUICK_BUTTONS (9) typedef struct _PoiCategoryEditInfo PoiCategoryEditInfo; @@ -327,10 +329,7 @@ dialog = gtk_dialog_new_with_buttons(_("POI Categories"), GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); -#ifdef WITH_OSSO_HELP - /* Enable the help button. */ - ossohelp_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_POICAT, _osso); -#endif + help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_POICAT); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_edit = gtk_button_new_with_label(_("Edit"))); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_add = gtk_button_new_with_label(_("Add"))); @@ -781,9 +780,8 @@ qp.dialog = gtk_dialog_new_with_buttons(_("Quick POI"), GTK_RESPONSE_REJECT, NULL); -#ifdef WITH_OSSO_NOTYET - /* Enable the help button. */ - ossohelp_dialog_help_enable(GTK_DIALOG(qp.dialog), HELP_ID_POIQUICK, _osso); +#if 0 +help_dialog_help_enable(GTK_DIALOG(qp.dialog), HELP_ID_POIQUICK); #endif gtk_box_pack_start(GTK_BOX(GTK_DIALOG(qp.dialog)->vbox), table = gtk_table_new(3, 3, FALSE), TRUE, TRUE, 0); diff --git a/src/route.c b/src/route.c index fe40e95..969daf7 100644 --- a/src/route.c +++ b/src/route.c @@ -31,6 +31,8 @@ #include "map-download.h" #include "iap.h" +#include "help.h" + void route_find_nearest_point(void); void cancel_autoroute(gboolean temporary); void route_show_distance_to_last(void); @@ -275,12 +277,7 @@ dialog = gtk_dialog_new_with_buttons(_("Download Route"), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); -#ifdef WITH_OSSO_HELP -ossohelp_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_DOWNROUTE, _osso); -#endif -#ifdef WITH_HILDON_HELP -hildon_help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_DOWNROUTE, _osso); -#endif +help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_DOWNROUTE); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table = gtk_table_new(2, 5, FALSE), TRUE, TRUE, 0); diff --git a/src/settings-gui.c b/src/settings-gui.c index 17a9452..5b559d8 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -36,6 +36,8 @@ #include "hildon-wrappers.h" +#include "help.h" + #define UPDATE_GC(gc) \ gdk_gc_set_line_attributes(gc, _draw_width, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND); void @@ -405,12 +407,8 @@ settings_dialog(void) GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); -#ifdef WITH_OSSO_HELP - ossohelp_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS, _osso); -#endif -#ifdef WITH_HILDON_HELP - hildon_help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS, _osso); -#endif + help_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS); + #ifdef WITH_DEVICE_770 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_buttons = gtk_button_new_with_label(_("Hardware Keys..."))); diff --git a/src/ui-maemo.h b/src/ui-maemo.h index 1882704..32432f4 100644 --- a/src/ui-maemo.h +++ b/src/ui-maemo.h @@ -7,16 +7,6 @@ #ifdef WITH_HILDON -#define HELP_ID_PREFIX "help_mapper_" -#define HELP_ID_INTRO HELP_ID_PREFIX"intro" -#define HELP_ID_GETSTARTED HELP_ID_PREFIX"getstarted" -#define HELP_ID_ABOUT HELP_ID_PREFIX"about" -#define HELP_ID_SETTINGS HELP_ID_PREFIX"settings" -#define HELP_ID_REPOMAN HELP_ID_PREFIX"repoman" -#define HELP_ID_MAPMAN HELP_ID_PREFIX"mapman" -#define HELP_ID_DOWNROUTE HELP_ID_PREFIX"downroute" -#define HELP_ID_POICAT HELP_ID_PREFIX"poicat" - #ifdef WITH_OSSO #include /** The main OSSO context of the application. */ -- 2.39.5