fix meeting list ui
This commit is contained in:
parent
94dd384129
commit
c5c95d5a6f
4 changed files with 16 additions and 6 deletions
|
|
@ -546,8 +546,9 @@ void ConferenceInfoCore::writeIntoModel(std::shared_ptr<ConferenceInfoModel> mod
|
||||||
model->enableInvite(mInviteEnabled);
|
model->enableInvite(mInviteEnabled);
|
||||||
if (!mOrganizerAddress.isEmpty()) {
|
if (!mOrganizerAddress.isEmpty()) {
|
||||||
model->setOrganizer(mOrganizerAddress);
|
model->setOrganizer(mOrganizerAddress);
|
||||||
lDebug() << "Use of " << mOrganizerAddress;
|
lDebug() << log().arg("Use of %1").arg(mOrganizerAddress);
|
||||||
} else lDebug() << "Use of " << model->getOrganizerAddress();
|
} else lDebug() << log().arg("Use of %1").arg(model->getOrganizerAddress());
|
||||||
|
|
||||||
model->setDescription(mDescription);
|
model->setDescription(mDescription);
|
||||||
std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos;
|
std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos;
|
||||||
for (auto &p : mParticipants) {
|
for (auto &p : mParticipants) {
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,9 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
|
||||||
mCoreModelConnection->invokeToCore([this, items]() {
|
mCoreModelConnection->invokeToCore([this, items]() {
|
||||||
mustBeInMainThread(getClassName());
|
mustBeInMainThread(getClassName());
|
||||||
int currentDateIndex = sort(*items);
|
int currentDateIndex = sort(*items);
|
||||||
|
auto itemAfterDummy = currentDateIndex < items->size() - 1 ? items->at(currentDateIndex + 1) : nullptr;
|
||||||
|
updateHaveCurrentDate(itemAfterDummy);
|
||||||
resetData<ConferenceInfoCore>(*items);
|
resetData<ConferenceInfoCore>(*items);
|
||||||
updateHaveCurrentDate();
|
|
||||||
if (mLastConfInfoInserted) {
|
if (mLastConfInfoInserted) {
|
||||||
int index = -1;
|
int index = -1;
|
||||||
// TODO : uncomment when linphone conference scheduler updated
|
// TODO : uncomment when linphone conference scheduler updated
|
||||||
|
|
@ -160,6 +161,11 @@ void ConferenceInfoList::updateHaveCurrentDate() {
|
||||||
setHaveCurrentDate(false);
|
setHaveCurrentDate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConferenceInfoList::updateHaveCurrentDate(QSharedPointer<ConferenceInfoCore> itemToCompare) {
|
||||||
|
setHaveCurrentDate(itemToCompare &&
|
||||||
|
itemToCompare->getDateTimeUtc().date() == QDateTime::currentDateTimeUtc().date());
|
||||||
|
}
|
||||||
|
|
||||||
int ConferenceInfoList::getCurrentDateIndex() const {
|
int ConferenceInfoList::getCurrentDateIndex() const {
|
||||||
return mCurrentDateIndex;
|
return mCurrentDateIndex;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public:
|
||||||
bool haveCurrentDate() const;
|
bool haveCurrentDate() const;
|
||||||
void setHaveCurrentDate(bool have);
|
void setHaveCurrentDate(bool have);
|
||||||
void updateHaveCurrentDate();
|
void updateHaveCurrentDate();
|
||||||
|
void updateHaveCurrentDate(QSharedPointer<ConferenceInfoCore> itemToCompare);
|
||||||
|
|
||||||
int getCurrentDateIndex() const;
|
int getCurrentDateIndex() const;
|
||||||
void setCurrentDateIndex(int index);
|
void setCurrentDateIndex(int index);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ ListView {
|
||||||
// using highlight doesn't center, take time before moving and don't work for not visible item (like not loaded)
|
// using highlight doesn't center, take time before moving and don't work for not visible item (like not loaded)
|
||||||
highlightFollowsCurrentItem: false
|
highlightFollowsCurrentItem: false
|
||||||
|
|
||||||
onCountChanged: selectedConference = model && currentIndex != -1 && currentIndex < model.count ? model.getAt(currentIndex) : null
|
onCountChanged: {
|
||||||
|
selectedConference = model && currentIndex != -1 && currentIndex < model.count ? model.getAt(currentIndex) : null
|
||||||
|
}
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
selectedConference = model.getAt(currentIndex) || null
|
selectedConference = model.getAt(currentIndex) || null
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +70,7 @@ ListView {
|
||||||
id: itemDelegate
|
id: itemDelegate
|
||||||
height: 63 * DefaultStyle.dp + topOffset
|
height: 63 * DefaultStyle.dp + topOffset
|
||||||
width: mainItem.width
|
width: mainItem.width
|
||||||
enabled: !isCanceled
|
enabled: !isCanceled && haveModel
|
||||||
property var previousItem : mainItem.model.count > 0 && index > 0 ? mainItem.model.getAt(index-1) : null
|
property var previousItem : mainItem.model.count > 0 && index > 0 ? mainItem.model.getAt(index-1) : null
|
||||||
property var dateTime: !!$modelData && $modelData.core.haveModel ? $modelData.core.dateTime : UtilsCpp.getCurrentDateTime()
|
property var dateTime: !!$modelData && $modelData.core.haveModel ? $modelData.core.dateTime : UtilsCpp.getCurrentDateTime()
|
||||||
property string day : UtilsCpp.toDateDayNameString(dateTime)
|
property string day : UtilsCpp.toDateDayNameString(dateTime)
|
||||||
|
|
@ -161,7 +163,7 @@ ListView {
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
text: $modelData.core.subject
|
text: $modelData? $modelData.core.subject : ""
|
||||||
font {
|
font {
|
||||||
pixelSize: 13 * DefaultStyle.dp
|
pixelSize: 13 * DefaultStyle.dp
|
||||||
weight: 700 * DefaultStyle.dp
|
weight: 700 * DefaultStyle.dp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue