diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ WindowSystem DocTools Declarative + NewStuff ) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) diff --git a/doc/index.docbook b/doc/index.docbook --- a/doc/index.docbook +++ b/doc/index.docbook @@ -115,7 +115,7 @@ To save a screenshot to the default location, click on the arrow portion of the Save As... button and press the Save (&Ctrl;S) button. The new save mode will be remembered for next time; this behavior can be configured in Spectacle's settings. The default save location and filename can also be configured there, as described later. - To quickly save the image and quit &spectacle;, click on the checkbox beside Quit after Save or Copy, then click the arrow portion of the Save As... button and press the Save (&Ctrl;S) item. This saves the image as a PNG file in your default Pictures folder, and exits the application immediately. As above, this new save mode will be remembered. + To quickly save the image and quit &spectacle;, click on the arrow portion of the Save As... button and press the Save & Exit (&Ctrl;Q) item. This saves the image as a PNG file in your default Pictures folder, and exits the application immediately. As above, this new save mode will be remembered. Taking A Screenshot @@ -146,7 +146,7 @@ The Window Under Cursor option takes a screenshot of the window that is under the mouse cursor. If the cursor is on top of a popup menu, &spectacle; tries to take a screenshot of the menu as well as its parent window. - While this works most of the time, in certain cases it may fail to obtain information about the parent window. In this case, &spectacle; falls back to old way of capturing the image automatically, and captures an image of only the popup menu. You can also force the old way of capturing the image by checking the Capture the current pop-up only checkbox under Options + While this works most of the time, in certain cases it may fail to obtain information about the parent window. In this case, &spectacle; falls back to old way of capturing the image automatically, and captures an image of only the popup menu. You can also force the old way of capturing the image by checking the Capture the current pop-up only checkbox under Content Options The Rectangular Region option allows you to select a rectangular region of your desktop with your mouse. This region may be spread across different outputs. @@ -161,9 +161,9 @@ - Options + Content Options - The Options settings allow you to select whether the mouse cursor should be included in the screenshots, and whether to capture window decorations along with the image of a single application window. In Window Under Cursor mode, it also allows you to select if &spectacle; shall only capture the image of the current popup menu under the cursor, or also include the parent window. Finally, Quit after Save or Copy will quit Spectacle after any save or copy operations. + The content options settings allow you to select whether the mouse cursor should be included in the screenshots, and whether to capture window decorations along with the image of a single application window. In Window Under Cursor mode, it also allows you to select if &spectacle; shall only capture the image of the current popup menu under the cursor, or also include the parent window. @@ -175,9 +175,6 @@ The Capture the current pop-up only option is only enabled when the Window Under Cursor mode is selected in the Area combo-box. Checking this option captures only the popup menu under the cursor, without its parent window. - - The Quit after Save or Copy option will quit Spectacle after any saving or copying operations. Note that a copied screenshot will only be retained if you are running a clipboard manager that accepts images. KDE Klipper can be configured in this manner by right-clicking on its icon, selecting Configure Clipboard..., and unchecking Ignore images. - @@ -189,45 +186,53 @@ Buttons - There are six buttons located at the bottom of the &spectacle; window. Their functions are described below: + There are some buttons located at the bottom of the &spectacle; window. Their functions are described below: Help - This button gives you the common menu items described in the Help Menu of the &kde; Fundamentals. + gives you the common menu items described in the Help Menu of the &kde; Fundamentals. Configure... - This button gives you access to Spectacle's Configure window where you can change the capture settings and default save location and filename. + gives you access to Spectacle's Configure window where you can change the capture settings and default save location and filename. Tools - Clicking on this button shows a drop-down menu, offering access to various functions. You can open the Print dialog, and Open Screenshots Folder is a shortcut to highlight the last saved screenshot in the default file manager. + opens a drop-down menu which offers various tools: + + + the print dialog + + + a range of external programs for Screen Recording + + Export - This drop-down menu will allow you to directly open the screenshot with all programs that are associated with the PNG (Portable Network Graphics) &MIME; type. Depending on what programs are installed, you will be able to open and edit the snapshot in your graphics applications or viewers. + opens a drop-down menu that will allow you to directly open the screenshot with all programs that are associated with the PNG (Portable Network Graphics) &MIME; type. Depending on what programs are installed, you will be able to open and edit the snapshot in your graphics applications or viewers. Furthermore, if you have the KIPI Plugins installed, you will be able to email your screenshots and export them directly to some social networks and websites. Copy To Clipboard - This button copies the current screenshot to the clipboard. You can also use the &Ctrl;C keyboard shortcut for this. + copies the current screenshot to the clipboard. You can also use the &Ctrl;C keyboard shortcut for this. - Save As + Save & Exit - Clicking this button saves the screenshot as a PNG image to a location of your choosing. Clicking on the arrow on the side will expose the other save mode, Save, which will save the screenshot as a PNG image to the standard location (which defaults to your Pictures folder). By default, the last-used save mode is remembered for next time. + saves the screenshot as a PNG image in your default Pictures folder and immediately exits the application. @@ -277,7 +282,7 @@ Save - When you use the Save function, &spectacle; saves the image with a default filename, in your Pictures folder (which is inside your home folder). The default filename includes the date and time when the image was taken. + When you use the Save & Exit or the Save functions, &spectacle; saves the image with a default filename, in your Pictures folder under your home folder. The default filename includes the date and time when the image was taken. The Save page allows you to set the default save location and filename. Clicking this option brings up a dialog box like the following: @@ -293,7 +298,7 @@ Default Save Location - In the Location text box set the folder where you'd like to save your screenshots when you press Save. + In the Location text box set the folder where you'd like to save your screenshots when you press Save or Save & Exit. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -75,6 +75,7 @@ KF5::WindowSystem KF5::XmlGui KF5::Declarative + KF5::NewStuff ) if(XCB_FOUND) diff --git a/src/Gui/KSMainWindow.h b/src/Gui/KSMainWindow.h --- a/src/Gui/KSMainWindow.h +++ b/src/Gui/KSMainWindow.h @@ -33,6 +33,8 @@ #include "KSWidget.h" #include "SpectacleConfig.h" +class KMoreToolsMenuFactory; + class KSMainWindow : public QDialog { Q_OBJECT @@ -89,6 +91,8 @@ QAction *mSaveAction; KMessageWidget *mMessageWidget; QMenu *mToolsMenu; + QMenu *mScreenRecorderToolsMenu; + QScopedPointer mScreenrecorderToolsMenuFactory; ExportMenu *mExportMenu; bool mOnClickAvailable; }; diff --git a/src/Gui/KSMainWindow.cpp b/src/Gui/KSMainWindow.cpp --- a/src/Gui/KSMainWindow.cpp +++ b/src/Gui/KSMainWindow.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include "SettingsDialog/SettingsDialog.h" #include "ExportMenu.h" @@ -66,6 +67,7 @@ mSaveAction(new QAction), mMessageWidget(new KMessageWidget), mToolsMenu(new QMenu), + mScreenRecorderToolsMenu(new QMenu), mExportMenu(new ExportMenu(this)), mOnClickAvailable(onClickAvailable) { @@ -150,6 +152,13 @@ KGuiItem::assign(mToolsButton, KGuiItem(i18n("Tools"))); mToolsButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu"))); mDialogButtonBox->addButton(mToolsButton, QDialogButtonBox::ActionRole); + mScreenRecorderToolsMenu = mToolsMenu->addMenu(i18n("Record Screen")); + connect(mScreenRecorderToolsMenu, &QMenu::aboutToShow, [this]() + { + mScreenrecorderToolsMenuFactory.reset(new KMoreToolsMenuFactory(QStringLiteral("spectacle/screenrecorder-tools"))); + mScreenRecorderToolsMenu->clear(); + mScreenrecorderToolsMenuFactory->fillMenuFromGroupingNames(mScreenRecorderToolsMenu, { QStringLiteral("screenrecorder") }); + } ); mToolsButton->setMenu(mToolsMenu); KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export")));