}
if(ginfo->ask_submit) {
- gnome_app_ok_cancel_modal
- ((GnomeApp *)uinfo->app,
+ DisplayOkCancelDialog(GTK_WINDOW(uinfo->app),
_("This disc has been found on your secondary server,\n"
"but not on your primary server.\n\n"
"Do you wish to submit this disc information?"),
ginfo->first_time=0;
}
-void SubmitEntry(gint reply,gpointer data)
+void SubmitEntry(gpointer data)
{
GripInfo *ginfo;
int fd;
char mailcmd[256];
char filename[256];
- if(reply) return;
-
ginfo=(GripInfo *)data;
sprintf(filename,"/tmp/grip.XXXXXX");
void ScanDisc(GtkWidget *widget,gpointer data);
void UpdateDisplay(GripInfo *ginfo);
void UpdateTracks(GripInfo *ginfo);
-void SubmitEntry(gint reply,gpointer data);
+void SubmitEntry(gpointer data);
void PlayTrackCB(GtkWidget *widget,gpointer data);
void StopPlayCB(GtkWidget *widget,gpointer data);
#include "common.h"
#include "dialog.h"
+void DisplayOkCancelDialog(GtkWindow *window, char *msg,
+ GripReplyCallback callback, gpointer data)
+{
+ GtkWidget *dialog;
+ gint response;
+
+ dialog = gtk_message_dialog_new(window,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_OK_CANCEL,
+ msg);
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+ if(response == GTK_RESPONSE_OK) {
+ callback(data);
+ }
+ gtk_widget_destroy(dialog);
+}
+
void DisplayWarningMsg(GtkWindow *window, char *msg)
{
GtkWidget *dialog;
*/
/* Message routines */
+
+typedef void (*GripReplyCallback)(gpointer data);
+
+void DisplayOkCancelDialog(GtkWindow *window, char *msg,
+ GripReplyCallback callback, gpointer data);
+
void DisplayWarningMsg(GtkWindow *window, char *msg);
void DisplayErrorMsg(GtkWindow *window, char *msg);
void BoolDialog(char *question,char *yes,GtkSignalFunc yesfunc,
len=strlen(ginfo->discdb_submit_email);
if(!strncasecmp(ginfo->discdb_submit_email+(len-9),".cddb.com",9))
- gnome_app_ok_cancel_modal
- ((GnomeApp *)ginfo->gui_info.app,
+ DisplayOkCancelDialog(GTK_WINDOW(ginfo->gui_info.app),
_("You are about to submit this disc information\n"
"to a commercial CDDB server, which will then\n"
"own the data that you submit. These servers make\n"
"a profit out of your effort. We suggest that you\n"
"support free servers instead.\n\nContinue?"),
- (GnomeReplyCallback)SubmitEntry,(gpointer)ginfo);
+ SubmitEntry, (gpointer)ginfo);
else
- gnome_app_ok_cancel_modal
- ((GnomeApp *)ginfo->gui_info.app,
+ DisplayOkCancelDialog(GTK_WINDOW(ginfo->gui_info.app),
_("You are about to submit this\ndisc information via email.\n\n"
- "Continue?"),(GnomeReplyCallback)SubmitEntry,(gpointer)ginfo);
+ "Continue?"), SubmitEntry, (gpointer)ginfo);
}
/* Make the user pick a DiscDB genre on submit*/
#include "parsecfg.h"
#include "tray.h"
-static void ReallyDie(gint reply,gpointer data);
+static void ReallyDie(gpointer data);
static void MakeStatusPage(GripInfo *ginfo);
static void DoHelp(GtkWidget *widget,gpointer data);
static void MakeHelpPage(GripInfo *ginfo);
#ifndef GRIPCD
if(ginfo->ripping_a_disc || ginfo->encoding)
- gnome_app_ok_cancel_modal((GnomeApp *)ginfo->gui_info.app,
+ DisplayOkCancelDialog(GTK_WINDOW(ginfo->gui_info.app),
_("Work is in progress.\nReally shut down?"),
ReallyDie,(gpointer)ginfo);
- else ReallyDie(0,ginfo);
+ else ReallyDie(ginfo);
#else
- ReallyDie(0,ginfo);
+ ReallyDie(ginfo);
#endif
}
-static void ReallyDie(gint reply,gpointer data)
+static void ReallyDie(gpointer data)
{
GripInfo *ginfo;
- if(reply) return;
-
ginfo=(GripInfo *)data;
#ifndef GRIPCD
static void DoDiscFilter(GripInfo *ginfo);
static void RipIsFinished(GripInfo *ginfo,gboolean aborted);
static void CheckDupNames(GripInfo *ginfo);
-static void RipWholeCD(gint reply,gpointer data);
+static void RipWholeCD(gpointer data);
static int NextTrackToRip(GripInfo *ginfo);
static gboolean RipNextTrack(GripInfo *ginfo);
#ifdef CDPAR
}
if(NextTrackToRip(ginfo)==ginfo->disc.num_tracks) {
- gnome_app_ok_cancel_modal
- ((GnomeApp *)ginfo->gui_info.app,
+ DisplayOkCancelDialog(GTK_WINDOW(ginfo->gui_info.app),
_("No tracks selected.\nRip whole CD?\n"),
RipWholeCD,(gpointer)ginfo);
return;
}
}
-static void RipWholeCD(gint reply,gpointer data)
+static void RipWholeCD(gpointer data)
{
int track;
GripInfo *ginfo;
- if(reply) return;
-
Debug(_("Ripping whole CD\n"));
ginfo=(GripInfo *)data;