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 @@ -189,45 +189,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 - 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. 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")));