Commit cd4aabaa authored by Seth Burgess's avatar Seth Burgess

Fixed imap apply callback (from author)

 	ChangeLog
	plug-ins/imagemap/imap_default_dialog.c
 	plug-ins/imagemap/imap_edit_area_info.c
 	plug-ins/imagemap/imap_default_dialog.h
parent e9ada454
2000-06-06 Seth Burgess <sjburges@gimp.org>
* plug-ins/imagemap/imap_default_dialog.c
* plug-ins/imagemap/imap_edit_area_info.c
* plug-ins/imagemap/imap_default_dialog.h: Applied author's
(Maurits Rijk <lpeek.mrijk@consunet.nl>) patches to make apply
callback behave properly
2000-06-07 Tor Lillqvist <tml@iki.fi>
* Makefile.am: Add the build subdirectory (which contains a copy
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2000 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -45,7 +45,9 @@ static void
dialog_apply(GtkWidget *widget, gpointer data)
{
DefaultDialog_t *dialog = (DefaultDialog_t*) data;
if (dialog->ok_cb)
if (dialog->apply_cb)
dialog->apply_cb(dialog->apply_cb_data);
else if (dialog->ok_cb)
dialog->ok_cb(dialog->ok_cb_data);
}
......@@ -66,6 +68,15 @@ default_dialog_set_ok_cb(DefaultDialog_t *dialog, void (*ok_cb)(gpointer),
dialog->ok_cb_data = ok_cb_data;
}
void
default_dialog_set_apply_cb(DefaultDialog_t *dialog,
void (*apply_cb)(gpointer),
gpointer apply_cb_data)
{
dialog->apply_cb = apply_cb;
dialog->apply_cb_data = apply_cb_data;
}
void
default_dialog_set_cancel_cb(DefaultDialog_t *dialog,
void (*cancel_cb)(gpointer),
......@@ -82,6 +93,7 @@ make_default_dialog(const gchar *title)
GtkWidget *dialog, *hbbox;
data->ok_cb = NULL;
data->apply_cb = NULL;
data->cancel_cb = NULL;
data->dialog = dialog = gtk_dialog_new();
gtk_window_set_title(GTK_WINDOW(dialog), title);
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2000 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -34,6 +34,8 @@ typedef struct {
GtkWidget *help;
void (*ok_cb)(gpointer);
gpointer ok_cb_data;
void (*apply_cb)(gpointer);
gpointer apply_cb_data;
void (*cancel_cb)(gpointer);
gpointer cancel_cb_data;
} DefaultDialog_t;
......@@ -41,6 +43,9 @@ typedef struct {
DefaultDialog_t *make_default_dialog(const gchar *title);
void default_dialog_set_ok_cb(DefaultDialog_t *dialog, void (*ok_cb)(gpointer),
gpointer ok_cb_data);
void default_dialog_set_apply_cb(DefaultDialog_t *dialog,
void (*apply_cb)(gpointer),
gpointer apply_cb_data);
void default_dialog_set_cancel_cb(DefaultDialog_t *dialog,
void (*ok_cb)(gpointer),
gpointer ok_cb_data);
......
......@@ -3,7 +3,7 @@
*
* Generates clickable image maps.
*
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
* Copyright (C) 1998-2000 Maurits Rijk lpeek.mrijk@consunet.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -342,17 +342,11 @@ object_was_changed(AreaInfoDialog_t *dialog)
}
static void
edit_area_ok_cb(gpointer data)
edit_area_apply_cb(gpointer data)
{
AreaInfoDialog_t *param = (AreaInfoDialog_t*) data;
Object_t *obj = param->obj;
object_list_remove_geometry_cb(obj->list, param->geometry_cb_id);
/* Fix me: nasty hack */
if (param->add)
command_list_add(edit_object_command_new(obj));
object_set_url(obj, gtk_entry_get_text(GTK_ENTRY(param->url)));
object_set_target(obj, gtk_entry_get_text(GTK_ENTRY(param->target)));
object_set_comment(obj, gtk_entry_get_text(GTK_ENTRY(param->comment)));
......@@ -363,10 +357,25 @@ edit_area_ok_cb(gpointer data)
object_set_blur(obj, gtk_entry_get_text(GTK_ENTRY(param->blur)));
object_update(obj, param->infotab);
update_shape(obj);
object_unlock(obj);
if (object_was_changed(param))
redraw_preview();
}
static void
edit_area_ok_cb(gpointer data)
{
AreaInfoDialog_t *param = (AreaInfoDialog_t*) data;
Object_t *obj = param->obj;
object_list_remove_geometry_cb(obj->list, param->geometry_cb_id);
/* Fix me: nasty hack */
if (param->add)
command_list_add(edit_object_command_new(obj));
edit_area_apply_cb(data);
object_unlock(obj);
object_unref(param->clone);
}
......@@ -415,6 +424,7 @@ create_edit_area_info_dialog(Object_t *obj)
data->browse = NULL;
data->dialog = make_default_dialog(_("Area Settings"));
default_dialog_set_ok_cb(data->dialog, edit_area_ok_cb, data);
default_dialog_set_apply_cb(data->dialog, edit_area_apply_cb, data);
default_dialog_set_cancel_cb(data->dialog, edit_area_cancel_cb, data);
data->notebook = notebook = gtk_notebook_new();
......
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