summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-09-14 20:52:30 +0200
committerMontel Laurent <[email protected]>2015-09-14 21:13:01 +0200
commit9935315a4203f8062fecc0d017bc15f545cf9c93 (patch)
treedea8480d283b56c7c63944e41a3e51ef54cbfdec
parentaf4d378e1f6ea848a5e8560eab531486116cda85 (diff)
Improve api
-rw-r--r--messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.h1
-rw-r--r--messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.h1
-rw-r--r--messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.h2
-rw-r--r--messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.h1
-rw-r--r--messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.h1
-rw-r--r--messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.cpp6
-rw-r--r--messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.h1
-rw-r--r--messageviewer/src/header/headerstyleinterface.h2
-rw-r--r--messageviewer/src/header/headerstylemenumanager.cpp9
-rw-r--r--messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.h1
-rw-r--r--messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp5
-rw-r--r--messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.h1
18 files changed, 58 insertions, 3 deletions
diff --git a/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.cpp b/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.cpp
index f472a59..c4840f0 100644
--- a/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.cpp
+++ b/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.cpp
@@ -41,3 +41,8 @@ void AllHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *acti
addActionToMenu(menu, actionGroup);
}
+void AllHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.h b/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.h
index 8946a6d..b8023ab 100644
--- a/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.h
+++ b/messageviewer/src/header/allheaderstyleplugin/allheaderstyleinterface.h
@@ -31,6 +31,7 @@ public:
~AllHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
};
}
diff --git a/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.cpp b/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.cpp
index f3044c6..8f39bf6 100644
--- a/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.cpp
+++ b/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.cpp
@@ -42,3 +42,8 @@ void BriefHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *ac
addActionToMenu(menu, actionGroup);
}
+void BriefHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.h b/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.h
index 9028914..b4cbfbe 100644
--- a/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.h
+++ b/messageviewer/src/header/briefheaderstyleplugin/briefheaderstyleinterface.h
@@ -32,6 +32,7 @@ public:
~BriefHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
};
}
diff --git a/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.cpp b/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.cpp
index ddf2b8f..896a802 100644
--- a/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.cpp
+++ b/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.cpp
@@ -42,3 +42,8 @@ void CustomHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *a
addActionToMenu(menu, actionGroup);
}
+void CustomHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.h b/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.h
index 536219d..4f6c59a 100644
--- a/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.h
+++ b/messageviewer/src/header/customheaderstyleplugin/customheaderstyleinterface.h
@@ -30,7 +30,7 @@ public:
explicit CustomHeaderStyleInterface(MessageViewer::HeaderStylePlugin *plugin, QObject *parent = Q_NULLPTR);
~CustomHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
-
+ void activateAction() Q_DECL_OVERRIDE;
};
}
diff --git a/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.cpp b/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.cpp
index 047b0d8..d8f0a73 100644
--- a/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.cpp
+++ b/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.cpp
@@ -41,3 +41,8 @@ void EnterpriseHeaderStyleInterface::createAction(KActionMenu *menu, QActionGrou
addActionToMenu(menu, actionGroup);
}
+void EnterpriseHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.h b/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.h
index 2203667..3f18a61 100644
--- a/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.h
+++ b/messageviewer/src/header/enterpriseheaderstyleplugin/enterpriseheaderstyleinterface.h
@@ -31,6 +31,7 @@ public:
~EnterpriseHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
};
}
diff --git a/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.cpp b/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.cpp
index eb30f69..21ecd0c 100644
--- a/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.cpp
+++ b/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.cpp
@@ -42,3 +42,8 @@ void FancyHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *ac
addActionToMenu(menu, actionGroup);
}
+void FancyHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.h b/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.h
index b0ac8aa..3340137 100644
--- a/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.h
+++ b/messageviewer/src/header/fancyheaderstyleplugin/fancyheaderstyleinterface.h
@@ -31,6 +31,7 @@ public:
~FancyHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
};
}
diff --git a/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.cpp b/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.cpp
index d5b03e5..a58fbd2 100644
--- a/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.cpp
+++ b/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.cpp
@@ -18,6 +18,7 @@
#include "grantleeheaderstyleinterface.h"
#include <grantleetheme/grantleethememanager.h>
+#include <KToggleAction>
using namespace MessageViewer;
GrantleeHeaderStyleInterface::GrantleeHeaderStyleInterface(MessageViewer::HeaderStylePlugin *plugin, QObject *parent)
@@ -46,3 +47,8 @@ void GrantleeHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup
addActionToMenu(menu, actionGroup);
}
+void GrantleeHeaderStyleInterface::activateAction()
+{
+
+}
+
diff --git a/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.h b/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.h
index b22e15e..42a88e6 100644
--- a/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.h
+++ b/messageviewer/src/header/grantleeheaderstyleplugin/grantleeheaderstyleinterface.h
@@ -36,6 +36,7 @@ public:
~GrantleeHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
private:
GrantleeTheme::GrantleeThemeManager *mThemeManager;
};
diff --git a/messageviewer/src/header/headerstyleinterface.h b/messageviewer/src/header/headerstyleinterface.h
index cb76ae0..4b474f9 100644
--- a/messageviewer/src/header/headerstyleinterface.h
+++ b/messageviewer/src/header/headerstyleinterface.h
@@ -38,7 +38,7 @@ public:
virtual ~HeaderStyleInterface();
QList<KToggleAction * > action() const;
virtual void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) = 0;
-
+ virtual void activateAction() = 0;
Q_SIGNALS:
void styleChanged(MessageViewer::HeaderStyle *headerStyle, MessageViewer::HeaderStrategy *headerStrategy);
void styleUpdated();
diff --git a/messageviewer/src/header/headerstylemenumanager.cpp b/messageviewer/src/header/headerstylemenumanager.cpp
index 19b44d4..39cd75c 100644
--- a/messageviewer/src/header/headerstylemenumanager.cpp
+++ b/messageviewer/src/header/headerstylemenumanager.cpp
@@ -56,7 +56,14 @@ void HeaderStyleMenuManagerPrivate::setPluginName(const QString &pluginName)
{
MessageViewer::HeaderStyleInterface *interface = lstInterface.value(pluginName);
if (interface) {
- //TODO activate menu.
+ interface->activateAction();
+ } else {
+ if (lstInterface.isEmpty()) {
+ //TODO
+ } else {
+ interface = lstInterface.cbegin().value();
+ interface->activateAction();
+ }
}
}
diff --git a/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.cpp b/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.cpp
index d45c29f..458214f 100644
--- a/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.cpp
+++ b/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.cpp
@@ -43,3 +43,8 @@ void LongHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *act
}
+void LongHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.h b/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.h
index a9b45c1..c5bc142 100644
--- a/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.h
+++ b/messageviewer/src/header/longheaderstyleplugin/longheaderstyleinterface.h
@@ -31,6 +31,7 @@ public:
~LongHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
};
}
diff --git a/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp b/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp
index 9b4e162..ddbfad2 100644
--- a/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp
+++ b/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp
@@ -42,3 +42,8 @@ void StandardsHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup
addActionToMenu(menu, actionGroup);
}
+void StandardsHeaderStyleInterface::activateAction()
+{
+ mAction.at(0)->setChecked(true);
+}
+
diff --git a/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.h b/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.h
index 3654014..6857e9f 100644
--- a/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.h
+++ b/messageviewer/src/header/standardsheaderstyleplugin/standardsheaderstyleinterface.h
@@ -31,6 +31,7 @@ public:
~StandardsHeaderStyleInterface();
void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE;
+ void activateAction() Q_DECL_OVERRIDE;
};
}