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,8 +608,20 @@ CallWidget::on_contactMethodComboBox_currentIndexChanged(const QString& number) ...@@ -608,8 +608,20 @@ CallWidget::on_contactMethodComboBox_currentIndexChanged(const QString& number)
SIGNAL(messageInserted(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)), SIGNAL(messageInserted(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)),
this, this,
SLOT(slotAccountMessageReceived(QMap<QString,QString>,ContactMethod*,Media::Media::Direction))); SLOT(slotAccountMessageReceived(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)));
ui->listMessageView->scrollToBottom(); auto messagesPresent = txtRecording->instantMessagingModel()->rowCount() > 0;
txtRecording->setAllRead(); 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);
});
}
} }
} }
......
...@@ -755,6 +755,23 @@ ...@@ -755,6 +755,23 @@
</item> </item>
</layout> </layout>
</item> </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> <item>
<widget class="QListView" name="listMessageView"> <widget class="QListView" name="listMessageView">
<property name="sizePolicy"> <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