Commit 46708690 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added "gboolean verbose" to GimpRc and its constructor. Print messages

2002-11-26  Michael Natterer  <mitch@gimp.org>

	* app/config/gimprc.[ch]: added "gboolean verbose" to GimpRc and
	its constructor. Print messages only if verbose == TRUE.

	* app/gui/user-install-dialog.[ch]: changed accordingly.

	* app/app_procs.c: ditto. No need any more to parse unitrc before
	calling user_install_dialog_create().

	* app/gui/preferences-dialog.c: ditto. Added the static
	prefs_dialog pointer again to our local help func finds the
	current notebook page.
parent 9cfb44c5
2002-11-26 Michael Natterer <mitch@gimp.org>
* app/config/gimprc.[ch]: added "gboolean verbose" to GimpRc and
its constructor. Print messages only if verbose == TRUE.
* app/gui/user-install-dialog.[ch]: changed accordingly.
* app/app_procs.c: ditto. No need any more to parse unitrc before
calling user_install_dialog_create().
* app/gui/preferences-dialog.c: ditto. Added the static
prefs_dialog pointer again to our local help func finds the
current notebook page.
2002-11-26 Jakub Steiner <jimmac@ximian.com>
 
* themes/Default/images/preferences/image-title.png:
unique icon. Nothing too fancy though.
* themes/Default/images/preferences/input-devices.png:
fix the border a little
fix the border a little
 
2002-11-25 Maurits Rijk <lpeek.mrijk@consunet.nl>
 
......
......@@ -116,21 +116,22 @@ app_init (gint gimp_argc,
}
else
{
/* this needs to be done before gimprc loading */
gimp_unitrc_load (the_gimp);
user_install_dialog_create (alternate_system_gimprc,
alternate_gimprc);
alternate_gimprc,
be_verbose);
gtk_main ();
}
}
/* this needs to be done before gimprc loading */
/* this needs to be done before gimprc loading because gimprc can
* use user defined units
*/
gimp_unitrc_load (the_gimp);
the_gimp->config = GIMP_CORE_CONFIG (gimp_rc_new (alternate_system_gimprc,
alternate_gimprc));
alternate_gimprc,
be_verbose));
/* solely for debugging */
g_signal_connect (G_OBJECT (the_gimp->config), "notify",
......
......@@ -299,7 +299,8 @@ gimp_rc_load (GimpRc *rc)
g_return_if_fail (GIMP_IS_RC (rc));
g_printerr ("parsing '%s'\n", rc->system_gimprc);
if (rc->verbose)
g_print (_("Parsing '%s'\n"), rc->system_gimprc);
if (! gimp_config_deserialize (G_OBJECT (rc),
rc->system_gimprc, NULL, &error))
......@@ -310,7 +311,8 @@ gimp_rc_load (GimpRc *rc)
g_clear_error (&error);
}
g_printerr ("parsing '%s'\n", rc->user_gimprc);
if (rc->verbose)
g_print (_("Parsing '%s'\n"), rc->user_gimprc);
if (! gimp_config_deserialize (G_OBJECT (rc),
rc->user_gimprc, NULL, &error))
......@@ -324,7 +326,8 @@ gimp_rc_load (GimpRc *rc)
GimpRc *
gimp_rc_new (const gchar *system_gimprc,
const gchar *user_gimprc)
const gchar *user_gimprc,
gboolean verbose)
{
GimpRc *rc;
......@@ -338,6 +341,8 @@ gimp_rc_new (const gchar *system_gimprc,
"user-gimprc", user_gimprc,
NULL));
rc->verbose = verbose ? TRUE : FALSE;
gimp_rc_load (rc);
return rc;
......@@ -443,7 +448,8 @@ gimp_rc_save (GimpRc *rc)
header = g_strconcat (top, rc->system_gimprc, bottom, NULL);
g_printerr ("saving '%s'\n", rc->user_gimprc);
if (rc->verbose)
g_print (_("Saving '%s'\n"), rc->user_gimprc);
if (! gimp_config_serialize (G_OBJECT (rc),
rc->user_gimprc, header, footer, global,
......
......@@ -36,10 +36,12 @@ typedef struct _GimpRcClass GimpRcClass;
struct _GimpRc
{
GimpGuiConfig parent_instance;
GimpGuiConfig parent_instance;
gchar *user_gimprc;
gchar *system_gimprc;
gchar *user_gimprc;
gchar *system_gimprc;
gboolean verbose;
};
struct _GimpRcClass
......@@ -50,7 +52,8 @@ struct _GimpRcClass
GType gimp_rc_get_type (void) G_GNUC_CONST;
GimpRc * gimp_rc_new (const gchar *system_gimprc, /* NULL for default */
const gchar *user__gimprc); /* NULL for default */
const gchar *user_gimprc, /* NULL for default */
gboolean verbose);
void gimp_rc_save (GimpRc *gimprc);
gchar * gimp_rc_query (GimpRc *rc,
const gchar *key);
......
......@@ -76,18 +76,25 @@ static void prefs_input_dialog_able_callback (GtkWidget *widget,
gpointer data);
/* private variables */
static GtkWidget *prefs_dialog = NULL;
/* public function */
GtkWidget *
preferences_dialog_create (Gimp *gimp)
{
GtkWidget *prefs_dialog;
GObject *config;
GObject *config_copy;
GObject *config_orig;
GObject *config;
GObject *config_copy;
GObject *config_orig;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (prefs_dialog)
return prefs_dialog;
config = G_OBJECT (gimp->config);
config_copy = gimp_config_duplicate (config);
config_orig = gimp_config_duplicate (config);
......@@ -100,7 +107,8 @@ preferences_dialog_create (Gimp *gimp)
GList *list;
gimprc = gimp_rc_new (GIMP_RC (config)->system_gimprc,
GIMP_RC (config)->user_gimprc);
GIMP_RC (config)->user_gimprc,
GIMP_RC (config)->verbose);
config_saved = G_OBJECT (gimprc);
diff = gimp_config_diff (config_saved, config_copy, GIMP_PARAM_RESTART);
......@@ -133,6 +141,9 @@ preferences_dialog_create (Gimp *gimp)
prefs_dialog = prefs_dialog_new (gimp, config_copy);
g_object_add_weak_pointer (G_OBJECT (prefs_dialog),
&prefs_dialog);
g_object_weak_ref (G_OBJECT (prefs_dialog),
(GWeakNotify) g_object_unref,
config_copy);
......@@ -156,7 +167,7 @@ prefs_config_notify (GObject *config,
GObject *config_copy)
{
GValue global_value = { 0, };
GValue copy_value = { 0, };
GValue copy_value = { 0, };
g_value_init (&global_value, param_spec->value_type);
g_value_init (&copy_value, param_spec->value_type);
......@@ -805,18 +816,19 @@ prefs_memsize_entry_add (GObject *config,
static void
prefs_help_func (const gchar *help_data)
{
#if 0
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
if (prefs_dialog)
{
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
#endif
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
}
}
static GtkWidget *
......
......@@ -515,7 +515,8 @@ user_install_tv_fix_size_request (GtkWidget *widget,
void
user_install_dialog_create (const gchar *alternate_system_gimprc,
const gchar *alternate_gimprc)
const gchar *alternate_gimprc,
gboolean verbose)
{
GimpRc *gimprc;
GtkWidget *dialog;
......@@ -530,7 +531,7 @@ user_install_dialog_create (const gchar *alternate_system_gimprc,
GdkPixbuf *wilber;
gchar *filename;
gimprc = gimp_rc_new (alternate_system_gimprc, alternate_gimprc);
gimprc = gimp_rc_new (alternate_system_gimprc, alternate_gimprc, verbose);
dialog = user_install_dialog =
gimp_dialog_new (_("GIMP User Installation"), "user_installation",
......
......@@ -21,7 +21,8 @@
void user_install_dialog_create (const gchar *alternate_system_gimprc,
const gchar *alernate_gimprc);
const gchar *alernate_gimprc,
gboolean verbose);
#endif /* __USER_INSTALL_DIALOG_H__ */
......@@ -76,18 +76,25 @@ static void prefs_input_dialog_able_callback (GtkWidget *widget,
gpointer data);
/* private variables */
static GtkWidget *prefs_dialog = NULL;
/* public function */
GtkWidget *
preferences_dialog_create (Gimp *gimp)
{
GtkWidget *prefs_dialog;
GObject *config;
GObject *config_copy;
GObject *config_orig;
GObject *config;
GObject *config_copy;
GObject *config_orig;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (prefs_dialog)
return prefs_dialog;
config = G_OBJECT (gimp->config);
config_copy = gimp_config_duplicate (config);
config_orig = gimp_config_duplicate (config);
......@@ -100,7 +107,8 @@ preferences_dialog_create (Gimp *gimp)
GList *list;
gimprc = gimp_rc_new (GIMP_RC (config)->system_gimprc,
GIMP_RC (config)->user_gimprc);
GIMP_RC (config)->user_gimprc,
GIMP_RC (config)->verbose);
config_saved = G_OBJECT (gimprc);
diff = gimp_config_diff (config_saved, config_copy, GIMP_PARAM_RESTART);
......@@ -133,6 +141,9 @@ preferences_dialog_create (Gimp *gimp)
prefs_dialog = prefs_dialog_new (gimp, config_copy);
g_object_add_weak_pointer (G_OBJECT (prefs_dialog),
&prefs_dialog);
g_object_weak_ref (G_OBJECT (prefs_dialog),
(GWeakNotify) g_object_unref,
config_copy);
......@@ -156,7 +167,7 @@ prefs_config_notify (GObject *config,
GObject *config_copy)
{
GValue global_value = { 0, };
GValue copy_value = { 0, };
GValue copy_value = { 0, };
g_value_init (&global_value, param_spec->value_type);
g_value_init (&copy_value, param_spec->value_type);
......@@ -805,18 +816,19 @@ prefs_memsize_entry_add (GObject *config,
static void
prefs_help_func (const gchar *help_data)
{
#if 0
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
if (prefs_dialog)
{
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
#endif
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
}
}
static GtkWidget *
......
......@@ -515,7 +515,8 @@ user_install_tv_fix_size_request (GtkWidget *widget,
void
user_install_dialog_create (const gchar *alternate_system_gimprc,
const gchar *alternate_gimprc)
const gchar *alternate_gimprc,
gboolean verbose)
{
GimpRc *gimprc;
GtkWidget *dialog;
......@@ -530,7 +531,7 @@ user_install_dialog_create (const gchar *alternate_system_gimprc,
GdkPixbuf *wilber;
gchar *filename;
gimprc = gimp_rc_new (alternate_system_gimprc, alternate_gimprc);
gimprc = gimp_rc_new (alternate_system_gimprc, alternate_gimprc, verbose);
dialog = user_install_dialog =
gimp_dialog_new (_("GIMP User Installation"), "user_installation",
......
......@@ -21,7 +21,8 @@
void user_install_dialog_create (const gchar *alternate_system_gimprc,
const gchar *alernate_gimprc);
const gchar *alernate_gimprc,
gboolean verbose);
#endif /* __USER_INSTALL_DIALOG_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment