Replace gnome_ok_dialog() with Gtk dialog
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 5 Sep 2011 15:49:20 +0000 (11:49 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Tue, 25 Mar 2014 03:27:04 +0000 (23:27 -0400)
src/dialog.c
src/dialog.h
src/grip.c

index 02532b3..ece3f40 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <gtk/gtk.h>
-#include <gnome.h>
+
+#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,
index 1d9562f..2f29a4d 100644 (file)
@@ -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);
index f475b74..4d817af 100644 (file)
@@ -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);