SheetConfig.qml Example File
pushCollector/10.0/pushCollector/assets/SheetConfig.qml
import bb.cascades 1.0
Page {
id: sheetConfig
function setValues() {
appId.text = _pushAPIHandler.appId;
ppgUrl.text = _pushAPIHandler.ppgUrl;
pushInitiatorUrl.text = _pushAPIHandler.pushInitiatorUrl;
publicPpgOption.selected = _pushAPIHandler.usePublicPpg;
enterprisePpgOption.selected = ! _pushAPIHandler.usePublicPpg;
launchAppOnPush.checked = _pushAPIHandler.launchApplicationOnPush;
useSDKasPushInitiator.checked = _pushAPIHandler.pushInitiatorUrl != "";
}
signal cancel()
signal save()
signal refresh()
onRefresh: {
_pushAPIHandler.loadConfiguration();
setValues();
}
onCreationCompleted: {
setValues();
}
titleBar: TitleBar {
id: addBar
title: qsTr("Configuration")
visibility: ChromeVisibility.Visible
dismissAction: ActionItem {
title: qsTr("Cancel")
onTriggered: {
sheetConfig.cancel();
}
}
acceptAction: ActionItem {
title: qsTr("Save")
onTriggered: {
sheetConfig.save();
}
}
}
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Vertical
}
Container {
Container {
topPadding: 30
leftPadding: 20
rightPadding: 20
bottomPadding: 10
DropDown {
horizontalAlignment: HorizontalAlignment.Center
title: qsTr("Mode")
enabled: true
Option {
id: publicPpgOption
text: qsTr("Public/BIS")
value: text
selected: true
}
Option {
id: enterprisePpgOption
text: qsTr("Enterprise/BDS")
value: text
}
onSelectedIndexChanged: {
_pushAPIHandler.usePublicPpg = publicPpgOption.selected;
}
}
}
Divider {
}
CustomCheckBox {
id: useSDKasPushInitiator
text: qsTr("Subscribe with Push Service SDK")
onCheckedChanged: {
_pushAPIHandler.useSdk = checked
}
}
Divider {
}
CustomTextField {
id: appId
description: qsTr("Application ID")
inputMode: TextFieldInputMode.Text
onTextChanged: {
_pushAPIHandler.appId = text;
}
textEnabled: (publicPpgOption.selected ? true : useSDKasPushInitiator.checked)
}
Divider {
}
CustomTextField {
id: ppgUrl
description: qsTr("PPG Url")
inputMode: TextFieldInputMode.Url
textEnabled: publicPpgOption.selected
onTextChanged: {
_pushAPIHandler.ppgUrl = text;
}
}
Divider {
}
CustomTextField {
id: pushInitiatorUrl
description: qsTr("Push Initiator Url")
inputMode: TextFieldInputMode.Url
textEnabled: useSDKasPushInitiator.checked
onTextChanged: {
_pushAPIHandler.pushInitiatorUrl = text;
}
}
Divider {
}
CustomCheckBox {
id: launchAppOnPush
text: qsTr("Launch Application on New Push")
onCheckedChanged: {
_pushAPIHandler.launchApplicationOnPush = checked;
}
}
Divider {
}
}
}
}