diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ # KDE Application Version, managed by release script set(KDE_APPLICATIONS_VERSION_MAJOR "18") -set(KDE_APPLICATIONS_VERSION_MINOR "08") -set(KDE_APPLICATIONS_VERSION_MICRO "0") +set(KDE_APPLICATIONS_VERSION_MINOR "11") +set(KDE_APPLICATIONS_VERSION_MICRO "70") set(KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") set(SPECTACLE_VERSION ${KDE_APPLICATIONS_VERSION}) # minimum requirements @@ -102,11 +102,7 @@ # fail build if none of the platform backends can be found if (NOT XCB_FOUND OR NOT XCB_COMPONENTS_FOUND) - message(FATAL_ERROR "No suitable backend platform was found. Currenty supported platforms are: XCB Components Required: ${XCB_COMPONENTS_ERRORS}") -endif() - -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_definitions("-Wno-mismatched-tags") + message(FATAL_ERROR "No suitable backend platform was found. Currently supported platforms are: XCB Components Required: ${XCB_COMPONENTS_ERRORS}") endif() # hand off to subdirectories diff --git a/desktop/org.kde.spectacle.appdata.xml b/desktop/org.kde.spectacle.appdata.xml --- a/desktop/org.kde.spectacle.appdata.xml +++ b/desktop/org.kde.spectacle.appdata.xml @@ -331,17 +331,21 @@ L'Spectacle després de prendre una captura de pantalla L'Spectacle després de prendre una captura de pantalla Spectacle po sejmutí obrazovky - Spectacle tras realizar una captura de pantalla + Spectacle nach der Aufnahme eines Bildschirmfotos + Spectacle after taking a screenshot + Spectacle tras realizar una captura Spectacle pantaila-argazki bat hartu ondoren Spectacle après une capture d'écran Spectacle dopo la cattura di una schermata + 스크린샷을 찍은 후 Spectacle 설정 Spectacle na nemen van een schermafdruk Spectacle etter å ha teke eit skjermbilete O Spectacle após capturar uma imagem O Spectacle após a captura de uma imagem Spectacle efter en skärmbild har tagits Spectacle після створення знімка xxSpectacle after taking a screenshotxx + 截图之后闪动 拍下螢幕快照後開啟 Spetacle http://kde.org/images/screenshots/spectacle.png diff --git a/doc/index.docbook b/doc/index.docbook --- a/doc/index.docbook +++ b/doc/index.docbook @@ -151,7 +151,7 @@ This mode does not immediately take a screenshot but allows you to draw a rectangle on your screen, which can be moved and resized as needed. Once the desired selection rectangle has been drawn, double-clicking anywhere on the screen, or pressing the &Enter; button on the keyboard will capture the screenshot. - You can use the arrow keys to move and adjust the rectangle. Pressing the arrow keys will move the rectangle. Holding the Shift key while pressing the arrow keys will move the rectangle slowly, for fine-tuning your selection. Holding the Alt key while pressing the arrow keys will adjust the size of the rectangle. + You can use the arrow keys to move and adjust the rectangle. Pressing the arrow keys will move the rectangle. Holding the &Shift; key while pressing the arrow keys will move the rectangle slowly, for fine-tuning your selection. Holding the &Alt; key while pressing the arrow keys will adjust the size of the rectangle. @@ -231,7 +231,7 @@ - Copy To Clipboard + Copy to Clipboard Copies the current screenshot to the clipboard. You can also use the &Ctrl;C keyboard shortcut for this. diff --git a/src/ExportManager.cpp b/src/ExportManager.cpp --- a/src/ExportManager.cpp +++ b/src/ExportManager.cpp @@ -170,11 +170,8 @@ QString ExportManager::makeAutosaveFilename() { - KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("spectaclerc")); - KConfigGroup generalConfig = KConfigGroup(config, "General"); - const QDateTime timestamp = QDateTime::currentDateTime(); - QString baseName = generalConfig.readEntry("save-filename-format", "Screenshot_%Y%M%D_%H%m%S"); + QString baseName = SpectacleConfig::instance()->autoSaveFilenameFormat(); QString title; @@ -208,7 +205,7 @@ } if (result.isEmpty()) { - result = QStringLiteral("Screenshot"); + result = SpectacleConfig::instance()->defaultFilename(); } return truncatedFilename(result); } diff --git a/src/Gui/KSMainWindow.cpp b/src/Gui/KSMainWindow.cpp --- a/src/Gui/KSMainWindow.cpp +++ b/src/Gui/KSMainWindow.cpp @@ -150,7 +150,7 @@ mDialogButtonBox->addButton(mSendToButton, QDialogButtonBox::ActionRole); mClipboardButton->setDefaultAction(KStandardAction::copy(this, SLOT(sendToClipboard()), this)); - mClipboardButton->setText(i18n("Copy To Clipboard")); + mClipboardButton->setText(i18n("Copy to Clipboard")); mClipboardButton->setToolTip(i18n("Copy the current screenshot image to the clipboard.")); mClipboardButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mDialogButtonBox->addButton(mClipboardButton, QDialogButtonBox::ActionRole); @@ -239,6 +239,7 @@ { switch (SpectacleConfig::instance()->lastUsedSaveMode()) { case SaveMode::SaveAs: + default: mSaveButton->setDefaultAction(mSaveAsAction); break; case SaveMode::Save: @@ -304,6 +305,7 @@ location = QUrl::fromLocalFile(ExportManager::instance()->saveLocation() + QStringLiteral("/")); break; case SaveMode::SaveAs: + default: location = SpectacleConfig::instance()->lastSaveAsLocation(); // already has a "/" at the end break; } @@ -339,6 +341,9 @@ case KMessageWidget::Error: mMessageWidget->setIcon(QIcon::fromTheme(QStringLiteral("dialog-error"))); break; + case KMessageWidget::Warning: + mMessageWidget->setIcon(QIcon::fromTheme(QStringLiteral("dialog-warning"))); + break; case KMessageWidget::Positive: mMessageWidget->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok-apply"))); break; diff --git a/src/Gui/KSWidget.cpp b/src/Gui/KSWidget.cpp --- a/src/Gui/KSWidget.cpp +++ b/src/Gui/KSWidget.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -225,8 +226,16 @@ mWindowDecorations->setEnabled(true); mCaptureTransientOnly->setEnabled(false); break; - default: + case ImageGrabber::FullScreen: + case ImageGrabber::CurrentScreen: + case ImageGrabber::RectangularRegion: mWindowDecorations->setEnabled(false); mCaptureTransientOnly->setEnabled(false); + break; + case ImageGrabber::TransientWithParent: + case ImageGrabber::InvalidChoice: + default: + qWarning() << "Skipping invalid or unreachable enum value"; + break; } } diff --git a/src/Gui/SettingsDialog/SaveOptionsPage.cpp b/src/Gui/SettingsDialog/SaveOptionsPage.cpp --- a/src/Gui/SettingsDialog/SaveOptionsPage.cpp +++ b/src/Gui/SettingsDialog/SaveOptionsPage.cpp @@ -90,7 +90,7 @@ // now the save filename format layout - const QString helpText = i18n( + const QString helpText = i18nc("%1 is the default filename of a screenshot", "

You can use the following placeholders in the filename, which will be replaced " "with actual text when the file is saved:

" @@ -108,8 +108,9 @@ "

To save to a sub-folder, use slashes to describe the desired path, e.g.:

" "
" - "%Y/%M/Screenshot_%Y%M%D_%H%m%S" - "
" + "%Y/%M/%1" + "", + SpectacleConfig::instance()->defaultFilename() + SpectacleConfig::instance()->defaultTimestampTemplate() ); QLabel *fmtHelpText = new QLabel(helpText, this); diff --git a/src/KipiInterface/KSGKipiImageCollectionSelector.h b/src/KipiInterface/KSGKipiImageCollectionSelector.h --- a/src/KipiInterface/KSGKipiImageCollectionSelector.h +++ b/src/KipiInterface/KSGKipiImageCollectionSelector.h @@ -41,7 +41,7 @@ explicit KSGKipiImageCollectionSelector(KIPI::Interface *interface, QWidget *parent); ~KSGKipiImageCollectionSelector() Q_DECL_OVERRIDE; - QList selectedImageCollections() const; + QList selectedImageCollections() const Q_DECL_OVERRIDE; private: diff --git a/src/Main.cpp b/src/Main.cpp --- a/src/Main.cpp +++ b/src/Main.cpp @@ -131,6 +131,7 @@ app.setQuitOnLastWindowClosed(false); break; case SpectacleCore::GuiMode: + default: break; } diff --git a/src/PlatformBackends/X11ImageGrabber.cpp b/src/PlatformBackends/X11ImageGrabber.cpp --- a/src/PlatformBackends/X11ImageGrabber.cpp +++ b/src/PlatformBackends/X11ImageGrabber.cpp @@ -39,7 +39,6 @@ #include #include -#include #include #include diff --git a/src/QuickEditor/EditorRoot.qml b/src/QuickEditor/EditorRoot.qml --- a/src/QuickEditor/EditorRoot.qml +++ b/src/QuickEditor/EditorRoot.qml @@ -443,8 +443,7 @@ TextLabel { id: midHelpTextElement; - text: i18n("Click anywhere to start drawing a selection rectangle,\n" + - "or press Esc to cancel."); + text: i18n("Click anywhere to start drawing a selection rectangle,\nor press Esc to cancel."); font.pixelSize: Qt.application.font.pixelSize * 1.2; anchors.centerIn: parent; @@ -480,15 +479,13 @@ text: i18n("Shift:"); Layout.alignment: Qt.AlignRight | Qt.AlignTop; } - TextLabel { text: i18n("Hold to toggle magnifier \n" + - "while dragging selection handles"); } + TextLabel { text: i18n("Hold to toggle magnifier\nwhile dragging selection handles"); } TextLabel { text: i18n("Arrow keys:"); Layout.alignment: Qt.AlignRight | Qt.AlignTop; } - TextLabel { text: i18n("Move selection rectangle \n" + - "Hold Alt to resize, Shift to fine-tune"); } + TextLabel { text: i18n("Move selection rectangle.\nHold Alt to resize, Shift to fine-tune"); } TextLabel { text: i18n("Right-click:"); diff --git a/src/QuickEditor/QuickEditor.h b/src/QuickEditor/QuickEditor.h --- a/src/QuickEditor/QuickEditor.h +++ b/src/QuickEditor/QuickEditor.h @@ -45,8 +45,8 @@ struct ImageStore; ImageStore *mImageStore; - struct QuickEditorPrivate; - Q_DECLARE_PRIVATE(QuickEditor); + class QuickEditorPrivate; + Q_DECLARE_PRIVATE(QuickEditor) QuickEditorPrivate *d_ptr; }; diff --git a/src/QuickEditor/QuickEditor.cpp b/src/QuickEditor/QuickEditor.cpp --- a/src/QuickEditor/QuickEditor.cpp +++ b/src/QuickEditor/QuickEditor.cpp @@ -56,8 +56,9 @@ QPixmap mPixmap; }; -struct QuickEditor::QuickEditorPrivate +class QuickEditor::QuickEditorPrivate { +public: KDeclarative::KDeclarative *mDecl; QQuickView *mQuickView; QQmlEngine *mQmlEngine; diff --git a/src/SpectacleConfig.h b/src/SpectacleConfig.h --- a/src/SpectacleConfig.h +++ b/src/SpectacleConfig.h @@ -42,6 +42,9 @@ static SpectacleConfig* instance(); + QString defaultFilename() const; + QString defaultTimestampTemplate() const; + private: explicit SpectacleConfig(QObject *parent = nullptr); diff --git a/src/SpectacleConfig.cpp b/src/SpectacleConfig.cpp --- a/src/SpectacleConfig.cpp +++ b/src/SpectacleConfig.cpp @@ -36,6 +36,17 @@ return &instance; } +QString SpectacleConfig::defaultFilename() const +{ + return QStringLiteral("Screenshot"); +} + +QString SpectacleConfig::defaultTimestampTemplate() const +{ + // includes separator at the front + return QStringLiteral("_%Y%M%D_%H%m%S"); +} + // lastSaveAsLocation QUrl SpectacleConfig::lastSaveAsLocation() const @@ -217,7 +228,7 @@ QString SpectacleConfig::autoSaveFilenameFormat() const { return mGeneralConfig.readEntry(QStringLiteral("save-filename-format"), - QStringLiteral("Screenshot_%Y%M%D_%H%m%S")); + QString(defaultFilename() + defaultTimestampTemplate())); } void SpectacleConfig::setAutoSaveFilenameFormat(const QString &format) diff --git a/src/SpectacleCore.cpp b/src/SpectacleCore.cpp --- a/src/SpectacleCore.cpp +++ b/src/SpectacleCore.cpp @@ -93,6 +93,7 @@ switch (startMode) { case DBusMode: + default: break; case BackgroundMode: { int msec = (KWindowSystem::compositingActive() ? 200 : 50) + delayMsec; @@ -186,6 +187,7 @@ switch (mStartMode) { case BackgroundMode: case DBusMode: + default: { if (mNotify) { connect(mExportManager, &ExportManager::imageSaved, this, &SpectacleCore::doNotify); @@ -215,6 +217,7 @@ emit allDone(); return; case DBusMode: + default: emit grabFailed(); emit allDone(); return; @@ -244,6 +247,7 @@ case ImageGrabber::GrabMode::RectangularRegion: notify->setTitle(i18nc("A rectangular region was captured, heading", "Rectangular Region Captured")); break; + case ImageGrabber::GrabMode::InvalidChoice: default: break; }