| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/printsupport/widgets/qcupsjobwidget.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | QCupsJobWidget::QCupsJobWidget(QWidget *parent) | - | ||||||||||||
| 5 | : QWidget(parent) | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | m_ui.setupUi(this); | - | ||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | initJobHold(); | - | ||||||||||||
| 11 | initJobBilling(); | - | ||||||||||||
| 12 | initJobPriority(); | - | ||||||||||||
| 13 | initBannerPages(); | - | ||||||||||||
| 14 | } never executed: end of block | 0 | ||||||||||||
| 15 | - | |||||||||||||
| 16 | QCupsJobWidget::~QCupsJobWidget() | - | ||||||||||||
| 17 | { | - | ||||||||||||
| 18 | } | - | ||||||||||||
| 19 | - | |||||||||||||
| 20 | void QCupsJobWidget::setPrinter(QPrinter *printer) | - | ||||||||||||
| 21 | { | - | ||||||||||||
| 22 | m_printer = printer; | - | ||||||||||||
| 23 | } never executed: end of block | 0 | ||||||||||||
| 24 | - | |||||||||||||
| 25 | void QCupsJobWidget::setupPrinter() | - | ||||||||||||
| 26 | { | - | ||||||||||||
| 27 | QCUPSSupport::setJobHold(m_printer, jobHold(), jobHoldTime()); | - | ||||||||||||
| 28 | QCUPSSupport::setJobBilling(m_printer, jobBilling()); | - | ||||||||||||
| 29 | QCUPSSupport::setJobPriority(m_printer, jobPriority()); | - | ||||||||||||
| 30 | QCUPSSupport::setBannerPages(m_printer, startBannerPage(), endBannerPage()); | - | ||||||||||||
| 31 | } never executed: end of block | 0 | ||||||||||||
| 32 | - | |||||||||||||
| 33 | void QCupsJobWidget::initJobHold() | - | ||||||||||||
| 34 | { | - | ||||||||||||
| 35 | m_ui.jobHoldComboBox->addItem(tr("Print Immediately"), QVariant::fromValue(QCUPSSupport::NoHold)); | - | ||||||||||||
| 36 | m_ui.jobHoldComboBox->addItem(tr("Hold Indefinitely"), QVariant::fromValue(QCUPSSupport::Indefinite)); | - | ||||||||||||
| 37 | m_ui.jobHoldComboBox->addItem(tr("Day (06:00 to 17:59)"), QVariant::fromValue(QCUPSSupport::DayTime)); | - | ||||||||||||
| 38 | m_ui.jobHoldComboBox->addItem(tr("Night (18:00 to 05:59)"), QVariant::fromValue(QCUPSSupport::Night)); | - | ||||||||||||
| 39 | m_ui.jobHoldComboBox->addItem(tr("Second Shift (16:00 to 23:59)"), QVariant::fromValue(QCUPSSupport::SecondShift)); | - | ||||||||||||
| 40 | m_ui.jobHoldComboBox->addItem(tr("Third Shift (00:00 to 07:59)"), QVariant::fromValue(QCUPSSupport::ThirdShift)); | - | ||||||||||||
| 41 | m_ui.jobHoldComboBox->addItem(tr("Weekend (Saturday to Sunday)"), QVariant::fromValue(QCUPSSupport::Weekend)); | - | ||||||||||||
| 42 | m_ui.jobHoldComboBox->addItem(tr("Specific Time"), QVariant::fromValue(QCUPSSupport::SpecificTime)); | - | ||||||||||||
| 43 | - | |||||||||||||
| 44 | connect(m_ui.jobHoldComboBox, qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "109"), this, qFlagLocation("1""toggleJobHoldTime()" "\0" __FILE__ ":" "109")); | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | setJobHold(QCUPSSupport::NoHold, QTime()); | - | ||||||||||||
| 47 | toggleJobHoldTime(); | - | ||||||||||||
| 48 | } never executed: end of block | 0 | ||||||||||||
| 49 | - | |||||||||||||
| 50 | void QCupsJobWidget::setJobHold(QCUPSSupport::JobHoldUntil jobHold, const QTime &holdUntilTime) | - | ||||||||||||
| 51 | { | - | ||||||||||||
| 52 | if (jobHold == QCUPSSupport::SpecificTime
| 0 | ||||||||||||
| 53 | jobHold = QCUPSSupport::NoHold; | - | ||||||||||||
| 54 | toggleJobHoldTime(); | - | ||||||||||||
| 55 | } never executed: end of block | 0 | ||||||||||||
| 56 | m_ui.jobHoldComboBox->setCurrentIndex(m_ui.jobHoldComboBox->findData(QVariant::fromValue(jobHold))); | - | ||||||||||||
| 57 | m_ui.jobHoldTimeEdit->setTime(holdUntilTime); | - | ||||||||||||
| 58 | } never executed: end of block | 0 | ||||||||||||
| 59 | - | |||||||||||||
| 60 | QCUPSSupport::JobHoldUntil QCupsJobWidget::jobHold() const | - | ||||||||||||
| 61 | { | - | ||||||||||||
| 62 | return never executed: m_ui.jobHoldComboBox->itemData(m_ui.jobHoldComboBox->currentIndex()).value<QCUPSSupport::JobHoldUntil>();return m_ui.jobHoldComboBox->itemData(m_ui.jobHoldComboBox->currentIndex()).value<QCUPSSupport::JobHoldUntil>();never executed: return m_ui.jobHoldComboBox->itemData(m_ui.jobHoldComboBox->currentIndex()).value<QCUPSSupport::JobHoldUntil>(); | 0 | ||||||||||||
| 63 | } | - | ||||||||||||
| 64 | - | |||||||||||||
| 65 | void QCupsJobWidget::toggleJobHoldTime() | - | ||||||||||||
| 66 | { | - | ||||||||||||
| 67 | if (jobHold() == QCUPSSupport::SpecificTime
| 0 | ||||||||||||
| 68 | m_ui.jobHoldTimeEdit->setEnabled(true); never executed: m_ui.jobHoldTimeEdit->setEnabled(true); | 0 | ||||||||||||
| 69 | else | - | ||||||||||||
| 70 | m_ui.jobHoldTimeEdit->setEnabled(false); never executed: m_ui.jobHoldTimeEdit->setEnabled(false); | 0 | ||||||||||||
| 71 | } | - | ||||||||||||
| 72 | - | |||||||||||||
| 73 | QTime QCupsJobWidget::jobHoldTime() const | - | ||||||||||||
| 74 | { | - | ||||||||||||
| 75 | return never executed: m_ui.jobHoldTimeEdit->time();return m_ui.jobHoldTimeEdit->time();never executed: return m_ui.jobHoldTimeEdit->time(); | 0 | ||||||||||||
| 76 | } | - | ||||||||||||
| 77 | - | |||||||||||||
| 78 | void QCupsJobWidget::initJobBilling() | - | ||||||||||||
| 79 | { | - | ||||||||||||
| 80 | setJobBilling(QString()); | - | ||||||||||||
| 81 | } never executed: end of block | 0 | ||||||||||||
| 82 | - | |||||||||||||
| 83 | void QCupsJobWidget::setJobBilling(const QString &jobBilling) | - | ||||||||||||
| 84 | { | - | ||||||||||||
| 85 | m_ui.jobBillingLineEdit->insert(jobBilling); | - | ||||||||||||
| 86 | } never executed: end of block | 0 | ||||||||||||
| 87 | - | |||||||||||||
| 88 | QString QCupsJobWidget::jobBilling() const | - | ||||||||||||
| 89 | { | - | ||||||||||||
| 90 | return never executed: m_ui.jobBillingLineEdit->text();return m_ui.jobBillingLineEdit->text();never executed: return m_ui.jobBillingLineEdit->text(); | 0 | ||||||||||||
| 91 | } | - | ||||||||||||
| 92 | - | |||||||||||||
| 93 | void QCupsJobWidget::initJobPriority() | - | ||||||||||||
| 94 | { | - | ||||||||||||
| 95 | setJobPriority(50); | - | ||||||||||||
| 96 | } never executed: end of block | 0 | ||||||||||||
| 97 | - | |||||||||||||
| 98 | void QCupsJobWidget::setJobPriority(int jobPriority) | - | ||||||||||||
| 99 | { | - | ||||||||||||
| 100 | m_ui.jobPrioritySpinBox->setValue(jobPriority); | - | ||||||||||||
| 101 | } never executed: end of block | 0 | ||||||||||||
| 102 | - | |||||||||||||
| 103 | int QCupsJobWidget::jobPriority() const | - | ||||||||||||
| 104 | { | - | ||||||||||||
| 105 | return never executed: m_ui.jobPrioritySpinBox->value();return m_ui.jobPrioritySpinBox->value();never executed: return m_ui.jobPrioritySpinBox->value(); | 0 | ||||||||||||
| 106 | } | - | ||||||||||||
| 107 | - | |||||||||||||
| 108 | void QCupsJobWidget::initBannerPages() | - | ||||||||||||
| 109 | { | - | ||||||||||||
| 110 | m_ui.startBannerPageCombo->addItem(tr("None", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::NoBanner)); | - | ||||||||||||
| 111 | m_ui.startBannerPageCombo->addItem(tr("Standard", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Standard)); | - | ||||||||||||
| 112 | m_ui.startBannerPageCombo->addItem(tr("Unclassified", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Unclassified)); | - | ||||||||||||
| 113 | m_ui.startBannerPageCombo->addItem(tr("Confidential", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Confidential)); | - | ||||||||||||
| 114 | m_ui.startBannerPageCombo->addItem(tr("Classified", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Classified)); | - | ||||||||||||
| 115 | m_ui.startBannerPageCombo->addItem(tr("Secret", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Secret)); | - | ||||||||||||
| 116 | m_ui.startBannerPageCombo->addItem(tr("Top Secret", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::TopSecret)); | - | ||||||||||||
| 117 | - | |||||||||||||
| 118 | m_ui.endBannerPageCombo->addItem(tr("None", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::NoBanner)); | - | ||||||||||||
| 119 | m_ui.endBannerPageCombo->addItem(tr("Standard", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Standard)); | - | ||||||||||||
| 120 | m_ui.endBannerPageCombo->addItem(tr("Unclassified", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Unclassified)); | - | ||||||||||||
| 121 | m_ui.endBannerPageCombo->addItem(tr("Confidential", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Confidential)); | - | ||||||||||||
| 122 | m_ui.endBannerPageCombo->addItem(tr("Classified", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Classified)); | - | ||||||||||||
| 123 | m_ui.endBannerPageCombo->addItem(tr("Secret", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::Secret)); | - | ||||||||||||
| 124 | m_ui.endBannerPageCombo->addItem(tr("Top Secret", "CUPS Banner page"), QVariant::fromValue(QCUPSSupport::TopSecret)); | - | ||||||||||||
| 125 | - | |||||||||||||
| 126 | setStartBannerPage(QCUPSSupport::NoBanner); | - | ||||||||||||
| 127 | setEndBannerPage(QCUPSSupport::NoBanner); | - | ||||||||||||
| 128 | } never executed: end of block | 0 | ||||||||||||
| 129 | - | |||||||||||||
| 130 | void QCupsJobWidget::setStartBannerPage(const QCUPSSupport::BannerPage bannerPage) | - | ||||||||||||
| 131 | { | - | ||||||||||||
| 132 | m_ui.startBannerPageCombo->setCurrentIndex(m_ui.startBannerPageCombo->findData(QVariant::fromValue(bannerPage))); | - | ||||||||||||
| 133 | } never executed: end of block | 0 | ||||||||||||
| 134 | - | |||||||||||||
| 135 | QCUPSSupport::BannerPage QCupsJobWidget::startBannerPage() const | - | ||||||||||||
| 136 | { | - | ||||||||||||
| 137 | return never executed: m_ui.startBannerPageCombo->itemData(m_ui.startBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();return m_ui.startBannerPageCombo->itemData(m_ui.startBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();never executed: return m_ui.startBannerPageCombo->itemData(m_ui.startBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>(); | 0 | ||||||||||||
| 138 | } | - | ||||||||||||
| 139 | - | |||||||||||||
| 140 | void QCupsJobWidget::setEndBannerPage(const QCUPSSupport::BannerPage bannerPage) | - | ||||||||||||
| 141 | { | - | ||||||||||||
| 142 | m_ui.endBannerPageCombo->setCurrentIndex(m_ui.endBannerPageCombo->findData(QVariant::fromValue(bannerPage))); | - | ||||||||||||
| 143 | } never executed: end of block | 0 | ||||||||||||
| 144 | - | |||||||||||||
| 145 | QCUPSSupport::BannerPage QCupsJobWidget::endBannerPage() const | - | ||||||||||||
| 146 | { | - | ||||||||||||
| 147 | return never executed: m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();never executed: return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>(); | 0 | ||||||||||||
| 148 | } | - | ||||||||||||
| 149 | - | |||||||||||||
| 150 | - | |||||||||||||
| 151 | - | |||||||||||||
| 152 | - | |||||||||||||
| Switch to Source code | Preprocessed file |