mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
gimprc.in app/gimprc.[ch] new gimprc variable "help-browser" which can be
1999-12-19 Michael Natterer <mitch@gimp.org> * gimprc.in * app/gimprc.[ch] * app/preferences_dialog.c: new gimprc variable "help-browser" which can be either "gimp", or "netscape". * app/gimphelp.[ch]: depending on the value of help_browser, show the help page with the webbrowser plugin.
This commit is contained in:
parent
6d1d305f95
commit
65e424f36b
10 changed files with 342 additions and 70 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
1999-12-19 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* gimprc.in
|
||||||
|
* app/gimprc.[ch]
|
||||||
|
* app/preferences_dialog.c: new gimprc variable "help-browser"
|
||||||
|
which can be either "gimp", or "netscape".
|
||||||
|
|
||||||
|
* app/gimphelp.[ch]: depending on the value of help_browser, show
|
||||||
|
the help page with the webbrowser plugin.
|
||||||
|
|
||||||
1999-12-19 Michael Natterer <mitch@gimp.org>
|
1999-12-19 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* plug-ins/helpbrowser/helpbrowser.c: immediately return from
|
* plug-ins/helpbrowser/helpbrowser.c: immediately return from
|
||||||
|
|
|
@ -110,6 +110,7 @@ static int old_trust_dirty_flag;
|
||||||
static int old_use_help;
|
static int old_use_help;
|
||||||
static int old_nav_window_per_display;
|
static int old_nav_window_per_display;
|
||||||
static int old_info_window_follows_mouse;
|
static int old_info_window_follows_mouse;
|
||||||
|
static int old_help_browser;
|
||||||
|
|
||||||
/* variables which can't be changed on the fly */
|
/* variables which can't be changed on the fly */
|
||||||
static int edit_stingy_memory_use;
|
static int edit_stingy_memory_use;
|
||||||
|
@ -560,6 +561,8 @@ file_prefs_save_callback (GtkWidget *widget,
|
||||||
info_window_follows_mouse = edit_info_window_follows_mouse;
|
info_window_follows_mouse = edit_info_window_follows_mouse;
|
||||||
restart_notification = TRUE;
|
restart_notification = TRUE;
|
||||||
}
|
}
|
||||||
|
if (help_browser != old_help_browser)
|
||||||
|
update = g_list_append (update, "help-browser");
|
||||||
|
|
||||||
save_gimprc (&update, &remove);
|
save_gimprc (&update, &remove);
|
||||||
|
|
||||||
|
@ -631,6 +634,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
|
||||||
use_help = old_use_help;
|
use_help = old_use_help;
|
||||||
nav_window_per_display = old_nav_window_per_display;
|
nav_window_per_display = old_nav_window_per_display;
|
||||||
info_window_follows_mouse = old_info_window_follows_mouse;
|
info_window_follows_mouse = old_info_window_follows_mouse;
|
||||||
|
help_browser = old_help_browser;
|
||||||
|
|
||||||
if (preview_size != old_preview_size)
|
if (preview_size != old_preview_size)
|
||||||
{
|
{
|
||||||
|
@ -733,8 +737,10 @@ file_prefs_toggle_callback (GtkWidget *widget,
|
||||||
context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active);
|
context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active);
|
||||||
else if (data == &show_indicators)
|
else if (data == &show_indicators)
|
||||||
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
|
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
|
||||||
else if (data == &thumbnail_mode || data == &interpolation_type ||
|
else if (data == &thumbnail_mode ||
|
||||||
data == &trust_dirty_flag)
|
data == &interpolation_type ||
|
||||||
|
data == &trust_dirty_flag ||
|
||||||
|
data == &help_browser)
|
||||||
{
|
{
|
||||||
val = data;
|
val = data;
|
||||||
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||||
|
@ -1232,6 +1238,7 @@ file_pref_cmd_callback (GtkWidget *widget,
|
||||||
old_use_help = use_help;
|
old_use_help = use_help;
|
||||||
old_nav_window_per_display = nav_window_per_display;
|
old_nav_window_per_display = nav_window_per_display;
|
||||||
old_info_window_follows_mouse = info_window_follows_mouse;
|
old_info_window_follows_mouse = info_window_follows_mouse;
|
||||||
|
old_help_browser = help_browser;
|
||||||
|
|
||||||
file_prefs_strset (&old_image_title_format, image_title_format);
|
file_prefs_strset (&old_image_title_format, image_title_format);
|
||||||
file_prefs_strset (&old_temp_path, edit_temp_path);
|
file_prefs_strset (&old_temp_path, edit_temp_path);
|
||||||
|
@ -1645,6 +1652,26 @@ file_pref_cmd_callback (GtkWidget *widget,
|
||||||
&use_help);
|
&use_help);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
|
vbox2 = file_prefs_frame_new (_("Help Browser"), GTK_BOX (vbox));
|
||||||
|
|
||||||
|
table = gtk_table_new (1, 2, FALSE);
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||||
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
|
optionmenu =
|
||||||
|
gimp_option_menu_new (file_prefs_toggle_callback,
|
||||||
|
(gpointer) help_browser,
|
||||||
|
_("Internal"), &help_browser,
|
||||||
|
(gpointer) HELP_BROWSER_GIMP,
|
||||||
|
_("Netscape"), &help_browser,
|
||||||
|
(gpointer) HELP_BROWSER_NETSCAPE,
|
||||||
|
NULL);
|
||||||
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
||||||
|
_("Help Browser to Use:"), 1.0, 0.5,
|
||||||
|
optionmenu, TRUE);
|
||||||
|
|
||||||
/* Interface / Image Windows */
|
/* Interface / Image Windows */
|
||||||
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||||
_("Image Windows Settings"),
|
_("Image Windows Settings"),
|
||||||
|
|
|
@ -18,6 +18,12 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
@ -26,11 +32,16 @@
|
||||||
#include "plug_in.h"
|
#include "plug_in.h"
|
||||||
#include "procedural_db.h"
|
#include "procedural_db.h"
|
||||||
|
|
||||||
|
#include "libgimp/gimpenv.h"
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
|
||||||
#define DEBUG_HELP
|
#define DEBUG_HELP
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
static void gimp_help_internal (gchar *current_locale,
|
||||||
|
gchar *help_data);
|
||||||
|
static void gimp_help_netscape (gchar *current_locale,
|
||||||
|
gchar *help_data);
|
||||||
static void gimp_help_callback (GtkWidget *widget,
|
static void gimp_help_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static gint gimp_help_tips_query_idle_show_help (gpointer data);
|
static gint gimp_help_tips_query_idle_show_help (gpointer data);
|
||||||
|
@ -180,14 +191,47 @@ gimp_help_set_help_data (GtkWidget *widget,
|
||||||
void
|
void
|
||||||
gimp_help (gchar *help_data)
|
gimp_help (gchar *help_data)
|
||||||
{
|
{
|
||||||
ProcRecord *proc_rec;
|
|
||||||
|
|
||||||
static gchar *current_locale = "C";
|
static gchar *current_locale = "C";
|
||||||
|
|
||||||
|
if (help_data == NULL && help_browser != HELP_BROWSER_GIMP)
|
||||||
|
help_data = "welcome.html";
|
||||||
|
|
||||||
#ifdef DEBUG_HELP
|
#ifdef DEBUG_HELP
|
||||||
g_print ("Help Page: %s\n", help_data);
|
g_print ("Help Page: %s\n", help_data);
|
||||||
#endif /* DEBUG_HELP */
|
#endif /* DEBUG_HELP */
|
||||||
|
|
||||||
|
switch (help_browser)
|
||||||
|
{
|
||||||
|
case HELP_BROWSER_GIMP:
|
||||||
|
gimp_help_internal (current_locale, help_data);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HELP_BROWSER_NETSCAPE:
|
||||||
|
gimp_help_netscape (current_locale, help_data);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_context_help (void)
|
||||||
|
{
|
||||||
|
if (tips_query)
|
||||||
|
gimp_help_tips_query_start (NULL, tips_query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************/
|
||||||
|
/* local functions */
|
||||||
|
/*********************/
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_help_internal (gchar *current_locale,
|
||||||
|
gchar *help_data)
|
||||||
|
{
|
||||||
|
ProcRecord *proc_rec;
|
||||||
|
|
||||||
/* Check if a help browser is already running */
|
/* Check if a help browser is already running */
|
||||||
proc_rec = procedural_db_lookup ("extension_gimp_help_browser_temp");
|
proc_rec = procedural_db_lookup ("extension_gimp_help_browser_temp");
|
||||||
|
|
||||||
|
@ -234,15 +278,32 @@ gimp_help (gchar *help_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_context_help (void)
|
gimp_help_netscape (gchar *current_locale,
|
||||||
|
gchar *help_data)
|
||||||
{
|
{
|
||||||
if (tips_query)
|
Argument *return_vals;
|
||||||
gimp_help_tips_query_start (NULL, tips_query);
|
gint nreturn_vals;
|
||||||
}
|
gchar *url;
|
||||||
|
|
||||||
/*********************/
|
url = g_strconcat ("file:",
|
||||||
/* local functions */
|
gimp_data_directory (),
|
||||||
/*********************/
|
"/help/",
|
||||||
|
current_locale, "/",
|
||||||
|
help_data,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
return_vals =
|
||||||
|
procedural_db_run_proc ("extension_web_browser",
|
||||||
|
&nreturn_vals,
|
||||||
|
PDB_INT32, RUN_NONINTERACTIVE,
|
||||||
|
PDB_STRING, url,
|
||||||
|
PDB_INT32, FALSE,
|
||||||
|
PDB_END);
|
||||||
|
|
||||||
|
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
g_free (url);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_help_callback (GtkWidget *widget,
|
gimp_help_callback (GtkWidget *widget,
|
||||||
|
|
50
app/gimprc.c
50
app/gimprc.c
|
@ -38,13 +38,14 @@
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "fileops.h"
|
#include "fileops.h"
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
#include "gimpparasite.h"
|
||||||
|
#include "gimphelp.h"
|
||||||
#include "gimprc.h"
|
#include "gimprc.h"
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
#include "plug_in.h"
|
#include "plug_in.h"
|
||||||
#include "gimage.h"
|
#include "gimage.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
#include "gimpparasite.h"
|
|
||||||
|
|
||||||
#include "libgimp/parasite.h"
|
#include "libgimp/parasite.h"
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
@ -75,7 +76,8 @@ typedef enum {
|
||||||
TT_XSESSIONINFO,
|
TT_XSESSIONINFO,
|
||||||
TT_XUNITINFO,
|
TT_XUNITINFO,
|
||||||
TT_XPARASITE,
|
TT_XPARASITE,
|
||||||
TT_XNAVPREVSIZE
|
TT_XNAVPREVSIZE,
|
||||||
|
TT_XHELPBROWSER
|
||||||
} TokenType;
|
} TokenType;
|
||||||
|
|
||||||
typedef struct _ParseFunc ParseFunc;
|
typedef struct _ParseFunc ParseFunc;
|
||||||
|
@ -161,6 +163,7 @@ int trust_dirty_flag = FALSE;
|
||||||
int use_help = TRUE;
|
int use_help = TRUE;
|
||||||
int nav_window_per_display = FALSE;
|
int nav_window_per_display = FALSE;
|
||||||
int info_window_follows_mouse = FALSE;
|
int info_window_follows_mouse = FALSE;
|
||||||
|
int help_browser = HELP_BROWSER_GIMP;
|
||||||
|
|
||||||
extern char * module_db_load_inhibit;
|
extern char * module_db_load_inhibit;
|
||||||
|
|
||||||
|
@ -189,6 +192,7 @@ static int parse_menu_path (gpointer val1p, gpointer val2p);
|
||||||
static int parse_session_info (gpointer val1p, gpointer val2p);
|
static int parse_session_info (gpointer val1p, gpointer val2p);
|
||||||
static int parse_unit_info (gpointer val1p, gpointer val2p);
|
static int parse_unit_info (gpointer val1p, gpointer val2p);
|
||||||
static int parse_parasite (gpointer val1p, gpointer val2p);
|
static int parse_parasite (gpointer val1p, gpointer val2p);
|
||||||
|
static int parse_help_broswer (gpointer val1p, gpointer val2p);
|
||||||
|
|
||||||
static int parse_proc_def (PlugInProcDef **proc_def);
|
static int parse_proc_def (PlugInProcDef **proc_def);
|
||||||
static int parse_proc_arg (ProcArg *arg);
|
static int parse_proc_arg (ProcArg *arg);
|
||||||
|
@ -211,6 +215,7 @@ static inline char* color_cube_to_str (gpointer val1p, gpointer val2p);
|
||||||
static inline char * preview_size_to_str (gpointer val1p, gpointer val2p);
|
static inline char * preview_size_to_str (gpointer val1p, gpointer val2p);
|
||||||
static inline char * nav_preview_size_to_str (gpointer val1p, gpointer val2p);
|
static inline char * nav_preview_size_to_str (gpointer val1p, gpointer val2p);
|
||||||
static inline char * units_to_str (gpointer val1p, gpointer val2p);
|
static inline char * units_to_str (gpointer val1p, gpointer val2p);
|
||||||
|
static inline char * help_browser_to_str (gpointer val1p, gpointer val2p);
|
||||||
|
|
||||||
static char* transform_path (char *path, int destroy);
|
static char* transform_path (char *path, int destroy);
|
||||||
static void gimprc_set_token (char *token, char *value);
|
static void gimprc_set_token (char *token, char *value);
|
||||||
|
@ -317,7 +322,8 @@ static ParseFunc funcs[] =
|
||||||
{ "nav-window-per-display", TT_BOOLEAN, &nav_window_per_display, NULL },
|
{ "nav-window-per-display", TT_BOOLEAN, &nav_window_per_display, NULL },
|
||||||
{ "nav-window-follows-auto", TT_BOOLEAN, NULL, &nav_window_per_display },
|
{ "nav-window-follows-auto", TT_BOOLEAN, NULL, &nav_window_per_display },
|
||||||
{ "info-window-follows-mouse", TT_BOOLEAN, &info_window_follows_mouse, NULL },
|
{ "info-window-follows-mouse", TT_BOOLEAN, &info_window_follows_mouse, NULL },
|
||||||
{ "info-window-per-display", TT_BOOLEAN, NULL, &info_window_follows_mouse }
|
{ "info-window-per-display", TT_BOOLEAN, NULL, &info_window_follows_mouse },
|
||||||
|
{ "help-browser", TT_XHELPBROWSER, &help_browser, NULL }
|
||||||
};
|
};
|
||||||
static int nfuncs = sizeof (funcs) / sizeof (funcs[0]);
|
static int nfuncs = sizeof (funcs) / sizeof (funcs[0]);
|
||||||
|
|
||||||
|
@ -844,6 +850,8 @@ parse_statement (void)
|
||||||
return parse_unit_info (funcs[i].val1p, funcs[i].val2p);
|
return parse_unit_info (funcs[i].val1p, funcs[i].val2p);
|
||||||
case TT_XPARASITE:
|
case TT_XPARASITE:
|
||||||
return parse_parasite (funcs[i].val1p, funcs[i].val2p);
|
return parse_parasite (funcs[i].val1p, funcs[i].val2p);
|
||||||
|
case TT_XHELPBROWSER:
|
||||||
|
return parse_help_browser (funcs[i].val1p, funcs[i].val2p);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parse_unknown (token_sym);
|
return parse_unknown (token_sym);
|
||||||
|
@ -2378,6 +2386,30 @@ error:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
parse_help_browser (gpointer val1p,
|
||||||
|
gpointer val2p)
|
||||||
|
{
|
||||||
|
int token;
|
||||||
|
|
||||||
|
token = peek_next_token ();
|
||||||
|
if (!token || token != TOKEN_SYMBOL)
|
||||||
|
return ERROR;
|
||||||
|
token = get_next_token ();
|
||||||
|
|
||||||
|
if (strcmp (token_sym, "gimp") == 0)
|
||||||
|
help_browser = HELP_BROWSER_GIMP;
|
||||||
|
else if (strcmp (token_sym, "netscape") == 0)
|
||||||
|
help_browser = HELP_BROWSER_NETSCAPE;
|
||||||
|
|
||||||
|
token = peek_next_token ();
|
||||||
|
if (!token || (token != TOKEN_RIGHT_PAREN))
|
||||||
|
return ERROR;
|
||||||
|
token = get_next_token ();
|
||||||
|
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
parse_unknown (char *token_sym)
|
parse_unknown (char *token_sym)
|
||||||
{
|
{
|
||||||
|
@ -2474,6 +2506,8 @@ value_to_str (char *name)
|
||||||
return nav_preview_size_to_str (funcs[i].val1p, funcs[i].val2p);
|
return nav_preview_size_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||||
case TT_XUNIT:
|
case TT_XUNIT:
|
||||||
return units_to_str (funcs[i].val1p, funcs[i].val2p);
|
return units_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||||
|
case TT_XHELPBROWSER:
|
||||||
|
return help_browser_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||||
case TT_XPLUGIN:
|
case TT_XPLUGIN:
|
||||||
case TT_XPLUGINDEF:
|
case TT_XPLUGINDEF:
|
||||||
case TT_XMENUPATH:
|
case TT_XMENUPATH:
|
||||||
|
@ -2651,6 +2685,16 @@ units_to_str (gpointer val1p,
|
||||||
return g_strdup (gimp_unit_get_identifier (*((GUnit*)val1p)));
|
return g_strdup (gimp_unit_get_identifier (*((GUnit*)val1p)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline char *
|
||||||
|
help_browser_to_str (gpointer val1p,
|
||||||
|
gpointer val2p)
|
||||||
|
{
|
||||||
|
if (help_browser == HELP_BROWSER_NETSCAPE)
|
||||||
|
return g_strdup ("netscape");
|
||||||
|
else
|
||||||
|
return g_strdup ("gimp");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_gimp_directory_token (char *gimp_dir)
|
add_gimp_directory_token (char *gimp_dir)
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,6 +84,7 @@ extern int trust_dirty_flag;
|
||||||
extern int use_help;
|
extern int use_help;
|
||||||
extern int nav_window_per_display;
|
extern int nav_window_per_display;
|
||||||
extern int info_window_follows_mouse;
|
extern int info_window_follows_mouse;
|
||||||
|
extern int help_browser;
|
||||||
|
|
||||||
/* function prototypes */
|
/* function prototypes */
|
||||||
void parse_buffers_init (); /* this has to be called before any file
|
void parse_buffers_init (); /* this has to be called before any file
|
||||||
|
|
|
@ -110,6 +110,7 @@ static int old_trust_dirty_flag;
|
||||||
static int old_use_help;
|
static int old_use_help;
|
||||||
static int old_nav_window_per_display;
|
static int old_nav_window_per_display;
|
||||||
static int old_info_window_follows_mouse;
|
static int old_info_window_follows_mouse;
|
||||||
|
static int old_help_browser;
|
||||||
|
|
||||||
/* variables which can't be changed on the fly */
|
/* variables which can't be changed on the fly */
|
||||||
static int edit_stingy_memory_use;
|
static int edit_stingy_memory_use;
|
||||||
|
@ -560,6 +561,8 @@ file_prefs_save_callback (GtkWidget *widget,
|
||||||
info_window_follows_mouse = edit_info_window_follows_mouse;
|
info_window_follows_mouse = edit_info_window_follows_mouse;
|
||||||
restart_notification = TRUE;
|
restart_notification = TRUE;
|
||||||
}
|
}
|
||||||
|
if (help_browser != old_help_browser)
|
||||||
|
update = g_list_append (update, "help-browser");
|
||||||
|
|
||||||
save_gimprc (&update, &remove);
|
save_gimprc (&update, &remove);
|
||||||
|
|
||||||
|
@ -631,6 +634,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
|
||||||
use_help = old_use_help;
|
use_help = old_use_help;
|
||||||
nav_window_per_display = old_nav_window_per_display;
|
nav_window_per_display = old_nav_window_per_display;
|
||||||
info_window_follows_mouse = old_info_window_follows_mouse;
|
info_window_follows_mouse = old_info_window_follows_mouse;
|
||||||
|
help_browser = old_help_browser;
|
||||||
|
|
||||||
if (preview_size != old_preview_size)
|
if (preview_size != old_preview_size)
|
||||||
{
|
{
|
||||||
|
@ -733,8 +737,10 @@ file_prefs_toggle_callback (GtkWidget *widget,
|
||||||
context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active);
|
context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active);
|
||||||
else if (data == &show_indicators)
|
else if (data == &show_indicators)
|
||||||
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
|
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
|
||||||
else if (data == &thumbnail_mode || data == &interpolation_type ||
|
else if (data == &thumbnail_mode ||
|
||||||
data == &trust_dirty_flag)
|
data == &interpolation_type ||
|
||||||
|
data == &trust_dirty_flag ||
|
||||||
|
data == &help_browser)
|
||||||
{
|
{
|
||||||
val = data;
|
val = data;
|
||||||
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||||
|
@ -1232,6 +1238,7 @@ file_pref_cmd_callback (GtkWidget *widget,
|
||||||
old_use_help = use_help;
|
old_use_help = use_help;
|
||||||
old_nav_window_per_display = nav_window_per_display;
|
old_nav_window_per_display = nav_window_per_display;
|
||||||
old_info_window_follows_mouse = info_window_follows_mouse;
|
old_info_window_follows_mouse = info_window_follows_mouse;
|
||||||
|
old_help_browser = help_browser;
|
||||||
|
|
||||||
file_prefs_strset (&old_image_title_format, image_title_format);
|
file_prefs_strset (&old_image_title_format, image_title_format);
|
||||||
file_prefs_strset (&old_temp_path, edit_temp_path);
|
file_prefs_strset (&old_temp_path, edit_temp_path);
|
||||||
|
@ -1645,6 +1652,26 @@ file_pref_cmd_callback (GtkWidget *widget,
|
||||||
&use_help);
|
&use_help);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
|
vbox2 = file_prefs_frame_new (_("Help Browser"), GTK_BOX (vbox));
|
||||||
|
|
||||||
|
table = gtk_table_new (1, 2, FALSE);
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||||
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
|
optionmenu =
|
||||||
|
gimp_option_menu_new (file_prefs_toggle_callback,
|
||||||
|
(gpointer) help_browser,
|
||||||
|
_("Internal"), &help_browser,
|
||||||
|
(gpointer) HELP_BROWSER_GIMP,
|
||||||
|
_("Netscape"), &help_browser,
|
||||||
|
(gpointer) HELP_BROWSER_NETSCAPE,
|
||||||
|
NULL);
|
||||||
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
||||||
|
_("Help Browser to Use:"), 1.0, 0.5,
|
||||||
|
optionmenu, TRUE);
|
||||||
|
|
||||||
/* Interface / Image Windows */
|
/* Interface / Image Windows */
|
||||||
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||||
_("Image Windows Settings"),
|
_("Image Windows Settings"),
|
||||||
|
|
|
@ -110,6 +110,7 @@ static int old_trust_dirty_flag;
|
||||||
static int old_use_help;
|
static int old_use_help;
|
||||||
static int old_nav_window_per_display;
|
static int old_nav_window_per_display;
|
||||||
static int old_info_window_follows_mouse;
|
static int old_info_window_follows_mouse;
|
||||||
|
static int old_help_browser;
|
||||||
|
|
||||||
/* variables which can't be changed on the fly */
|
/* variables which can't be changed on the fly */
|
||||||
static int edit_stingy_memory_use;
|
static int edit_stingy_memory_use;
|
||||||
|
@ -560,6 +561,8 @@ file_prefs_save_callback (GtkWidget *widget,
|
||||||
info_window_follows_mouse = edit_info_window_follows_mouse;
|
info_window_follows_mouse = edit_info_window_follows_mouse;
|
||||||
restart_notification = TRUE;
|
restart_notification = TRUE;
|
||||||
}
|
}
|
||||||
|
if (help_browser != old_help_browser)
|
||||||
|
update = g_list_append (update, "help-browser");
|
||||||
|
|
||||||
save_gimprc (&update, &remove);
|
save_gimprc (&update, &remove);
|
||||||
|
|
||||||
|
@ -631,6 +634,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
|
||||||
use_help = old_use_help;
|
use_help = old_use_help;
|
||||||
nav_window_per_display = old_nav_window_per_display;
|
nav_window_per_display = old_nav_window_per_display;
|
||||||
info_window_follows_mouse = old_info_window_follows_mouse;
|
info_window_follows_mouse = old_info_window_follows_mouse;
|
||||||
|
help_browser = old_help_browser;
|
||||||
|
|
||||||
if (preview_size != old_preview_size)
|
if (preview_size != old_preview_size)
|
||||||
{
|
{
|
||||||
|
@ -733,8 +737,10 @@ file_prefs_toggle_callback (GtkWidget *widget,
|
||||||
context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active);
|
context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active);
|
||||||
else if (data == &show_indicators)
|
else if (data == &show_indicators)
|
||||||
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
|
show_indicators = GTK_TOGGLE_BUTTON (widget)->active;
|
||||||
else if (data == &thumbnail_mode || data == &interpolation_type ||
|
else if (data == &thumbnail_mode ||
|
||||||
data == &trust_dirty_flag)
|
data == &interpolation_type ||
|
||||||
|
data == &trust_dirty_flag ||
|
||||||
|
data == &help_browser)
|
||||||
{
|
{
|
||||||
val = data;
|
val = data;
|
||||||
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||||
|
@ -1232,6 +1238,7 @@ file_pref_cmd_callback (GtkWidget *widget,
|
||||||
old_use_help = use_help;
|
old_use_help = use_help;
|
||||||
old_nav_window_per_display = nav_window_per_display;
|
old_nav_window_per_display = nav_window_per_display;
|
||||||
old_info_window_follows_mouse = info_window_follows_mouse;
|
old_info_window_follows_mouse = info_window_follows_mouse;
|
||||||
|
old_help_browser = help_browser;
|
||||||
|
|
||||||
file_prefs_strset (&old_image_title_format, image_title_format);
|
file_prefs_strset (&old_image_title_format, image_title_format);
|
||||||
file_prefs_strset (&old_temp_path, edit_temp_path);
|
file_prefs_strset (&old_temp_path, edit_temp_path);
|
||||||
|
@ -1645,6 +1652,26 @@ file_pref_cmd_callback (GtkWidget *widget,
|
||||||
&use_help);
|
&use_help);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
|
vbox2 = file_prefs_frame_new (_("Help Browser"), GTK_BOX (vbox));
|
||||||
|
|
||||||
|
table = gtk_table_new (1, 2, FALSE);
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||||
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (table);
|
||||||
|
|
||||||
|
optionmenu =
|
||||||
|
gimp_option_menu_new (file_prefs_toggle_callback,
|
||||||
|
(gpointer) help_browser,
|
||||||
|
_("Internal"), &help_browser,
|
||||||
|
(gpointer) HELP_BROWSER_GIMP,
|
||||||
|
_("Netscape"), &help_browser,
|
||||||
|
(gpointer) HELP_BROWSER_NETSCAPE,
|
||||||
|
NULL);
|
||||||
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
||||||
|
_("Help Browser to Use:"), 1.0, 0.5,
|
||||||
|
optionmenu, TRUE);
|
||||||
|
|
||||||
/* Interface / Image Windows */
|
/* Interface / Image Windows */
|
||||||
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||||
_("Image Windows Settings"),
|
_("Image Windows Settings"),
|
||||||
|
|
|
@ -18,6 +18,12 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
@ -26,11 +32,16 @@
|
||||||
#include "plug_in.h"
|
#include "plug_in.h"
|
||||||
#include "procedural_db.h"
|
#include "procedural_db.h"
|
||||||
|
|
||||||
|
#include "libgimp/gimpenv.h"
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
|
||||||
#define DEBUG_HELP
|
#define DEBUG_HELP
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
static void gimp_help_internal (gchar *current_locale,
|
||||||
|
gchar *help_data);
|
||||||
|
static void gimp_help_netscape (gchar *current_locale,
|
||||||
|
gchar *help_data);
|
||||||
static void gimp_help_callback (GtkWidget *widget,
|
static void gimp_help_callback (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static gint gimp_help_tips_query_idle_show_help (gpointer data);
|
static gint gimp_help_tips_query_idle_show_help (gpointer data);
|
||||||
|
@ -180,14 +191,47 @@ gimp_help_set_help_data (GtkWidget *widget,
|
||||||
void
|
void
|
||||||
gimp_help (gchar *help_data)
|
gimp_help (gchar *help_data)
|
||||||
{
|
{
|
||||||
ProcRecord *proc_rec;
|
|
||||||
|
|
||||||
static gchar *current_locale = "C";
|
static gchar *current_locale = "C";
|
||||||
|
|
||||||
|
if (help_data == NULL && help_browser != HELP_BROWSER_GIMP)
|
||||||
|
help_data = "welcome.html";
|
||||||
|
|
||||||
#ifdef DEBUG_HELP
|
#ifdef DEBUG_HELP
|
||||||
g_print ("Help Page: %s\n", help_data);
|
g_print ("Help Page: %s\n", help_data);
|
||||||
#endif /* DEBUG_HELP */
|
#endif /* DEBUG_HELP */
|
||||||
|
|
||||||
|
switch (help_browser)
|
||||||
|
{
|
||||||
|
case HELP_BROWSER_GIMP:
|
||||||
|
gimp_help_internal (current_locale, help_data);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HELP_BROWSER_NETSCAPE:
|
||||||
|
gimp_help_netscape (current_locale, help_data);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_context_help (void)
|
||||||
|
{
|
||||||
|
if (tips_query)
|
||||||
|
gimp_help_tips_query_start (NULL, tips_query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************/
|
||||||
|
/* local functions */
|
||||||
|
/*********************/
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_help_internal (gchar *current_locale,
|
||||||
|
gchar *help_data)
|
||||||
|
{
|
||||||
|
ProcRecord *proc_rec;
|
||||||
|
|
||||||
/* Check if a help browser is already running */
|
/* Check if a help browser is already running */
|
||||||
proc_rec = procedural_db_lookup ("extension_gimp_help_browser_temp");
|
proc_rec = procedural_db_lookup ("extension_gimp_help_browser_temp");
|
||||||
|
|
||||||
|
@ -234,15 +278,32 @@ gimp_help (gchar *help_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_context_help (void)
|
gimp_help_netscape (gchar *current_locale,
|
||||||
|
gchar *help_data)
|
||||||
{
|
{
|
||||||
if (tips_query)
|
Argument *return_vals;
|
||||||
gimp_help_tips_query_start (NULL, tips_query);
|
gint nreturn_vals;
|
||||||
}
|
gchar *url;
|
||||||
|
|
||||||
/*********************/
|
url = g_strconcat ("file:",
|
||||||
/* local functions */
|
gimp_data_directory (),
|
||||||
/*********************/
|
"/help/",
|
||||||
|
current_locale, "/",
|
||||||
|
help_data,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
return_vals =
|
||||||
|
procedural_db_run_proc ("extension_web_browser",
|
||||||
|
&nreturn_vals,
|
||||||
|
PDB_INT32, RUN_NONINTERACTIVE,
|
||||||
|
PDB_STRING, url,
|
||||||
|
PDB_INT32, FALSE,
|
||||||
|
PDB_END);
|
||||||
|
|
||||||
|
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||||
|
|
||||||
|
g_free (url);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_help_callback (GtkWidget *widget,
|
gimp_help_callback (GtkWidget *widget,
|
||||||
|
|
|
@ -292,6 +292,13 @@
|
||||||
# Just uncomment the following line if you trust the dirty flag.
|
# Just uncomment the following line if you trust the dirty flag.
|
||||||
# (trust-dirty-flag)
|
# (trust-dirty-flag)
|
||||||
|
|
||||||
|
# Help browser
|
||||||
|
# Determines which program to use as browser for the GIMP help pages.
|
||||||
|
# Possible values are "gimp" which means the built-in help browser
|
||||||
|
# which comes with GIMP as a plug-in and "netscape" which will show
|
||||||
|
# the help pages using the "netscape-remote" command.
|
||||||
|
(help-browser gimp)
|
||||||
|
|
||||||
# Gfig search path
|
# Gfig search path
|
||||||
# This path will be searched for Gfig figures when you use the Gfig plug-in.
|
# This path will be searched for Gfig figures when you use the Gfig plug-in.
|
||||||
(gfig-path "${gimp_dir}/gfig:${gimp_data_dir}/gfig")
|
(gfig-path "${gimp_dir}/gfig:${gimp_data_dir}/gfig")
|
||||||
|
|
|
@ -292,6 +292,13 @@
|
||||||
# Just uncomment the following line if you trust the dirty flag.
|
# Just uncomment the following line if you trust the dirty flag.
|
||||||
# (trust-dirty-flag)
|
# (trust-dirty-flag)
|
||||||
|
|
||||||
|
# Help browser
|
||||||
|
# Determines which program to use as browser for the GIMP help pages.
|
||||||
|
# Possible values are "gimp" which means the built-in help browser
|
||||||
|
# which comes with GIMP as a plug-in and "netscape" which will show
|
||||||
|
# the help pages using the "netscape-remote" command.
|
||||||
|
(help-browser gimp)
|
||||||
|
|
||||||
# Gfig search path
|
# Gfig search path
|
||||||
# This path will be searched for Gfig figures when you use the Gfig plug-in.
|
# This path will be searched for Gfig figures when you use the Gfig plug-in.
|
||||||
(gfig-path "${gimp_dir}/gfig:${gimp_data_dir}/gfig")
|
(gfig-path "${gimp_dir}/gfig:${gimp_data_dir}/gfig")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue