use a GtkFileChooserButton instead of a GimpFileEntry widget.
2006-05-24 Sven Neumann <sven@gimp.org> * plug-ins/common/raw.c (load_dialog): use a GtkFileChooserButton instead of a GimpFileEntry widget. * plug-ins/script-fu/script-fu-interface.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-types.h: use GtkFileChooserButton for SF_FILENAME and SF_DIRNAME parameters.
This commit is contained in:

committed by
Sven Neumann

parent
7c6cc1d09a
commit
c03e117e48
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2006-05-24 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/common/raw.c (load_dialog): use a GtkFileChooserButton
|
||||||
|
instead of a GimpFileEntry widget.
|
||||||
|
|
||||||
|
* plug-ins/script-fu/script-fu-interface.c
|
||||||
|
* plug-ins/script-fu/script-fu-scripts.c
|
||||||
|
* plug-ins/script-fu/script-fu-types.h: use GtkFileChooserButton
|
||||||
|
for SF_FILENAME and SF_DIRNAME parameters.
|
||||||
|
|
||||||
2006-05-24 Sven Neumann <sven@gimp.org>
|
2006-05-24 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/dialogs/palette-import-dialog.c: use a GtkFileChooserButton
|
* app/dialogs/palette-import-dialog.c: use a GtkFileChooserButton
|
||||||
|
@ -124,7 +124,7 @@ static gboolean load_dialog (gchar *name);
|
|||||||
static gboolean save_dialog (gchar *filename,
|
static gboolean save_dialog (gchar *filename,
|
||||||
gint32 image_id,
|
gint32 image_id,
|
||||||
gint32 drawable_id);
|
gint32 drawable_id);
|
||||||
static void palette_callback (GimpFileEntry *file_entry,
|
static void palette_callback (GtkFileChooser *button,
|
||||||
GimpPreviewArea *preview);
|
GimpPreviewArea *preview);
|
||||||
|
|
||||||
|
|
||||||
@ -913,8 +913,8 @@ load_dialog (gchar *filename)
|
|||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
GtkWidget *frame;
|
GtkWidget *frame;
|
||||||
GtkWidget *combo;
|
GtkWidget *combo;
|
||||||
|
GtkWidget *button;
|
||||||
GtkObject *adj;
|
GtkObject *adj;
|
||||||
GtkWidget *entry;
|
|
||||||
gint32 size;
|
gint32 size;
|
||||||
gboolean run;
|
gboolean run;
|
||||||
|
|
||||||
@ -1062,13 +1062,16 @@ load_dialog (gchar *filename)
|
|||||||
G_CALLBACK (palette_update),
|
G_CALLBACK (palette_update),
|
||||||
preview);
|
preview);
|
||||||
|
|
||||||
entry = gimp_file_entry_new (_("Select Palette File to Load"),
|
button = gtk_file_chooser_button_new (_("Select Palette File"),
|
||||||
palfile, FALSE, TRUE);
|
GTK_FILE_CHOOSER_ACTION_OPEN);
|
||||||
|
if (palfile)
|
||||||
|
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (button), palfile);
|
||||||
|
|
||||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||||
_("Pal_ette File:"), 0.0, 0.5,
|
_("Pal_ette File:"), 0.0, 0.5,
|
||||||
entry, 2, FALSE);
|
button, 2, FALSE);
|
||||||
|
|
||||||
g_signal_connect (entry, "filename-changed",
|
g_signal_connect (button, "selection-changed",
|
||||||
G_CALLBACK (palette_callback),
|
G_CALLBACK (palette_callback),
|
||||||
preview);
|
preview);
|
||||||
|
|
||||||
@ -1147,13 +1150,13 @@ save_dialog (gchar * filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
palette_callback (GimpFileEntry *file_entry,
|
palette_callback (GtkFileChooser *button,
|
||||||
GimpPreviewArea *preview)
|
GimpPreviewArea *preview)
|
||||||
{
|
{
|
||||||
if (palfile)
|
if (palfile)
|
||||||
g_free (palfile);
|
g_free (palfile);
|
||||||
|
|
||||||
palfile = gimp_file_entry_get_filename (file_entry);
|
palfile = gtk_file_chooser_get_filename (button);
|
||||||
|
|
||||||
palette_update (preview);
|
palette_update (preview);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ static void script_fu_ok (SFScript *script);
|
|||||||
static void script_fu_reset (SFScript *script);
|
static void script_fu_reset (SFScript *script);
|
||||||
static void script_fu_about (SFScript *script);
|
static void script_fu_about (SFScript *script);
|
||||||
|
|
||||||
static void script_fu_file_entry_callback (GtkWidget *widget,
|
static void script_fu_file_callback (GtkWidget *widget,
|
||||||
SFFilename *file);
|
SFFilename *file);
|
||||||
static void script_fu_combo_callback (GtkWidget *widget,
|
static void script_fu_combo_callback (GtkWidget *widget,
|
||||||
SFOption *option);
|
SFOption *option);
|
||||||
@ -428,20 +428,17 @@ script_fu_interface (SFScript *script)
|
|||||||
case SF_FILENAME:
|
case SF_FILENAME:
|
||||||
case SF_DIRNAME:
|
case SF_DIRNAME:
|
||||||
if (script->arg_types[i] == SF_FILENAME)
|
if (script->arg_types[i] == SF_FILENAME)
|
||||||
widget = gimp_file_entry_new (_("Script-Fu File Selection"),
|
widget = gtk_file_chooser_button_new (_("Script-Fu File Selection"),
|
||||||
script->arg_values[i].sfa_file.filename,
|
GTK_FILE_CHOOSER_ACTION_OPEN);
|
||||||
FALSE, TRUE);
|
|
||||||
else
|
else
|
||||||
widget = gimp_file_entry_new (_("Script-Fu Folder Selection"),
|
widget = gtk_file_chooser_button_new (_("Script-Fu Folder Selection"),
|
||||||
script->arg_values[i].sfa_file.filename,
|
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
|
||||||
TRUE, TRUE);
|
if (script->arg_values[i].sfa_file.filename)
|
||||||
|
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
|
||||||
|
script->arg_values[i].sfa_file.filename);
|
||||||
|
|
||||||
gtk_entry_set_activates_default (GTK_ENTRY (GIMP_FILE_ENTRY (widget)->entry), TRUE);
|
g_signal_connect (widget, "selection-changed",
|
||||||
|
G_CALLBACK (script_fu_file_callback),
|
||||||
script->arg_values[i].sfa_file.file_entry = widget;
|
|
||||||
|
|
||||||
g_signal_connect (widget, "filename-changed",
|
|
||||||
G_CALLBACK (script_fu_file_entry_callback),
|
|
||||||
&script->arg_values[i].sfa_file);
|
&script->arg_values[i].sfa_file);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -626,14 +623,13 @@ script_fu_interface_quit (SFScript *script)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
script_fu_file_entry_callback (GtkWidget *widget,
|
script_fu_file_callback (GtkWidget *widget,
|
||||||
SFFilename *file)
|
SFFilename *file)
|
||||||
{
|
{
|
||||||
if (file->filename)
|
if (file->filename)
|
||||||
g_free (file->filename);
|
g_free (file->filename);
|
||||||
|
|
||||||
file->filename =
|
file->filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
||||||
gimp_file_entry_get_filename (GIMP_FILE_ENTRY(file->file_entry));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -945,9 +941,8 @@ script_fu_reset (SFScript *script)
|
|||||||
|
|
||||||
case SF_FILENAME:
|
case SF_FILENAME:
|
||||||
case SF_DIRNAME:
|
case SF_DIRNAME:
|
||||||
gimp_file_entry_set_filename
|
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget),
|
||||||
(GIMP_FILE_ENTRY (script->arg_values[i].sfa_file.file_entry),
|
script->arg_defaults[i].sfa_file.filename);
|
||||||
script->arg_defaults[i].sfa_file.filename);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SF_FONT:
|
case SF_FONT:
|
||||||
|
@ -420,7 +420,6 @@ script_fu_add_script (LISP a)
|
|||||||
#endif
|
#endif
|
||||||
script->arg_values[i].sfa_file.filename =
|
script->arg_values[i].sfa_file.filename =
|
||||||
g_strdup (script->arg_defaults[i].sfa_file.filename);
|
g_strdup (script->arg_defaults[i].sfa_file.filename);
|
||||||
script->arg_values[i].sfa_file.file_entry = NULL;
|
|
||||||
|
|
||||||
args[i + 1].type = GIMP_PDB_STRING;
|
args[i + 1].type = GIMP_PDB_STRING;
|
||||||
args[i + 1].name = (script->arg_types[i] == SF_FILENAME ?
|
args[i + 1].name = (script->arg_types[i] == SF_FILENAME ?
|
||||||
|
@ -37,8 +37,7 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GtkWidget *file_entry;
|
gchar *filename;
|
||||||
gchar *filename;
|
|
||||||
} SFFilename;
|
} SFFilename;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
Reference in New Issue
Block a user