Commit c37d3a4e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve editing

parent 30597d4d
Pipeline #47515 passed with stage
in 45 minutes and 39 seconds
......@@ -6,6 +6,7 @@
#include "remotecontentconfigurewidget.h"
#include "remotecontentdialog.h"
#include "remotecontentinfo.h"
#include "remotecontentmanager.h"
#include <KLocalizedString>
......@@ -13,6 +14,8 @@
#include <QListWidget>
#include <QMenu>
#include <QVBoxLayout>
#include <QPointer>
using namespace MessageViewer;
RemoteContentConfigureWidget::RemoteContentConfigureWidget(QWidget *parent)
: QWidget(parent)
......@@ -42,7 +45,7 @@ void RemoteContentConfigureWidget::slotCustomContextMenuRequested(const QPoint &
if (item) {
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("document-edit")), i18n("Modify..."), this, [this, item]() {
modifyRule(item);
modifyRemoteContent(item);
});
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove Rule"), this, [this, item]() {
......@@ -54,13 +57,23 @@ void RemoteContentConfigureWidget::slotCustomContextMenuRequested(const QPoint &
menu.exec(QCursor::pos());
}
void RemoteContentConfigureWidget::modifyRule(QListWidgetItem *rulesItem)
void RemoteContentConfigureWidget::modifyRemoteContent(QListWidgetItem *rulesItem)
{
QPointer<RemoteContentDialog> dlg = new RemoteContentDialog(this);
if (dlg->exec()) {
//TODO
}
delete dlg;
//TODO
}
void RemoteContentConfigureWidget::slotAdd()
{
QPointer<RemoteContentDialog> dlg = new RemoteContentDialog(this);
if (dlg->exec()) {
//TODO
}
delete dlg;
//TODO
}
......
......@@ -22,7 +22,7 @@ public:
void saveSettings();
private:
void slotCustomContextMenuRequested(const QPoint &);
void modifyRule(QListWidgetItem *rulesItem);
void modifyRemoteContent(QListWidgetItem *rulesItem);
void slotAdd();
void readSettings();
QListWidget *mListWidget = nullptr;
......
......@@ -38,3 +38,8 @@ RemoteContentInfo RemoteContentDialog::info() const
{
return mRemoveContentWidget->info();
}
void RemoteContentDialog::setInfo(const RemoteContentInfo &info)
{
mRemoveContentWidget->setInfo(info);
}
......@@ -21,6 +21,7 @@ public:
~RemoteContentDialog() override;
Q_REQUIRED_RESULT RemoteContentInfo info() const;
void setInfo(const RemoteContentInfo &info);
private:
RemoteContentWidget *const mRemoveContentWidget;
......
......@@ -37,3 +37,8 @@ RemoteContentInfo RemoteContentWidget::info() const
//TODO
return {};
}
void RemoteContentWidget::setInfo(const RemoteContentInfo &info)
{
//TODO
}
......@@ -20,6 +20,7 @@ public:
~RemoteContentWidget() override;
Q_REQUIRED_RESULT RemoteContentInfo info() const;
void setInfo(const RemoteContentInfo &info);
private:
QLineEdit *const mLineEdit;
};
......
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