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

[OutgoingMessageViewer] Added action to clear out the table

parent 4ef7d7ca
No related branches found
No related tags found
No related merge requests found
......@@ -153,6 +153,11 @@ void OutgoingMessagesViewerModule::customContextMenuActionSetup()
});
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";
}
......@@ -287,6 +292,13 @@ void OutgoingMessagesViewerModule::addMessageToTable(
table->setItem(row, 2, msgName);
}
void OutgoingMessagesViewerModule::clearTable()
{
table->clearContents();
table->setRowCount(0);
messages.clear();
}
void OutgoingMessagesViewerModule::updateElapsedTime()
{
auto currentTime = QDateTime::currentDateTime();
......
......@@ -50,6 +50,7 @@ private:
void handleWack(const Message& wack);
void addMessageToTable(const QPair<QDateTime, Message>& msg, int row = 0);
void clearTable();
void updateElapsedTime();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment