Skip to content
Snippets Groups Projects
Commit 19deeccc authored by Alberto Nidasio's avatar Alberto Nidasio Committed by Emilio Corigliano
Browse files

[OutgoingMessageViewer] Added action to clear out the table

parent 543466f6
No related branches found
No related tags found
No related merge requests found
...@@ -153,6 +153,11 @@ void OutgoingMessagesViewerModule::customContextMenuActionSetup() ...@@ -153,6 +153,11 @@ void OutgoingMessagesViewerModule::customContextMenuActionSetup()
}); });
customContextMenuActions.append(elapsedTime); customContextMenuActions.append(elapsedTime);
auto clear = new QAction("Clear");
connect(clear, &QAction::triggered, this,
&OutgoingMessagesViewerModule::clearTable);
customContextMenuActions.append(clear);
qDebug() << "Set context menu for outgoing messages viewer"; qDebug() << "Set context menu for outgoing messages viewer";
} }
...@@ -287,6 +292,13 @@ void OutgoingMessagesViewerModule::addMessageToTable( ...@@ -287,6 +292,13 @@ void OutgoingMessagesViewerModule::addMessageToTable(
table->setItem(row, 2, msgName); table->setItem(row, 2, msgName);
} }
void OutgoingMessagesViewerModule::clearTable()
{
table->clearContents();
table->setRowCount(0);
messages.clear();
}
void OutgoingMessagesViewerModule::updateElapsedTime() void OutgoingMessagesViewerModule::updateElapsedTime()
{ {
auto currentTime = QDateTime::currentDateTime(); auto currentTime = QDateTime::currentDateTime();
......
...@@ -50,6 +50,7 @@ private: ...@@ -50,6 +50,7 @@ private:
void handleWack(const Message& wack); void handleWack(const Message& wack);
void addMessageToTable(const QPair<QDateTime, Message>& msg, int row = 0); void addMessageToTable(const QPair<QDateTime, Message>& msg, int row = 0);
void clearTable();
void updateElapsedTime(); void updateElapsedTime();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment