/****************************************************************************** * Name * on_help_contents_activate * * Synopsis * #include "gui/main_menu.h" * * void on_help_contents_activate(GtkMenuItem * menuitem, * gpointer user_data) * * Description * display the help contents file * * Return value * void */ G_MODULE_EXPORT void on_help_contents_activate(GtkMenuItem *menuitem, gpointer user_data) { #ifdef WIN32 const char *lang = g_getenv("LANG"); gchar *help_file = g_win32_get_package_installation_directory_of_module(NULL); help_file = g_strconcat(help_file, "\0", NULL); if (!strncmp(lang, "fr", 2)) help_file = g_build_filename(help_file, "share", "help", "xiphos_fr.chm", NULL); else if (!strncmp(lang, "fa", 2)) help_file = g_build_filename(help_file, "share", "help", "xiphos_fa.chm", NULL); else help_file = g_build_filename(help_file, "share", "help", "xiphos.chm", NULL); xiphos_open_default(help_file); g_free(help_file); #else GError *error = NULL; gtk_show_uri(NULL, "ghelp:xiphos", gtk_get_current_event_time(), &error); if (error != NULL) { XI_warning(("%s", error->message)); g_error_free(error); } #endif /* WIN32 */ }
/****************************************************************************** * Name * on_live_chat_activate * * Synopsis * #include "gui/main_menu.h" * * void on_live_chat_activate(GtkMenuItem * menuitem, * gpointer user_data) * * Description * open web browser to freenode irc chat * * Return value * void */ G_MODULE_EXPORT void on_live_chat_activate(GtkMenuItem *menuitem, gpointer user_data) { gchar *user = g_strdup_printf("%s", g_get_user_name()), *s, *url; gchar version[] = VERSION; int i; gchar platform = #ifdef WIN32 'W' #else 'L' #endif ; /* no periods in irc nicks. */ for (i = 0; version[i]; ++i) if (version[i] == '.') version[i] = '-'; /* mibbit nick length limit = 16 chars. */ /* cut name off at 8, leaving 8 for "|platform+version". */ if (strlen(user) > 8) user[8] = '\0'; /* no blanks in irc nicks. */ for (s = strchr(user, ' '); s; s = strchr(s, ' ')) *s = '_'; url = g_strdup_printf("http://webchat.freenode.net/?nick=%s|%c%s&channels=xiphos&prompt=1", user, platform, version); xiphos_open_default(url); g_free(url); g_free(user); }
G_MODULE_EXPORT void on_lookup_google_activate(GtkMenuItem *menuitem, gpointer user_data) { gchar *dict_key; XIPHOS_HTML_COPY_SELECTION(_get_html()); gtk_editable_select_region((GtkEditable *)widgets.entry_dict, 0, -1); gtk_editable_paste_clipboard((GtkEditable *)widgets.entry_dict); dict_key = g_strdup(gtk_editable_get_chars((GtkEditable *)widgets.entry_dict, 0, -1)); if ((dict_key == NULL) || (*dict_key == '\0')) { gui_generic_warning("No selection made"); } else { gchar *showstr = g_strconcat("http://www.biblemap.org/#", dict_key, NULL); xiphos_open_default(showstr); g_free(showstr); } g_free(dict_key); }
/****************************************************************************** * Name * on_report_bug_activate * * Synopsis * #include "gui/main_menu.h" * * void on_report_bug_activate(GtkMenuItem * menuitem, * gpointer user_data) * * Description * open web browser to github bug tracker * * Return value * void */ G_MODULE_EXPORT void on_report_bug_activate(GtkMenuItem *menuitem, gpointer user_data) { xiphos_open_default(PACKAGE_BUGREPORT); }
/****************************************************************************** * Name * on_mailing_list_activate * * Synopsis * #include "gui/main_menu.h" * * void on_mailing_list_activate(GtkMenuItem * menuitem, * gpointer user_data) * * Description * open web browser to the mailing list signup page * * Return value * void */ G_MODULE_EXPORT void on_mailing_list_activate(GtkMenuItem *menuitem, gpointer user_data) { xiphos_open_default("http://www.crosswire.org/mailman/listinfo/xiphos-users/"); }