Commit 134fa439 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement mail action

parent 5a8bdaa7
......@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(MESSAGELIB_LIB_VERSION "5.1.52")
set(MESSAGELIB_LIB_VERSION "5.1.53")
set(KF5_VERSION "5.17.0")
set(KDEPIMLIBS_LIB_VERSION "5.1.42")
......
......@@ -93,19 +93,19 @@ public:
if (url.scheme() == QLatin1String("kmailaction")) {
const QString urlPath(url.path());
if (urlPath == QStringLiteral("trash")) {
viewer->setMailAction(ViewerPrivate::Trash);
viewer->setMailAction(MessageViewer::Viewer::Trash);
return true;
} else if (urlPath == QStringLiteral("reply")) {
viewer->setMailAction(ViewerPrivate::Reply);
viewer->setMailAction(MessageViewer::Viewer::Reply);
return true;
} else if (urlPath == QStringLiteral("replyToAll")) {
viewer->setMailAction(ViewerPrivate::ReplyToAll);
viewer->setMailAction(MessageViewer::Viewer::ReplyToAll);
return true;
} else if (urlPath == QStringLiteral("forward")) {
viewer->setMailAction(ViewerPrivate::Forward);
viewer->setMailAction(MessageViewer::Viewer::Forward);
return true;
} else if (urlPath == QStringLiteral("newMessage")) {
viewer->setMailAction(ViewerPrivate::NewMessage);
viewer->setMailAction(MessageViewer::Viewer::NewMessage);
return true;
}
}
......
......@@ -83,6 +83,7 @@ void Viewer::initialize()
this, &Viewer::itemRemoved);
connect(d_ptr, &ViewerPrivate::changeDisplayMail, this, &Viewer::slotChangeDisplayMail);
connect(d_ptr, &ViewerPrivate::moveMessageToTrash, this, &Viewer::moveMessageToTrash);
connect(d_ptr, &ViewerPrivate::executeMailAction, this, &Viewer::executeMailAction);
setMessage(KMime::Message::Ptr(), Delayed);
}
......
......@@ -126,6 +126,14 @@ public:
ScrollTo = 10
};
enum MailAction {
Trash = 0,
Reply,
ReplyToAll,
Forward,
NewMessage
};
/**
* The display update mode: Force updates the display immediately, Delayed updates
* after some time (150ms by default)
......@@ -343,6 +351,7 @@ public:
Q_SIGNALS:
void moveMessageToTrash();
void executeMailAction(MessageViewer::Viewer::MailAction type );
/**
* Emitted when a status bar message is shown. Note that the status bar message is also set to
......
......@@ -2929,8 +2929,9 @@ void ViewerPrivate::saveMainFrameScreenshotInFile(const QString &filename)
mViewer->saveMainFrameScreenshotInFile(filename);
}
void ViewerPrivate::setMailAction(ViewerPrivate::MailAction type)
void ViewerPrivate::setMailAction(MessageViewer::Viewer::MailAction type)
{
Q_EMIT executeMailAction(type);
//TODO
}
......
......@@ -184,13 +184,6 @@ class ViewerPrivate : public QObject
{
Q_OBJECT
public:
enum MailAction {
Trash = 0,
Reply,
ReplyToAll,
Forward,
NewMessage
};
ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollection *actionCollection);
......@@ -284,7 +277,7 @@ public:
void saveMainFrameScreenshotInFile(const QString &filename);
void setMailAction(MailAction type);
void setMailAction(MessageViewer::Viewer::MailAction type);
private:
/** HTML initialization. */
......@@ -585,6 +578,7 @@ Q_SIGNALS:
void changeDisplayMail(Viewer::DisplayFormatMessage, bool);
void moveMessageToTrash();
void executeMailAction(MessageViewer::Viewer::MailAction type );
private:
QString attachmentInjectionHtml();
......
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