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 @@ -186,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 the print dialog. + 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 & Exit - Clicking this button saves the screenshot as a PNG image in your default Pictures folder and immediately exits the application. + 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 @@ -32,6 +32,8 @@ #include "ExportMenu.h" #include "KSWidget.h" +class KMoreToolsMenuFactory; + class KSMainWindow : public QDialog { Q_OBJECT @@ -81,6 +83,8 @@ QMenu *mSaveMenu; 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 @@ -40,6 +40,7 @@ #include #include #include +#include #include "SettingsDialog/SettingsDialog.h" #include "ExportMenu.h" @@ -59,6 +60,7 @@ mSaveMenu(new QMenu), mMessageWidget(new KMessageWidget), mToolsMenu(new QMenu), + mScreenRecorderToolsMenu(new QMenu), mExportMenu(new ExportMenu(this)), mOnClickAvailable(onClickAvailable) { @@ -138,6 +140,13 @@ mToolsButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu"))); mDialogButtonBox->addButton(mToolsButton, QDialogButtonBox::ActionRole); mToolsMenu->addAction(KStandardAction::print(this, SLOT(showPrintDialog()), this)); + 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")));