Commit 05959a2e authored by Laurent Montel's avatar Laurent Montel 😁

Add toolbar action

parent 734602d3
......@@ -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)
......
......@@ -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")
......
......@@ -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)
......@@ -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);
}
......
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