123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- import QtQuick 1.1
- MyPage {
- id: addContactPage
- 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: addContactPage.width - flickArea.anchors.rightMargin - flickArea.anchors.leftMargin
- spacing: 10
- Item {
- id: spacer1
- height: 30
- width: addContactPage.width
- }
- Row {
- spacing: 20
- anchors.horizontalCenter: parent.horizontalCenter
- Image {
- id: imgAddContact
- anchors.verticalCenter: parent.verticalCenter
- source: "qrc:/qml/images/contact_add.png"
- }
- Text {
- id: txtAddContact
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Adding contact:")
- font.pixelSize: 32
- }
- }
- Item {
- id: spacer11
- height: 20
- width: addContactPage.width
- }
- Text {
- id: txtJid
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Jid:")
- font.pixelSize: 28
- }
- Text {
- id: txtJidExample
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Example: login@server.com")
- color: "gray"
- font.pixelSize: 18
- font.italic: true
- }
- MyTextInput {
- id: tiJid
- anchors.horizontalCenter: parent.horizontalCenter
- height: 50
- width: parent.width
- }
- Item {
- id: spacer2
- height: 10
- width: addContactPage.width
- }
- Text {
- id: txtNickname
- anchors.horizontalCenter: parent.horizontalCenter
- text: qsTr("Nickname (optional):")
- font.pixelSize: 28
- }
- MyTextInput {
- id: tiNickname
- anchors.horizontalCenter: parent.horizontalCenter
- height: 50
- width: parent.width
- font.pixelSize: 28
- }
- Item {
- id: spacer3
- height: 10
- width: addContactPage.width
- }
- MyCheckBox {
- id: checkBoxAuth
- text: qsTr("Request authorization")
- }
- Item {
- height: 10
- width: addContactPage.width
- }
- Item {
- id: spacer6
- height: 5
- width: addContactPage.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: {
- addContactPage.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( tiJid.text != "" ) {
- var sendSubcribe = false
- if( checkBoxAuth.checked ) { sendSubcribe = true }
- xmppClient.addContact( tiJid.text, tiNickname.text, "", sendSubcribe )
- addContactPage.closePage( "qrc:/qml/RosterPage.qml" )
- }
- }
- pauseAnim: 600
- }
- }
- }
|