mirror of
https://github.com/JS8Call-improved/JS8Call-improved
synced 2026-08-13 17:47:36 -04:00
Allow message inbox to dock into the main UI Enable column sorting in the message table Rework mark-as-read signals to trigger on row deselection Add SemiSortableHeader subclass of QHeaderView
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#ifndef JS8CALL_MESSAGEPANEL_H
|
|
#define JS8CALL_MESSAGEPANEL_H
|
|
#include "JS8_Main/Inbox.h"
|
|
#include "JS8_Main/Message.h"
|
|
|
|
#include <QItemSelection>
|
|
#include <QPair>
|
|
#include <QWidget>
|
|
|
|
namespace Ui { class MessagePanel; }
|
|
|
|
class MessagePanel : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit MessagePanel(QString inboxPath, QWidget* parent = nullptr);
|
|
~MessagePanel() override;
|
|
signals:
|
|
void replyMessage(const QString &call);
|
|
void countsUpdated();
|
|
void requestFloat();
|
|
void requestDock();
|
|
|
|
public slots:
|
|
void setCall(const QString &call);
|
|
void refresh();
|
|
void populateMessages(QList<QPair<int, Message>> msgs);
|
|
QString prepareReplyMessage(QString path, QString text);
|
|
|
|
private slots:
|
|
void messageTableSelectionChanged(const QItemSelection & /*selected*/,
|
|
const QItemSelection & /*deselected*/);
|
|
void on_replyPushButton_clicked();
|
|
|
|
private:
|
|
void deleteSelectedMessages(); // shared by context menu + Delete key
|
|
void deleteMessage(int id);
|
|
void markMessageRead(int id);
|
|
Ui::MessagePanel *ui;
|
|
Inbox *inbox;
|
|
QString call;
|
|
};
|
|
#endif // JS8CALL_MESSAGEPANEL_H
|