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 f1bafd1a authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 382562 - Hidden menu in kmail composer: no (obvious?) way to get it back (or hide it)

FIXED-IN: 5.8.0
BUG: 382562

(adding action for show or not menubar)
parent cb9093ce
......@@ -194,6 +194,7 @@
#include <QStatusBar>
#include <QTemporaryDir>
#include <QTextDocumentWriter>
#include <QMenuBar>
// GPGME
#include <gpgme++/keylistresult.h>
......@@ -1303,6 +1304,11 @@ void KMComposerWin::setupActions(void)
mPluginEditorCheckBeforeSendManagerInterface->initializePlugins();
mPluginEditorInitManagerInterface->initializePlugins();
mHideMenuBarAction = KStandardAction::showMenubar(this, &KMComposerWin::slotToggleMenubar, actionCollection());
mHideMenuBarAction->setChecked(KMailSettings::self()->composerShowMenuBar());
slotToggleMenubar(true);
createGUI(QStringLiteral("kmcomposerui.rc"));
initializePluginActions();
connect(toolBar(QStringLiteral("htmlToolBar"))->toggleViewAction(), &QAction::toggled,
......@@ -1316,6 +1322,26 @@ void KMComposerWin::setupActions(void)
}
}
void KMComposerWin::slotToggleMenubar(bool dontShowWarning)
{
if (menuBar()) {
if (mHideMenuBarAction->isChecked()) {
menuBar()->show();
} else {
if (!dontShowWarning) {
const QString accel = mHideMenuBarAction->shortcut().toString();
KMessageBox::information(this,
i18n("<qt>This will hide the menu bar completely."
" You can show it again by typing %1.</qt>", accel),
i18n("Hide menu bar"), QStringLiteral("HideMenuBarWarning"));
}
menuBar()->hide();
}
KMailSettings::self()->setComposerShowMenuBar(mHideMenuBarAction->isChecked());
}
}
void KMComposerWin::initializePluginActions()
{
if (guiFactory()) {
......
......@@ -532,6 +532,8 @@ private:
KeyOk,
NoKey
};
void slotToggleMenubar(bool dontShowWarning);
void slotCryptoModuleSelected();
void slotFccIsInvalid();
void slotIdentityDeleted(uint uoid);
......@@ -599,6 +601,7 @@ private:
KToggleAction *mAutoSpellCheckingAction = nullptr;
KToggleAction *mDictionaryAction = nullptr;
KToggleAction *mSnippetAction = nullptr;
KToggleAction *mHideMenuBarAction = nullptr;
QAction *mAppendSignature = nullptr;
QAction *mPrependSignature = nullptr;
QAction *mInsertSignatureAtCursorPosition = nullptr;
......
<!DOCTYPE gui SYSTEM "kpartgui.dtd" >
<gui version="515" name="kmcomposer" translationDomain="kmail">
<gui version="517" name="kmcomposer" translationDomain="kmail">
<MenuBar>
<Menu noMerge="1" name="file" >
<text>&amp;Message</text>
......@@ -101,6 +101,7 @@
<Menu name="settings" >
<text>&amp;Settings</text>
<Action name="setup_spellchecker" append="save_merge"/>
<Action name="options_show_menubar" group="settings_configure" />
</Menu>
</MenuBar>
<ToolBar noMerge="1" name="mainToolBar" fullWidth="true" ><text>Main Toolbar</text>
......
......@@ -132,6 +132,13 @@
<label></label>
<whatsthis></whatsthis>
</entry>
<entry key="ComposerShowMenuBar" type="Bool">
<default>true</default>
<!-- label and whatsthis are already provided by KStandardAction::showMenubar -->
<label></label>
<whatsthis></whatsthis>
</entry>
</group>
<!-- General -->
......
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