Commit d8c78b29 authored by Roman Inflianskas's avatar Roman Inflianskas Committed by Nate Graham

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
parent b6a185b2
......@@ -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>
......
......@@ -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;
......
......@@ -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);
......
......@@ -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());
......
......@@ -43,7 +43,6 @@ class GeneralOptionsPage : public SettingsPage
private:
QCheckBox *mUseLastSaveAction;
QCheckBox *mRememberRect;
QCheckBox *mUseLightBackground;
QCheckBox *mCopyPathToClipboard;
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment