}
else {
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot do lookup while ripping."));
return;
if(DiscDBWriteDiscData(&(ginfo->disc),&(ginfo->ddata),NULL,TRUE,FALSE,
"utf-8")<0)
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error saving disc data."));
}
ginfo=(GripInfo *)data;
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot fast forward while ripping."));
return;
ginfo=(GripInfo *)data;
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot rewind while ripping."));
return;
ginfo=(GripInfo *)data;
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot switch discs while ripping."));
return;
LogStatus(ginfo,_("Eject disc\n"));
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot eject while ripping."));
return;
disc=&(ginfo->disc);
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot play while ripping."));
return;
void NextTrack(GripInfo *ginfo)
{
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot switch tracks while ripping."));
return;
}
static void PrevTrack(GripInfo *ginfo)
{
if(ginfo->ripping_a_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot switch tracks while ripping."));
return;
}
fd = mkstemp(filename);
if(fd == -1) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: Unable to create temporary file."));
return;
}
if(!efp) {
close(fd);
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: Unable to create temporary file."));
}
else {
if(DiscDBWriteDiscData(&(ginfo->disc),&(ginfo->ddata),efp,FALSE,
ginfo->db_use_freedb,ginfo->db_use_freedb?
"UTF-8":ginfo->discdb_encoding)<0) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: Unable to write disc data."));
fclose(efp);
}
#include "common.h"
#include "dialog.h"
+void DisplayWarningMsg(GtkWindow *window, char *msg)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new(window,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_CLOSE,
+ msg);
+ gtk_dialog_run(GTK_DIALOG (dialog));
+ gtk_widget_destroy(dialog);
+}
+
void DisplayErrorMsg(GtkWindow *window, char *msg)
{
GtkWidget *dialog;
*/
/* Message routines */
+void DisplayWarningMsg(GtkWindow *window, char *msg);
void DisplayErrorMsg(GtkWindow *window, char *msg);
void BoolDialog(char *question,char *yes,GtkSignalFunc yesfunc,
gpointer yesdata,
if(ginfo->have_disc) {
if(DiscDBWriteDiscData(&(ginfo->disc),&(ginfo->ddata),NULL,TRUE,FALSE,
"utf-8")<0)
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error saving disc data."));
}
- else gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ else DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("No disc present."));
}
ginfo=(GripInfo *)data;
if(!ginfo->have_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Cannot submit. No disc is present."));
return;
}
if(!ginfo->ddata.data_genre) {
- /* gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ /* DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Submission requires a genre other than 'unknown'."));*/
GetDiscDBGenre(ginfo);
}
if(!*ginfo->ddata.data_title) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("You must enter a disc title."));
return;
}
if(!*ginfo->ddata.data_artist) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("You must enter a disc artist."));
return;
/* Check if we have a dev release */
if(minor%2) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("This is a development version of Grip. If you encounter problems, you are encouraged to revert to the latest stable version."));
}
}
if(confret<0) {
/* Check if the config is out of date */
if(confret==-2) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Your config file is out of date -- "
"resetting to defaults.\n"
"You will need to re-configure Grip.\n"
g_snprintf(filename,256,"%s/%s",getenv("HOME"),ginfo->config_filename);
if(!SaveConfig(filename,"GRIP",2,cfg_entries))
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: Unable to save config file."));
SaveRipperConfig(ginfo,ginfo->selected_ripper);
ripper_defaults[ripcfg].name);
if(!SaveConfig(buf,"GRIP",2,rip_cfg_entries))
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: Unable to save ripper config."));
}
encoder_defaults[encodecfg].name);
if(!SaveConfig(buf,"GRIP",2,encode_cfg_entries))
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: Unable to save encoder config."));
}
fp=fopen(conv_str, "w");
if(fp==NULL) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Error: can't open m3u file."));
return FALSE;
}
ginfo=(GripInfo *)data;
if(!ginfo->have_disc) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("No disc was detected in the drive. If you have a disc in your drive, please check your CDRom device setting under Config->CD."));
return;
}
else ginfo->doencode=TRUE;
if(!ginfo->using_builtin_cdp&&!FileExists(ginfo->ripexename)) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Invalid rip executable.\nCheck your rip config, and ensure it specifies the full path to the ripper executable."));
ginfo->doencode=FALSE;
}
if(ginfo->doencode&&!FileExists(ginfo->mp3exename)) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Invalid encoder executable.\nCheck your encoder config, and ensure it specifies the full path to the encoder executable."));
ginfo->doencode=FALSE;
MakeDirs(ginfo->ripfile);
if(!CanWrite(ginfo->ripfile)) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("No write access to write wav file"));
return FALSE;
}
bytesleft=BytesLeftInFS(ginfo->ripfile);
if(bytesleft<(ginfo->ripsize*1.5)) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Out of space in output directory"));
return FALSE;
MakeDirs(ginfo->mp3file[cpu]);
if(!CanWrite(ginfo->mp3file[cpu])) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("No write access to write encoded file."));
return FALSE;
}
(gfloat)(ginfo->kbits_per_sec*1024)/600.0);
if(bytesleft<(ginfo->mp3size[cpu]*1.5)) {
- gnome_app_warning((GnomeApp *)ginfo->gui_info.app,
+ DisplayWarningMsg(GTK_WINDOW(ginfo->gui_info.app),
_("Out of space in output directory"));
return FALSE;