--- trunk/src/notes.c 2009/10/12 20:27:55 133 +++ trunk/src/notes.c 2009/11/05 20:37:16 164 @@ -33,6 +33,10 @@ #include "gpxview.h" +#if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5) +#include +#endif + void gtk_text_buffer_set_can_paste_rich_text(GtkTextBuffer *buffer, gboolean); void gtk_text_buffer_set_rich_text_format(GtkTextBuffer *buffer, const gchar *); @@ -454,6 +458,7 @@ /* about to remove "found" flag -> ask for confirmation */ if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { +#if !defined(USE_MAEMO) || (MAEMO_VERSION_MAJOR < 5) GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(context->appdata->window), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -467,6 +472,17 @@ if(GTK_RESPONSE_NO == gtk_dialog_run(GTK_DIALOG(dialog))) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); +#else + GtkWidget *dialog = + hildon_note_new_confirmation(GTK_WINDOW(context->appdata->window), + _("Do you really want to remove the \"found\" flag? " + "This will void the recorded date of your find!")); + + /* set the active flag again if the user answered "no" */ + if(GTK_RESPONSE_OK != gtk_dialog_run(GTK_DIALOG(dialog))) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); +#endif + gtk_widget_destroy(dialog); } @@ -478,6 +494,7 @@ /* about to remove "found" flag -> ask for confirmation */ if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { +#if !defined(USE_MAEMO) || (MAEMO_VERSION_MAJOR < 5) GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(context->appdata->window), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -496,6 +513,23 @@ gtk_widget_set_sensitive(context->notes.foundw, TRUE); } +#else + GtkWidget *dialog = + hildon_note_new_confirmation(GTK_WINDOW(context->appdata->window), + _("Do you really want to remove the \"logged\" flag? " + "This may cause problems on your next Garmin Field " + "Notes upload!")); + + /* set the active flag again if the user answered "no" */ + if(GTK_RESPONSE_OK != gtk_dialog_run(GTK_DIALOG(dialog))) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); + else { + gtk_widget_set_sensitive(widget, FALSE); + gtk_widget_set_sensitive(context->notes.foundw, TRUE); + } + +#endif + gtk_widget_destroy(dialog); } }