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

Create tab

parent f6c95f87
......@@ -59,6 +59,8 @@ using KPIM::RecentAddresses;
#include <QRegularExpression>
#include <QRegularExpressionValidator>
#include <MessageComposer/PluginEditorCheckBeforeSendConfigureWidget>
#include <libkdepim/blacklistbalooemailcompletiondialog.h>
#include <libkdepim/completionconfiguredialog.h>
......@@ -131,6 +133,20 @@ ComposerPage::ComposerPage(QWidget *parent)
// "external editor" tab:
ExternalEditorTab *externalEditorTab = new ExternalEditorTab();
addTab(externalEditorTab, i18n("External Editor"));
#if 0 //FIXME
MiscPageAgentSettingsTab *agentSettingsTab = new MiscPageAgentSettingsTab();
addTab(agentSettingsTab, i18n("Plugins Settings"));
Q_FOREACH (WebEngineViewer::NetworkPluginUrlInterceptor *plugin, WebEngineViewer::NetworkUrlInterceptorPluginManager::self()->pluginsList()) {
if (plugin->hasConfigureSupport()) {
WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting settings = plugin->createConfigureWidget(this);
AddonsPluginTab *tab = new AddonsPluginTab(settings.configureWidget, this);
addTab(tab, settings.name);
}
}
#endif
}
QString ComposerPage::GeneralTab::helpAnchor() const
......@@ -1406,3 +1422,38 @@ void ComposerPageAutoImageResizeTab::doResetToDefaultsOther()
{
autoResizeWidget->resetToDefault();
}
ComposerPluginTab::ComposerPluginTab(MessageComposer::PluginEditorCheckBeforeSendConfigureWidget *configureWidget, QWidget *parent)
: ConfigModuleTab(parent),
mConfigureWidget(configureWidget)
{
QHBoxLayout *l = new QHBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
l->addWidget(mConfigureWidget);
connect(mConfigureWidget, &MessageComposer::PluginEditorCheckBeforeSendConfigureWidget::configureChanged, this, &ComposerPluginTab::slotEmitChanged);
}
ComposerPluginTab::~ComposerPluginTab()
{
}
void ComposerPluginTab::save()
{
mConfigureWidget->saveSettings();
}
void ComposerPluginTab::doLoadFromGlobalSettings()
{
//TODO
}
void ComposerPluginTab::doLoadOther()
{
mConfigureWidget->loadSettings();
}
void ComposerPluginTab::doResetToDefaultsOther()
{
mConfigureWidget->resetSettings();
}
......@@ -39,15 +39,12 @@ class TemplatesConfiguration;
namespace PimCommon
{
class AutoCorrectionWidget;
class SimpleStringListEditor;
}
namespace MessageComposer
{
class ImageScalingWidget;
}
namespace PimCommon
{
class SimpleStringListEditor;
class PluginEditorCheckBeforeSendConfigureWidget;
}
class ComposerPageGeneralTab : public ConfigModuleTab
......@@ -265,12 +262,11 @@ private:
MessageComposer::ImageScalingWidget *autoResizeWidget;
};
#if 0 //TODO
class ComposerPluginTab : public ConfigModuleTab
{
Q_OBJECT
public:
explicit ComposerPluginTab(WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidget *configureWidget, QWidget *parent = Q_NULLPTR);
explicit ComposerPluginTab(MessageComposer::PluginEditorCheckBeforeSendConfigureWidget *configureWidget, QWidget *parent = Q_NULLPTR);
~ComposerPluginTab();
void save() Q_DECL_OVERRIDE;
......@@ -281,9 +277,8 @@ private:
void doResetToDefaultsOther() Q_DECL_OVERRIDE;
private:
WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidget *mConfigureWidget;
MessageComposer::PluginEditorCheckBeforeSendConfigureWidget *mConfigureWidget;
};
#endif
class KMAIL_EXPORT ComposerPage : public ConfigModuleWithTabs
{
......
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