1029 |
|
|
1030 |
/******************** begin of menu *********************/ |
/******************** begin of menu *********************/ |
1031 |
|
|
1032 |
|
typedef struct { |
1033 |
|
appdata_t *appdata; |
1034 |
|
GtkWidget *dialog; |
1035 |
|
} about_context_t; |
1036 |
|
|
1037 |
|
#ifdef ENABLE_BROWSER_INTERFACE |
1038 |
|
void on_paypal_button_clicked(GtkButton *button, about_context_t *context) { |
1039 |
|
gtk_dialog_response(GTK_DIALOG(context->dialog), GTK_RESPONSE_ACCEPT); |
1040 |
|
browser_url(context->appdata, |
1041 |
|
"https://www.paypal.com/cgi-bin/webscr" |
1042 |
|
"?cmd=_s-xclick&hosted_button_id=7400558"); |
1043 |
|
} |
1044 |
|
#endif |
1045 |
|
|
1046 |
static void |
static void |
1047 |
cb_menu_about(GtkWidget *window, gpointer data) { |
cb_menu_about(GtkWidget *window, gpointer data) { |
1048 |
GtkAboutDialog *about = GTK_ABOUT_DIALOG(gtk_about_dialog_new()); |
about_context_t context; |
1049 |
|
|
1050 |
gtk_about_dialog_set_name(about, "GPXView"); |
context.appdata = (appdata_t *)data; |
|
gtk_about_dialog_set_version(about, VERSION); |
|
1051 |
|
|
1052 |
#ifdef ENABLE_LIBLOCATION |
#ifdef ENABLE_LIBLOCATION |
1053 |
char *uses = "uses liblocation"; |
char *uses = "uses liblocation"; |
1057 |
char *uses = "uses gpsd"; |
char *uses = "uses gpsd"; |
1058 |
#endif |
#endif |
1059 |
|
|
1060 |
char *str = g_strdup_printf("%s\n\n(%s)", |
const gchar *authors[] = { |
1061 |
_("GPXView (c) 2008-2009 by\n" |
"Till Harbaum <till@harbaum.org>", |
1062 |
"Till Harbaum <till@harbaum.org>\n" |
"John Stowers <john.stowers@gmail.com>", |
1063 |
"Mailing list: gpxview-users@garage.maemo.org"), |
NULL }; |
1064 |
_(uses) |
|
1065 |
); |
context.dialog = g_object_new(GTK_TYPE_ABOUT_DIALOG, |
1066 |
|
"name", "GPXView", |
1067 |
gtk_about_dialog_set_copyright(about, str); |
"version", VERSION, |
1068 |
g_free(str); |
"copyright", _("Copyright 2008-2009"), |
1069 |
|
"authors", authors, |
1070 |
gtk_about_dialog_set_website(about, |
"website", _("http://www.harbaum.org/till/maemo"), |
1071 |
_("http://www.harbaum.org/till/maemo")); |
"comments", _(uses), |
1072 |
|
NULL); |
1073 |
|
|
1074 |
|
#ifdef ENABLE_BROWSER_INTERFACE |
1075 |
|
/* add a way to donate to the project */ |
1076 |
|
GtkWidget *alignment = gtk_alignment_new(0.5, 0, 0, 0); |
1077 |
|
|
1078 |
gtk_about_dialog_set_comments(about, |
GtkWidget *hbox = gtk_hbox_new(FALSE, 8); |
1079 |
_("Geocaching.com GPX file viewer")); |
gtk_box_pack_start(GTK_BOX(hbox), |
1080 |
|
gtk_label_new(_("Do you you ĺike GPXView?")), |
1081 |
|
FALSE, FALSE, 0); |
1082 |
|
|
1083 |
|
GtkWidget *button = gtk_button_new(); |
1084 |
|
gtk_button_set_image(GTK_BUTTON(button), |
1085 |
|
icon_get_widget(ICON_MISC, 8)); |
1086 |
|
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
1087 |
|
g_signal_connect(button, "clicked", |
1088 |
|
G_CALLBACK(on_paypal_button_clicked), &context); |
1089 |
|
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1090 |
|
|
1091 |
|
gtk_container_add(GTK_CONTAINER(alignment), hbox); |
1092 |
|
gtk_box_pack_start_defaults(GTK_BOX((GTK_DIALOG(context.dialog))->vbox), |
1093 |
|
alignment); |
1094 |
|
|
1095 |
|
gtk_widget_show_all(alignment); |
1096 |
|
#endif |
1097 |
|
|
1098 |
gtk_widget_show_all(GTK_WIDGET(about)); |
gtk_dialog_run(GTK_DIALOG(context.dialog)); |
1099 |
gtk_dialog_run(GTK_DIALOG(about)); |
gtk_widget_destroy(context.dialog); |
|
gtk_widget_destroy(GTK_WIDGET(about)); |
|
1100 |
} |
} |
1101 |
|
|
1102 |
#if defined(USE_MAEMO) && defined(HILDON_HELP) |
#if defined(USE_MAEMO) && defined(HILDON_HELP) |