Return success if print to file dialog has been canceled (so that print_server will delete spool file).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2528 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
822ea83244
commit
7af3c68cbf
@ -122,6 +122,9 @@ PrinterDriver::PrintJob
|
||||
if (OpenTransport() != B_OK) {
|
||||
return B_ERROR;
|
||||
}
|
||||
if (PrintToFileCanceled()) {
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
// read print file header
|
||||
fJobFile->Seek(0, SEEK_SET);
|
||||
@ -383,13 +386,6 @@ PrinterDriver::OpenTransport()
|
||||
delete msg;
|
||||
delete path;
|
||||
|
||||
// The BeOS "Print To File" transport returns a non-NULL BDataIO *
|
||||
// even after user filepanel cancellation!
|
||||
BFile* file = dynamic_cast<BFile*>(fTransport);
|
||||
if (file && file->InitCheck() != B_OK)
|
||||
// Quietly return
|
||||
return B_ERROR;
|
||||
|
||||
if (fTransport == 0) {
|
||||
BAlert *alert = new BAlert("Uh oh!", "Couldn't open transport.", "OK");
|
||||
alert->Go();
|
||||
@ -400,6 +396,17 @@ PrinterDriver::OpenTransport()
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------
|
||||
bool
|
||||
PrinterDriver::PrintToFileCanceled()
|
||||
{
|
||||
// The BeOS "Print To File" transport returns a non-NULL BDataIO *
|
||||
// even after user filepanel cancellation!
|
||||
BFile* file = dynamic_cast<BFile*>(fTransport);
|
||||
return file && file->InitCheck() != B_OK;
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------
|
||||
status_t
|
||||
PrinterDriver::CloseTransport()
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
// transport-related methods
|
||||
status_t OpenTransport();
|
||||
status_t CloseTransport();
|
||||
bool PrintToFileCanceled();
|
||||
|
||||
// accessors
|
||||
inline BFile *JobFile() { return fJobFile; }
|
||||
|
Loading…
Reference in New Issue
Block a user