00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 import QtQuick 1.0
00041 import com.nokia.symbian 1.0
00042 import QtMobility.systeminfo 1.1
00043
00044 ApplicationWindow {
00045 id: window
00046
00047 function setStateIfFound(target, name) {
00048 for (var i = 0; i < target.states.length; i++) {
00049 var curState = target.states[i];
00050 if(curState.name == name) {
00051 target.state = name
00052 break
00053 }
00054 }
00055 }
00056
00057 ToolBarLayout {
00058 id: commonTools
00059 ToolButton {
00060 flat: true
00061 iconSource: "toolbar_back.svg"
00062 onClicked: pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
00063 }
00064 ToolButton {
00065 flat: true
00066 iconSource: "toolbar_options.svg"
00067 }
00068 }
00069
00070 Page {
00071 id: page
00072
00073 tools: commonTools
00074
00075 Component.onCompleted: {
00076 if(screen.currentOrientation == Screen.Portrait) {
00077 setStateIfFound(page, "PortraitState")
00078 } else if(screen.currentOrientation == Screen.Landscape) {
00079 setStateIfFound(page, "LandscapeState")
00080 }
00081 }
00082
00083 PageHeading{
00084 id: heading
00085 anchors.top: parent.top
00086 width: parent.width
00087 text: qsTr("Network Information")
00088 }
00089
00090
00091 NetworkInfo{
00092 id:myNetworkInfo
00093 }
00094
00095
00096 TextArea{
00097 id: displayInfo
00098 anchors.top: heading.bottom
00099 anchors.topMargin: 10
00100 font.pointSize: 8
00101 anchors.left: parent.left
00102 anchors.leftMargin: 10
00103 width: parent.width
00104 readOnly: true
00105 text: {
00106 "Current MCC : " + myNetworkInfo.currentMobileCountryCode + "\n" +
00107 "Cell ID : " + myNetworkInfo.cellId + "\n" +
00108 "Current MNC : " + myNetworkInfo.currentMobileNetworkCode + "\n" +
00109 "Current Mode : " + myNetworkInfo.currentMode + "\n" +
00110 "Network name : " + myNetworkInfo.networkName + "\n" +
00111 "Home MCC : " + myNetworkInfo.homeMobileCountryCode + "\n" +
00112 "Home MNC : " + myNetworkInfo.homeMobileNetworkCode + "\n" +
00113 "Location Area Code : " + myNetworkInfo.locationAreaCode + "\n" +
00114 "Network Status : " + myNetworkInfo.networkStatus + "\n" +
00115 "Network Signal Strength : " + myNetworkInfo.networkSignalStrength
00116 }
00117 }
00118
00119 Text{
00120 id: smsStatus
00121 width: parent.width
00122 anchors.top: displayInfo.bottom
00123 anchors.topMargin: 10
00124 anchors.leftMargin: 10
00125 text: "Sms delivery status..."
00126 color: "white"
00127 }
00128
00129
00130 SettingsPage{ id: settingsPage }
00131
00132
00133 Column{
00134 id: optionsList
00135 anchors.bottom: parent.bottom
00136 anchors.bottomMargin: 20
00137 spacing: 10
00138 anchors.left: parent.left
00139 anchors.leftMargin: 20
00140 anchors.rightMargin: 20
00141 anchors.right: parent.right
00142
00143 Button{
00144 id: sendSmS
00145 width: parent.width
00146 text: "Send SMS"
00147 onClicked:{
00148 smsStatus.text = "Calling send message";
00149 mymessaging.sendMessage( displayInfo.text, settingsPage.num1, settingsPage.num2
00150 , settingsPage.num3);
00151 }
00152 }
00153
00154 Button{
00155 id: settings
00156 width: parent.width
00157 text: "Settings"
00158 onClicked:{
00159 pageStack.push(settingsPage);
00160 }
00161 }
00162 }
00163
00164
00165 Connections{
00166 target: mymessaging
00167 onMsgStatusReceived:{
00168 smsStatus.text = response;
00169 }
00170 }
00171
00172 Connections {
00173 target: screen
00174 onCurrentOrientationChanged: {
00175 if(screen.currentOrientation == Screen.Portrait) {
00176 page.state = 'PortraitState'
00177 }
00178 if(screen.currentOrientation == Screen.Landscape) {
00179 page.state = 'LandscapeState'
00180 }
00181 }
00182 }
00183
00184 states: [
00185 State {
00186 name: "PortraitState"
00187
00188 AnchorChanges {
00189 target: optionsList
00190 anchors.left: parent.left
00191 }
00192
00193 AnchorChanges {
00194 target: smsStatus
00195 anchors.top: displayInfo.bottom
00196 anchors.left: parent.left
00197 }
00198 },
00199 State {
00200 name: "LandscapeState"
00201
00202 AnchorChanges {
00203 target: optionsList
00204 anchors.left: displayInfo.right
00205 }
00206
00207 AnchorChanges {
00208 target: smsStatus
00209 anchors.top: heading.bottom
00210 anchors.left: displayInfo.right
00211 }
00212
00213 PropertyChanges {
00214 target: displayInfo
00215 width: parent.width/2
00216 }
00217 }
00218 ]
00219 }
00220 Component.onCompleted: pageStack.push(page)
00221 }
00222