[Dar-libdar_api] Callback functions in libdar
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Michael R. <mi...@da...> - 2005-08-10 04:16:19
|
Hi all,
I have a question I hope on of you can help me with:
First a piece of the source code:
/*
** Display a warning to the user in a GtkMessageDialog
** Input:
** void *: Gpointer to the main window
** GtkMessageType: The type of message dialog
** const gchar *: The message to display in the dialog
**
** Output:
** Cancel clicked: GTK_RESPONSE_CANCEL
** Ok clicked: GTK_RESPONSE_OK
*/
GtkResponseType ok_cancel_message(
void *mainwindow, GtkMessageType type, const gchar *msg)
{
GtkWidget *dialog;
GtkResponseType result;
=20
dialog =3D gtk_message_dialog_new (
(GtkWindow *) mainwindow,
(GtkDialogFlags) (GTK_DIALOG_DESTROY_WITH_PARENT |
GTK_DIALOG_MODAL),
type,
GTK_BUTTONS_OK_CANCEL,
msg);
result =3D (GtkResponseType) gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
return result;
}
bool answer_callback(const string &message, void *context)
{
GtkResponseType result;
=20
result =3D ok_cancel_message(context, GTK_MESSAGE_WARNING,
message.c_str());
if (result =3D=3D GTK_RESPONSE_OK)
return true;
else
throw Euser_abort(NULL);
}
The answer call back is called when slices exists and the
user has choosen to create a new backup set. The
ok_cancel_message is shown and if the user hits Ok the
creating of the backup set begin. Now comes the problem: all
though the gtk_widget_destroy(dialog) is called before
returning the call it is blocked until the creation of the
archive is finished. Does anyone have an idea how I can bypass
this state?
--=20
Hilsen/Regards
Michael Rasmussen
Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://keyserver.veridis.com:11371/pks/lookup?op=3Dget&search=3D0xD3C9A00E
mir <at> datanom <dot> net
http://keyserver.veridis.com:11371/pks/lookup?op=3Dget&search=3D0xE501F51C
mir <at> miras <dot> org
http://keyserver.veridis.com:11371/pks/lookup?op=3Dget&search=3D0xE3E80917
--------------------------------------------------------------
Tonight's the night: Sleep in a eucalyptus tree.
|