Add and use utils_get_help_url().

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4442 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-11-23 22:59:36 +00:00
parent 9f444ac698
commit c1620cfe92
4 changed files with 38 additions and 19 deletions

View File

@ -3,19 +3,21 @@
* tagmanager/php.c:
Remove duplicate regular expression for parsing classes.
Fix and improve parsing of constants (patch by Harold Aling, thanks).
* doc/geany.1.in, doc/geany.html, doc/geany.txt, src/main.c,
* doc/geany.1.in, doc/geany.html, doc/geany.txt, src/main.c,
src/main.h, THANKS, src/about.c:
Add new command line option "--socket-file" to be able to specify
separate socket filenames for instances
separate socket filenames for instances
(closes #2896027, patch by Jörn Reder, thanks).
* src/keybindings.c, src/keybindings.h:
Add keybindings_check_event() to manually check GdkKeyEvents against
Geany's keybindings.
* src/callbacks.c, src/utils.c, src/utils.h:
Add and use utils_get_help_url().
2009-11-22 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/toolbar.c, src/geanymenubuttonaction.c,
* src/toolbar.c, src/geanymenubuttonaction.c,
src/geanymenubuttonaction.h:
Use separate tooltips for toolbar menu buttons and their attached
drop-down arrows.

View File

@ -1323,24 +1323,9 @@ void
on_help1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
gint skip;
gchar *uri;
#ifdef G_OS_WIN32
skip = 8;
uri = g_strconcat("file:///", app->docdir, "/Manual.html", NULL);
g_strdelimit(uri, "\\", '/'); /* replace '\\' by '/' */
#else
skip = 7;
uri = g_strconcat("file://", app->docdir, "index.html", NULL);
#endif
if (! g_file_test(uri + skip, G_FILE_TEST_IS_REGULAR))
{ /* fall back to online documentation if it is not found on the hard disk */
g_free(uri);
uri = g_strconcat(GEANY_HOMEPAGE, "manual/", VERSION, "/index.html", NULL);
}
uri = utils_get_help_url(NULL);
utils_open_browser(uri);
g_free(uri);
}

View File

@ -1864,3 +1864,33 @@ GSList *utils_get_config_files(const gchar *subdir)
}
/* Suffix can be NULL or a string which should be appended to the Help URL like
* an anchor link, e.g. "#some_anchor". */
gchar *utils_get_help_url(const gchar *suffix)
{
gint skip;
gchar *uri;
#ifdef G_OS_WIN32
skip = 8;
uri = g_strconcat("file:///", app->docdir, "/Manual.html", NULL);
g_strdelimit(uri, "\\", '/'); /* replace '\\' by '/' */
#else
skip = 7;
uri = g_strconcat("file://", app->docdir, "index.html", NULL);
#endif
if (! g_file_test(uri + skip, G_FILE_TEST_IS_REGULAR))
{ /* fall back to online documentation if it is not found on the hard disk */
g_free(uri);
uri = g_strconcat(GEANY_HOMEPAGE, "manual/", VERSION, "/index.html", NULL);
}
if (suffix != NULL)
{
setptr(uri, g_strconcat(uri, suffix, NULL));
}
return uri;
}

View File

@ -200,6 +200,8 @@ GSList *utils_get_file_list_full(const gchar *path, gboolean full_path, gboolean
GSList *utils_get_config_files(const gchar *subdir);
gchar *utils_get_help_url(const gchar *suffix);
gboolean utils_str_has_upper(const gchar *str);
gint utils_is_file_writeable(const gchar *locale_filename);