Changeset View
Changeset View
Standalone View
Standalone View
mainWindow/kpMainWindow_File.cpp
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | |||||
102 | #endif | 102 | #endif | ||
103 | 103 | | |||
104 | d->actionSave = KStandardAction::save (this, SLOT (slotSave()), ac); | 104 | d->actionSave = KStandardAction::save (this, SLOT (slotSave()), ac); | ||
105 | d->actionSaveAs = KStandardAction::saveAs (this, SLOT (slotSaveAs()), ac); | 105 | d->actionSaveAs = KStandardAction::saveAs (this, SLOT (slotSaveAs()), ac); | ||
106 | 106 | | |||
107 | d->actionExport = ac->addAction("file_export"); | 107 | d->actionExport = ac->addAction("file_export"); | ||
108 | d->actionExport->setText (i18n ("E&xport...")); | 108 | d->actionExport->setText (i18n ("E&xport...")); | ||
109 | d->actionExport->setIcon(KDE::icon("document-export")); | 109 | d->actionExport->setIcon(KDE::icon("document-export")); | ||
110 | connect(d->actionExport, SIGNAL(triggered(bool)), SLOT (slotExport())); | 110 | connect (d->actionExport, &QAction::triggered, this, &kpMainWindow::slotExport); | ||
111 | 111 | | |||
112 | d->actionScan = ac->addAction("file_scan"); | 112 | d->actionScan = ac->addAction("file_scan"); | ||
113 | d->actionScan->setText(i18n ("Scan...")); | 113 | d->actionScan->setText(i18n ("Scan...")); | ||
114 | d->actionScan->setIcon(SmallIcon("scanner")); | 114 | d->actionScan->setIcon(SmallIcon("scanner")); | ||
115 | #if HAVE_KSANE | 115 | #if HAVE_KSANE | ||
116 | connect(d->actionScan, SIGNAL(triggered(bool)), SLOT(slotScan())); | 116 | connect (d->actionScan, &QAction::triggered, this, &kpMainWindow::slotScan); | ||
117 | #else | 117 | #else | ||
118 | d->actionScan->setEnabled(false); | 118 | d->actionScan->setEnabled(false); | ||
119 | #endif // HAVE_KSANE | 119 | #endif // HAVE_KSANE | ||
120 | 120 | | |||
121 | d->actionScreenshot = ac->addAction("file_screenshot"); | 121 | d->actionScreenshot = ac->addAction("file_screenshot"); | ||
122 | d->actionScreenshot->setText(i18n("Acquire Screenshot")); | 122 | d->actionScreenshot->setText(i18n("Acquire Screenshot")); | ||
123 | connect(d->actionScreenshot, SIGNAL(triggered(bool)), SLOT(slotScreenshot())); | 123 | connect (d->actionScreenshot, &QAction::triggered, this, &kpMainWindow::slotScreenshot); | ||
124 | 124 | | |||
125 | d->actionProperties = ac->addAction ("file_properties"); | 125 | d->actionProperties = ac->addAction ("file_properties"); | ||
126 | d->actionProperties->setText (i18n ("Properties")); | 126 | d->actionProperties->setText (i18n ("Properties")); | ||
127 | d->actionProperties->setIcon(KDE::icon("document-properties")); | 127 | d->actionProperties->setIcon(KDE::icon("document-properties")); | ||
128 | connect (d->actionProperties, SIGNAL (triggered(bool)), SLOT (slotProperties())); | 128 | connect (d->actionProperties, &QAction::triggered, this, &kpMainWindow::slotProperties); | ||
129 | 129 | | |||
130 | //d->actionRevert = KStandardAction::revert (this, SLOT (slotRevert()), ac); | 130 | //d->actionRevert = KStandardAction::revert (this, SLOT (slotRevert()), ac); | ||
131 | d->actionReload = ac->addAction ("file_revert"); | 131 | d->actionReload = ac->addAction ("file_revert"); | ||
132 | d->actionReload->setText (i18n ("Reloa&d")); | 132 | d->actionReload->setText (i18n ("Reloa&d")); | ||
133 | d->actionReload->setIcon(KDE::icon("view-refresh")); | 133 | d->actionReload->setIcon(KDE::icon("view-refresh")); | ||
134 | connect(d->actionReload, SIGNAL(triggered(bool)), SLOT (slotReload())); | 134 | connect (d->actionReload, &QAction::triggered, this, &kpMainWindow::slotReload); | ||
135 | ac->setDefaultShortcuts (d->actionReload, KStandardShortcut::reload ()); | 135 | ac->setDefaultShortcuts (d->actionReload, KStandardShortcut::reload ()); | ||
136 | slotEnableReload (); | 136 | slotEnableReload (); | ||
137 | 137 | | |||
138 | d->actionPrint = KStandardAction::print (this, SLOT (slotPrint()), ac); | 138 | d->actionPrint = KStandardAction::print (this, SLOT (slotPrint()), ac); | ||
139 | d->actionPrintPreview = KStandardAction::printPreview (this, SLOT (slotPrintPreview()), ac); | 139 | d->actionPrintPreview = KStandardAction::printPreview (this, SLOT (slotPrintPreview()), ac); | ||
140 | 140 | | |||
141 | d->actionMail = KStandardAction::mail (this, SLOT (slotMail()), ac); | 141 | d->actionMail = KStandardAction::mail (this, SLOT (slotMail()), ac); | ||
142 | 142 | | |||
▲ Show 20 Lines • Show All 408 Lines • ▼ Show 20 Line(s) | 550 | KMessageBox::sorry (this, | |||
551 | i18n("Failed to open scanning dialog."), | 551 | i18n("Failed to open scanning dialog."), | ||
552 | i18nc("@title:window", "Scanning Failed")); | 552 | i18nc("@title:window", "Scanning Failed")); | ||
553 | return; | 553 | return; | ||
554 | } | 554 | } | ||
555 | 555 | | |||
556 | #if DEBUG_KP_MAIN_WINDOW | 556 | #if DEBUG_KP_MAIN_WINDOW | ||
557 | qCDebug(kpLogMainWindow) << "\tcreated scanDialog=" << d->scanDialog; | 557 | qCDebug(kpLogMainWindow) << "\tcreated scanDialog=" << d->scanDialog; | ||
558 | #endif | 558 | #endif | ||
559 | connect (d->scanDialog, SIGNAL (finalImage(QImage,int)), | 559 | connect (d->scanDialog, &SaneDialog::finalImage, this, &kpMainWindow::slotScanned); | ||
560 | SLOT (slotScanned(QImage,int))); | | |||
561 | } | 560 | } | ||
562 | 561 | | |||
563 | 562 | | |||
564 | // If using OpenImagesInSameWindow mode, ask whether to close the | 563 | // If using OpenImagesInSameWindow mode, ask whether to close the | ||
565 | // current document. | 564 | // current document. | ||
566 | // | 565 | // | ||
567 | // Do this after scan support is detected. Because if it's not, what | 566 | // Do this after scan support is detected. Because if it's not, what | ||
568 | // would be the point of closing the document? | 567 | // would be the point of closing the document? | ||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | |||||
659 | 658 | | |||
660 | void kpMainWindow::slotScreenshot() | 659 | void kpMainWindow::slotScreenshot() | ||
661 | { | 660 | { | ||
662 | toolEndShape(); | 661 | toolEndShape(); | ||
663 | 662 | | |||
664 | QDialog *dialog = new QDialog(this); | 663 | QDialog *dialog = new QDialog(this); | ||
665 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | | 664 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | | ||
666 | QDialogButtonBox::Cancel, dialog); | 665 | QDialogButtonBox::Cancel, dialog); | ||
667 | connect (buttons, SIGNAL (accepted()), dialog, SLOT (accept())); | 666 | connect (buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept); | ||
668 | connect (buttons, SIGNAL (rejected()), dialog, SLOT (reject())); | 667 | connect (buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject); | ||
669 | 668 | | |||
670 | QLabel *label = new QLabel(i18n("Snapshot Delay")); | 669 | QLabel *label = new QLabel(i18n("Snapshot Delay")); | ||
671 | KPluralHandlingSpinBox *seconds = new KPluralHandlingSpinBox; | 670 | KPluralHandlingSpinBox *seconds = new KPluralHandlingSpinBox; | ||
672 | seconds->setRange(0, 99); | 671 | seconds->setRange(0, 99); | ||
673 | seconds->setSuffix(ki18np(" second", " seconds")); | 672 | seconds->setSuffix(ki18np(" second", " seconds")); | ||
674 | seconds->setSpecialValueText(i18n("No delay")); | 673 | seconds->setSpecialValueText(i18n("No delay")); | ||
675 | 674 | | |||
676 | QCheckBox *hideWindow = new QCheckBox(i18n("Hide Main Window")); | 675 | QCheckBox *hideWindow = new QCheckBox(i18n("Hide Main Window")); | ||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 889 | KFileDialog fd (QUrl (startURL), QString(), this, | |||
891 | saveOptionsWidget); | 890 | saveOptionsWidget); | ||
892 | saveOptionsWidget->setVisualParent (&fd); | 891 | saveOptionsWidget->setVisualParent (&fd); | ||
893 | fd.setWindowTitle (caption); | 892 | fd.setWindowTitle (caption); | ||
894 | fd.setOperationMode (KFileDialog::Saving); | 893 | fd.setOperationMode (KFileDialog::Saving); | ||
895 | fd.setMimeFilter (mimeTypes, fdSaveOptions.mimeType ()); | 894 | fd.setMimeFilter (mimeTypes, fdSaveOptions.mimeType ()); | ||
896 | if (localOnly) | 895 | if (localOnly) | ||
897 | fd.setMode (KFile::File | KFile::LocalOnly); | 896 | fd.setMode (KFile::File | KFile::LocalOnly); | ||
898 | 897 | | |||
899 | connect (&fd, SIGNAL (filterChanged(QString)), | 898 | connect (&fd, &KFileDialog::filterChanged, | ||
900 | saveOptionsWidget, SLOT (setMimeType(QString))); | 899 | saveOptionsWidget, &kpDocumentSaveOptionsWidget::setMimeType); | ||
901 | 900 | | |||
902 | if ( fd.exec() == QDialog::Accepted ) | 901 | if ( fd.exec() == QDialog::Accepted ) | ||
903 | { | 902 | { | ||
904 | kpDocumentSaveOptions newSaveOptions = saveOptionsWidget->documentSaveOptions (); | 903 | kpDocumentSaveOptions newSaveOptions = saveOptionsWidget->documentSaveOptions (); | ||
905 | #if DEBUG_KP_MAIN_WINDOW | 904 | #if DEBUG_KP_MAIN_WINDOW | ||
906 | newSaveOptions.printDebug ("\tnewSaveOptions"); | 905 | newSaveOptions.printDebug ("\tnewSaveOptions"); | ||
907 | #endif | 906 | #endif | ||
908 | 907 | | |||
▲ Show 20 Lines • Show All 609 Lines • Show Last 20 Lines |