123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734 |
- // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
- import QtQuick 1.1
- import "main.js" as Engine
- MyPage {
- id: settingsPage
- Component {
- id: cmpSounds
- Column {
- spacing: 10
- width: flickArea.width
- /*-------------------------------------------------*/
- Text {
- text: qsTr("Message received")
- font.pixelSize: 20
- font.bold: true
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Item {
- id: itemIncommingMsg
- width: parent.width
- height: 64
- Text {
- id: textIncommingMsg
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnFileIncommingMsg.left
- anchors.rightMargin: 10
- text: settings.soundIncomingMessage == "" ? "Empty" : Engine.baseName( settings.soundIncomingMessage )
- color: settings.soundIncomingMessage == "" ? "gray" : "black"
- //font.italic: settings.soundIncomingMessage == "" ? true : false
- font.italic: true
- font.pixelSize: 22
- clip: true
- MouseArea {
- anchors.fill: parent
- onClicked: {
- notify.notifyMessageRecv()
- }
- onPressedChanged: {
- if( pressed ) {
- textIncommingMsg.font.bold = true
- } else {
- textIncommingMsg.font.bold = false
- }
- }
- } //MouseArea
- }
- Button {
- id: btnFileIncommingMsg
- text: "..."
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnClearIncommingMsg.left
- anchors.rightMargin: 10
- height: parent.height - 4
- width: 72
- onClicked: {
- //chooseFilesSoundInMsg.dlgShowHide()
- var p = Engine.basePath( settings.soundIncomingMessage )
- //console.log( "presetPath:" + p )
- Engine.dlgFilesChoose( settingsPage, p, funcFileSoundInMsg )
- }
- }
- ToolButton {
- id: btnClearIncommingMsg
- anchors.right: parent.right
- anchors.rightMargin: 10
- icon: "qrc:/qml/images/bar_close.png"
- onClicked: {
- settings.soundIncomingMessage = ""
- }
- pauseAnim: 1
- }
- } // Item{ id: itemIncommingMsg ... }
- /*-------------------------------------------------------------------*/
- Text {
- text: qsTr("Message sent")
- font.pixelSize: 20
- font.bold: true
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Item {
- id: itemOutcommingMsg
- width: parent.width
- height: 64
- Text {
- id: textOutcommingMsg
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnFileOutcommingMsg.left
- anchors.rightMargin: 10
- text: settings.soundOutcomingMessage == "" ? "Empty" : Engine.baseName( settings.soundOutcomingMessage )
- color: settings.soundOutcomingMessage == "" ? "gray" : "black"
- //font.italic: settings.soundOutcomingMessage == "" ? true : false
- font.italic: true
- font.pixelSize: 22
- clip: true
- MouseArea {
- anchors.fill: parent
- onClicked: {
- notify.notifyMessageSent()
- }
- onPressedChanged: {
- if( pressed ) {
- textOutcommingMsg.font.bold = true
- } else {
- textOutcommingMsg.font.bold = false
- }
- }
- } //MouseArea
- }
- Button {
- id: btnFileOutcommingMsg
- text: "..."
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnClearOutcommingMsg.left
- anchors.rightMargin: 10
- height: parent.height-4
- width: 72
- onClicked: {
- //chooseFilesSoundOutMsg.dlgShowHide()
- var p = Engine.basePath( settings.soundOutcomingMessage )
- Engine.dlgFilesChoose( settingsPage, p, funcFilesSoundOutMsg )
- }
- }
- ToolButton {
- id: btnClearOutcommingMsg
- anchors.right: parent.right
- anchors.rightMargin: 10
- icon: "qrc:/qml/images/bar_close.png"
- onClicked: {
- settings.soundOutcomingMessage = ""
- }
- pauseAnim: 1
- }
- } // Item{ id: itemIncommingMsg ... }
- /*----------------------------------------------------------------*/
- Text {
- text: qsTr("Buddy logs in")
- font.pixelSize: 20
- anchors.horizontalCenter: parent.horizontalCenter
- font.bold: true
- }
- Item {
- id: itemBuddyLogsIn
- width: parent.width
- height: 64
- Text {
- id: textBuddyLogsIn
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnBuddyLogsIn.left
- anchors.rightMargin: 10
- text: settings.soundBuddyLogsIn == "" ? "Empty" : Engine.baseName( settings.soundBuddyLogsIn )
- color: settings.soundBuddyLogsIn == "" ? "gray" : "black"
- //font.italic: settings.soundBuddyLogsIn == "" ? true : false
- font.italic: true
- font.pixelSize: 22
- clip: true
- MouseArea {
- anchors.fill: parent
- onClicked: {
- notify.notifyBuddyLogsIn()
- }
- onPressedChanged: {
- if( pressed ) {
- textBuddyLogsIn.font.bold = true
- } else {
- textBuddyLogsIn.font.bold = false
- }
- }
- } //MouseArea
- }
- Button {
- id: btnBuddyLogsIn
- text: "..."
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnClearBuddyLogsIn.left
- anchors.rightMargin: 10
- height: parent.height-4
- width: 72
- onClicked: {
- //chooseFilesSoundIBuddyLogsIn.dlgShowHide()
- var p = Engine.basePath( settings.soundBuddyLogsIn )
- Engine.dlgFilesChoose( settingsPage, p, funcFilesSoundIBuddyLogsIn )
- }
- }
- ToolButton {
- id: btnClearBuddyLogsIn
- anchors.right: parent.right
- anchors.rightMargin: 10
- icon: "qrc:/qml/images/bar_close.png"
- onClicked: {
- settings.soundBuddyLogsIn = ""
- }
- pauseAnim: 1
- }
- } // Item{ id: itemBuddyLogsIn ... }
- /*---------------------------------------------------------------------*/
- Text {
- text: qsTr("Buddy logs Out")
- font.pixelSize: 20
- anchors.horizontalCenter: parent.horizontalCenter
- font.bold: true
- }
- Item {
- id: itemBuddyLogsOut
- width: parent.width
- height: 64
- Text {
- id: textBuddyLogsOut
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnBuddyLogsOut.left
- anchors.rightMargin: 10
- text: settings.soundBuddyLogsOut == "" ? "Empty" : Engine.baseName( settings.soundBuddyLogsOut )
- color: settings.soundBuddyLogsOut == "" ? "gray" : "black"
- //font.italic: settings.soundBuddyLogsOut == "" ? true : false
- font.italic: true
- font.pixelSize: 22
- clip: true
- MouseArea {
- anchors.fill: parent
- onClicked: {
- notify.notifyBuddyLogsOut()
- }
- onPressedChanged: {
- if( pressed ) {
- textBuddyLogsOut.font.bold = true
- } else {
- textBuddyLogsOut.font.bold = false
- }
- }
- } //MouseArea
- }
- Button {
- id: btnBuddyLogsOut
- text: "..."
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnClearBuddyLogsOut.left
- anchors.rightMargin: 10
- height: parent.height-4
- width: 72
- onClicked: {
- //chooseFilesSoundIBuddyLogsOut.dlgShowHide()
- var p = Engine.basePath( settings.soundBuddyLogsOut )
- Engine.dlgFilesChoose( settingsPage, p, funcFilesSoundIBuddyLogsOut )
- }
- }
- ToolButton {
- id: btnClearBuddyLogsOut
- anchors.right: parent.right
- anchors.rightMargin: 10
- icon: "qrc:/qml/images/bar_close.png"
- onClicked: {
- settings.soundBuddyLogsOut = ""
- }
- pauseAnim: 1
- }
- } // Item{ id: itemBuddyLogsIn ... }
- /*-------------------------------------------------*/
- Text {
- text: qsTr("Someone says your name in chat")
- font.pixelSize: 20
- font.bold: true
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Item {
- id: itemSaysYourName
- width: parent.width
- height: 64
- Text {
- id: textSaysYourName
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnFileSaysYourName.left
- anchors.rightMargin: 10
- text: settings.soundChatSomeoneSaysMyName == "" ? "Empty" : Engine.baseName( settings.soundChatSomeoneSaysMyName )
- color: settings.soundChatSomeoneSaysMyName == "" ? "gray" : "black"
- font.italic: true
- font.pixelSize: 22
- clip: true
- MouseArea {
- anchors.fill: parent
- onClicked: {
- notify.notifyChatSomeoneSaysMyName()
- }
- onPressedChanged: {
- if( pressed ) {
- textSaysYourName.font.bold = true
- } else {
- textSaysYourName.font.bold = false
- }
- }
- } //MouseArea
- }
- Button {
- id: btnFileSaysYourName
- text: "..."
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnClearSaysYourName.left
- anchors.rightMargin: 10
- height: parent.height - 4
- width: 72
- onClicked: {
- var p = Engine.basePath( settings.soundChatSomeoneSaysMyName )
- Engine.dlgFilesChoose( settingsPage, p, funcFileSaysYourName )
- }
- }
- ToolButton {
- id: btnClearSaysYourName
- anchors.right: parent.right
- anchors.rightMargin: 10
- icon: "qrc:/qml/images/bar_close.png"
- onClicked: {
- settings.soundChatSomeoneSaysMyName = ""
- }
- pauseAnim: 1
- }
- } // Item{ id: itemSaysYourName ... }
- /*-------------------------------------------------*/
- Text {
- text: qsTr("Others talk")
- font.pixelSize: 20
- font.bold: true
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Item {
- id: itemOthersSay
- width: parent.width
- height: 64
- Text {
- id: textOthersSay
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnFileOthersSay.left
- anchors.rightMargin: 10
- text: settings.soundChatOthersTalk == "" ? "Empty" : Engine.baseName( settings.soundChatOthersTalk )
- color: settings.soundChatOthersTalk == "" ? "gray" : "black"
- font.italic: true
- font.pixelSize: 22
- clip: true
- MouseArea {
- anchors.fill: parent
- onClicked: {
- notify.notifyChatOthersTalk()
- }
- onPressedChanged: {
- if( pressed ) {
- textOthersSay.font.bold = true
- } else {
- textOthersSay.font.bold = false
- }
- }
- } //MouseArea
- }
- Button {
- id: btnFileOthersSay
- text: "..."
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: btnClearOthersSay.left
- anchors.rightMargin: 10
- height: parent.height - 4
- width: 72
- onClicked: {
- var p = Engine.basePath( settings.soundChatOthersTalk )
- Engine.dlgFilesChoose( settingsPage, p, funcFileChatOthersTalk )
- }
- }
- ToolButton {
- id: btnClearOthersSay
- anchors.right: parent.right
- anchors.rightMargin: 10
- icon: "qrc:/qml/images/bar_close.png"
- onClicked: {
- settings.soundChatOthersTalk = ""
- }
- pauseAnim: 1
- }
- } // Item{ id: itemOthersSay ... }
- } //Column
- }
- Component {
- id: cmpVibration
- Column {
- spacing: 10
- width: flickArea.width
- MyCheckBox {
- id: vibrMsgRecv
- text: qsTr("Message received")
- font.pixelSize: 24
- checked: settings.vibrationMessageReceived
- onCheckedChanged: {
- settings.vibrationMessageReceived = checked
- }
- }
- MyCheckBox {
- id: vibrMesgSent
- text: qsTr("Message sent")
- font.pixelSize: 24
- checked: settings.vibrationMessageSent
- onCheckedChanged: {
- settings.vibrationMessageSent = checked
- }
- }
- MyCheckBox {
- id: vibrChatSaysYourName
- text: qsTr("Someone says you name")
- font.pixelSize: 24
- checked: settings.vibrationChatSomeoneSaysMyName
- onCheckedChanged: {
- settings.vibrationChatSomeoneSaysMyName = checked
- }
- }
- MyCheckBox {
- id: vibrChatOthersTalk
- text: qsTr("Others talk")
- font.pixelSize: 24
- checked: settings.vibrationChatOthersTalk
- onCheckedChanged: {
- settings.vibrationChatOthersTalk = checked
- }
- }
- }
- }
- Component {
- id: cmpNotification
- Column {
- spacing: 10
- width: flickArea.width
- MyCheckBox {
- id: notifyConnecting
- text: qsTr("Connecting")
- font.pixelSize: 24
- checked: settings.notifyConnection
- onCheckedChanged: {
- settings.notifyConnection = checked
- }
- }
- MyCheckBox {
- id: notifyOnlibe
- text: qsTr("Online")
- font.pixelSize: 24
- checked: settings.notifyOnline
- onCheckedChanged: {
- settings.notifyOnline = checked
- }
- }
- MyCheckBox {
- id: notifyOffline
- text: qsTr("Offline")
- font.pixelSize: 24
- checked: settings.notifyOffline
- onCheckedChanged: {
- settings.notifyOffline = checked
- }
- }
- MyCheckBox {
- id: notifyMsgReceived
- text: qsTr("Message received")
- font.pixelSize: 24
- checked: settings.notifyMessage
- onCheckedChanged: {
- settings.notifyMessage = checked
- }
- }
- MyCheckBox {
- id: notifyBoxTyping
- text: qsTr("Typing")
- font.pixelSize: 24
- checked: settings.notifyTyping
- onCheckedChanged: {
- settings.notifyTyping = checked
- }
- }
- }
- }
- Component {
- id: cmpConnection
- Column {
- spacing: 10
- width: flickArea.width
- MyCheckBox {
- id: cbNeedReconnect
- text: qsTr("Reconnect when error")
- font.pixelSize: 24
- checked: settings.reconnectWhenError === true ? true : false
- onCheckedChanged: {
- console.log("Reconnect when error: checked="+checked)
- xmppClient.reconnectOnError = checked
- settings.reconnectWhenError = checked
- }
- }
- Text {
- text: qsTr("Keep alive interval (secs)")
- font.pixelSize: 20
- anchors.horizontalCenter: parent.horizontalCenter
- font.bold: true
- }
- MyTextInput {
- id: tiKeepAlive
- anchors.horizontalCenter: parent.horizontalCenter
- height: 50
- width: parent.width - 20
- Component.onCompleted: {
- tiKeepAlive.text = settings.keepAliveInterval
- }
- onTextChanged: {
- var interval = parseInt(tiKeepAlive.text)
- xmppClient.keepAlive = interval
- settings.keepAliveInterval = interval
- }
- }
- Item {
- id: space
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width
- height: 50
- }
- }
- }
- Component {
- id: cmpSmilesTheme
- Column {
- spacing: 10
- width: flickArea.width
- Text {
- id: textCurrentTheme
- font.pixelSize: 24
- anchors.horizontalCenter: parent.horizontalCenter
- }
- ListView {
- id: listModelThemeSmiles
- delegate: delegateThemeSmiles
- model: mainSmiles.themeSmiles
- height: 400
- width: parent.width
- clip: true
- }
- }
- }
- Component {
- id: delegateThemeSmiles
- Rectangle {
- id: wrapper
- width: listModelThemeSmiles.width-4
- height: 70
- border.color: "gray"
- anchors.horizontalCenter: parent.horizontalCenter
- Image {
- id: imgTheme
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 15
- smooth: true
- height: 58; width: height
- source:smileThemePicture
- }
- Text {
- id: textName
- font.pixelSize: 28
- anchors.left: imgTheme.right
- anchors.leftMargin: 15
- anchors.top: parent.top
- anchors.topMargin: 5
- text: smileThemeName
- }
- Text {
- id: textAuthor
- font.pixelSize: 16
- color: "gray"
- anchors.left: imgTheme.right
- anchors.leftMargin: 15
- anchors.top: textName.bottom
- anchors.topMargin: 5
- text: qsTr("Author") + ": " + smileThemeAuthor
- }
- MouseArea {
- id: mouseAreaItem;
- anchors.fill: parent
- onClicked:
- {
- wrapper.ListView.view.currentIndex = index
- settings.smilesTheme = smileThemeFile
- mainSmiles.file = smileThemeFile
- textCurrentTheme.text = qsTr("Current theme is") + " <b>'" + smileThemeName + "'</b>"
- }
- }
- Component.onCompleted: {
- console.log("mainSmiles.file="+mainSmiles.file)
- console.log("index="+index)
- if (settings.smilesTheme == smileThemeFile) {
- textCurrentTheme.text = qsTr("Current theme is") + " <b>'" + smileThemeName + "'</b>"
- }
- }
- states: State {
- name: "Current"
- when: (wrapper.ListView.isCurrentItem && (mainSmiles.file = smileThemeFile) )
- PropertyChanges { target: wrapper; color: "lightblue" }
- }
- //color: (settings.smilesTheme == smileThemeFile) ? "lightblue" : "white"
- }
- }
- 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: columnContent.height
- contentWidth: columnContent.width
- flickableDirection: Flickable.VerticalFlick
- Column {
- id: columnContent
- width: settingsPage.width - flickArea.anchors.rightMargin - flickArea.anchors.leftMargin
- spacing: 5
- HiddenBlock {
- id: soundNotify
- state: "open"
- contentBlock: cmpSounds
- title: qsTr("Sounds")
- }
- HiddenBlock {
- id: vibrNotify
- state: "close"
- contentBlock: cmpVibration
- title: qsTr("Vibration")
- }
- HiddenBlock {
- id: optNotify
- state: "close"
- contentBlock: cmpNotification
- title: qsTr("Notification")
- }
- HiddenBlock {
- id: optConnection
- state: "close"
- contentBlock: cmpConnection
- title: qsTr("Connection")
- }
- HiddenBlock {
- id: optThemeSmiles
- state: "close"
- contentBlock: cmpSmilesTheme
- title: qsTr("Smiles")
- }
- }
- }
- /****************************************************/
- function funcFileSoundInMsg( fileSelected ) {
- settings.soundIncomingMessage = fileSelected
- }
- function funcFilesSoundOutMsg( fileSelected ) {
- settings.soundOutcomingMessage = fileSelected
- }
- function funcFilesSoundIBuddyLogsIn( fileSelected ) {
- settings.soundBuddyLogsIn = fileSelected
- }
- function funcFilesSoundIBuddyLogsOut( fileSelected ) {
- settings.soundBuddyLogsOut = fileSelected
- }
- function funcFileSaysYourName( fileSelected ) {
- settings.soundChatSomeoneSaysMyName = fileSelected
- }
- function funcFileChatPersonEnters( fileSelected ) {
- settings.soundChatPersonEnters = fileSelected
- }
- function funcFileChatPersonLeaves( fileSelected ) {
- settings.soundChatPersonLeaves = fileSelected
- }
- function funcFileChatITalk( fileSelected ) {
- settings.soundChatChatITalk = fileSelected
- }
- function funcFileChatOthersTalk( fileSelected ) {
- settings.soundChatOthersTalk = fileSelected
- }
- /****************************************************/
- ToolBar {
- id: toolBar
- ToolButton {
- id: toolBarButtonDialog
- icon: "qrc:/qml/images/bar_roster.png"
- anchors.left: parent.left
- anchors.leftMargin: 30
- onClicked: {
- settingsPage.closePage( "qrc:/qml/RosterPage.qml" )
- }
- pauseAnim: 500
- }
- } //ToolBar
- } //MyPage
|