plug-ins/FractalExplorer/Dialogs.c plug-ins/common/CML_explorer.c

2003-11-09  Michael Natterer  <mitch@gimp.org>

	* plug-ins/FractalExplorer/Dialogs.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/curve_bend.c
	* plug-ins/common/gqbist.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/flame/flame.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gimpressionist/brush.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/imagemap/imap_browse.c: more file selections on the
	right screen.
This commit is contained in:
Michael Natterer 2003-11-09 22:44:45 +00:00 committed by Michael Natterer
parent 9b6f0cd324
commit dfa405eff3
11 changed files with 154 additions and 84 deletions

View File

@ -1,3 +1,17 @@
2003-11-09 Michael Natterer <mitch@gimp.org>
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/curve_bend.c
* plug-ins/common/gqbist.c
* plug-ins/common/spheredesigner.c
* plug-ins/flame/flame.c
* plug-ins/gfig/gfig.c
* plug-ins/gimpressionist/brush.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/imagemap/imap_browse.c: more file selections on the
right screen.
2003-11-09 Michael Natterer <mitch@gimp.org>
* app/gui/file-commands.[ch]

View File

@ -72,10 +72,13 @@ static explorer_vals_t standardvals =
*********************************************************************/
static void load_file_selection_ok (GtkWidget *widget,
GtkFileSelection *fs,
gpointer data);
static void create_load_file_selection (void);
static void create_file_selection (void);
GtkFileSelection *fs);
static void file_selection_ok (GtkWidget *widget,
GtkFileSelection *fs);
static void create_load_file_selection (GtkWidget *widget,
GtkWidget *dialog);
static void create_file_selection (GtkWidget *widget,
GtkWidget *dialog);
static void explorer_logo_dialog (GtkWidget *parent);
@ -1820,8 +1823,7 @@ save_callback (void)
static void
file_selection_ok (GtkWidget *w,
GtkFileSelection *fs,
gpointer data)
GtkFileSelection *fs)
{
const gchar *filenamebuf;
@ -1848,8 +1850,7 @@ file_selection_ok (GtkWidget *w,
static void
load_file_selection_ok (GtkWidget *w,
GtkFileSelection *fs,
gpointer data)
GtkFileSelection *fs)
{
filename =
g_strdup (gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
@ -1867,7 +1868,8 @@ load_file_selection_ok (GtkWidget *w,
}
static void
create_load_file_selection (void)
create_load_file_selection (GtkWidget *widget,
GtkWidget *dialog)
{
static GtkWidget *window = NULL;
@ -1876,12 +1878,13 @@ create_load_file_selection (void)
window = gtk_file_selection_new (_("Load Fractal Parameters"));
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_NONE);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (dialog));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
g_signal_connect (GTK_FILE_SELECTION (window)->ok_button,
"clicked",
g_signal_connect (GTK_FILE_SELECTION (window)->ok_button, "clicked",
G_CALLBACK (load_file_selection_ok),
window);
@ -1895,7 +1898,8 @@ create_load_file_selection (void)
}
static void
create_file_selection (void)
create_file_selection (GtkWidget *widget,
GtkWidget *dialog)
{
static GtkWidget *window = NULL;
@ -1904,12 +1908,13 @@ create_file_selection (void)
window = gtk_file_selection_new (_("Save Fractal Parameters"));
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_NONE);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (dialog));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
g_signal_connect (GTK_FILE_SELECTION (window)->ok_button,
"clicked",
g_signal_connect (GTK_FILE_SELECTION (window)->ok_button, "clicked",
G_CALLBACK (file_selection_ok),
window);

View File

@ -372,7 +372,8 @@ static void CML_save_to_file_callback (GtkWidget *widget,
gpointer data);
static void CML_execute_save_to_file (GtkWidget *widget,
gpointer data);
static gint force_overwrite (const gchar *filename);
static gint force_overwrite (const gchar *filename,
GtkWidget *parent);
static void CML_preview_update_callback (GtkWidget *widget,
gpointer data);
@ -1875,7 +1876,7 @@ function_graph_new (GtkWidget *widget,
CML_PARAM *param = (CML_PARAM *) *((gpointer *) data + 1);
dlg = gimp_dialog_new (_("Graph of the current settings"), "cml_explorer",
NULL, 0,
gtk_widget_get_toplevel (widget), 0,
gimp_standard_help_func, "filters/cml_explorer.html",
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -2049,7 +2050,9 @@ CML_save_to_file_callback (GtkWidget *widget,
if (!filesel)
{
filesel = gtk_file_selection_new (_("Save Parameters to"));
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (filesel),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
"clicked",
@ -2112,7 +2115,7 @@ CML_execute_save_to_file (GtkWidget *widget,
{
gtk_widget_set_sensitive (GTK_WIDGET (data), FALSE);
if (! force_overwrite (filename))
if (! force_overwrite (filename, gtk_widget_get_toplevel (widget)))
{
gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);
return;
@ -2189,7 +2192,8 @@ CML_execute_save_to_file (GtkWidget *widget,
}
static gint
force_overwrite (const gchar *filename)
force_overwrite (const gchar *filename,
GtkWidget *parent)
{
GtkWidget *dlg;
GtkWidget *label;
@ -2198,7 +2202,7 @@ force_overwrite (const gchar *filename)
gboolean overwrite;
dlg = gimp_dialog_new (_("CML File Operation Warning"), "cml_explorer",
NULL, 0,
parent, 0,
gimp_standard_help_func, "filters/cml_explorer.html",
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@ -2239,7 +2243,8 @@ CML_load_from_file_callback (GtkWidget *widget,
{
filesel = gtk_file_selection_new ("");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (filesel),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
"clicked",

View File

@ -2022,7 +2022,9 @@ bender_load_callback (GtkWidget *w,
filesel = gtk_file_selection_new ( _("Load Curve Points from file"));
cd->filesel = filesel;
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (filesel),
GTK_WINDOW (gtk_widget_get_toplevel (w)));
g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
"clicked",
G_CALLBACK (p_points_load_from_file),
@ -2054,7 +2056,9 @@ bender_save_callback (GtkWidget *w,
filesel = gtk_file_selection_new ( _("Save Curve Points to file"));
cd->filesel = filesel;
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (filesel),
GTK_WINDOW (gtk_widget_get_toplevel (w)));
g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
"clicked",
G_CALLBACK (p_points_save_to_file),

View File

@ -733,6 +733,9 @@ dialog_load (GtkWidget *widget,
file_select = gtk_file_selection_new (_("Load QBE file..."));
gtk_window_set_transient_for (GTK_WINDOW (file_select),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/gqbist.html", NULL);
@ -760,6 +763,9 @@ dialog_save (GtkWidget *widget,
file_select =
gtk_file_selection_new (_("Save (middle transform) as QBE file..."));
gtk_window_set_transient_for (GTK_WINDOW (file_select),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/gqbist.html", NULL);

View File

@ -296,16 +296,24 @@ struct
settings = { 1, 1, 1 };
static inline void vset (GimpVector4 *v, gdouble a, gdouble b, gdouble c);
static inline void vset (GimpVector4 *v,
gdouble a,
gdouble b,
gdouble c);
static void restartrender (void);
static void drawcolor1 (GtkWidget *widget);
static void drawcolor2 (GtkWidget *widget);
static void render (void);
static void realrender (GimpDrawable *drawable);
static void fileselect (gint);
static gint traceray (ray * r, GimpVector4 * col, gint level,
static void fileselect (gint action,
GtkWidget *parent);
static gint traceray (ray *r,
GimpVector4 *col,
gint level,
gdouble imp);
static gdouble turbulence (gdouble *point, gdouble lofreq, gdouble hifreq);
static gdouble turbulence (gdouble *point,
gdouble lofreq,
gdouble hifreq);
#define COLORBUTTONWIDTH 30
@ -2114,19 +2122,22 @@ savepreset_ok (GtkWidget *widget,
}
static void
loadpreset (void)
loadpreset (GtkWidget *widget,
GtkWidget *parent)
{
fileselect (0);
fileselect (0, parent);
}
static void
savepreset (void)
savepreset (GtkWidget *widget,
GtkWidget *parent)
{
fileselect (1);
fileselect (1, parent);
}
static void
fileselect (gint action)
fileselect (gint action,
GtkWidget *parent)
{
static GtkWidget *windows[2] = { NULL, NULL };
@ -2136,8 +2147,9 @@ fileselect (gint action)
if (!windows[action])
{
windows[action] = gtk_file_selection_new (gettext (titles[action]));
gtk_window_set_position (GTK_WINDOW (windows[action]),
GTK_WIN_POS_MOUSE);
gtk_window_set_transient_for (GTK_WINDOW (windows[action]),
GTK_WINDOW (parent));
g_signal_connect (windows[action], "destroy",
G_CALLBACK (gtk_widget_destroy), &windows[action]);
@ -2564,16 +2576,20 @@ makewindow (void)
button = gtk_button_new_from_stock (GTK_STOCK_OPEN);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (loadpreset), NULL);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (loadpreset),
window);
button = gtk_button_new_from_stock (GTK_STOCK_SAVE);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (savepreset), NULL);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (savepreset),
window);
frame = gtk_frame_new (_("Texture Properties"));
gtk_table_attach (GTK_TABLE (table), frame, 2, 3, 0, 3,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);

View File

@ -454,21 +454,21 @@ file_ok_callback (GtkWidget *widget,
}
static void
make_file_dlg (void)
make_file_dlg (GtkWidget *parent)
{
file_dlg = gtk_file_selection_new (NULL);
gtk_quit_add_destroy (1, GTK_OBJECT (file_dlg));
gtk_window_set_transient_for (GTK_WINDOW (file_dlg), GTK_WINDOW (parent));
gtk_window_set_destroy_with_parent (GTK_WINDOW (file_dlg), TRUE);
gtk_window_set_position (GTK_WINDOW (file_dlg), GTK_WIN_POS_MOUSE);
g_signal_connect_swapped (file_dlg, "delete_event",
G_CALLBACK (file_cancel_callback),
file_dlg);
g_signal_connect (GTK_FILE_SELECTION (file_dlg)->ok_button,
"clicked",
g_signal_connect (GTK_FILE_SELECTION (file_dlg)->ok_button, "clicked",
G_CALLBACK (file_ok_callback),
file_dlg);
g_signal_connect_swapped
(GTK_FILE_SELECTION (file_dlg)->cancel_button,
g_signal_connect_swapped (GTK_FILE_SELECTION (file_dlg)->cancel_button,
"clicked",
G_CALLBACK (file_cancel_callback),
file_dlg);
@ -744,7 +744,7 @@ load_callback (GtkWidget *widget,
{
if (! file_dlg)
{
make_file_dlg ();
make_file_dlg (gtk_widget_get_toplevel (widget));
}
else
{
@ -766,7 +766,7 @@ save_callback (GtkWidget *widget,
{
if (!file_dlg)
{
make_file_dlg ();
make_file_dlg (gtk_widget_get_toplevel (widget));
}
else
{

View File

@ -1149,13 +1149,16 @@ file_selection_ok (GtkWidget *w,
static void
create_file_selection (GFigObj *obj,
gchar *tpath)
gchar *tpath,
GtkWidget *parent)
{
static GtkWidget *window = NULL;
if (!window)
{
window = gtk_file_selection_new (_("Save Gfig Drawing"));
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent));
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
g_signal_connect (window, "destroy",
@ -1203,12 +1206,12 @@ create_file_selection (GFigObj *obj,
}
static void
gfig_save (void)
gfig_save (GtkWidget *parent)
{
/* Save the current object */
if (!current_obj->filename)
{
create_file_selection (current_obj, NULL);
create_file_selection (current_obj, NULL, parent);
return;
}
gfig_save_callbk ();
@ -3445,7 +3448,7 @@ gfig_response (GtkWidget *widget,
break;
case RESPONSE_SAVE:
gfig_save (); /* Save current object */
gfig_save (widget); /* Save current object */
break;
case GTK_RESPONSE_CLOSE:
@ -3965,6 +3968,9 @@ load_button_callback (GtkWidget *widget,
/* Load a single object */
window = gtk_file_selection_new (_("Load Gfig object collection"));
gtk_window_set_transient_for (GTK_WINDOW (window),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
g_signal_connect (window, "destroy",
@ -4560,7 +4566,7 @@ gfig_save_menu_callback (GtkWidget *widget,
current_obj = gfig_obj_for_menu;
gfig_save (); /* Save current object */
gfig_save (GTK_WIDGET (data)); /* Save current object */
current_obj = real_current;
}
@ -4576,7 +4582,8 @@ static void
gfig_rename_menu_callback (GtkWidget *widget,
gpointer data)
{
create_file_selection (gfig_obj_for_menu, gfig_obj_for_menu->filename);
create_file_selection (gfig_obj_for_menu, gfig_obj_for_menu->filename,
gtk_widget_get_toplevel (widget));
}
static void
@ -4623,7 +4630,7 @@ gfig_op_menu_create (GtkWidget *window)
g_signal_connect (menu_item, "activate",
G_CALLBACK (gfig_save_menu_callback),
NULL);
window);
#if 0
gtk_widget_install_accelerator (menu_item,

View File

@ -194,6 +194,9 @@ void savebrush(GtkWidget *wg, gpointer data)
sprintf(path, "%s/Brushes/", (char *)thispath->data);
window = gtk_file_selection_new( _("Save brush"));
gtk_window_set_transient_for (GTK_WINDOW (window),
GTK_WINDOW (gtk_widget_get_toplevel (wg)));
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_file_selection_set_filename (GTK_FILE_SELECTION (window), path);

View File

@ -2708,6 +2708,9 @@ ifs_compose_save (GtkWidget *parent)
{
file_select = gtk_file_selection_new (_("Save as IFS file"));
gtk_window_set_transient_for (GTK_WINDOW (file_select),
GTK_WINDOW (parent));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/ifscompose.html", NULL);
@ -2732,6 +2735,9 @@ ifs_compose_load (GtkWidget *parent)
{
file_select = gtk_file_selection_new (_("Load IFS file"));
gtk_window_set_transient_for (GTK_WINDOW (file_select),
GTK_WINDOW (parent));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/ifscompose.html", NULL);

View File

@ -60,6 +60,10 @@ browse_cb(GtkWidget *widget, gpointer data)
if (!browse->file_selection) {
GtkWidget *dialog;
dialog = browse->file_selection = gtk_file_selection_new(browse->name);
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
g_signal_connect_swapped(GTK_FILE_SELECTION(dialog)->cancel_button,
"clicked", G_CALLBACK(gtk_widget_hide), dialog);
g_signal_connect(GTK_FILE_SELECTION(dialog)->ok_button,