summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-02 06:55:48 +0100
committerLaurent Montel <[email protected]>2018-02-02 06:55:48 +0100
commit05959a2e2f772ed37a5b3d51455c1a1f54f4f2ea (patch)
tree7d0cca551735234478d421b52d27a547152cd879
parent734602d3ea33c6abc6667d8bed515da437c8752c (diff)
Add toolbar action
-rw-r--r--kmail/editorplugins/inserttemplatecommand/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt2
-rw-r--r--kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp2
-rw-r--r--kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditorinterface.cpp7
4 files changed, 7 insertions, 6 deletions
diff --git a/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt b/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
index 7b1492f..b3496aa 100644
--- a/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
+++ b/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
@@ -7,7 +7,7 @@ kcoreaddons_add_plugin(kmail_inserttemplatecommandeditorplugin JSON kmail_insert
${kmail_inserttemplatecommandeditorplugin_SRCS} INSTALL_NAMESPACE kmail)
target_link_libraries(kmail_inserttemplatecommandeditorplugin
- KF5::IconThemes KF5::MessageComposer KF5::XmlGui KF5::I18n
+ KF5::IconThemes KF5::MessageComposer KF5::TemplateParser KF5::XmlGui KF5::I18n
)
if(BUILD_TESTING)
diff --git a/kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt b/kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt
index fcab364..ca10fb1 100644
--- a/kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt
+++ b/kmail/editorplugins/inserttemplatecommand/autotests/CMakeLists.txt
@@ -5,7 +5,7 @@ macro(add_kmail_editorplugin_unittest _source _additional)
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(kmail_editorplugin-${_name})
- target_link_libraries( ${_name} Qt5::Test KF5::XmlGui KF5::IconThemes KF5::MessageComposer KF5::I18n)
+ target_link_libraries( ${_name} Qt5::Test KF5::XmlGui KF5::IconThemes KF5::MessageComposer KF5::TemplateParser KF5::I18n)
endmacro ()
add_kmail_editorplugin_unittest(inserttemplatecommandplugineditortest.cpp "../inserttemplatecommandplugineditor.cpp;../inserttemplatecommandplugineditorinterface.cpp")
diff --git a/kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp b/kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp
index 2c199f5..357d9b6 100644
--- a/kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp
+++ b/kmail/editorplugins/inserttemplatecommand/autotests/inserttemplatecommandplugineditorinterfacetest.cpp
@@ -37,7 +37,7 @@ void InsertTemplateCommandPluginEditorInterfaceTest::shouldHaveDefaultValue()
interface.createAction(new KActionCollection(this));
MessageComposer::ActionType type = interface.actionType();
QVERIFY(type.action());
- QCOMPARE(type.type(), MessageComposer::ActionType::Edit);
+ QCOMPARE(type.type(), MessageComposer::ActionType::ToolBar);
}
QTEST_MAIN(InsertTemplateCommandPluginEditorInterfaceTest)
diff --git a/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditorinterface.cpp b/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditorinterface.cpp
index bb1f9ac..d8a82ec 100644
--- a/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditorinterface.cpp
+++ b/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditorinterface.cpp
@@ -34,10 +34,11 @@ InsertTemplateCommandPluginEditorInterface::~InsertTemplateCommandPluginEditorIn
void InsertTemplateCommandPluginEditorInterface::createAction(KActionCollection *ac)
{
- QAction *action = new QAction(i18n("Insert Special Character..."), this);
- ac->addAction(QStringLiteral("insert_special_character"), action);
+ //ADD template button
+ QAction *action = new QAction(i18n("Insert Template Command..."), this);
+ ac->addAction(QStringLiteral("insert_template_command"), action);
connect(action, &QAction::triggered, this, &InsertTemplateCommandPluginEditorInterface::slotActivated);
- MessageComposer::ActionType type(action, MessageComposer::ActionType::Edit);
+ MessageComposer::ActionType type(action, MessageComposer::ActionType::ToolBar);
setActionType(type);
}