[spectacle] /: Remove "Remember last used Save mode" checkbox

Nathaniel Graham null at kde.org
Thu Feb 22 17:08:24 UTC 2018


Git commit d8c78b2934110e7e705e7cbba21945dcddd28f5f by Nathaniel Graham, on behalf of Roman Inflianskas.
Committed on 22/02/2018 at 17:08.
Pushed by ngraham into branch 'master'.

Remove "Remember last used Save mode" checkbox

Summary:
Per Nate Graham: "This UI control is a relic from a prior version of spectacle when the "Save" split button's menu was full of items. Now, it only has two, and this setting is checked by default. The use case for turning it off is pretty difficult to envision now. Therefore, in the interest of de-cluttering, let's remove it."

BUG: 390809

Before:
{F5723847}

After:
{F5723849}

Test Plan:
# Select `Save` button.
# Close Spectacle.
# Open Spectacle.
# `Save` is active.
# Select `Save As`.
# Close Spectacle.
# Open Spectacle.
# `Save As` is active.

Reviewers: rkflx, ngraham, #spectacle

Reviewed By: rkflx, ngraham, #spectacle

Subscribers: acrouthamel, ngraham, rkflx

Tags: #spectacle

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

M  +1    -7    doc/index.docbook
M  +2    -8    src/Gui/KSMainWindow.cpp
M  +0    -4    src/Gui/KSMainWindow.h
M  +0    -9    src/Gui/SettingsDialog/GeneralOptionsPage.cpp
M  +0    -1    src/Gui/SettingsDialog/GeneralOptionsPage.h
M  +0    -13   src/SpectacleConfig.cpp
M  +0    -3    src/SpectacleConfig.h

https://commits.kde.org/spectacle/d8c78b2934110e7e705e7cbba21945dcddd28f5f

diff --git a/doc/index.docbook b/doc/index.docbook
index e3d87a5..9fef8c6 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -113,7 +113,7 @@
 
 		<para>The image can be saved to a location of your choice by clicking on the <guibutton>Save As</guibutton> button or typing <keycombo action="simul">&Ctrl;&Shift;<keycap>S</keycap></keycombo>. This opens the standard save dialog, where you can choose the filename, the folder location, and the format that your screenshot will be saved in. You may edit the filename to anything you wish, including the name of a previously saved screenshot.</para>
 
-		<para>To save a screenshot to the default location, click on the arrow portion of the <guibutton>Save As...</guibutton> button and press the <guimenuitem>Save </guimenuitem> (<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>) 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.</para>
+		<para>To save a screenshot to the default location, click on the arrow portion of the <guibutton>Save As...</guibutton> button and press the <guimenuitem>Save </guimenuitem> (<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>) button. The new save mode will be remembered for next time. The default save location and filename can be configured, as described later.</para>
 
 		<para>To quickly save the image and quit &spectacle;, click on the checkbox beside <guilabel>Quit after Save or Copy</guilabel>, then click the arrow portion of the <guibutton>Save As...</guibutton> button and press the <guimenuitem>Save</guimenuitem> (<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>) 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.</para>
 
@@ -255,12 +255,6 @@
 					</textobject>
 				</mediaobject>
 			<variablelist>
-				<varlistentry>
-					<term><guilabel>Remember last used Save mode</guilabel></term>
-					<listitem>
-						<para>The default behavior of the save button is to display <guibutton>Save As</guibutton>. Choosing another save mode by clicking on the arrow portion of the button will make that save mode the default one. Disable this option to make the button stop remembering the last used save mode</para>
-					</listitem>
-				</varlistentry>
 				<varlistentry>
 					<term><guilabel>Copy save location to clipboard</guilabel></term>
 					<listitem>
diff --git a/src/Gui/KSMainWindow.cpp b/src/Gui/KSMainWindow.cpp
index 3029b9b..248f05c 100644
--- a/src/Gui/KSMainWindow.cpp
+++ b/src/Gui/KSMainWindow.cpp
@@ -111,12 +111,6 @@ KSMainWindow::KSMainWindow(bool onClickAvailable, QWidget *parent) :
 KSMainWindow::~KSMainWindow()
 {}
 
-SaveMode KSMainWindow::saveButtonMode() const
-{
-    const SpectacleConfig *cfgManager = SpectacleConfig::instance();
-    return cfgManager->useDynamicSaveButton() ? cfgManager->lastUsedSaveMode() : SaveMode::SaveAs;
-}
-
 // GUI init
 
 void KSMainWindow::init()
@@ -246,7 +240,7 @@ int KSMainWindow::windowWidth(const QPixmap &pixmap) const
 
 void KSMainWindow::setDefaultSaveAction()
 {
-    switch (saveButtonMode()) {
+    switch (SpectacleConfig::instance()->lastUsedSaveMode()) {
     case SaveMode::SaveAs:
         mSaveButton->setDefaultAction(mSaveAsAction);
         break;
@@ -307,7 +301,7 @@ void KSMainWindow::openScreenshotsFolder()
     // or open default directory as determined by save button
     QUrl location = ExportManager::instance()->lastSavePath();
     if (!ExportManager::instance()->isFileExists(location)) {
-        switch(saveButtonMode()) {
+        switch(SpectacleConfig::instance()->lastUsedSaveMode()) {
         case SaveMode::Save:
             location = QUrl::fromLocalFile(ExportManager::instance()->saveLocation() + QStringLiteral("/"));
             break;
diff --git a/src/Gui/KSMainWindow.h b/src/Gui/KSMainWindow.h
index 0b8086c..8e26b77 100644
--- a/src/Gui/KSMainWindow.h
+++ b/src/Gui/KSMainWindow.h
@@ -44,10 +44,6 @@ class KSMainWindow : public QDialog
     explicit KSMainWindow(bool onClickAvailable, QWidget *parent = 0);
     ~KSMainWindow();
 
-    private:
-
-    SaveMode saveButtonMode() const;
-
     private slots:
 
     void captureScreenshot(ImageGrabber::GrabMode mode, int timeout, bool includePointer, bool includeDecorations);
diff --git a/src/Gui/SettingsDialog/GeneralOptionsPage.cpp b/src/Gui/SettingsDialog/GeneralOptionsPage.cpp
index ed3769e..2e8ea0b 100644
--- a/src/Gui/SettingsDialog/GeneralOptionsPage.cpp
+++ b/src/Gui/SettingsDialog/GeneralOptionsPage.cpp
@@ -35,19 +35,12 @@ GeneralOptionsPage::GeneralOptionsPage(QWidget *parent) :
 
     QVBoxLayout *mainLayout = new QVBoxLayout(this);
 
-    // dynamic save button
-
-    mUseLastSaveAction = new QCheckBox(i18n("Remember last used Save mode"), this);
-    connect(mUseLastSaveAction, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty);
-    mainLayout->addWidget(mUseLastSaveAction, 1);
-
     // copy save path to clipboard
 
     mCopyPathToClipboard = new QCheckBox(i18n("Copy save location to the clipboard"), this);
     connect(mCopyPathToClipboard, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty);
     mainLayout->addWidget(mCopyPathToClipboard, 1);
 
-
     // Rectangular Region settings
 
     QGroupBox *rrGroup = new QGroupBox(i18n("Rectangular Region"));
@@ -92,7 +85,6 @@ void GeneralOptionsPage::saveChanges()
 {
     SpectacleConfig *cfgManager = SpectacleConfig::instance();
 
-    cfgManager->setUseDynamicSaveButton(mUseLastSaveAction->checkState() == Qt::Checked);
     cfgManager->setUseLightRegionMaskColour(mUseLightBackground->checkState() == Qt::Checked);
     cfgManager->setRememberLastRectangularRegion(mRememberRect->checkState() == Qt::Checked);
     cfgManager->setCopySaveLocationToClipboard(mCopyPathToClipboard->checkState() == Qt::Checked);
@@ -104,7 +96,6 @@ void GeneralOptionsPage::resetChanges()
 {
     SpectacleConfig *cfgManager = SpectacleConfig::instance();
 
-    mUseLastSaveAction->setChecked(cfgManager->useDynamicSaveButton());
     mUseLightBackground->setChecked(cfgManager->useLightRegionMaskColour());
     mRememberRect->setChecked(cfgManager->rememberLastRectangularRegion());
     mCopyPathToClipboard->setChecked(cfgManager->copySaveLocationToClipboard());
diff --git a/src/Gui/SettingsDialog/GeneralOptionsPage.h b/src/Gui/SettingsDialog/GeneralOptionsPage.h
index 343ce03..31c71dc 100644
--- a/src/Gui/SettingsDialog/GeneralOptionsPage.h
+++ b/src/Gui/SettingsDialog/GeneralOptionsPage.h
@@ -43,7 +43,6 @@ class GeneralOptionsPage : public SettingsPage
 
     private:
 
-    QCheckBox *mUseLastSaveAction;
     QCheckBox *mRememberRect;
     QCheckBox *mUseLightBackground;
     QCheckBox *mCopyPathToClipboard;
diff --git a/src/SpectacleConfig.cpp b/src/SpectacleConfig.cpp
index 199ad51..cbbcb64 100644
--- a/src/SpectacleConfig.cpp
+++ b/src/SpectacleConfig.cpp
@@ -156,19 +156,6 @@ void SpectacleConfig::setCaptureMode(int index)
     mGuiConfig.sync();
 }
 
-// dynamic save button
-
-bool SpectacleConfig::useDynamicSaveButton() const
-{
-    return mGuiConfig.readEntry(QStringLiteral("dynamicSaveButton"), true);
-}
-
-void SpectacleConfig::setUseDynamicSaveButton(bool enabled)
-{
-    mGuiConfig.writeEntry(QStringLiteral("dynamicSaveButton"), enabled);
-    mGuiConfig.sync();
-}
-
 // remember last rectangular region
 
 bool SpectacleConfig::rememberLastRectangularRegion() const
diff --git a/src/SpectacleConfig.h b/src/SpectacleConfig.h
index 98f944b..5aafecb 100644
--- a/src/SpectacleConfig.h
+++ b/src/SpectacleConfig.h
@@ -81,9 +81,6 @@ class SpectacleConfig : public QObject
     int captureMode() const;
     void setCaptureMode(int index);
 
-    bool useDynamicSaveButton() const;
-    void setUseDynamicSaveButton(bool enabled);
-
     bool rememberLastRectangularRegion() const;
     void setRememberLastRectangularRegion(bool enabled);
 


More information about the kde-doc-english mailing list