X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=qml%2Fubi%2FPropertiesPage.qml;h=3b00ae7d66e0f31f4c848e7dba824057abdb8c14;hb=4b7d3c9a2ffcba5ec4f6479dccb09d6b16988773;hp=4aeef62bfa0e3a98c725c925cee7f2c63c01e03f;hpb=7f0e071fbec9953213b41b6298a419c921850fa8;p=ubi diff --git a/qml/ubi/PropertiesPage.qml b/qml/ubi/PropertiesPage.qml index 4aeef62..3b00ae7 100644 --- a/qml/ubi/PropertiesPage.qml +++ b/qml/ubi/PropertiesPage.qml @@ -13,6 +13,8 @@ Page { property variant properties property bool isPublic + property alias taskMenu: taskMenu + menu: [ [qsTr("Download"),false], [qsTr("Publish"),false], @@ -50,9 +52,9 @@ Page { onOperationError: { mask.state = "idle"; if(status==401) { - tip.show(qsTr("Authorization failed!")); + tip.show(qsTr("Ubuntu One authorization has failed. Try once again or check login settings.")); } else { - tip.show(qsTr("Error: ")+status); + tip.show(qsTr("Unknown error: ")+status); } } } @@ -100,11 +102,11 @@ Page { { mask.state = "idle"; if(status==401) { - tip.show(qsTr("Authorization failed!")); + tip.show(qsTr("Ubuntu One authorization has failed. Try once again or check login settings.")); } else if(status==0) { - tip.show(qsTr("Unable to connect!")); + tip.show(qsTr("Unable to connect. Check internet connection.")); } else { - tip.show(qsTr("Error: ")+status); + tip.show(qsTr("Unknown error: ")+status); } } @@ -150,8 +152,8 @@ Page { Flickable { width: root.width height: root.height - contentHeight: content.height+Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN - y: Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN + contentHeight: content.height+Const.TOP_BAR_HEIGHT+Const.SYSTEM_BAR_HEIGHT+Const.TEXT_MARGIN + y: Const.TOP_BAR_HEIGHT Column { id: content @@ -256,7 +258,7 @@ Page { } } - FileSelector { + /*FileSelector { id: fileSelector z: 200 y: 200 @@ -266,8 +268,22 @@ Page { U1.getFileContent(secrets,root,properties.content_path,folder,properties.size,Utils); Utils.setLastFolder(folder); } + }*/ + + FileDialog { + id: fileSelector + z: 200 + hidden: true + folder: Utils.lastFolder()=="" ? Const.DEFAULT_FOLDER : Utils.lastFolder() + folderOnly: true + onFolderSelected: { + fileSelector.close(); + U1.getFileContent(secrets,root,properties.content_path,folder,properties.size,Utils); + Utils.setLastFolder(folder); + } } + DialogYesNo { id: dialogDelete z: 200 @@ -369,4 +385,86 @@ Page { } } + /* + menu: [ + [qsTr("Download"),false], + [qsTr("Publish"),false], + [qsTr("Rename"),false], + [qsTr("Delete"),false] + ] + + function menuFun(id) { + if(id==qsTr("Download")) { + fileSelector.state = "visible"; + } + if(id==qsTr("Publish")) { + if(isPublic) { + dialogStopPublish.open(); + } else { + dialogStartPublish.open(); + } + } + if(id==qsTr("Rename")) { + dialogRename.open(); + } + if(id==qsTr("Delete")) { + dialogDelete.open(); + } + }*/ + + TaskMenu { + z: 200 + id: taskMenu + + contexMenu: true + menuDynamic: _menuDyn + menuHeight: menuDynamic.height+menuFixed.height+7*Const.DEFAULT_MARGIN + + Flow { + id: _menuDyn + + y: root.height-taskMenu.menuHeight-Const.SYSTEM_BAR_HEIGHT+2*Const.DEFAULT_MARGIN + x: Const.DEFAULT_MARGIN + + width: parent.width-2*Const.DEFAULT_MARGIN + spacing: Const.DEFAULT_MARGIN + + Button { + label: qsTr("Download"); + onButtonClicked: { + taskMenu.close(); + fileSelector.open(); + } + } + + Button { + label: qsTr("Publish"); + onButtonClicked: { + taskMenu.close(); + if(isPublic) { + dialogStopPublish.open(); + } else { + dialogStartPublish.open(); + } + } + } + + Button { + label: qsTr("Rename"); + onButtonClicked: { + taskMenu.close(); + dialogRename.open(); + } + } + + Button { + label: qsTr("Delete"); + onButtonClicked: { + taskMenu.close(); + dialogDelete.open(); + } + } + } + } + }