Paste from clipboard on "Add new URL"

This commit is contained in:
Thomas Perl 2014-03-29 09:15:06 +01:00
parent 2f63de31b0
commit d1e7b2f2c9
3 changed files with 12 additions and 0 deletions

View file

@ -29,6 +29,10 @@ Item {
property string placeholderText: ''
signal accepted
function paste() {
textInput.paste();
}
height: 50 * pgst.scalef
TextInput {

View file

@ -58,6 +58,7 @@ SlidePage {
pgst.loadPage('TextInputDialog.qml', {
buttonText: 'Subscribe',
placeholderText: 'Feed URL',
pasteOnLoad: true,
callback: function (url) {
ctx.py.call('main.subscribe', [url]);
}

View file

@ -28,10 +28,17 @@ Dialog {
property string buttonText
property string placeholderText
property string text
property bool pasteOnLoad: false
property var callback
contentHeight: contentColumn.height
Component.onCompleted: {
if (pasteOnLoad) {
input.paste();
}
}
function accept() {
textInputDialog.callback(input.text);
textInputDialog.closePage();