2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-06-15 12:51:04 +00:00
|
|
|
import "../../../../shared"
|
2021-01-28 11:04:10 +00:00
|
|
|
import "../../../../shared/status"
|
2020-06-15 12:51:04 +00:00
|
|
|
import "./"
|
|
|
|
|
2020-09-23 18:01:33 +00:00
|
|
|
ModalPopup {
|
2020-06-15 16:24:21 +00:00
|
|
|
function doRename(){
|
2020-12-06 15:24:28 +00:00
|
|
|
chatsModel.groups.rename(groupName.text)
|
2020-06-15 16:24:21 +00:00
|
|
|
popup.close();
|
|
|
|
}
|
|
|
|
|
2020-06-15 12:51:04 +00:00
|
|
|
id: popup
|
2020-09-23 18:01:33 +00:00
|
|
|
height: 210
|
2020-06-15 12:51:04 +00:00
|
|
|
|
2020-09-23 18:01:33 +00:00
|
|
|
//% "Group name"
|
|
|
|
title: qsTrId("group-name")
|
2020-06-15 12:51:04 +00:00
|
|
|
|
|
|
|
onOpened: {
|
|
|
|
groupName.forceActiveFocus(Qt.MouseFocusReason)
|
2021-06-17 22:09:00 +00:00
|
|
|
groupName.text = chatsModel.channelView.activeChannel.name
|
2020-06-15 12:51:04 +00:00
|
|
|
}
|
|
|
|
|
2020-09-23 18:01:33 +00:00
|
|
|
Input {
|
|
|
|
id: groupName
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
//% "Group name"
|
|
|
|
placeholderText: qsTrId("group-name")
|
|
|
|
Keys.onEnterPressed: doRename()
|
|
|
|
Keys.onReturnPressed: doRename()
|
2020-06-15 12:51:04 +00:00
|
|
|
}
|
|
|
|
|
2021-01-28 11:04:10 +00:00
|
|
|
footer: StatusButton {
|
2020-09-23 18:01:33 +00:00
|
|
|
id: saveBtn
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
//% "Save"
|
2021-01-28 11:04:10 +00:00
|
|
|
text: qsTrId("save")
|
2020-09-23 18:01:33 +00:00
|
|
|
onClicked : doRename()
|
|
|
|
}
|
2020-06-15 12:51:04 +00:00
|
|
|
}
|