applied a patch from Maurits Rijk that enables mnemonics (bug #80804).

2002-05-08  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpwidgets.c (gimp_scale_entry_new)
	(gimp_table_attach_aligned): applied a patch from Maurits Rijk that
	enables mnemonics (bug #80804).

	* plug-ins/common/apply_lens.c
	* plug-ins/common/glasstile.c: applied a patch from Maurits Rijk that
	adds mnemonics (bug #80804).

	* plug-ins/common/animationplay.c
	* plug-ins/common/decompose.c
	* plug-ins/common/film.c
	* plug-ins/common/gee.c
	* plug-ins/common/gee_zoom.c
	* plug-ins/common/guillotine.c
	* plug-ins/common/winprint.c
	* plug-ins/gap/gap_lib.c
	* plug-ins/imagemap/imap_main.c
	* plug-ins/imagemap/imap_settings.c
	* plug-ins/print/gimp_main_window.c
	* plug-ins/print/print.c
	* plug-ins/print/print_gimp.h: use new function gimp_image_get_name()
	where applicable.
This commit is contained in:
Sven Neumann 2002-05-08 00:30:26 +00:00 committed by Sven Neumann
parent 182eb5170c
commit e1b20e1c14
17 changed files with 117 additions and 89 deletions

View File

@ -1,3 +1,28 @@
2002-05-08 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpwidgets.c (gimp_scale_entry_new)
(gimp_table_attach_aligned): applied a patch from Maurits Rijk that
enables mnemonics (bug #80804).
* plug-ins/common/apply_lens.c
* plug-ins/common/glasstile.c: applied a patch from Maurits Rijk that
adds mnemonics (bug #80804).
* plug-ins/common/animationplay.c
* plug-ins/common/decompose.c
* plug-ins/common/film.c
* plug-ins/common/gee.c
* plug-ins/common/gee_zoom.c
* plug-ins/common/guillotine.c
* plug-ins/common/winprint.c
* plug-ins/gap/gap_lib.c
* plug-ins/imagemap/imap_main.c
* plug-ins/imagemap/imap_settings.c
* plug-ins/print/gimp_main_window.c
* plug-ins/print/print.c
* plug-ins/print/print_gimp.h: use new function gimp_image_get_name()
where applicable.
2002-05-07 Manish Singh <yosh@gimp.org>
* tools/pdbgen/pdb/image.pdb: added image_get_name. Also, no longer

View File

@ -706,7 +706,7 @@ gimp_scale_entry_new (GtkTable *table,
GtkObject *adjustment;
GtkObject *return_adj;
label = gtk_label_new (text);
label = gtk_label_new_with_mnemonic (text);
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label,
column, column + 1, row, row + 1,
@ -751,6 +751,8 @@ gimp_scale_entry_new (GtkTable *table,
return_adj = adjustment;
}
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
if (spinbutton_width > 0)
gtk_widget_set_size_request (spinbutton, spinbutton_width, -1);
@ -1502,7 +1504,7 @@ gimp_table_attach_aligned (GtkTable *table,
if (label_text)
{
label = gtk_label_new (label_text);
label = gtk_label_new_with_mnemonic (label_text);
gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
gtk_table_attach (table, label,
@ -1510,6 +1512,7 @@ gimp_table_attach_aligned (GtkTable *table,
row, row + 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (label);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
}
if (left_align)

View File

@ -649,7 +649,7 @@ preview_pressed (GtkWidget *widget,
static void
build_dialog (GimpImageBaseType basetype,
char *imagename)
gchar *imagename)
{
gchar* windowname;
CursorOffset* icon_pos;
@ -924,9 +924,9 @@ do_playback (void)
init_preview_misc();
build_dialog(gimp_image_base_type(image_id),
gimp_image_get_filename(image_id));
build_dialog (gimp_image_base_type (image_id),
gimp_image_get_name (image_id));
/* Make sure that whole preview is dirtied with pure-alpha */
total_alpha_preview(preview_data);

View File

@ -380,7 +380,6 @@ lens_dialog (GimpDrawable *drawable)
GtkWidget *hbox;
GtkWidget *spinbutton;
GtkObject *adj;
GSList *group = NULL;
GimpImageType drawtype;
drawtype = gimp_drawable_type (drawable->drawable_id);
@ -413,9 +412,8 @@ lens_dialog (GimpDrawable *drawable)
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_add (GTK_CONTAINER (frame), vbox);
toggle = gtk_radio_button_new_with_label (group,
_("Keep Original Surroundings"));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
toggle = gtk_radio_button_new_with_mnemonic_from_widget
(NULL, _("_Keep Original Surroundings"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), lvals.keep_surr);
gtk_widget_show (toggle);
@ -424,13 +422,11 @@ lens_dialog (GimpDrawable *drawable)
G_CALLBACK (gimp_toggle_button_update),
&lvals.keep_surr);
toggle =
gtk_radio_button_new_with_label (group,
drawtype == GIMP_INDEXEDA_IMAGE ||
drawtype == GIMP_INDEXED_IMAGE ?
_("Set Surroundings to Index 0") :
_("Set Surroundings to Background Color"));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
toggle = gtk_radio_button_new_with_mnemonic_from_widget
(GTK_RADIO_BUTTON (toggle),
drawtype == GIMP_INDEXEDA_IMAGE || drawtype == GIMP_INDEXED_IMAGE ?
_("_Set Surroundings to Index 0") :
_("_Set Surroundings to Background Color"));
gtk_box_pack_start(GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), lvals.use_bkgr);
gtk_widget_show (toggle);
@ -440,13 +436,11 @@ lens_dialog (GimpDrawable *drawable)
&lvals.use_bkgr);
if ((drawtype == GIMP_INDEXEDA_IMAGE) ||
(drawtype == GIMP_GRAYA_IMAGE) ||
(drawtype == GIMP_GRAYA_IMAGE) ||
(drawtype == GIMP_RGBA_IMAGE))
{
toggle =
gtk_radio_button_new_with_label (group,
_("Make Surroundings Transparent"));
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
toggle = gtk_radio_button_new_with_mnemonic_from_widget
(GTK_RADIO_BUTTON (toggle), _("_Make Surroundings Transparent"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
lvals.set_transparent);
@ -464,7 +458,7 @@ lens_dialog (GimpDrawable *drawable)
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (_("Lens Refraction Index:"));
label = gtk_label_new_with_mnemonic (_("_Lens Refraction Index:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@ -473,6 +467,8 @@ lens_dialog (GimpDrawable *drawable)
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&lvals.refraction);

View File

@ -374,26 +374,37 @@ decompose (gint32 image_ID,
for (j = 0; j < num_images; j++)
{
/* Build a filename like <imagename>-<channel>.<extension> */
char *fname = g_strdup (gimp_image_get_filename (image_ID));
char *extension = fname + strlen (fname) - 1;
gchar *fname;
gchar *extension;
while (extension >= fname)
{
if (*extension == '.') break;
extension--;
}
if (extension >= fname)
{
*(extension++) = '\0';
filename = g_strdup_printf ("%s-%s.%s", fname,
gettext (extract[extract_idx].channel_name[j]),
extension);
}
fname = gimp_image_get_filename (image_ID);
if (fname)
{
extension = fname + strlen (fname) - 1;
while (extension >= fname)
{
if (*extension == '.') break;
extension--;
}
if (extension >= fname)
{
*(extension++) = '\0';
filename = g_strdup_printf ("%s-%s.%s", fname,
gettext (extract[extract_idx].channel_name[j]),
extension);
}
else
{
filename = g_strdup_printf ("%s-%s", fname,
gettext (extract[extract_idx].channel_name[j]));
}
}
else
{
filename = g_strdup_printf ("%s-%s", fname,
gettext (extract[extract_idx].channel_name[j]));
}
{
filename = g_strdup (gettext (extract[extract_idx].channel_name[j]));
}
image_ID_dst[j] = create_new_image (filename, width, height, GIMP_GRAY,
layer_ID_dst+j, drawable_dst+j,

View File

@ -1011,25 +1011,18 @@ create_new_image (gchar *filename,
static gchar *
compose_image_name (gint32 image_ID)
{
static gchar buffer[256];
gchar *filename, *basename;
filename = gimp_image_get_filename (image_ID);
if (filename == NULL)
return "";
gchar *image_name;
gchar *name;
/* Compose a name of the basename and the image-ID */
basename = strrchr (filename, '/');
if (basename == NULL)
basename = filename;
else
basename++;
g_snprintf (buffer, sizeof (buffer), "%s-%ld", basename, (long)image_ID);
name = gimp_image_get_name (image_ID);
g_free (filename);
image_name = g_strdup_printf ("%s-%d", name, image_ID);
return buffer;
g_free (name);
return image_name;
}
@ -1040,7 +1033,6 @@ add_list_item_callback (GtkWidget *widget,
GList *tmp_list;
GtkWidget *label;
GtkWidget *list_item;
gint32 image_ID;
tmp_list = GTK_LIST (list)->selection;
@ -1048,16 +1040,24 @@ add_list_item_callback (GtkWidget *widget,
{
if ((label = (GtkWidget *) tmp_list->data) != NULL)
{
image_ID = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (label),
"image"));
list_item =
gtk_list_item_new_with_label (compose_image_name (image_ID));
gint32 image_ID;
gchar *name;
image_ID = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (label),
"image"));
name = compose_image_name (image_ID);
list_item = gtk_list_item_new_with_label (name);
g_object_set_data (G_OBJECT (list_item), "image",
GINT_TO_POINTER (image_ID));
gtk_container_add (GTK_CONTAINER (filmint.image_list_film), list_item);
g_free (name);
gtk_container_add (GTK_CONTAINER (filmint.image_list_film),
list_item);
gtk_widget_show (list_item);
}
tmp_list = tmp_list->next;
}
}
@ -1126,8 +1126,11 @@ add_image_list (gint add_box_flag,
for (i = 0; i < n; i++)
{
list_item =
gtk_list_item_new_with_label (compose_image_name (image_id[i]));
gchar *name = compose_image_name (image_id[i]);
list_item = gtk_list_item_new_with_label (name);
g_free (name);
g_object_set_data (G_OBJECT (list_item), "image",
GINT_TO_POINTER (image_id[i]));

View File

@ -166,8 +166,7 @@ run (gchar *name,
static void
build_dialog (GimpImageBaseType basetype,
gchar *imagename)
build_dialog (void)
{
GtkWidget *dlg;
GtkWidget *button;
@ -318,8 +317,7 @@ do_fun (void)
gimp_tile_cache_ntiles (1);
init_preview_misc();
build_dialog(gimp_image_base_type(image_id),
gimp_image_get_filename(image_id));
build_dialog ();
gen_llut();

View File

@ -183,8 +183,7 @@ run (gchar *name,
static void
build_dialog (GimpImageBaseType basetype,
gchar *imagename)
build_dialog (void)
{
GtkWidget *dlg;
GtkWidget *button;
@ -321,9 +320,8 @@ do_fun (void)
/* cache hint */
gimp_tile_cache_ntiles (1);
init_preview_misc();
build_dialog(gimp_image_base_type(image_id),
gimp_image_get_filename(image_id));
init_preview_misc ();
build_dialog ();
init_lut();

View File

@ -315,7 +315,7 @@ glass_dialog (GimpDrawable *drawable)
/* Horizontal scale - Width */
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Tile Width:"), 150, 0,
_("Tile _Width:"), 150, 0,
gtvals.xblock, 10, 50, 2, 10, 0,
TRUE, 0, 0,
NULL, NULL);
@ -329,7 +329,7 @@ glass_dialog (GimpDrawable *drawable)
/* Horizontal scale - Height */
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Tile Height:"), 150, 0,
_("Tile _Height:"), 150, 0,
gtvals.yblock, 10, 50, 2, 10, 0,
TRUE, 0, 0,
NULL, NULL);

View File

@ -172,6 +172,8 @@ guillotine (gint32 image_ID)
gint x, y;
filename = gimp_image_get_filename (image_ID);
if (!filename)
filename = g_strdup (_("Untitled"));
/* Do the actual dup'ing and cropping... this isn't a too naive a
way to do this since we got copy-on-write tiles, either. */

View File

@ -360,8 +360,7 @@ run (gchar *name,
/* Start print job. */
docInfo.cbSize = sizeof (DOCINFO);
docInfo.lpszDocName =
gimp_image_get_filename (param[1].data.d_image);
docInfo.lpszDocName = gimp_image_get_name (param[1].data.d_image);
docInfo.lpszOutput = NULL;
docInfo.lpszDatatype = NULL;
docInfo.fwType = 0;

View File

@ -635,9 +635,6 @@ t_anim_info *p_alloc_ainfo(gint32 image_id, GimpRunMode run_mode)
l_ainfo_ptr->old_filename = gimp_image_get_filename(image_id);
if(l_ainfo_ptr->old_filename == NULL)
{
/* note: gimp versions > 1.2 have default filenames for new created images
* and we'll probably never step into this place anymore
*/
l_ainfo_ptr->old_filename = g_strdup("frame_0001.xcf"); /* assign a defaultname */
gimp_image_set_filename (image_id, l_ainfo_ptr->old_filename);
}

View File

@ -170,7 +170,7 @@ run(char *name, int n_params, GimpParam *param, int *nreturn_vals,
/* Get the specified drawable */
drawable = gimp_drawable_get(param[2].data.d_drawable);
_image_name = gimp_image_get_filename(param[1].data.d_image);
_image_name = gimp_image_get_name(param[1].data.d_image);
_image_width = gimp_image_width(param[1].data.d_image);
_image_height = gimp_image_height(param[1].data.d_image);

View File

@ -159,8 +159,7 @@ do_settings_dialog(void)
if (!dialog)
dialog = make_settings_dialog();
gtk_label_set_text(GTK_LABEL(dialog->filename),
(filename) ? filename : _("<Untitled>"));
gtk_label_set_text(GTK_LABEL(dialog->filename), filename);
browse_widget_set_filename(dialog->imagename, info->image_name);
gtk_entry_set_text(GTK_ENTRY(dialog->title), info->title);
gtk_entry_set_text(GTK_ENTRY(dialog->author), info->author);

View File

@ -332,7 +332,7 @@ create_top_level_structure(void)
*/
plug_in_name = g_strdup_printf (_("%s -- Print v%s"),
image_filename, PLUG_IN_VERSION);
image_name, PLUG_IN_VERSION);
print_dialog =
gimp_dialog_new (plug_in_name, "print",

View File

@ -83,7 +83,7 @@ int runme = FALSE; /* True if print should proceed */
stp_printer_t current_printer = 0; /* Current printer index */
gint32 image_ID; /* image ID */
gchar *image_filename;
gchar *image_name;
gint image_width;
gint image_height;
@ -273,10 +273,7 @@ run (gchar *name, /* I - Name of print program. */
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
image_filename = gimp_image_get_filename (image_ID);
if (strchr (image_filename, '/'))
image_filename = strrchr(image_filename, '/') + 1;
image_name = gimp_image_get_name (image_ID);
/* eventually export the image */
switch (run_mode)

View File

@ -61,7 +61,7 @@ extern gint plist_count; /* Number of system printers */
extern gint plist_current; /* Current system printer */
extern gp_plist_t *plist; /* System printers */
extern gint32 image_ID;
extern gchar *image_filename;
extern gchar *image_name;
extern gint image_width;
extern gint image_height;
extern stp_printer_t current_printer;