mirror of https://github.com/GNOME/gimp.git
app/gimprc.[ch] app/config/gimpdisplayconfig.[ch] made the string which
2002-02-11 Michael Natterer <mitch@gimp.org> * app/gimprc.[ch] * app/config/gimpdisplayconfig.[ch] * app/gui/preferences-dialog.c: made the string which appears in the display's statusbar configurable separately from the title string. They still both have the same default value. * app/display/gimpdisplayshell.c: changed accordingly. Also added lots of new % expansions which implement all stuff mentioned in #5843. Didn't apply the original patch because it is overly complicated (the same can be acheived using %D and %C). Instead, applied a changed version of gimp-quinet-000618-0.patch. Added %Cx, which expands to 'x' if the image is clean. * docs/gimprc-1.3.5.in * etc/gimprc.in * etc/gimprc.win32: added documentation for the new stuff.
This commit is contained in:
parent
aa94076da2
commit
9e2f662a6d
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2002-02-11 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/gimprc.[ch]
|
||||
* app/config/gimpdisplayconfig.[ch]
|
||||
* app/gui/preferences-dialog.c: made the string which appears in
|
||||
the display's statusbar configurable separately from the title
|
||||
string. They still both have the same default value.
|
||||
|
||||
* app/display/gimpdisplayshell.c: changed accordingly.
|
||||
|
||||
Also added lots of new % expansions which implement all stuff
|
||||
mentioned in #5843. Didn't apply the original patch because it is
|
||||
overly complicated (the same can be acheived using %D and %C).
|
||||
Instead, applied a changed version of gimp-quinet-000618-0.patch.
|
||||
Added %Cx, which expands to 'x' if the image is clean.
|
||||
|
||||
* docs/gimprc-1.3.5.in
|
||||
* etc/gimprc.in
|
||||
* etc/gimprc.win32: added documentation for the new stuff.
|
||||
|
||||
2002-02-11 Nathan Summers <rock@gimp.org>
|
||||
|
||||
* gui/preferences-dialog.c: s/directory/folder/ and other
|
||||
|
|
|
@ -43,6 +43,10 @@ static void gimp_display_config_get_property (GObject *object,
|
|||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
|
||||
#define DEFAULT_IMAGE_TITLE_FORMAT "%f-%p.%i (%t)"
|
||||
#define DEFAULT_IMAGE_STATUS_FORMAT DEFAULT_IMAGE_TITLE_FORMAT
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
@ -54,6 +58,7 @@ enum
|
|||
PROP_CURSOR_MODE,
|
||||
PROP_CURSOR_UPDATING,
|
||||
PROP_IMAGE_TITLE_FORMAT,
|
||||
PROP_IMAGE_STATUS_FORMAT,
|
||||
PROP_SHOW_RULERS,
|
||||
PROP_SHOW_STATUSBAR,
|
||||
PROP_CONFIRM_ON_CLOSE,
|
||||
|
@ -129,7 +134,10 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
|
|||
TRUE);
|
||||
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_TITLE_FORMAT,
|
||||
"image-title-format",
|
||||
"%f-%p.%i (%t)");
|
||||
DEFAULT_IMAGE_TITLE_FORMAT);
|
||||
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_STATUS_FORMAT,
|
||||
"image-status-format",
|
||||
DEFAULT_IMAGE_STATUS_FORMAT);
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_RULERS,
|
||||
"show-rulers",
|
||||
TRUE);
|
||||
|
@ -158,6 +166,7 @@ gimp_display_config_finalize (GObject *object)
|
|||
display_config = GIMP_DISPLAY_CONFIG (object);
|
||||
|
||||
g_free (display_config->image_title_format);
|
||||
g_free (display_config->image_status_format);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -199,6 +208,10 @@ gimp_display_config_set_property (GObject *object,
|
|||
g_free (display_config->image_title_format);
|
||||
display_config->image_title_format = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_IMAGE_STATUS_FORMAT:
|
||||
g_free (display_config->image_status_format);
|
||||
display_config->image_status_format = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_SHOW_RULERS:
|
||||
display_config->show_rulers = g_value_get_boolean (value);
|
||||
break;
|
||||
|
@ -260,6 +273,9 @@ gimp_display_config_get_property (GObject *object,
|
|||
case PROP_IMAGE_TITLE_FORMAT:
|
||||
g_value_set_string (value, display_config->image_title_format);
|
||||
break;
|
||||
case PROP_IMAGE_STATUS_FORMAT:
|
||||
g_value_set_string (value, display_config->image_status_format);
|
||||
break;
|
||||
case PROP_SHOW_RULERS:
|
||||
g_value_set_boolean (value, display_config->show_rulers);
|
||||
break;
|
||||
|
|
|
@ -49,6 +49,7 @@ struct _GimpDisplayConfig
|
|||
GimpCursorMode cursor_mode;
|
||||
gboolean cursor_updating;
|
||||
gchar *image_title_format;
|
||||
gchar *image_status_format;
|
||||
gboolean show_rulers;
|
||||
gboolean show_statusbar;
|
||||
gboolean confirm_on_close;
|
||||
|
|
|
@ -159,6 +159,7 @@ static gdouble old_monitor_yres;
|
|||
static gboolean old_using_xserver_resolution;
|
||||
static gint old_num_processors;
|
||||
static gchar * old_image_title_format;
|
||||
static gchar * old_image_status_format;
|
||||
static gboolean old_global_paint_options;
|
||||
static guint old_max_new_image_size;
|
||||
static gboolean old_write_thumbnails;
|
||||
|
@ -342,6 +343,12 @@ prefs_check_settings (Gimp *gimp)
|
|||
gimprc.image_title_format = old_image_title_format;
|
||||
return PREFS_CORRUPT;
|
||||
}
|
||||
if (gimprc.image_status_format == NULL)
|
||||
{
|
||||
g_message (_("Error: Image status format must not be NULL."));
|
||||
gimprc.image_status_format = old_image_status_format;
|
||||
return PREFS_CORRUPT;
|
||||
}
|
||||
|
||||
if (base_config->num_processors < 1 || base_config->num_processors > 30)
|
||||
{
|
||||
|
@ -705,6 +712,10 @@ prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "image-title-format");
|
||||
}
|
||||
if (prefs_strcmp (gimprc.image_status_format, old_image_status_format))
|
||||
{
|
||||
update = g_list_append (update, "image-status-format");
|
||||
}
|
||||
if (gimprc.global_paint_options != old_global_paint_options)
|
||||
{
|
||||
update = g_list_append (update, "global-paint-options");
|
||||
|
@ -969,6 +980,7 @@ prefs_cancel_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
prefs_strset (&gimprc.image_title_format, old_image_title_format);
|
||||
prefs_strset (&gimprc.image_status_format, old_image_status_format);
|
||||
prefs_strset (&gimp->config->default_comment, old_default_comment);
|
||||
|
||||
tool_manager_set_global_paint_options (gimp, old_global_paint_options);
|
||||
|
@ -1580,8 +1592,9 @@ preferences_dialog_create (Gimp *gimp)
|
|||
old_cursor_mode = gimprc.cursor_mode;
|
||||
old_default_threshold = gimprc.default_threshold;
|
||||
|
||||
prefs_strset (&old_image_title_format, gimprc.image_title_format);
|
||||
prefs_strset (&old_default_comment, gimp->config->default_comment);
|
||||
prefs_strset (&old_image_title_format, gimprc.image_title_format);
|
||||
prefs_strset (&old_image_status_format, gimprc.image_status_format);
|
||||
prefs_strset (&old_default_comment, gimp->config->default_comment);
|
||||
|
||||
/* values which will need a restart */
|
||||
old_stingy_memory_use = edit_stingy_memory_use;
|
||||
|
@ -2243,7 +2256,7 @@ preferences_dialog_create (Gimp *gimp)
|
|||
G_CALLBACK (prefs_toggle_callback),
|
||||
&gimprc.show_statusbar);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
table = gtk_table_new (3, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
|
@ -2260,7 +2273,7 @@ preferences_dialog_create (Gimp *gimp)
|
|||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&gimprc.marching_speed);
|
||||
|
||||
/* The title format string */
|
||||
/* The title and status format strings */
|
||||
{
|
||||
GtkWidget *combo;
|
||||
GtkWidget *comboitem;
|
||||
|
@ -2309,6 +2322,29 @@ preferences_dialog_create (Gimp *gimp)
|
|||
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
||||
G_CALLBACK (prefs_string_callback),
|
||||
&gimprc.image_title_format);
|
||||
|
||||
format_strings[0] = gimprc.image_status_format;
|
||||
|
||||
combo = gtk_combo_new ();
|
||||
gtk_combo_set_use_arrows (GTK_COMBO (combo), FALSE);
|
||||
gtk_combo_set_value_in_list (GTK_COMBO (combo), FALSE, FALSE);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (combo_strings); i++)
|
||||
{
|
||||
comboitem = gtk_list_item_new_with_label (gettext (combo_strings[i]));
|
||||
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
||||
format_strings[i]);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
||||
gtk_widget_show (comboitem);
|
||||
}
|
||||
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("Image Status Format:"), 1.0, 0.5,
|
||||
combo, 1, FALSE);
|
||||
|
||||
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
||||
G_CALLBACK (prefs_string_callback),
|
||||
&gimprc.image_status_format);
|
||||
}
|
||||
|
||||
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"), GTK_BOX (vbox));
|
||||
|
|
|
@ -103,7 +103,8 @@ static void gimp_display_shell_draw_cursor (GimpDisplayShell *shell);
|
|||
|
||||
static void gimp_display_shell_format_title (GimpDisplayShell *gdisp,
|
||||
gchar *title,
|
||||
gint title_len);
|
||||
gint title_len,
|
||||
const gchar *format);
|
||||
|
||||
static void gimp_display_shell_update_icon (GimpDisplayShell *gdisp);
|
||||
static gboolean gimp_display_shell_update_icon_invoker (gpointer data);
|
||||
|
@ -1475,9 +1476,17 @@ gimp_display_shell_update_title (GimpDisplayShell *shell)
|
|||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
/* format the title */
|
||||
gimp_display_shell_format_title (shell, title, MAX_TITLE_BUF);
|
||||
gimp_display_shell_format_title (shell, title, sizeof (title),
|
||||
gimprc.image_title_format);
|
||||
gdk_window_set_title (GTK_WIDGET (shell)->window, title);
|
||||
|
||||
/* format the statusbar */
|
||||
if (strcmp (gimprc.image_title_format, gimprc.image_status_format))
|
||||
{
|
||||
gimp_display_shell_format_title (shell, title, sizeof (title),
|
||||
gimprc.image_status_format);
|
||||
}
|
||||
|
||||
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "title");
|
||||
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "title", title);
|
||||
}
|
||||
|
@ -2089,13 +2098,14 @@ print (gchar *buf,
|
|||
static void
|
||||
gimp_display_shell_format_title (GimpDisplayShell *shell,
|
||||
gchar *title,
|
||||
gint title_len)
|
||||
gint title_len,
|
||||
const gchar *format)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
gchar *image_type_str = NULL;
|
||||
gboolean empty;
|
||||
gint i;
|
||||
gchar *format;
|
||||
gchar unit_format[8];
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
|
@ -2120,7 +2130,6 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||
}
|
||||
|
||||
i = 0;
|
||||
format = gimprc.image_title_format;
|
||||
|
||||
while (i < title_len && *format)
|
||||
{
|
||||
|
@ -2192,6 +2201,18 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||
format++;
|
||||
break;
|
||||
|
||||
case 'C': /* clean flag */
|
||||
if (format[1] == 0)
|
||||
{
|
||||
g_warning ("image-title-format string ended within "
|
||||
"%%C-sequence");
|
||||
break;
|
||||
}
|
||||
if (! gimage->dirty)
|
||||
title[i++] = format[1];
|
||||
format++;
|
||||
break;
|
||||
|
||||
case 'm': /* memory used by image */
|
||||
{
|
||||
gsize memsize;
|
||||
|
@ -2207,9 +2228,66 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||
}
|
||||
break;
|
||||
|
||||
case 'l': /* number of layers */
|
||||
i += print (title, title_len, i, "%d",
|
||||
gimp_container_num_children (gimage->layers));
|
||||
break;
|
||||
|
||||
case 'L': /* active drawable name */
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (drawable)
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_object_get_name (GIMP_OBJECT (drawable)));
|
||||
else
|
||||
i += print (title, title_len, i, "%s", "(none)");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'w': /* width in pixels */
|
||||
i += print (title, title_len, i, "%d", gimage->width);
|
||||
break;
|
||||
|
||||
case 'W': /* width in real-world units */
|
||||
g_snprintf (unit_format, sizeof (unit_format), "%%.%df",
|
||||
gimp_unit_get_digits (gimage->unit) + 1);
|
||||
i += print (title, title_len, i, unit_format,
|
||||
(gimage->width *
|
||||
gimp_unit_get_factor (gimage->unit) /
|
||||
gimage->xresolution));
|
||||
break;
|
||||
|
||||
case 'h': /* height in pixels */
|
||||
i += print (title, title_len, i, "%d", gimage->height);
|
||||
break;
|
||||
|
||||
case 'H': /* height in real-world units */
|
||||
g_snprintf (unit_format, sizeof (unit_format), "%%.%df",
|
||||
gimp_unit_get_digits (gimage->unit) + 1);
|
||||
i += print (title, title_len, i, unit_format,
|
||||
(gimage->height *
|
||||
gimp_unit_get_factor (gimage->unit) /
|
||||
gimage->yresolution));
|
||||
break;
|
||||
|
||||
case 'u': /* unit symbol */
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_unit_get_symbol (gimage->unit));
|
||||
break;
|
||||
|
||||
case 'U': /* unit abbreviation */
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_unit_get_abbreviation (gimage->unit));
|
||||
break;
|
||||
|
||||
/* Other cool things to be added:
|
||||
* some kind of resolution / image size thing
|
||||
* people seem to want to know the active layer name
|
||||
* %r = xresolution
|
||||
* %R = yresolution
|
||||
* %ø = image's fractal dimension
|
||||
* %þ = the answer to everything
|
||||
*/
|
||||
|
||||
default:
|
||||
|
|
|
@ -103,7 +103,8 @@ static void gimp_display_shell_draw_cursor (GimpDisplayShell *shell);
|
|||
|
||||
static void gimp_display_shell_format_title (GimpDisplayShell *gdisp,
|
||||
gchar *title,
|
||||
gint title_len);
|
||||
gint title_len,
|
||||
const gchar *format);
|
||||
|
||||
static void gimp_display_shell_update_icon (GimpDisplayShell *gdisp);
|
||||
static gboolean gimp_display_shell_update_icon_invoker (gpointer data);
|
||||
|
@ -1475,9 +1476,17 @@ gimp_display_shell_update_title (GimpDisplayShell *shell)
|
|||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
/* format the title */
|
||||
gimp_display_shell_format_title (shell, title, MAX_TITLE_BUF);
|
||||
gimp_display_shell_format_title (shell, title, sizeof (title),
|
||||
gimprc.image_title_format);
|
||||
gdk_window_set_title (GTK_WIDGET (shell)->window, title);
|
||||
|
||||
/* format the statusbar */
|
||||
if (strcmp (gimprc.image_title_format, gimprc.image_status_format))
|
||||
{
|
||||
gimp_display_shell_format_title (shell, title, sizeof (title),
|
||||
gimprc.image_status_format);
|
||||
}
|
||||
|
||||
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "title");
|
||||
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "title", title);
|
||||
}
|
||||
|
@ -2089,13 +2098,14 @@ print (gchar *buf,
|
|||
static void
|
||||
gimp_display_shell_format_title (GimpDisplayShell *shell,
|
||||
gchar *title,
|
||||
gint title_len)
|
||||
gint title_len,
|
||||
const gchar *format)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
gchar *image_type_str = NULL;
|
||||
gboolean empty;
|
||||
gint i;
|
||||
gchar *format;
|
||||
gchar unit_format[8];
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
|
@ -2120,7 +2130,6 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||
}
|
||||
|
||||
i = 0;
|
||||
format = gimprc.image_title_format;
|
||||
|
||||
while (i < title_len && *format)
|
||||
{
|
||||
|
@ -2192,6 +2201,18 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||
format++;
|
||||
break;
|
||||
|
||||
case 'C': /* clean flag */
|
||||
if (format[1] == 0)
|
||||
{
|
||||
g_warning ("image-title-format string ended within "
|
||||
"%%C-sequence");
|
||||
break;
|
||||
}
|
||||
if (! gimage->dirty)
|
||||
title[i++] = format[1];
|
||||
format++;
|
||||
break;
|
||||
|
||||
case 'm': /* memory used by image */
|
||||
{
|
||||
gsize memsize;
|
||||
|
@ -2207,9 +2228,66 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
|||
}
|
||||
break;
|
||||
|
||||
case 'l': /* number of layers */
|
||||
i += print (title, title_len, i, "%d",
|
||||
gimp_container_num_children (gimage->layers));
|
||||
break;
|
||||
|
||||
case 'L': /* active drawable name */
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
if (drawable)
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_object_get_name (GIMP_OBJECT (drawable)));
|
||||
else
|
||||
i += print (title, title_len, i, "%s", "(none)");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'w': /* width in pixels */
|
||||
i += print (title, title_len, i, "%d", gimage->width);
|
||||
break;
|
||||
|
||||
case 'W': /* width in real-world units */
|
||||
g_snprintf (unit_format, sizeof (unit_format), "%%.%df",
|
||||
gimp_unit_get_digits (gimage->unit) + 1);
|
||||
i += print (title, title_len, i, unit_format,
|
||||
(gimage->width *
|
||||
gimp_unit_get_factor (gimage->unit) /
|
||||
gimage->xresolution));
|
||||
break;
|
||||
|
||||
case 'h': /* height in pixels */
|
||||
i += print (title, title_len, i, "%d", gimage->height);
|
||||
break;
|
||||
|
||||
case 'H': /* height in real-world units */
|
||||
g_snprintf (unit_format, sizeof (unit_format), "%%.%df",
|
||||
gimp_unit_get_digits (gimage->unit) + 1);
|
||||
i += print (title, title_len, i, unit_format,
|
||||
(gimage->height *
|
||||
gimp_unit_get_factor (gimage->unit) /
|
||||
gimage->yresolution));
|
||||
break;
|
||||
|
||||
case 'u': /* unit symbol */
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_unit_get_symbol (gimage->unit));
|
||||
break;
|
||||
|
||||
case 'U': /* unit abbreviation */
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_unit_get_abbreviation (gimage->unit));
|
||||
break;
|
||||
|
||||
/* Other cool things to be added:
|
||||
* some kind of resolution / image size thing
|
||||
* people seem to want to know the active layer name
|
||||
* %r = xresolution
|
||||
* %R = yresolution
|
||||
* %ø = image's fractal dimension
|
||||
* %þ = the answer to everything
|
||||
*/
|
||||
|
||||
default:
|
||||
|
|
11
app/gimprc.c
11
app/gimprc.c
|
@ -68,8 +68,9 @@
|
|||
#define OK 2
|
||||
|
||||
|
||||
#define DEFAULT_IMAGE_TITLE_FORMAT "%f-%p.%i (%t)"
|
||||
#define DEFAULT_COMMENT "Created with The GIMP"
|
||||
#define DEFAULT_IMAGE_TITLE_FORMAT "%f-%p.%i (%t)"
|
||||
#define DEFAULT_IMAGE_STATUS_FORMAT DEFAULT_IMAGE_TITLE_FORMAT
|
||||
#define DEFAULT_COMMENT "Created with The GIMP"
|
||||
|
||||
|
||||
typedef enum
|
||||
|
@ -213,6 +214,7 @@ GimpRc gimprc =
|
|||
/* monitor_yres */ 72.0,
|
||||
/* using_xserver_resolution */ FALSE,
|
||||
/* image_title_format */ NULL,
|
||||
/* image_status_format */ NULL,
|
||||
/* global_paint_options */ FALSE,
|
||||
/* show_indicators */ TRUE,
|
||||
/* max_new_image_size */ 33554432, /* 32 MB */
|
||||
|
@ -272,6 +274,7 @@ static ParseFunc funcs[] =
|
|||
{ "monitor-xresolution", TT_DOUBLE, &gimprc.monitor_xres, NULL },
|
||||
{ "monitor-yresolution", TT_DOUBLE, &gimprc.monitor_yres, NULL },
|
||||
{ "image-title-format", TT_STRING, &gimprc.image_title_format, NULL },
|
||||
{ "image-status-format", TT_STRING, &gimprc.image_status_format, NULL },
|
||||
{ "global-paint-options", TT_BOOLEAN, &gimprc.global_paint_options, NULL },
|
||||
{ "show-indicators", TT_BOOLEAN, &gimprc.show_indicators, NULL },
|
||||
{ "dont-show-indicators", TT_BOOLEAN, NULL, &gimprc.show_indicators },
|
||||
|
@ -472,6 +475,10 @@ gimprc_parse (Gimp *gimp,
|
|||
|
||||
if (! gimprc.image_title_format)
|
||||
gimprc.image_title_format = g_strdup (DEFAULT_IMAGE_TITLE_FORMAT);
|
||||
|
||||
if (! gimprc.image_status_format)
|
||||
gimprc.image_status_format = g_strdup (DEFAULT_IMAGE_STATUS_FORMAT);
|
||||
|
||||
if (! gimp->config->default_comment)
|
||||
gimp->config->default_comment = g_strdup (DEFAULT_COMMENT);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ struct _GimpRc
|
|||
gdouble monitor_yres;
|
||||
gboolean using_xserver_resolution;
|
||||
gchar *image_title_format;
|
||||
gchar *image_status_format;
|
||||
gboolean global_paint_options;
|
||||
gboolean show_indicators;
|
||||
guint max_new_image_size;
|
||||
|
|
|
@ -159,6 +159,7 @@ static gdouble old_monitor_yres;
|
|||
static gboolean old_using_xserver_resolution;
|
||||
static gint old_num_processors;
|
||||
static gchar * old_image_title_format;
|
||||
static gchar * old_image_status_format;
|
||||
static gboolean old_global_paint_options;
|
||||
static guint old_max_new_image_size;
|
||||
static gboolean old_write_thumbnails;
|
||||
|
@ -342,6 +343,12 @@ prefs_check_settings (Gimp *gimp)
|
|||
gimprc.image_title_format = old_image_title_format;
|
||||
return PREFS_CORRUPT;
|
||||
}
|
||||
if (gimprc.image_status_format == NULL)
|
||||
{
|
||||
g_message (_("Error: Image status format must not be NULL."));
|
||||
gimprc.image_status_format = old_image_status_format;
|
||||
return PREFS_CORRUPT;
|
||||
}
|
||||
|
||||
if (base_config->num_processors < 1 || base_config->num_processors > 30)
|
||||
{
|
||||
|
@ -705,6 +712,10 @@ prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "image-title-format");
|
||||
}
|
||||
if (prefs_strcmp (gimprc.image_status_format, old_image_status_format))
|
||||
{
|
||||
update = g_list_append (update, "image-status-format");
|
||||
}
|
||||
if (gimprc.global_paint_options != old_global_paint_options)
|
||||
{
|
||||
update = g_list_append (update, "global-paint-options");
|
||||
|
@ -969,6 +980,7 @@ prefs_cancel_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
prefs_strset (&gimprc.image_title_format, old_image_title_format);
|
||||
prefs_strset (&gimprc.image_status_format, old_image_status_format);
|
||||
prefs_strset (&gimp->config->default_comment, old_default_comment);
|
||||
|
||||
tool_manager_set_global_paint_options (gimp, old_global_paint_options);
|
||||
|
@ -1580,8 +1592,9 @@ preferences_dialog_create (Gimp *gimp)
|
|||
old_cursor_mode = gimprc.cursor_mode;
|
||||
old_default_threshold = gimprc.default_threshold;
|
||||
|
||||
prefs_strset (&old_image_title_format, gimprc.image_title_format);
|
||||
prefs_strset (&old_default_comment, gimp->config->default_comment);
|
||||
prefs_strset (&old_image_title_format, gimprc.image_title_format);
|
||||
prefs_strset (&old_image_status_format, gimprc.image_status_format);
|
||||
prefs_strset (&old_default_comment, gimp->config->default_comment);
|
||||
|
||||
/* values which will need a restart */
|
||||
old_stingy_memory_use = edit_stingy_memory_use;
|
||||
|
@ -2243,7 +2256,7 @@ preferences_dialog_create (Gimp *gimp)
|
|||
G_CALLBACK (prefs_toggle_callback),
|
||||
&gimprc.show_statusbar);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
table = gtk_table_new (3, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
|
@ -2260,7 +2273,7 @@ preferences_dialog_create (Gimp *gimp)
|
|||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&gimprc.marching_speed);
|
||||
|
||||
/* The title format string */
|
||||
/* The title and status format strings */
|
||||
{
|
||||
GtkWidget *combo;
|
||||
GtkWidget *comboitem;
|
||||
|
@ -2309,6 +2322,29 @@ preferences_dialog_create (Gimp *gimp)
|
|||
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
||||
G_CALLBACK (prefs_string_callback),
|
||||
&gimprc.image_title_format);
|
||||
|
||||
format_strings[0] = gimprc.image_status_format;
|
||||
|
||||
combo = gtk_combo_new ();
|
||||
gtk_combo_set_use_arrows (GTK_COMBO (combo), FALSE);
|
||||
gtk_combo_set_value_in_list (GTK_COMBO (combo), FALSE, FALSE);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (combo_strings); i++)
|
||||
{
|
||||
comboitem = gtk_list_item_new_with_label (gettext (combo_strings[i]));
|
||||
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
||||
format_strings[i]);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
||||
gtk_widget_show (comboitem);
|
||||
}
|
||||
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("Image Status Format:"), 1.0, 0.5,
|
||||
combo, 1, FALSE);
|
||||
|
||||
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
||||
G_CALLBACK (prefs_string_callback),
|
||||
&gimprc.image_status_format);
|
||||
}
|
||||
|
||||
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"), GTK_BOX (vbox));
|
||||
|
|
|
@ -415,9 +415,34 @@ sequences are recognised and expanded as follows:
|
|||
%Dx expands to x if the image is dirty, the empty string
|
||||
otherwise. The x can be any character, eg %D*.
|
||||
.br
|
||||
%m memory used by image
|
||||
%Cx expands to x if the image is clean, the empty string
|
||||
otherwise. The x can be any character, eg %Co.
|
||||
.br
|
||||
%m memory used by the image
|
||||
.br
|
||||
%l the number of layers
|
||||
.br
|
||||
%L the name of the active layer/channel
|
||||
.br
|
||||
%w image width in pixels
|
||||
.br
|
||||
%W image width in real-world units
|
||||
.br
|
||||
%h image height in pixels
|
||||
.br
|
||||
%H image height in real-world units
|
||||
.br
|
||||
%u unit symbol
|
||||
.br
|
||||
%U unit abbreviation
|
||||
|
||||
The default format string is "%f-%p.%i (%t)".
|
||||
The default title format string is "%f-%p.%i (%t)".
|
||||
.TP
|
||||
.I image-status-format STRING
|
||||
Set the text to appear in image window status bars. See image-title-format
|
||||
for the list of possible % sequences.
|
||||
|
||||
The default status format string is "%f-%p.%i (%t)".
|
||||
|
||||
.PP
|
||||
.SH PATH EXPANSION
|
||||
|
|
|
@ -415,9 +415,34 @@ sequences are recognised and expanded as follows:
|
|||
%Dx expands to x if the image is dirty, the empty string
|
||||
otherwise. The x can be any character, eg %D*.
|
||||
.br
|
||||
%m memory used by image
|
||||
%Cx expands to x if the image is clean, the empty string
|
||||
otherwise. The x can be any character, eg %Co.
|
||||
.br
|
||||
%m memory used by the image
|
||||
.br
|
||||
%l the number of layers
|
||||
.br
|
||||
%L the name of the active layer/channel
|
||||
.br
|
||||
%w image width in pixels
|
||||
.br
|
||||
%W image width in real-world units
|
||||
.br
|
||||
%h image height in pixels
|
||||
.br
|
||||
%H image height in real-world units
|
||||
.br
|
||||
%u unit symbol
|
||||
.br
|
||||
%U unit abbreviation
|
||||
|
||||
The default format string is "%f-%p.%i (%t)".
|
||||
The default title format string is "%f-%p.%i (%t)".
|
||||
.TP
|
||||
.I image-status-format STRING
|
||||
Set the text to appear in image window status bars. See image-title-format
|
||||
for the list of possible % sequences.
|
||||
|
||||
The default status format string is "%f-%p.%i (%t)".
|
||||
|
||||
.PP
|
||||
.SH PATH EXPANSION
|
||||
|
|
|
@ -285,10 +285,23 @@
|
|||
# %s source scale factor
|
||||
# %d destination scale factor
|
||||
# %Dx expands to x if the image is dirty
|
||||
# %Cx expands to x if the image is clean
|
||||
# %m memory used by the image
|
||||
# %l the number of layers
|
||||
# %L the name of the active layer/channel
|
||||
# %w image width in pixels
|
||||
# %W image width in real-world units
|
||||
# %h image height in pixels
|
||||
# %H image height in real-world units
|
||||
# %u unit symbol
|
||||
# %U unit abbreviation
|
||||
# See gimprc(5) for further details.
|
||||
(image-title-format "%D*%f-%p.%i (%t) %z%%")
|
||||
|
||||
# This string sets how image window status bars are formatted.
|
||||
# See image-title-format for the list of performed percent expansions.
|
||||
(image-status-format "%D*%f-%p.%i (%t) %z%%")
|
||||
|
||||
# Global paint options
|
||||
# By default options for the paint tools are local, e.g. all paint tools
|
||||
# use the options you specify in their tool options dialog. If you wish
|
||||
|
|
|
@ -290,10 +290,23 @@
|
|||
# %s source scale factor
|
||||
# %d destination scale factor
|
||||
# %Dx expands to x if the image is dirty
|
||||
# %Cx expands to x if the image is clean
|
||||
# %m memory used by the image
|
||||
# %l the number of layers
|
||||
# %L the name of the active layer/channel
|
||||
# %w image width in pixels
|
||||
# %W image width in real-world units
|
||||
# %h image height in pixels
|
||||
# %H image height in real-world units
|
||||
# %u unit symbol
|
||||
# %U unit abbreviation
|
||||
# See gimprc(5) for further details.
|
||||
(image-title-format "%D*%f-%p.%i (%t) %z%%")
|
||||
|
||||
# This string sets how image window status bars are formatted.
|
||||
# See image-title-format for the list of performed percent expansions.
|
||||
(image-status-format "%D*%f-%p.%i (%t) %z%%")
|
||||
|
||||
# Global paint options
|
||||
# By default options for the paint tools are local, e.g. all paint tools
|
||||
# use the options you specify in their tool options dialog. If you wish
|
||||
|
|
Loading…
Reference in New Issue