From: Hugo Villeneuve Date: Mon, 5 Sep 2011 15:49:20 +0000 (-0400) Subject: Replace gnome_ok_dialog() with Gtk dialog X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=1045f72c78b41cc886a49e6c822581c124c0459d;p=hvgrip.git Replace gnome_ok_dialog() with Gtk dialog --- diff --git a/src/dialog.c b/src/dialog.c index 02532b3..ece3f40 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -23,12 +23,21 @@ #include #include #include -#include + +#include "common.h" #include "dialog.h" -void DisplayMsg(char *msg) +void DisplayErrorMsg(GtkWindow *window, char *msg) { - gnome_ok_dialog(msg); + GtkWidget *dialog; + + dialog = gtk_message_dialog_new(window, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + msg); + gtk_dialog_run(GTK_DIALOG (dialog)); + gtk_widget_destroy(dialog); } void BoolDialog(char *question,char *yes,GtkSignalFunc yesfunc, diff --git a/src/dialog.h b/src/dialog.h index 1d9562f..2f29a4d 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -21,7 +21,7 @@ */ /* Message routines */ -void DisplayMsg(char *msg); +void DisplayErrorMsg(GtkWindow *window, char *msg); void BoolDialog(char *question,char *yes,GtkSignalFunc yesfunc, gpointer yesdata, char *no,GtkSignalFunc nofunc,gpointer nodata); diff --git a/src/grip.c b/src/grip.c index f475b74..4d817af 100644 --- a/src/grip.c +++ b/src/grip.c @@ -237,7 +237,7 @@ GtkWidget *GripNew(const gchar* geometry,char *device,char *scsi_device, if(!CDInitDevice(ginfo->cd_device,&(ginfo->disc))) { sprintf(buf,_("Error: Unable to initialize [%s]\n"),ginfo->cd_device); - DisplayMsg(buf); + DisplayErrorMsg(GTK_WINDOW(app), buf); } CDStat(&(ginfo->disc),TRUE);