fix meeting setup ui + force meeting end before midnight
This commit is contained in:
parent
c843829920
commit
8cffd73df5
5 changed files with 354 additions and 319 deletions
|
|
@ -1294,6 +1294,11 @@ QDateTime Utils::addYears(QDateTime date, int years) {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Utils::timeOffset(QDateTime start, QDateTime end) {
|
||||||
|
qDebug() << "offset between times" << start.msecsTo(end);
|
||||||
|
return start.msecsTo(end);
|
||||||
|
}
|
||||||
|
|
||||||
int Utils::getYear(const QDate &date) {
|
int Utils::getYear(const QDate &date) {
|
||||||
return date.year();
|
return date.year();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,11 +112,12 @@ public:
|
||||||
Q_INVOKABLE static int secsTo(const QString &start, const QString &end);
|
Q_INVOKABLE static int secsTo(const QString &start, const QString &end);
|
||||||
Q_INVOKABLE static QDateTime addSecs(QDateTime date, int secs);
|
Q_INVOKABLE static QDateTime addSecs(QDateTime date, int secs);
|
||||||
Q_INVOKABLE static QDateTime addYears(QDateTime date, int years);
|
Q_INVOKABLE static QDateTime addYears(QDateTime date, int years);
|
||||||
|
Q_INVOKABLE static int timeOffset(QDateTime start, QDateTime end);
|
||||||
Q_INVOKABLE static QString interpretUrl(const QString &uri);
|
Q_INVOKABLE static QString interpretUrl(const QString &uri);
|
||||||
Q_INVOKABLE static bool isValidSIPAddress(const QString &uri);
|
Q_INVOKABLE static bool isValidSIPAddress(const QString &uri);
|
||||||
Q_INVOKABLE static bool isValidIPAddress(const QString &host);
|
Q_INVOKABLE static bool isValidIPAddress(const QString &host);
|
||||||
Q_INVOKABLE static bool isValidHostname(const QString& hostname);
|
Q_INVOKABLE static bool isValidHostname(const QString &hostname);
|
||||||
Q_INVOKABLE static bool isValidURL(const QString& url);
|
Q_INVOKABLE static bool isValidURL(const QString &url);
|
||||||
Q_INVOKABLE static QString findAvatarByAddress(const QString &address);
|
Q_INVOKABLE static QString findAvatarByAddress(const QString &address);
|
||||||
Q_INVOKABLE static VariantObject *findFriendByAddress(const QString &address);
|
Q_INVOKABLE static VariantObject *findFriendByAddress(const QString &address);
|
||||||
static QString generateSavedFilename(const QString &from, const QString &to);
|
static QString generateSavedFilename(const QString &from, const QString &to);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import Linphone
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
readonly property var selectedDate: calendar.selectedDate
|
readonly property var selectedDate: calendar.selectedDate
|
||||||
|
onSelectedDateChanged: popupItem.close()
|
||||||
property alias calendar: calendar
|
property alias calendar: calendar
|
||||||
property alias contentText: contentText
|
property alias contentText: contentText
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import Linphone
|
||||||
import UtilsCpp
|
import UtilsCpp
|
||||||
import SettingsCpp
|
import SettingsCpp
|
||||||
|
|
||||||
FocusScope{
|
FocusScope {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property bool isCreation
|
property bool isCreation
|
||||||
property ConferenceInfoGui conferenceInfoGui
|
property ConferenceInfoGui conferenceInfoGui
|
||||||
|
|
@ -14,349 +14,363 @@ FocusScope{
|
||||||
signal returnRequested()
|
signal returnRequested()
|
||||||
signal saveSucceed(bool isCreation)
|
signal saveSucceed(bool isCreation)
|
||||||
|
|
||||||
Connections {
|
ColumnLayout {
|
||||||
target: mainItem.conferenceInfoGui.core
|
Connections {
|
||||||
function onSchedulerStateChanged() {
|
target: mainItem.conferenceInfoGui.core
|
||||||
if (mainItem.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) {
|
function onSchedulerStateChanged() {
|
||||||
mainItem.saveSucceed(isCreation)
|
if (mainItem.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) {
|
||||||
}
|
mainItem.saveSucceed(isCreation)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
endHour.selectedDateTime = mainItem.conferenceInfoGui.core.endDateTime
|
|
||||||
startHour.selectedDateTime = mainItem.conferenceInfoGui.core.dateTime
|
|
||||||
endDate.calendar.selectedDate = mainItem.conferenceInfoGui.core.endDateTime
|
|
||||||
startDate.calendar.selectedDate = mainItem.conferenceInfoGui.core.dateTime
|
|
||||||
}
|
|
||||||
|
|
||||||
component CheckableButton: Button {
|
|
||||||
id: checkableButton
|
|
||||||
checkable: true
|
|
||||||
autoExclusive: true
|
|
||||||
contentImageColor: checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
|
|
||||||
inversedColors: !checked
|
|
||||||
topPadding: 10 * DefaultStyle.dp
|
|
||||||
bottomPadding: 10 * DefaultStyle.dp
|
|
||||||
leftPadding: 16 * DefaultStyle.dp
|
|
||||||
rightPadding: 16 * DefaultStyle.dp
|
|
||||||
contentItem: RowLayout {
|
|
||||||
spacing: 8 * DefaultStyle.dp
|
|
||||||
EffectImage {
|
|
||||||
imageSource: checkableButton.icon.source
|
|
||||||
colorizationColor: checkableButton.checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
|
|
||||||
width: 24 * DefaultStyle.dp
|
|
||||||
height: 24 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
text: checkableButton.text
|
|
||||||
color: checkableButton.checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
|
|
||||||
font {
|
|
||||||
pixelSize: 16 * DefaultStyle.dp
|
|
||||||
weight: 400 * DefaultStyle.dp
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
Component.onCompleted: {
|
||||||
visible: mainItem.isCreation && !SettingsCpp.disableBroadcastFeature
|
endHour.selectedDateTime = mainItem.conferenceInfoGui.core.endDateTime
|
||||||
Layout.topMargin: 20 * DefaultStyle.dp
|
startHour.selectedDateTime = mainItem.conferenceInfoGui.core.dateTime
|
||||||
Layout.bottomMargin: 20 * DefaultStyle.dp
|
endDate.calendar.selectedDate = mainItem.conferenceInfoGui.core.endDateTime
|
||||||
spacing: 18 * DefaultStyle.dp
|
startDate.calendar.selectedDate = mainItem.conferenceInfoGui.core.dateTime
|
||||||
CheckableButton {
|
|
||||||
Layout.preferredWidth: 151 * DefaultStyle.dp
|
|
||||||
icon.source: AppIcons.usersThree
|
|
||||||
icon.width: 24 * DefaultStyle.dp
|
|
||||||
icon.height: 24 * DefaultStyle.dp
|
|
||||||
enabled: false
|
|
||||||
text: qsTr("Réunion")
|
|
||||||
checked: true
|
|
||||||
}
|
}
|
||||||
CheckableButton {
|
|
||||||
Layout.preferredWidth: 151 * DefaultStyle.dp
|
component CheckableButton: Button {
|
||||||
enabled: false
|
id: checkableButton
|
||||||
icon.source: AppIcons.slide
|
checkable: true
|
||||||
icon.width: 24 * DefaultStyle.dp
|
autoExclusive: true
|
||||||
icon.height: 24 * DefaultStyle.dp
|
contentImageColor: checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
|
||||||
text: qsTr("Broadcast")
|
inversedColors: !checked
|
||||||
}
|
topPadding: 10 * DefaultStyle.dp
|
||||||
}
|
bottomPadding: 10 * DefaultStyle.dp
|
||||||
Section {
|
leftPadding: 16 * DefaultStyle.dp
|
||||||
visible: mainItem.isCreation
|
rightPadding: 16 * DefaultStyle.dp
|
||||||
content: RowLayout {
|
contentItem: RowLayout {
|
||||||
spacing: 8 * DefaultStyle.dp
|
|
||||||
EffectImage {
|
|
||||||
imageSource: AppIcons.usersThree
|
|
||||||
colorizationColor: DefaultStyle.main2_600
|
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
TextInput {
|
|
||||||
id: confTitle
|
|
||||||
text: qsTr("Ajouter un titre")
|
|
||||||
color: DefaultStyle.main2_600
|
|
||||||
font {
|
|
||||||
pixelSize: 20 * DefaultStyle.dp
|
|
||||||
weight: 800 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
focus: true
|
|
||||||
onActiveFocusChanged: if(activeFocus) selectAll()
|
|
||||||
onEditingFinished: mainItem.conferenceInfoGui.core.subject = text
|
|
||||||
KeyNavigation.down: allDaySwitch
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Section {
|
|
||||||
Layout.topMargin: 10 * DefaultStyle.dp
|
|
||||||
content: [
|
|
||||||
RowLayout {
|
|
||||||
spacing: 8 * DefaultStyle.dp
|
spacing: 8 * DefaultStyle.dp
|
||||||
EffectImage {
|
EffectImage {
|
||||||
imageSource: AppIcons.clock
|
imageSource: checkableButton.icon.source
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
colorizationColor: checkableButton.checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
width: 24 * DefaultStyle.dp
|
||||||
colorizationColor: DefaultStyle.main2_600
|
height: 24 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("Toute la journée")
|
text: checkableButton.text
|
||||||
|
color: checkableButton.checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
|
||||||
font {
|
font {
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
pixelSize: 16 * DefaultStyle.dp
|
||||||
weight: 700 * DefaultStyle.dp
|
weight: 400 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item{Layout.fillWidth: true}
|
|
||||||
Switch {
|
|
||||||
id: allDaySwitch
|
|
||||||
readonly property bool isAllDay: position === 1
|
|
||||||
KeyNavigation.up: confTitle
|
|
||||||
KeyNavigation.down: startDate
|
|
||||||
onPositionChanged: if (position === 1) {
|
|
||||||
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, 0, 0)
|
|
||||||
mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, 23, 59)
|
|
||||||
}
|
|
||||||
Component.onCompleted: if (mainItem.conferenceInfoGui.core.isAllDayConf()) toggle
|
|
||||||
}
|
|
||||||
},
|
|
||||||
RowLayout {
|
|
||||||
spacing: 8 * DefaultStyle.dp
|
|
||||||
CalendarComboBox {
|
|
||||||
id: startDate
|
|
||||||
background.visible: mainItem.isCreation
|
|
||||||
indicator.visible: mainItem.isCreation
|
|
||||||
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
|
||||||
Layout.preferredWidth: 200 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
|
||||||
KeyNavigation.up: allDaySwitch
|
|
||||||
KeyNavigation.down: endDate
|
|
||||||
KeyNavigation.left: startHour
|
|
||||||
KeyNavigation.right: startHour
|
|
||||||
onSelectedDateChanged: {
|
|
||||||
if (!selectedDate || selectedDate == mainItem.conferenceInfoGui.core.dateTime) return
|
|
||||||
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(selectedDate, allDaySwitch.isAllDay ? 0 : startHour.selectedHour, allDaySwitch.isAllDay ? 0 : startHour.selectedMin)
|
|
||||||
if (isCreation) {
|
|
||||||
startHour.selectedDateTime = UtilsCpp.createDateTime(selectedDate, startHour.selectedHour, startHour.selectedMin)
|
|
||||||
if (allDaySwitch.position === 0) endDate.calendar.selectedDate = UtilsCpp.addSecs(startHour.selectedDateTime, 3600)
|
|
||||||
else endDate.calendar.selectedDate = UtilsCpp.createDateTime(selectedDate, 23, 59)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item{Layout.fillWidth: true}
|
|
||||||
TimeComboBox {
|
|
||||||
id: startHour
|
|
||||||
visible: allDaySwitch.position === 0
|
|
||||||
indicator.visible: mainItem.isCreation
|
|
||||||
// Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: 94 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
|
||||||
background.visible: mainItem.isCreation
|
|
||||||
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
|
||||||
KeyNavigation.up: allDaySwitch
|
|
||||||
KeyNavigation.down: endDate
|
|
||||||
KeyNavigation.left: startDate
|
|
||||||
KeyNavigation.right: startDate
|
|
||||||
onSelectedHourChanged: {
|
|
||||||
mainItem.conferenceInfoGui.core.dateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
|
|
||||||
endDate.calendar.selectedDate = UtilsCpp.addSecs(selectedDateTime, 3600)
|
|
||||||
endHour.selectedDateTime = UtilsCpp.addSecs(selectedDateTime, 3600)//Qt.formatDateTime(UtilsCpp.createDateTime(new Date(), selectedHour == 23 ? 23 : selectedHour + 1, selectedHour == 23 ? 59 : selectedMin), "hh:mm")
|
|
||||||
}
|
|
||||||
onSelectedMinChanged: {
|
|
||||||
mainItem.conferenceInfoGui.core.dateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
|
|
||||||
endDate.calendar.selectedDate = UtilsCpp.addSecs(selectedDateTime, 3600)
|
|
||||||
endHour.selectedDateTime = UtilsCpp.addSecs(selectedDateTime, 3600)//UtilsCpp.createDateTime(selectedDateTime, selectedHour == 23 ? 23 : selectedHour + 1, selectedHour == 23 ? 59 : selectedMin)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
RowLayout {
|
|
||||||
spacing: 8 * DefaultStyle.dp
|
|
||||||
CalendarComboBox {
|
|
||||||
id: endDate
|
|
||||||
background.visible: mainItem.isCreation
|
|
||||||
indicator.visible: mainItem.isCreation
|
|
||||||
// Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: 200 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
|
||||||
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
|
||||||
onSelectedDateChanged: if (selectedDate) mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(selectedDate, endHour.selectedHour, endHour.selectedMin)
|
|
||||||
}
|
|
||||||
Item{Layout.fillWidth: true}
|
|
||||||
TimeComboBox {
|
|
||||||
id: endHour
|
|
||||||
visible: allDaySwitch.position === 0
|
|
||||||
indicator.visible: mainItem.isCreation
|
|
||||||
Layout.preferredWidth: 94 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
|
||||||
background.visible: mainItem.isCreation
|
|
||||||
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
|
||||||
onSelectedHourChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
|
|
||||||
onSelectedMinChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
ComboBox {
|
|
||||||
id: timeZoneCbox
|
|
||||||
Layout.preferredWidth: 307 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
|
||||||
hoverEnabled: true
|
|
||||||
listView.implicitHeight: 250 * DefaultStyle.dp
|
|
||||||
constantImageSource: AppIcons.globe
|
|
||||||
weight: 700 * DefaultStyle.dp
|
|
||||||
leftMargin: 0
|
|
||||||
currentIndex: mainItem.conferenceInfoGui ? model.getIndex(mainItem.conferenceInfoGui.core.timeZoneModel) : -1
|
|
||||||
background: Rectangle {
|
|
||||||
visible: parent.hovered || parent.down
|
|
||||||
anchors.fill: parent
|
|
||||||
color: DefaultStyle.grey_100
|
|
||||||
}
|
|
||||||
model: TimeZoneProxy{
|
|
||||||
}
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
var modelIndex = timeZoneCbox.model.index(currentIndex, 0)
|
|
||||||
mainItem.conferenceInfoGui.core.timeZoneModel = timeZoneCbox.model.data(modelIndex, Qt.DisplayRole + 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
|
||||||
Section {
|
|
||||||
content: RowLayout {
|
|
||||||
spacing: 8 * DefaultStyle.dp
|
|
||||||
EffectImage {
|
|
||||||
imageSource: AppIcons.note
|
|
||||||
colorizationColor: DefaultStyle.main2_600
|
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
TextArea {
|
|
||||||
id: descriptionEdit
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: 275 * DefaultStyle.dp
|
|
||||||
leftPadding: 8 * DefaultStyle.dp
|
|
||||||
rightPadding: 8 * DefaultStyle.dp
|
|
||||||
hoverEnabled: true
|
|
||||||
placeholderText: qsTr("Ajouter une description")
|
|
||||||
placeholderTextColor: DefaultStyle.main2_600
|
|
||||||
placeholderWeight: 700 * DefaultStyle.dp
|
|
||||||
color: DefaultStyle.main2_600
|
|
||||||
font {
|
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
|
||||||
weight: 400 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
onEditingFinished: mainItem.conferenceInfoGui.core.description = text
|
|
||||||
Keys.onPressed: (event)=> {
|
|
||||||
if (event.key == Qt.Key_Escape) {
|
|
||||||
text = mainItem.conferenceInfoGui.core.description
|
|
||||||
nextItemInFocusChain().forceActiveFocus()
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
background: Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: descriptionEdit.hovered || descriptionEdit.activeFocus ? DefaultStyle.grey_100 : "transparent"
|
|
||||||
radius: 4 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Section {
|
RowLayout {
|
||||||
content: [
|
visible: mainItem.isCreation && !SettingsCpp.disableBroadcastFeature
|
||||||
Button {
|
Layout.topMargin: 20 * DefaultStyle.dp
|
||||||
id: addParticipantsButton
|
Layout.bottomMargin: 20 * DefaultStyle.dp
|
||||||
Layout.fillWidth: true
|
spacing: 18 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
CheckableButton {
|
||||||
background: Rectangle {
|
Layout.preferredWidth: 151 * DefaultStyle.dp
|
||||||
anchors.fill: parent
|
icon.source: AppIcons.usersThree
|
||||||
color: addParticipantsButton.hovered || addParticipantsButton.activeFocus ? DefaultStyle.grey_100 : "transparent"
|
icon.width: 24 * DefaultStyle.dp
|
||||||
radius: 4 * DefaultStyle.dp
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
enabled: false
|
||||||
|
text: qsTr("Réunion")
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
CheckableButton {
|
||||||
|
Layout.preferredWidth: 151 * DefaultStyle.dp
|
||||||
|
enabled: false
|
||||||
|
icon.source: AppIcons.slide
|
||||||
|
icon.width: 24 * DefaultStyle.dp
|
||||||
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
text: qsTr("Broadcast")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Section {
|
||||||
|
visible: mainItem.isCreation
|
||||||
|
content: RowLayout {
|
||||||
|
spacing: 8 * DefaultStyle.dp
|
||||||
|
EffectImage {
|
||||||
|
imageSource: AppIcons.usersThree
|
||||||
|
colorizationColor: DefaultStyle.main2_600
|
||||||
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
contentItem: RowLayout {
|
TextInput {
|
||||||
spacing: 8 * DefaultStyle.dp
|
id: confTitle
|
||||||
|
text: qsTr("Ajouter un titre")
|
||||||
|
color: DefaultStyle.main2_600
|
||||||
|
font {
|
||||||
|
pixelSize: 20 * DefaultStyle.dp
|
||||||
|
weight: 800 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
focus: true
|
||||||
|
onActiveFocusChanged: if(activeFocus) selectAll()
|
||||||
|
onEditingFinished: mainItem.conferenceInfoGui.core.subject = text
|
||||||
|
KeyNavigation.down: allDaySwitch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Section {
|
||||||
|
Layout.topMargin: 10 * DefaultStyle.dp
|
||||||
|
content: [
|
||||||
|
RowLayout {
|
||||||
EffectImage {
|
EffectImage {
|
||||||
imageSource: AppIcons.usersThree
|
imageSource: AppIcons.clock
|
||||||
colorizationColor: DefaultStyle.main2_600
|
colorizationColor: DefaultStyle.main2_600
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
Text {
|
CalendarComboBox {
|
||||||
|
id: startDate
|
||||||
|
background.visible: mainItem.isCreation
|
||||||
|
indicator.visible: mainItem.isCreation
|
||||||
|
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr("Ajouter des participants")
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
font {
|
KeyNavigation.up: allDaySwitch
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
KeyNavigation.down: endDate
|
||||||
weight: 700 * DefaultStyle.dp
|
KeyNavigation.left: startHour
|
||||||
|
KeyNavigation.right: startHour
|
||||||
|
onSelectedDateChanged: {
|
||||||
|
if (!selectedDate || selectedDate == mainItem.conferenceInfoGui.core.dateTime) return
|
||||||
|
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(selectedDate, allDaySwitch.isAllDay ? 0 : startHour.selectedHour, allDaySwitch.isAllDay ? 0 : startHour.selectedMin)
|
||||||
|
if (isCreation) {
|
||||||
|
startHour.selectedDateTime = UtilsCpp.createDateTime(selectedDate, startHour.selectedHour, startHour.selectedMin)
|
||||||
|
if (allDaySwitch.position === 0) endDate.calendar.selectedDate = UtilsCpp.addSecs(startHour.selectedDateTime, 3600)
|
||||||
|
else endDate.calendar.selectedDate = UtilsCpp.createDateTime(selectedDate, 23, 59)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
onClicked: mainItem.addParticipantsRequested()
|
RowLayout {
|
||||||
},
|
Item {
|
||||||
ListView {
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
id: participantList
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
Layout.fillWidth: true
|
}
|
||||||
Layout.preferredHeight: contentHeight
|
|
||||||
Layout.maximumHeight: 250 * DefaultStyle.dp
|
|
||||||
clip: true
|
|
||||||
model: mainItem.conferenceInfoGui.core.participants
|
|
||||||
delegate: Item {
|
|
||||||
height: 56 * DefaultStyle.dp
|
|
||||||
width: participantList.width
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
visible: allDaySwitch.position === 0
|
||||||
spacing: 16 * DefaultStyle.dp
|
TimeComboBox {
|
||||||
Avatar {
|
id: startHour
|
||||||
Layout.preferredWidth: 45 * DefaultStyle.dp
|
visible: allDaySwitch.position === 0
|
||||||
Layout.preferredHeight: 45 * DefaultStyle.dp
|
indicator.visible: mainItem.isCreation
|
||||||
address: modelData.address
|
// Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: 94 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
|
background.visible: mainItem.isCreation
|
||||||
|
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
||||||
|
KeyNavigation.up: allDaySwitch
|
||||||
|
KeyNavigation.down: endDate
|
||||||
|
KeyNavigation.left: startDate
|
||||||
|
KeyNavigation.right: startDate
|
||||||
|
onSelectedDateTimeChanged: {
|
||||||
|
endHour.minTime = selectedDateTime
|
||||||
|
endHour.maxTime = UtilsCpp.createDateTime(selectedDateTime, 23, 59)
|
||||||
|
mainItem.conferenceInfoGui.core.dateTime = selectedDateTime
|
||||||
|
endDate.calendar.selectedDate = UtilsCpp.addSecs(selectedDateTime, 3600)
|
||||||
|
endHour.selectedDateTime = UtilsCpp.addSecs(selectedDateTime, 3600)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Text {
|
TimeComboBox {
|
||||||
text: modelData.displayName
|
id: endHour
|
||||||
font.pixelSize: 14 * DefaultStyle.dp
|
visible: allDaySwitch.position === 0
|
||||||
font.capitalization: Font.Capitalize
|
indicator.visible: mainItem.isCreation
|
||||||
|
Layout.preferredWidth: 94 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
|
background.visible: mainItem.isCreation
|
||||||
|
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
||||||
|
onSelectedDateTimeChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
Button {
|
Text {
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
property int durationSec: UtilsCpp.secsTo(startHour.selectedTime, endHour.selectedTime)
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
property int hour: durationSec/3600
|
||||||
icon.width: 24 * DefaultStyle.dp
|
property int min: (durationSec - hour*3600)/60
|
||||||
icon.height: 24 * DefaultStyle.dp
|
text: (hour > 0 ? hour + "h" : "") + (min > 0 ? min + "mn" : "")
|
||||||
Layout.rightMargin: 10 * DefaultStyle.dp
|
font {
|
||||||
background: Item{}
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
icon.source: AppIcons.closeX
|
weight: 700 * DefaultStyle.dp
|
||||||
contentImageColor: DefaultStyle.main1_500_main
|
}
|
||||||
onClicked: mainItem.conferenceInfoGui.core.removeParticipant(index)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CalendarComboBox {
|
||||||
|
id: endDate
|
||||||
|
visible: allDaySwitch.position === 1
|
||||||
|
background.visible: mainItem.isCreation
|
||||||
|
indicator.visible: mainItem.isCreation
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
|
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
|
||||||
|
onSelectedDateChanged: if (selectedDate) mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(selectedDate, endHour.selectedHour, endHour.selectedMin)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
RowLayout {
|
||||||
|
Item {
|
||||||
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
Switch {
|
||||||
|
id: allDaySwitch
|
||||||
|
text: qsTr("Toute la journée")
|
||||||
|
onPositionChanged: {
|
||||||
|
if (position == 1) {
|
||||||
|
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, 0, 0)
|
||||||
|
mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, 23, 59)
|
||||||
|
} else {
|
||||||
|
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, startHour.selectedHour, startHour.selectedMin)
|
||||||
|
mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, endHour.selectedHour, endHour.selectedMin)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
ComboBox {
|
||||||
|
id: timeZoneCbox
|
||||||
|
Layout.preferredWidth: 307 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
|
hoverEnabled: true
|
||||||
|
listView.implicitHeight: 250 * DefaultStyle.dp
|
||||||
|
constantImageSource: AppIcons.globe
|
||||||
|
weight: 700 * DefaultStyle.dp
|
||||||
|
leftMargin: 0
|
||||||
|
currentIndex: mainItem.conferenceInfoGui ? model.getIndex(mainItem.conferenceInfoGui.core.timeZoneModel) : -1
|
||||||
|
background: Rectangle {
|
||||||
|
visible: parent.hovered || parent.down
|
||||||
|
anchors.fill: parent
|
||||||
|
color: DefaultStyle.grey_100
|
||||||
|
}
|
||||||
|
model: TimeZoneProxy{
|
||||||
|
}
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
var modelIndex = timeZoneCbox.model.index(currentIndex, 0)
|
||||||
|
mainItem.conferenceInfoGui.core.timeZoneModel = timeZoneCbox.model.data(modelIndex, Qt.DisplayRole + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
Section {
|
||||||
|
content: RowLayout {
|
||||||
|
spacing: 8 * DefaultStyle.dp
|
||||||
|
EffectImage {
|
||||||
|
imageSource: AppIcons.note
|
||||||
|
colorizationColor: DefaultStyle.main2_600
|
||||||
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
TextArea {
|
||||||
|
id: descriptionEdit
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: 275 * DefaultStyle.dp
|
||||||
|
leftPadding: 8 * DefaultStyle.dp
|
||||||
|
rightPadding: 8 * DefaultStyle.dp
|
||||||
|
hoverEnabled: true
|
||||||
|
placeholderText: qsTr("Ajouter une description")
|
||||||
|
placeholderTextColor: DefaultStyle.main2_600
|
||||||
|
placeholderWeight: 700 * DefaultStyle.dp
|
||||||
|
color: DefaultStyle.main2_600
|
||||||
|
font {
|
||||||
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
|
weight: 400 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
onEditingFinished: mainItem.conferenceInfoGui.core.description = text
|
||||||
|
Keys.onPressed: (event)=> {
|
||||||
|
if (event.key == Qt.Key_Escape) {
|
||||||
|
text = mainItem.conferenceInfoGui.core.description
|
||||||
|
nextItemInFocusChain().forceActiveFocus()
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
background: Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: descriptionEdit.hovered || descriptionEdit.activeFocus ? DefaultStyle.grey_100 : "transparent"
|
||||||
|
radius: 4 * DefaultStyle.dp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
Section {
|
||||||
Switch {
|
content: [
|
||||||
text: qsTr("Send invitation to participants")
|
Button {
|
||||||
checked: mainItem.conferenceInfoGui.core.inviteEnabled
|
id: addParticipantsButton
|
||||||
onToggled: mainItem.conferenceInfoGui.core.inviteEnabled = checked
|
Layout.fillWidth: true
|
||||||
}
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
Item {
|
background: Rectangle {
|
||||||
Layout.fillHeight: true
|
anchors.fill: parent
|
||||||
Layout.minimumHeight: 1 * DefaultStyle.dp
|
color: addParticipantsButton.hovered || addParticipantsButton.activeFocus ? DefaultStyle.grey_100 : "transparent"
|
||||||
|
radius: 4 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
contentItem: RowLayout {
|
||||||
|
spacing: 8 * DefaultStyle.dp
|
||||||
|
EffectImage {
|
||||||
|
imageSource: AppIcons.usersThree
|
||||||
|
colorizationColor: DefaultStyle.main2_600
|
||||||
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Ajouter des participants")
|
||||||
|
font {
|
||||||
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
|
weight: 700 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onClicked: mainItem.addParticipantsRequested()
|
||||||
|
},
|
||||||
|
ListView {
|
||||||
|
id: participantList
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
Layout.maximumHeight: 250 * DefaultStyle.dp
|
||||||
|
clip: true
|
||||||
|
model: mainItem.conferenceInfoGui.core.participants
|
||||||
|
delegate: Item {
|
||||||
|
height: 56 * DefaultStyle.dp
|
||||||
|
width: participantList.width
|
||||||
|
RowLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
spacing: 16 * DefaultStyle.dp
|
||||||
|
Avatar {
|
||||||
|
Layout.preferredWidth: 45 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 45 * DefaultStyle.dp
|
||||||
|
address: modelData.address
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: modelData.displayName
|
||||||
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
|
font.capitalization: Font.Capitalize
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
|
icon.width: 24 * DefaultStyle.dp
|
||||||
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
Layout.rightMargin: 10 * DefaultStyle.dp
|
||||||
|
background: Item{}
|
||||||
|
icon.source: AppIcons.closeX
|
||||||
|
contentImageColor: DefaultStyle.main1_500_main
|
||||||
|
onClicked: mainItem.conferenceInfoGui.core.removeParticipant(index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Switch {
|
||||||
|
text: qsTr("Send invitation to participants")
|
||||||
|
checked: mainItem.conferenceInfoGui.core.inviteEnabled
|
||||||
|
onToggled: mainItem.conferenceInfoGui.core.inviteEnabled = checked
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.minimumHeight: 1 * DefaultStyle.dp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,25 @@ import UtilsCpp 1.0
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property var selectedDateTime
|
property var selectedDateTime
|
||||||
|
onSelectedDateTimeChanged: {
|
||||||
|
if (minTime != undefined) {
|
||||||
|
if (UtilsCpp.timeOffset(minTime, selectedDateTime) < 0)
|
||||||
|
selectedDateTime = minTime
|
||||||
|
}
|
||||||
|
if (maxTime != undefined) {
|
||||||
|
if (UtilsCpp.timeOffset(maxTime, selectedDateTime) > 0)
|
||||||
|
selectedDateTime = maxTime
|
||||||
|
}
|
||||||
|
}
|
||||||
readonly property string selectedTimeString: Qt.formatDateTime(selectedDateTime, "hh:mm")
|
readonly property string selectedTimeString: Qt.formatDateTime(selectedDateTime, "hh:mm")
|
||||||
property int selectedHour: input.hour*1
|
property int selectedHour: input.hour*1
|
||||||
property int selectedMin: input.min*1
|
property int selectedMin: input.min*1
|
||||||
property alias contentText: input
|
property alias contentText: input
|
||||||
|
property var minTime
|
||||||
|
property var maxTime
|
||||||
popup.width: 73 * DefaultStyle.dp
|
popup.width: 73 * DefaultStyle.dp
|
||||||
listView.model: 48
|
listView.model: 48
|
||||||
listView.implicitHeight: 204 * DefaultStyle.dp
|
listView.height: Math.min(204 * DefaultStyle.dp, listView.implicitHeight)
|
||||||
editable: true
|
editable: true
|
||||||
popup.closePolicy: Popup.PressOutsideParent | Popup.CloseOnPressOutside
|
popup.closePolicy: Popup.PressOutsideParent | Popup.CloseOnPressOutside
|
||||||
onCurrentTextChanged: input.text = currentText
|
onCurrentTextChanged: input.text = currentText
|
||||||
|
|
@ -48,18 +60,20 @@ ComboBox {
|
||||||
focus = false
|
focus = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEditingFinished: {
|
onFocusChanged: if (!focus) {
|
||||||
console.log("set time", hour, min)
|
|
||||||
mainItem.selectedDateTime = UtilsCpp.createDateTime(mainItem.selectedDateTime, hour, min)
|
mainItem.selectedDateTime = UtilsCpp.createDateTime(mainItem.selectedDateTime, hour, min)
|
||||||
|
console.log("set time", hour, min)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
listView.delegate: Text {
|
listView.delegate: Text {
|
||||||
id: hourDelegate
|
id: hourDelegate
|
||||||
property int hour: modelData /2
|
property int hour: modelData /2
|
||||||
property int min: modelData%2 === 0 ? 0 : 30
|
property int min: modelData%2 === 0 ? 0 : 30
|
||||||
text: Qt.formatDateTime(UtilsCpp.createDateTime(new Date(), hour, min), "hh:mm")
|
property var currentDateTime: UtilsCpp.createDateTime(new Date(), hour, min)
|
||||||
|
text: Qt.formatDateTime(currentDateTime, "hh:mm")
|
||||||
width: mainItem.width
|
width: mainItem.width
|
||||||
height: 25 * DefaultStyle.dp
|
visible: mainItem.minTime == undefined || UtilsCpp.timeOffset(mainItem.minTime, currentDateTime) > 0
|
||||||
|
height: visible ? 25 * DefaultStyle.dp : 0
|
||||||
verticalAlignment: TextInput.AlignVCenter
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
horizontalAlignment: TextInput.AlignHCenter
|
horizontalAlignment: TextInput.AlignHCenter
|
||||||
font {
|
font {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue