<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.4.1, 2012-04-15T11:56:44. -->
+<!-- Written by Qt Creator 2.4.1, 2012-04-15T12:02:39. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
import QtQuick 1.1
import com.nokia.meego 1.0
import QtMobility.connectivity 1.2
+import QtMobility.systeminfo 1.2
import "settingsstorage.js" as SettingsStorage
import qzeecontrol 1.0
btConn.keyBindingRight = SettingsStorage.getSetting("Right")
}
+ function updateConnectButton(){
+ if((addressField.text !== "No device found yet.") && deviceInfo.currentBluetoothPowerState){
+ connectButton.enabled = true
+ infoText.text = "Press \"Connect\" to connect to the device."
+ }
+ }
+
states: [
State {
name: "active"
Button{
id: scanButton
- enabled: true
+ enabled: deviceInfo.currentBluetoothPowerState
anchors.horizontalCenter: parent.horizontalCenter
text: "Scan"
if(text === "No device found yet.")
return
- connectButton.enabled = true
- infoText.text = "Press \"Connect\" to connect to the device."
+ updateConnectButton();
+
console.log("Storing address in DB: " + text)
SettingsStorage.setSetting("address", text)
}
}
}
+ DeviceInfo{
+ id: deviceInfo
+
+ monitorBluetoothStateChanges: true
+
+ onBluetoothStateChanged: {
+ updateConnectButton()
+ }
+ }
+
BluetoothDiscoveryModel{
id: btDiscovery