Git commit 04e292aaef385d857f6a485132a13f3c04a3b8c9 by Nathaniel Graham.
Committed on 07/02/2018 at 13:57.
Pushed by ngraham into branch 'master'.

(2/3) Move "Configure..." from save menu into its own button

Summary:
Part 2 of 3 for {T7841}
Depends on D10283

BUG: 375965
FIXED-IN: 18.04

Nobody can ever find Spectacle's Configure window because the menu item to 
invoke is hidden in the Save menu, oddly enough. Once {D10283} lands, there'll 
be room for another button. So, we move the "Configure..." item out of the Save 
menu and into its own button.

Test Plan:
Tested in KDE Neon:
- "Save" split button no longer has a "Preferences" item
- Button works and opens the Configure Spectacle dialog
- Button responds to standard ctrl+shift+, keyboard shortcut
- Button has standard "configure" icon

{F5695269}

Reviewers: #spectacle, alexeymin, rkflx

Reviewed By: #spectacle, alexeymin, rkflx

Subscribers: alexeymin, rkflx

Differential Revision: https://phabricator.kde.org/D10289

M  +9    -5    doc/index.docbook
M  +7    -4    src/Gui/KSMainWindow.cpp
M  +1    -0    src/Gui/KSMainWindow.h

https://commits.kde.org/spectacle/04e292aaef385d857f6a485132a13f3c04a3b8c9

diff --git a/doc/index.docbook b/doc/index.docbook
index 83b1056..1013761 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -72,7 +72,7 @@
                 <listitem><para><keycombo 
action="simul">&Shift;<keysym>Print</keysym></keycombo> will take a screenshot 
of your entire desktop, &ie; all monitors</para></listitem>
                 <listitem><para><keycombo 
action="simul"><keycap>Meta</keycap>&Shift;<keysym>Print</keysym></keycombo> 
will take a rectangular region screenshot</para></listitem>
                 </itemizedlist>
-                <para>You can configure the default save location and filename 
by starting &spectacle; normally, clicking the downward arrow beside the 
<guibutton>Save &amp; Exit</guibutton> button, and selecting 
<guimenuitem>Preferences</guimenuitem> from the menu.</para>
+                <para>You can configure the default save location and filename 
by starting &spectacle; normally and clicking on the 
<guibutton>Configure...</guibutton> button, then navigating to the Save 
section.</para>
                        </listitem>
                        <listitem>
                                <para>The mini command line &krunner; (invoked 
with <keycombo action="simul">&Alt;<keycap>F2</keycap></keycombo>) may also be 
used to start &spectacle;.</para>
@@ -192,7 +192,13 @@
                                <varlistentry>
                                        <term><guibutton>Help</guibutton></term>
                                        <listitem>
-                                            <para>This button gives you the 
common menu items described in the <ulink 
url="help:/fundamentals/ui.html#menus-help">Help Menu</ulink> of the &kde; 
Fundamentals.</para>
+                                               <para>This button gives you the 
common menu items described in the <ulink 
url="help:/fundamentals/ui.html#menus-help">Help Menu</ulink> of the &kde; 
Fundamentals.</para>
+                                       </listitem>
+                               </varlistentry>
+                               <varlistentry>
+                                       
<term><guibutton>Configure...</guibutton></term>
+                                       <listitem>
+                                               <para>This button gives you 
access to Spectacle's Configure window where you can change the capture 
settings and default save location and filename.</para>
                                        </listitem>
                                </varlistentry>
                                <varlistentry>
@@ -213,8 +219,6 @@
                                        <term><guibutton>Save &amp; 
Exit</guibutton></term>
                                        <listitem>
                                                <para>Clicking this button 
saves the screenshot as a PNG image in your default Pictures folder and 
immediately exits the application.</para>
-
-                                               <para>Additionally, if you 
click the arrow on the right side of the button, a drop-down menu allows you to 
simply <guilabel>Save</guilabel> the image, save the image with a different 
filename, location and format (<guilabel>Save As...</guilabel>), 
<guilabel>Print</guilabel> the image, and configure the default 
<guimenuitem>Preferences</guimenuitem>, such as application preferences and 
where to save the image by default and what filename to save it as.</para>
                                        </listitem>
                                </varlistentry>
                        </variablelist>
@@ -222,7 +226,7 @@
 
                <sect1>
                        <title>Configure</title>
-                               <para>Use <menuchoice><guimenu>Save &amp; 
Exit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice> to open the 
configuration dialog.</para>
+            <para>Use the <guibutton>Configure...</guibutton> button to open 
the configuration dialog.</para>
                        <sect2>
                        <title>General</title>
                                <mediaobject>
diff --git a/src/Gui/KSMainWindow.cpp b/src/Gui/KSMainWindow.cpp
index 73ed41c..193b6bf 100644
--- a/src/Gui/KSMainWindow.cpp
+++ b/src/Gui/KSMainWindow.cpp
@@ -52,6 +52,7 @@ KSMainWindow::KSMainWindow(bool onClickAvailable, QWidget 
*parent) :
     mDivider(new QFrame),
     mDialogButtonBox(new QDialogButtonBox),
     mSendToButton(new QPushButton),
+    mConfigureButton(new QToolButton),
     mClipboardButton(new QToolButton),
     mSaveButton(new QToolButton),
     mSaveMenu(new QMenu),
@@ -125,6 +126,12 @@ void KSMainWindow::init()
 
     mDialogButtonBox->setStandardButtons(QDialogButtonBox::Help);
 
+    mConfigureButton->setDefaultAction(KStandardAction::preferences(this, 
SLOT(showPreferencesDialog()), this));
+    mConfigureButton->setText(i18n("Configure..."));
+    mConfigureButton->setToolTip(i18n("Change Spectacle's settings."));
+    mConfigureButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+    mDialogButtonBox->addButton(mConfigureButton, QDialogButtonBox::ResetRole);
+
     KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export Image...")));
     mSendToButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
     mDialogButtonBox->addButton(mSendToButton, QDialogButtonBox::ActionRole);
@@ -132,7 +139,6 @@ void KSMainWindow::init()
     mClipboardButton->setDefaultAction(KStandardAction::copy(this, 
SLOT(sendToClipboard()), this));
     mClipboardButton->setText(i18n("Copy To Clipboard"));
     mClipboardButton->setToolTip(i18n("Copy the current screenshot image to 
the clipboard."));
-    mClipboardButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
     mClipboardButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
     mDialogButtonBox->addButton(mClipboardButton, 
QDialogButtonBox::ActionRole);
 
@@ -217,9 +223,6 @@ void KSMainWindow::buildSaveMenu()
 
     // finish off building the menu
     mSaveMenu->addAction(KStandardAction::print(this, SLOT(showPrintDialog()), 
this));
-    mSaveMenu->addSeparator();
-    
mSaveMenu->addAction(QIcon::fromTheme(QStringLiteral("applications-system")), 
i18n("Preferences"),
-                         this, SLOT(showPreferencesDialog()));
 }
 
 // overrides
diff --git a/src/Gui/KSMainWindow.h b/src/Gui/KSMainWindow.h
index fe5104c..d35443d 100644
--- a/src/Gui/KSMainWindow.h
+++ b/src/Gui/KSMainWindow.h
@@ -74,6 +74,7 @@ class KSMainWindow : public QDialog
     QFrame           *mDivider;
     QDialogButtonBox *mDialogButtonBox;
     QPushButton      *mSendToButton;
+    QToolButton      *mConfigureButton;
     QToolButton      *mClipboardButton;
     QToolButton      *mSaveButton;
     QMenu            *mSaveMenu;

Reply via email to