Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 2c31ae4a authored by Nathaniel Graham's avatar Nathaniel Graham

(1/3) Remove unnecessary Discard/Quit button

Summary:
Part 1 of 3 for {T7841}

CCBUG: 386163
FIXED-IN: 18.04

Spectacle's main window doesn't need a discard/quit button, because there's already a user-visible way of closing the window: the titlebar's close button. The escape key does it, too. This button duplicates existing functionality and takes up room that could be used for a "Configure..." button, and has led to user confusion in the past as well (see https://bugs.kde.org/show_bug.cgi?id=386163)

Test Plan:
Tested in KDE Neon:
- Can still quit with the Escape key
- Quitting automatically discards the current screenshot if it has not been saved yet
- There's now more room in the button bar so we can add a visible "Configure..." button

{F5690995}

Reviewers: #spectacle, alexeymin

Reviewed By: #spectacle, alexeymin

Subscribers: alexeymin

Differential Revision: https://phabricator.kde.org/D10283
parent c3f89d5b
......@@ -217,12 +217,6 @@
<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>
<varlistentry>
<term><guibutton>Discard</guibutton></term>
<listitem>
<para>Discards the screenshot and immediately exits the application.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
......
......@@ -123,7 +123,7 @@ void KSMainWindow::init()
// the Button Bar
mDialogButtonBox->setStandardButtons(QDialogButtonBox::Help | QDialogButtonBox::Discard);
mDialogButtonBox->setStandardButtons(QDialogButtonBox::Help);
KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export Image...")));
mSendToButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
......@@ -142,10 +142,6 @@ void KSMainWindow::init()
buildSaveMenu();
mDialogButtonBox->addButton(mSaveButton, QDialogButtonBox::ActionRole);
QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), mDialogButtonBox->button(QDialogButtonBox::Discard));
connect(shortcut, &QShortcut::activated, qApp, &QApplication::quit);
connect(mDialogButtonBox->button(QDialogButtonBox::Discard), &QPushButton::clicked, qApp, &QApplication::quit);
// the help menu
KHelpMenu *helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true);
......@@ -255,7 +251,6 @@ void KSMainWindow::setScreenshotAndShow(const QPixmap &pixmap)
setWindowTitle(i18nc("Unsaved Screenshot", "Unsaved[*]"));
setWindowModified(true);
KGuiItem::assign(mDialogButtonBox->button(QDialogButtonBox::Discard), KStandardGuiItem::discard());
show();
}
......@@ -311,7 +306,6 @@ void KSMainWindow::setScreenshotWindowTitle(QUrl location)
{
setWindowTitle(location.fileName());
setWindowModified(false);
KGuiItem::assign(mDialogButtonBox->button(QDialogButtonBox::Discard), KStandardGuiItem::quit());
}
void KSMainWindow::save()
......
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