Commit 8981fb3d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to configure grammar plugins

parent 2407d85b
Pipeline #75512 passed with stage
in 54 minutes and 16 seconds
......@@ -63,7 +63,7 @@ find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(MAILCOMMON_LIB_VERSION "5.18.40")
set(GRAVATAR_LIB_VERSION "5.18.40")
set(PIMCOMMON_LIB_VERSION "5.18.40")
set(PIMCOMMON_LIB_VERSION "5.18.41")
set(GRANTLEETHEME_LIB_VERSION "5.18.40")
set(CALENDARSUPPORT_LIB_VERSION "5.18.40")
set(EVENTVIEW_LIB_VERSION "5.18.40")
......
......@@ -26,6 +26,9 @@ GrammalecteInterface::GrammalecteInterface(KActionCollection *ac, QWidget *paren
connect(mGrammarResultWidget, &GrammalecteResultWidget::replaceText, this, &GrammalecteInterface::slotReplaceText);
connect(mGrammarResultWidget, &GrammalecteResultWidget::checkAgain, this, &GrammalecteInterface::checkAgain);
connect(mGrammarResultWidget, &GrammalecteResultWidget::closeChecker, this, &GrammalecteInterface::closeChecker);
connect(mGrammarResultWidget, &GrammalecteResultWidget::configure, this, [this]() {
Q_EMIT configure(parentWidget());
});
layout->addWidget(mGrammarResultWidget);
createAction(ac);
......
......@@ -133,6 +133,9 @@ void GrammarResultTextEdit::contextMenuEvent(QContextMenuEvent *event)
QAction *checkAgainAct = popup->addAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("Check Again"));
connect(checkAgainAct, &QAction::triggered, this, &GrammarResultTextEdit::checkAgain);
popup->addSeparator();
QAction *configureAct = popup->addAction(QIcon::fromTheme(QStringLiteral("settings-configure")), i18n("Configure..."));
connect(configureAct, &QAction::triggered, this, &GrammarResultTextEdit::configure);
popup->addSeparator();
QAction *closeAct = KStandardAction::close(this, &GrammarResultTextEdit::closeChecker, this);
closeAct->setShortcut({});
popup->addAction(closeAct);
......
......@@ -31,6 +31,7 @@ Q_SIGNALS:
void replaceText(const MessageComposer::PluginGrammarAction &act);
void checkAgain();
void closeChecker();
void configure();
private:
Q_DISABLE_COPY(GrammarResultTextEdit)
......
......@@ -39,6 +39,7 @@ GrammarResultWidget::GrammarResultWidget(QWidget *parent)
connect(mResult, &GrammarResultTextEdit::replaceText, this, &GrammarResultWidget::replaceText);
connect(mResult, &GrammarResultTextEdit::checkAgain, this, &GrammarResultWidget::checkAgain);
connect(mResult, &GrammarResultTextEdit::closeChecker, this, &GrammarResultWidget::closeChecker);
connect(mResult, &GrammarResultTextEdit::configure, this, &GrammarResultWidget::configure);
mainLayout->addWidget(mResult);
}
......
......@@ -28,6 +28,7 @@ Q_SIGNALS:
void replaceText(const MessageComposer::PluginGrammarAction &act);
void checkAgain();
void closeChecker();
void configure();
protected:
virtual void addExtraWidget();
......
......@@ -27,6 +27,9 @@ LanguageToolInterface::LanguageToolInterface(KActionCollection *ac, QWidget *par
connect(mGrammarResultWidget, &LanguageToolResultWidget::replaceText, this, &LanguageToolInterface::slotReplaceText);
connect(mGrammarResultWidget, &LanguageToolResultWidget::checkAgain, this, &LanguageToolInterface::checkAgain);
connect(mGrammarResultWidget, &LanguageToolResultWidget::closeChecker, this, &LanguageToolInterface::closeChecker);
connect(mGrammarResultWidget, &LanguageToolResultWidget::configure, this, [this]() {
Q_EMIT configure(parentWidget());
});
layout->addWidget(mGrammarResultWidget);
createAction(ac);
......
......@@ -15,7 +15,7 @@ public:
explicit LanguageToolInterface(KActionCollection *ac, QWidget *parent = nullptr);
~LanguageToolInterface() override;
KToggleAction *action() const override;
Q_REQUIRED_RESULT KToggleAction *action() const override;
private:
Q_DISABLE_COPY(LanguageToolInterface)
......
......@@ -31,6 +31,7 @@ PimCommon::CustomToolsViewInterface *LanguageToolPlugin::createView(KActionColle
connect(view, &LanguageToolInterface::toolsWasClosed, parent, &PimCommon::CustomToolsWidgetNg::slotToolsWasClosed);
connect(view, &LanguageToolInterface::insertText, parent, &PimCommon::CustomToolsWidgetNg::insertText);
connect(view, &LanguageToolInterface::activateView, parent, &PimCommon::CustomToolsWidgetNg::slotActivateView);
connect(view, &LanguageToolInterface::configure, this, &LanguageToolPlugin::showConfigureDialog);
return view;
}
......
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