Commit 5206cdda authored by Henrik Fehlauer's avatar Henrik Fehlauer

Move printing to a new tools button

Summary:
{nav Print} does neither belong to {nav Save} nor {nav Save As}, so it
goes into a new menu button called {nav Tools}. More entries will be
added to the menu in D10295 and possibly in T6321.

In order to gain more horizontal space, {nav Export Image...} is renamed
to {nav Export}, which is in line with the other buttons not repeating
"image". "..." is removed as it should be only added to the menu entries
itself if necessary and the arrow on the button is enough to indicate
its purpose.

Ref. T7841

Test Plan:
{F5697449}

- Printing via the button still works, as well as {key Ctrl P}.
- Somewhat sensible icon chosen for the button.
- Docbook updated.

Reviewers: #spectacle, ngraham

Reviewed By: #spectacle, ngraham

Subscribers: ngraham

Differential Revision: https://phabricator.kde.org/D10371
parent 8c7c42de
......@@ -186,7 +186,7 @@
<sect1>
<title>Buttons</title>
<para>There are five buttons located at the bottom of the &spectacle; window. Their functions are described below:</para>
<para>There are six buttons located at the bottom of the &spectacle; window. Their functions are described below:</para>
<variablelist>
<varlistentry>
......@@ -202,7 +202,13 @@
</listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Export Image...</guibutton></term>
<term><guibutton>Tools</guibutton></term>
<listitem>
<para>Clicking on this button shows a drop-down menu, offering access to the print dialog.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Export</guibutton></term>
<listitem>
<para>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.</para>
......
......@@ -51,12 +51,14 @@ KSMainWindow::KSMainWindow(bool onClickAvailable, QWidget *parent) :
mKSWidget(new KSWidget),
mDivider(new QFrame),
mDialogButtonBox(new QDialogButtonBox),
mSendToButton(new QPushButton),
mConfigureButton(new QToolButton),
mToolsButton(new QPushButton),
mSendToButton(new QPushButton),
mClipboardButton(new QToolButton),
mSaveButton(new QToolButton),
mSaveMenu(new QMenu),
mMessageWidget(new KMessageWidget),
mToolsMenu(new QMenu),
mExportMenu(new ExportMenu(this)),
mOnClickAvailable(onClickAvailable)
{
......@@ -132,7 +134,13 @@ void KSMainWindow::init()
mConfigureButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
mDialogButtonBox->addButton(mConfigureButton, QDialogButtonBox::ResetRole);
KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export Image...")));
KGuiItem::assign(mToolsButton, KGuiItem(i18n("Tools")));
mToolsButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu")));
mDialogButtonBox->addButton(mToolsButton, QDialogButtonBox::ActionRole);
mToolsMenu->addAction(KStandardAction::print(this, SLOT(showPrintDialog()), this));
mToolsButton->setMenu(mToolsMenu);
KGuiItem::assign(mSendToButton, KGuiItem(i18n("Export")));
mSendToButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
mDialogButtonBox->addButton(mSendToButton, QDialogButtonBox::ActionRole);
......@@ -220,9 +228,6 @@ void KSMainWindow::buildSaveMenu()
mSaveMenu->addAction(actionSaveAs);
break;
}
// finish off building the menu
mSaveMenu->addAction(KStandardAction::print(this, SLOT(showPrintDialog()), this));
}
// overrides
......
......@@ -73,12 +73,14 @@ class KSMainWindow : public QDialog
KSWidget *mKSWidget;
QFrame *mDivider;
QDialogButtonBox *mDialogButtonBox;
QPushButton *mSendToButton;
QToolButton *mConfigureButton;
QPushButton *mToolsButton;
QPushButton *mSendToButton;
QToolButton *mClipboardButton;
QToolButton *mSaveButton;
QMenu *mSaveMenu;
KMessageWidget *mMessageWidget;
QMenu *mToolsMenu;
ExportMenu *mExportMenu;
bool mOnClickAvailable;
};
......
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