Commit d41a0589 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to hide/show action in headerstyle

parent 3924ce72
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "defaultgrantleeheaderstyleinterface.h" #include "defaultgrantleeheaderstyleinterface.h"
#include "defaultgrantleeheaderstyleplugin.h" #include "defaultgrantleeheaderstyleplugin.h"
#include "globalsettings_base.h"
#include <messageviewer/grantleeheaderstyle.h> #include <messageviewer/grantleeheaderstyle.h>
#include "defaultgrantleeheaderstrategy.h" #include "defaultgrantleeheaderstrategy.h"
#include <kpluginfactory.h> #include <kpluginfactory.h>
...@@ -29,6 +30,7 @@ DefaultGrantleeHeaderStylePlugin::DefaultGrantleeHeaderStylePlugin(QObject *pare ...@@ -29,6 +30,7 @@ DefaultGrantleeHeaderStylePlugin::DefaultGrantleeHeaderStylePlugin(QObject *pare
mHeaderStyle(new GrantleeHeaderStyle), mHeaderStyle(new GrantleeHeaderStyle),
mHeaderStrategy(new DefaultGrantleeHeaderStrategy) mHeaderStrategy(new DefaultGrantleeHeaderStrategy)
{ {
initializePlugin();
} }
DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin() DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin()
...@@ -36,6 +38,11 @@ DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin() ...@@ -36,6 +38,11 @@ DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin()
} }
void DefaultGrantleeHeaderStylePlugin::initializePlugin()
{
mHeaderStyle->setShowMailAction(DefaultGrantleeHeaderStylePluginSettings::self()->showActionMail());
}
HeaderStyle *DefaultGrantleeHeaderStylePlugin::headerStyle() const HeaderStyle *DefaultGrantleeHeaderStylePlugin::headerStyle() const
{ {
return mHeaderStyle; return mHeaderStyle;
......
...@@ -37,6 +37,7 @@ public: ...@@ -37,6 +37,7 @@ public:
HeaderStyleInterface *createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; HeaderStyleInterface *createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE;
QString name() const Q_DECL_OVERRIDE; QString name() const Q_DECL_OVERRIDE;
private: private:
void initializePlugin();
GrantleeHeaderStyle *mHeaderStyle; GrantleeHeaderStyle *mHeaderStyle;
HeaderStrategy *mHeaderStrategy; HeaderStrategy *mHeaderStrategy;
}; };
......
...@@ -8,7 +8,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta ...@@ -8,7 +8,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
<default>5.2</default> <default>5.2</default>
</entry> </entry>
<entry name="ShowActionMail" type="bool"> <entry name="ShowActionMail" type="bool">
<default>true</default> <default>false</default>
</entry> </entry>
</group> </group>
......
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