123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- import QtQuick 1.1
- import com.nokia.meego 1.0
- import TransferUI 1.0
- import "Consts.js" as Constants
- Item {
- id: transferEditor
- property alias id: idTextField.text
- property alias name: nameTextField.text
- property alias targetName: targetNameTextField.text
- property int size: sizeTextField.text
- property int type: Constants.TransferType.Upload
- property alias typeButtonsEnabled: typeButtonColumn.enabled
- property alias registerButtonEnabled: registerButton.enabled
- property alias commitButtonEnabled: commitButton.enabled
- property Style platformStyle: LabelStyle {}
- signal registerButtonClicked()
- signal commitButtonClicked()
- onSizeChanged: {
- sizeTextField.text = size;
- }
- Grid {
- id: editorGrid
- width: parent.width
- property int firstColumnWidth: 150
- property int secondColumnWidth: parent.width - spacing / 2
- - firstColumnWidth
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- }
- columns: 2
- spacing: 10
- Text {
- width: editorGrid.firstColumnWidth
- height: idTextField.height
- verticalAlignment: Text.AlignVCenter
- text: "ID"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- TextField {
- id: idTextField
- width: editorGrid.secondColumnWidth
- }
- Text {
- width: editorGrid.firstColumnWidth
- height: nameTextField.height
- verticalAlignment: Text.AlignVCenter
- text: "Name"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- TextField {
- id: nameTextField
- width: editorGrid.secondColumnWidth
- }
- Text {
- width: editorGrid.firstColumnWidth
- height: targetNameTextField.height
- verticalAlignment: Text.AlignVCenter
- text: "Target name"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- TextField {
- id: targetNameTextField
- width: editorGrid.secondColumnWidth
- }
- Text {
- width: editorGrid.firstColumnWidth
- height: sizeTextField.height
- verticalAlignment: Text.AlignVCenter
- text: "Size"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- TextField {
- id: sizeTextField
- width: editorGrid.secondColumnWidth
- validator: IntValidator {}
- inputMethodHints: Qt.ImhPreferNumbers
- onTextChanged: {
- var textAsNum = sizeTextField.text;
- transferEditor.size = textAsNum;
- }
- }
- Text {
- width: editorGrid.firstColumnWidth
- height: typeButtonColumn.height
- verticalAlignment: Text.AlignVCenter
- text: "Type"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- ButtonColumn {
- id: typeButtonColumn
- width: editorGrid.secondColumnWidth
- checkedButton: uploadButton
- Button {
- id: uploadButton
- text: "Upload"
- onClicked: transferEditor.type = Constants.TransferType.Upload;
- }
- Button {
- id: downloadButton
- text: "Download"
- onClicked: transferEditor.type = Constants.TransferType.Download;
- }
- Button {
- id: syncButton
- text: "Sync"
- onClicked: transferEditor.type = Constants.TransferType.Sync;
- }
- }
- }
- Row {
- id: buttonRow
- anchors {
- top: editorGrid.bottom
- left: parent.left
- right: parent.right
- topMargin: 20
- }
- spacing: 10
- Button {
- id: registerButton
- width: (buttonRow.width - buttonRow.spacing) / 2
- text: "Register"
- onClicked: transferEditor.registerButtonClicked();
- }
- Button {
- id: commitButton
- width: registerButton.width
- text: "Commit"
- onClicked: transferEditor.commitButtonClicked();
- }
- }
- }
- // End of file.
|