123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- import QtQuick 1.1
- MyPage {
- id: discoveryPage
- Flickable {
- id: flickArea
- anchors.top: parent.top; anchors.topMargin: 5
- anchors.bottom: toolBar.top; anchors.bottomMargin: 5
- anchors.left: parent.left; anchors.leftMargin: 10
- anchors.right: parent.right; anchors.rightMargin: 10
- contentHeight: contentPage.height
- contentWidth: contentPage.width
- flickableDirection: Flickable.VerticalFlick
- Column {
- id: contentPage
- width: discoveryPage.width - flickArea.anchors.rightMargin - flickArea.anchors.leftMargin
- spacing: 10
- Item {
- id: spacer1
- height: 30
- width: discoveryPage.width
- }
- Row {
- spacing: 20
- anchors.horizontalCenter: parent.horizontalCenter
- Image {
- id: imgAddContact
- anchors.verticalCenter: parent.verticalCenter
- source: "qrc:/qml/images/muc.png"
- }
- Text {
- id: txtAddContact
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Multi-user chat:")
- font.pixelSize: 32
- }
- }
- Item {
- id: spacer11
- height: 20
- width: discoveryPage.width
- }
- Text {
- id: txtJid
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Room:")
- font.pixelSize: 28
- }
- Text {
- id: txtJidExample
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Example: room@conference.server.com")
- color: "gray"
- font.pixelSize: 18
- font.italic: true
- }
- MyTextInput2 {
- id: tiJid
- anchors.horizontalCenter: parent.horizontalCenter
- height: 50
- width: parent.width
- Component.onCompleted: {
- if( main.invRoomJid != "" ) {
- tiJid.text = main.invRoomJid
- }
- }
- }
- Item {
- height: 10
- width: discoveryPage.width
- }
- Text {
- id: txtNickname
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Nickname:")
- font.pixelSize: 28
- }
- MyTextInput2 {
- id: tiNickname
- anchors.horizontalCenter: parent.horizontalCenter
- height: 50
- width: parent.width
- font.pixelSize: 28
- Component.onCompleted: {
- if( main.invMyNickName != "" ) {
- tiNickname.text = main.invMyNickName
- }
- }
- }
- Item {
- id: spacer3
- height: 10
- width: discoveryPage.width
- }
- Text {
- id: txtPassword
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Passowrd:")
- font.pixelSize: 28
- }
- MyTextInput2 {
- id: tiPassword
- anchors.horizontalCenter: parent.horizontalCenter
- height: 50
- width: parent.width
- font.pixelSize: 28
- }
- Item {
- height: 10
- width: discoveryPage.width
- }
- MyCheckBox {
- id: cbAddToRoster
- text: qsTr("bookmark")
- }
- Item {
- height: 10
- width: discoveryPage.width
- }
- Item {
- id: spacer6
- height: 5
- width: discoveryPage.width
- }
- }
- }
- /******************************************/
- ToolBar {
- id: toolBar
- ToolButton {
- id: toolBarButtonRoster
- icon: "qrc:/qml/images/bar_options.png"
- anchors.left: parent.left
- anchors.leftMargin: (0.5*(parent.width/4) - 0.5*toolBarButtonRoster.width)
- onClicked: {
- discoveryPage.closePage( "qrc:/qml/RosterPage.qml" )
- }
- pauseAnim: 500
- }
- ToolButton {
- id: toolBarButtonOptions
- icon: "qrc:/qml/images/bar_ok.png"
- anchors.left: parent.left
- anchors.leftMargin: (3.5*(parent.width/4) - 0.5*toolBarButtonOptions.width)
- onClicked: {
- if ( (tiNickname.text != "") && (tiJid.text != "") )
- {
- muc.nickName = tiNickname.text
- if ( tiPassword.text != "" ) {
- muc.password = tiPassword.text
- }
- xmppClient.addMucRoster( tiJid.text, muc.subjectRoom, cbAddToRoster.checked ) //add muc to roster
- muc.jidRoom = tiJid.text //enter to muc
- discoveryPage.closePage( "qrc:/qml/RosterPage.qml" )
- //xmppClient.chatJid = main.invRoomJid
- main.invRoomJid = ""
- main.invIniterJid = ""
- }
- }
- pauseAnim: 600
- }
- }
- }
|