removed the gimp_busy boolean, check whether user_installation is needed

2001-07-10  Michael Natterer  <mitch@gimp.org>

	* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
	user_installation is needed here, not in user_install.c, parse
	gtkrc an friends only if(!no_interface), create the Gimp object
	before parsing gimp's rc files an pas it to the parse functions,
	many other cleanups.

	* app/appenums.h: added MessageHandlerType and StackTraceMode.

	* app/appenv.h: removed MessageHandlerType, declare all global
	variables from main.c (no more hidden global stuff please).

	* app/errors.[ch]: added the fatal message func here (from main.c),
	removed the StackTraceMode enum.

	* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
	pointer to some functions.

	* app/gimpunit.c
	* app/unitrc.h: ok, this is ugly: renamed all functions to
	_gimp_unit_*() and made them public. The unit list is part
	of the Gimp object now, so pass a Gimp* to all functions.

	* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
	functions which are used by widgets.

	* app/main.c: cleaned up the global variables, removed the fatal
	message handler, call app_init() directly, not via the
	user_install stuff, misc. cleanups.

	* app/user_install.[ch]: removed the check if user_installation is
	needed (done by app_procs.c now).

	* app/core/gimp.[ch]: added the user_unit list and the "busy"
	boolean. Moved gimp_[set|unset]_busy() here. Added
	gimp_initialize() which is called after unitrc and gimprc are
	parsed.

	* app/batch.c
	* app/colormaps.c
	* app/devices.c
	* app/disp_callbacks.c
	* app/gdisplay_ops.c
	* app/gimphelp.c
	* app/module_db.c
	* app/nav_window.c
	* app/plug_in.c
	* app/core/gimpcontext.c
	* app/core/gimpdatafiles.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage.c
	* app/core/gimpparasite.c
	* app/core/gimpparasitelist.h
	* app/gui/file-open-dialog.c
	* app/gui/gui.[ch]
	* app/gui/info-dialog.c
	* app/gui/info-window.c
	* app/gui/preferences-dialog.c
	* app/gui/session.c
	* app/gui/tips-dialog.c
	* app/gui/toolbox.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimptransformtool.c
	* app/tools/tool_manager.c
	* app/widgets/gimpcolorpanel.c
	* app/widgets/gimpcursor.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c
	* tools/pdbgen/Makefile.am
	* tools/pdbgen/app.pl
	* tools/pdbgen/enums.pl
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/unit.pdb
	* app/pdb/image_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
This commit is contained in:
Michael Natterer
2001-07-10 19:16:16 +00:00
committed by Michael Natterer
parent d7fde9e68d
commit 9d87e554de
119 changed files with 1503 additions and 1152 deletions

View File

@ -74,9 +74,11 @@
#define PAGE_STYLE(widget) gtk_widget_set_style (widget, page_style)
#define TITLE_STYLE(widget) gtk_widget_set_style (widget, title_style)
static void user_install_dialog_create (UserInstallCallback);
static void user_install_continue_callback (GtkWidget *widget, gpointer data);
static void user_install_cancel_callback (GtkWidget *widget, gpointer data);
static void user_install_continue_callback (GtkWidget *widget,
gpointer data);
static void user_install_cancel_callback (GtkWidget *widget,
gpointer data);
static gboolean user_install_run (void);
static void user_install_tuning (void);
@ -85,39 +87,6 @@ static void user_install_resolution (void);
static void user_install_resolution_done (void);
void
user_install_verify (UserInstallCallback user_install_callback)
{
gboolean properly_installed = TRUE;
const gchar *filename;
struct stat stat_buf;
/* gimp_directory now always returns something */
filename = gimp_directory ();
if (stat (filename, &stat_buf) != 0)
properly_installed = FALSE;
/* If there is already a proper installation, invoke the callback */
if (properly_installed)
{
(* user_install_callback) ();
}
/* Otherwise, prepare for installation */
else if (no_interface)
{
g_print (_("The GIMP is not properly installed for the current user\n"));
g_print (_("User installation was skipped because the '--nointerface' flag was encountered\n"));
g_print (_("To perform user installation, run the GIMP without the '--nointerface' flag\n"));
(* user_install_callback) ();
}
else
{
user_install_dialog_create (user_install_callback);
}
}
/* private stuff */
static GtkWidget *user_install_dialog = NULL;
@ -350,9 +319,10 @@ user_install_continue_callback (GtkWidget *widget,
gpointer data)
{
static gint notebook_index = 0;
UserInstallCallback callback;
callback = (UserInstallCallback) data;
Gimp *gimp;
gimp = (Gimp *) data;
switch (notebook_index)
{
@ -382,9 +352,9 @@ user_install_continue_callback (GtkWidget *widget,
#ifdef G_OS_WIN32
FreeConsole ();
#endif
gimprc_init ();
parse_unitrc ();
parse_gimprc ();
gimprc_init (gimp);
gimp_unitrc_load (gimp);
gimprc_parse (gimp);
user_install_tuning ();
break;
@ -401,7 +371,7 @@ user_install_continue_callback (GtkWidget *widget,
gtk_style_unref (title_style);
gtk_style_unref (page_style);
(* callback) ();
gtk_main_quit ();
return;
break;
@ -426,7 +396,7 @@ user_install_cancel_callback (GtkWidget *widget,
gtk_widget_destroy (continue_button);
user_install_notebook_set_page (GTK_NOTEBOOK (notebook), EEK_PAGE);
timeout = gtk_timeout_add (1024, (GtkFunction)gtk_exit, (gpointer)0);
timeout = gtk_timeout_add (1024, (GtkFunction) gtk_exit, (gpointer) 0);
}
static gint
@ -534,7 +504,7 @@ user_install_ctree_select_row (GtkWidget *widget,
}
void
user_install_dialog_create (UserInstallCallback callback)
user_install_dialog_create (Gimp *gimp)
{
GtkWidget *dialog;
GtkWidget *vbox;
@ -553,9 +523,9 @@ user_install_dialog_create (UserInstallCallback callback)
FALSE, FALSE, FALSE,
_("Continue"), user_install_continue_callback,
callback, NULL, &continue_button, TRUE, FALSE,
gimp, NULL, &continue_button, TRUE, FALSE,
_("Cancel"), user_install_cancel_callback,
callback, 1, &cancel_button, FALSE, TRUE,
gimp, 1, &cancel_button, FALSE, TRUE,
NULL);
@ -939,11 +909,11 @@ quote_spaces (char *string)
static gboolean
user_install_run (void)
{
FILE *pfp;
gchar buffer[2048];
struct stat stat_buf;
gint err;
gboolean executable = TRUE;
FILE *pfp;
gchar buffer[2048];
struct stat stat_buf;
gint err;
gboolean executable = TRUE;
/* Generate output */
g_snprintf (buffer, sizeof (buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL,
@ -1328,7 +1298,7 @@ user_install_resolution_done (void)
gimprc.monitor_yres = 0.0;
}
save_gimprc (&update, &remove);
gimprc_save (&update, &remove);
if (gimprc.using_xserver_resolution)
gdisplay_xserver_resolution (&gimprc.monitor_xres, &gimprc.monitor_yres);