avoids using a BAlert when no be_app is available

it avoids crashing but console apps using a BApplication still show an alert
we might want to keep only a stderr warning


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13979 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2005-08-19 08:50:26 +00:00
parent 851028d043
commit 31ac1cfb0b
1 changed files with 12 additions and 3 deletions

View File

@ -924,7 +924,10 @@ Compress(BPositionIO *in, BPositionIO *out)
}
default:
{
(new BAlert("Wrong type", "Color space not implemented.", "Quit"))->Go();
if (be_app)
(new BAlert("Wrong type", "Color space not implemented.", "Quit"))->Go();
else
fprintf(stderr, "Wrong type: Color space not implemented.\n");
return B_ERROR;
}
}
@ -1056,7 +1059,10 @@ Decompress(BPositionIO *in, BPositionIO *out)
switch (cinfo.out_color_space)
{
case JCS_UNKNOWN: /* error/unspecified */
(new BAlert("From Type", "Jpeg uses unknown color type", "Quit"))->Go();
if (be_app)
(new BAlert("From Type", "Jpeg uses unknown color type", "Quit"))->Go();
else
fprintf(stderr, "From Type: Jpeg uses unknown color type\n");
break;
case JCS_GRAYSCALE: /* monochrome */
// Check if user wants to read only as RGB32 or not
@ -1088,7 +1094,10 @@ Decompress(BPositionIO *in, BPositionIO *out)
converter = convert_from_CMYK_to_32;
break;
default:
(new BAlert("From Type", "Jpeg uses hmm... i don't know really :(", "Quit"))->Go();
if (be_app)
(new BAlert("From Type", "Jpeg uses hmm... i don't know really :(", "Quit"))->Go();
else
fprintf(stderr, "From Type: Jpeg uses hmm... i don't know really :(\n");
break;
}
}