diff --git a/headers/libs/print/libprint/JobSetupDlg.h b/headers/libs/print/libprint/JobSetupDlg.h index f848afc7c8..561245100b 100644 --- a/headers/libs/print/libprint/JobSetupDlg.h +++ b/headers/libs/print/libprint/JobSetupDlg.h @@ -34,7 +34,7 @@ public: const PrinterCap* printerCap); virtual void AttachedToWindow(); virtual void MessageReceived(BMessage* message); - bool UpdateJobData(bool showPreview); + bool UpdateJobData(); private: void UpdateButtonEnabledState(); @@ -89,6 +89,7 @@ private: BRadioButton* fOddNumberedPages; BRadioButton* fEvenNumberedPages; std::map fDriverSpecificLists; + BCheckBox* fPreview; }; class JobSetupDlg : public DialogWindow { diff --git a/src/libs/print/libprint/JobSetupDlg.cpp b/src/libs/print/libprint/JobSetupDlg.cpp index 827dd9da61..b8806275c4 100644 --- a/src/libs/print/libprint/JobSetupDlg.cpp +++ b/src/libs/print/libprint/JobSetupDlg.cpp @@ -119,7 +119,6 @@ const BaseCap *gDitherTypes[] = { enum { kMsgRangeAll = 'JSdl', kMsgRangeSelection, - kMsgPreview, kMsgCancel, kMsgOK, kMsgQuality, @@ -318,13 +317,15 @@ JobSetupView::AttachedToWindow() fEvenNumberedPages = CreatePageSelectionItem("evenPages", "Even-Numbered Pages", JobData::kEvenNumberedPages); + fPreview = new BCheckBox("preview", "Show preview before printing", NULL); + if (fJobData->getShowPreview()) + fPreview->SetValue(B_CONTROL_ON); + // separator line BBox *separator = new BBox("separator"); separator->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 1)); // buttons - BButton* preview = new BButton("preview", "Preview" B_UTF8_ELLIPSIS, - new BMessage(kMsgPreview)); BButton* cancel = new BButton("cancel", "Cancel", new BMessage(kMsgCancel)); BButton* ok = new BButton("ok", "OK", new BMessage(kMsgOK)); @@ -418,12 +419,12 @@ JobSetupView::AttachedToWindow() .AddGlue() .End() .End() + .Add(fPreview) .AddGlue() .Add(separator) .AddGroup(B_HORIZONTAL, 10, 1.0f) .AddGlue() .Add(cancel) - .Add(preview) .Add(ok) .End() .SetInsets(0, 0, 0, 0) @@ -732,9 +733,9 @@ JobSetupView::PaperSource() } bool -JobSetupView::UpdateJobData(bool showPreview) +JobSetupView::UpdateJobData() { - fJobData->setShowPreview(showPreview); + fJobData->setShowPreview(fPreview->Value() == B_CONTROL_ON); fJobData->setColor(Color()); if (IsHalftoneConfigurationNeeded()) { fJobData->setGamma(Gamma()); @@ -820,8 +821,7 @@ JobSetupDlg::MessageReceived(BMessage* message) { switch (message->what) { case kMsgOK: - case kMsgPreview: - fJobSetup->UpdateJobData(message->what == kMsgPreview); + fJobSetup->UpdateJobData(); SetResult(B_NO_ERROR); PostMessage(B_QUIT_REQUESTED); break;