Commit 4be7202c authored by Edric Milaret's avatar Edric Milaret

im: add indication when no text message are present

Change-Id: I3b971d238edd65cdedfca531cfa33420928f9e68
Tuleap: #232
parent 23fd3fa9
......@@ -608,9 +608,21 @@ CallWidget::on_contactMethodComboBox_currentIndexChanged(const QString& number)
SIGNAL(messageInserted(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)),
this,
SLOT(slotAccountMessageReceived(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)));
auto messagesPresent = txtRecording->instantMessagingModel()->rowCount() > 0;
if (messagesPresent) {
ui->listMessageView->scrollToBottom();
txtRecording->setAllRead();
}
ui->listMessageView->setVisible(messagesPresent);
ui->noMessagesLabel->setVisible(!messagesPresent);
if (not messagesPresent) {
QMetaObject::Connection connection = connect(txtRecording->instantMessagingModel(), &QAbstractItemModel::rowsInserted, [&]() {
ui->listMessageView->setVisible(messagesPresent);
ui->noMessagesLabel->setVisible(!messagesPresent);
disconnect(connection);
});
}
}
}
void
......
......@@ -755,6 +755,23 @@
</item>
</layout>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QLabel" name="noMessagesLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Start the conversation !</string>
</property>
</widget>
</item>
<item>
<widget class="QListView" name="listMessageView">
<property name="sizePolicy">
......
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