void KMInstancePage::slotCopy() { KMTimer::self()->hold(); QString src = m_view->currentText(); if(!src.isEmpty()) { bool ok(false); QString name = KInputDialog::getText(i18n("Instance Name"), i18n("Enter name for new instance (leave untouched for default):"), i18n("(Default)"), &ok, this); if(ok) { if(name.find(QRegExp("[/\\s]")) != -1) KMessageBox::error(this, i18n("Instance name must not contain any spaces or slashes.")); else { if(src == i18n("(Default)")) src = QString::null; if(name == i18n("(Default)")) name = QString::null; KMFactory::self()->virtualManager()->copy(m_printer, src, name); setPrinter(m_printer); } } } KMTimer::self()->release(); }
void KMPropertyPage::reload() { clearPages(); m_widgets.clear(); initialize(); setPrinter(0); }
QT_BEGIN_NAMESPACE /*! \class QPageSetupDialog \brief The QPageSetupDialog class provides a configuration dialog for the page-related options on a printer. \ingroup standard-dialogs \ingroup printing \inmodule QtPrintSupport On Windows and \macos the page setup dialog is implemented using the native page setup dialogs. Note that on Windows and \macos custom paper sizes won't be reflected in the native page setup dialogs. Additionally, custom page margins set on a QPrinter won't show in the native \macos page setup dialog. \sa QPrinter, QPrintDialog */ /*! \fn QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent) Constructs a page setup dialog that configures \a printer with \a parent as the parent widget. */ /*! \fn QPageSetupDialog::~QPageSetupDialog() Destroys the page setup dialog. */ /*! \since 4.5 \fn QPageSetupDialog::QPageSetupDialog(QWidget *parent) Constructs a page setup dialog that configures a default-constructed QPrinter with \a parent as the parent widget. \sa printer() */ /*! \fn QPrinter *QPageSetupDialog::printer() Returns the printer that was passed to the QPageSetupDialog constructor. */ QPageSetupDialogPrivate::QPageSetupDialogPrivate(QPrinter *prntr) : printer(nullptr), ownsPrinter(false) { setPrinter(prntr); }
bool ORPrintRender::render(ORODocument * pDocument, ReportPrinter *printer) { setPrinter(printer); printer->setParams(pDocument->getPrinterParams()); printer->setPrinterType(pDocument->printerType()); setupPrinter(pDocument, printer); return render(pDocument); }
void KMInstancePage::slotDefault() { KMTimer::self()->hold(); QString src = m_view->currentText(); if(!src.isEmpty()) { if(src == i18n("(Default)")) src = QString::null; KMFactory::self()->virtualManager()->setAsDefault(m_printer, src); setPrinter(m_printer); } KMTimer::self()->release(true); }
PrintDialogController::PrintDialogController(QString symbol,QWidget *parent) { setSymbol(symbol); setPrinter(new QPrinter(QPrinter::HighResolution)); setSettings(new QSettings()); setDocumentService(new DocumentServices()); setSaveToPdf(false); setPrintReleated(false); setPrintAndSave(1); setPreferences(new SettingsPreferencesService()); setManager(new PrintManager()); setView(new PrintDialogView(parent,this)); directories(); restoreDefaultPrintPreferences(); }
void QPrintDialogPrivate::init() { Q_Q(QPrintDialog); numCopies = 1; if (_qt_print_dialog_creator) (*_qt_print_dialog_creator)(q); setupDestination(); setupPrinterSettings(); setupPaper(); setupOptions(); setPrinter(printer, true); q->installEventFilter(q); }
void KMInstancePage::slotRemove() { KMTimer::self()->hold(); bool reload(false); QString src = m_view->currentText(); QString msg = (src != i18n("(Default)") ? i18n("Do you really want to remove instance %1?") : i18n("You can't remove the default instance. However all settings of %1 will be discarded. Continue?")); if(!src.isEmpty() && KMessageBox::warningContinueCancel(this, msg.arg(src), QString::null, KStdGuiItem::del()) == KMessageBox::Continue) { if(src == i18n("(Default)")) src = QString::null; reload = KMFactory::self()->virtualManager()->isDefault(m_printer, src); KMFactory::self()->virtualManager()->remove(m_printer, src); setPrinter(m_printer); } KMTimer::self()->release(reload); }
void KMListView::setPrinter(KMPrinter *p) { setPrinter(p ? p->name() : TQString::null); }
void KMJobViewer::setPrinter(KMPrinter *p) { setPrinter((p ? p->printerName() : QString::null)); }
void KMPropWidget::setPrinterBase(KMPrinter *p) { m_printer = p; setPrinter(p); }