Newer
Older
width: 400
height: 200
minimumWidth: 400
minimumHeight: 200
maximumWidth: 800
maximumHeight: 400
standardButtons: StandardButton.Ok | StandardButton.Cancel
onAccepted: xdgUrlHandler.process()
onRejected: Qt.quit()
}
MessageDialog {
id: infoDialog
title: root.title
onAccepted: Qt.quit()
}
MessageDialog {
id: errorDialog
title: root.title
MessageDialog {
id: progressDialog
title: root.title
contentItem: Rectangle {
implicitWidth: 400
implicitHeight: 200
}
}
xdgUrlHandler.finished.connect(function(result) {
result = JSON.parse(result);
'success_download': 'Download successfull',
'success_install': 'Installation successfull',
'error_validation': 'Validation error',
'error_network': 'Network error',
'error_filetype': 'File type error',
'error_save': 'Saving file failed',
'error_install': 'Installation failed'
infoDialog.informativeText = metadata.filename;
infoDialog.detailedText = result.message;
errorDialog.informativeText = metadata.filename;
errorDialog.detailedText = result.message;
errorDialog.open();
}
});
if (xdgUrlHandler.isValid()) {
confirmDialog.text = 'Do you want to ' + metadata.command + '?';
confirmDialog.informativeText = metadata.filename;
confirmDialog.detailedText = 'URL: ' + metadata.url + '\n\n'
+ 'File: ' + metadata.filename + '\n\n'
errorDialog.text = 'Validation error';
errorDialog.detailedText = 'Invalid XDG-URL ' + xdgUrlHandler.getXdgUrl();