/* * Copyright (C) 2021 Lliurex project * * Author: * Enrique Medina Gremaldos * * Source: * https://github.com/lliurex/lliurex-homework-harvester * * This file is a part of lliurex homework harvester * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ import Edupals.N4D 1.0 as N4D import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.16 as Kirigami import QtQuick 2.6 import QtQuick.Controls 2.6 as QQC2 import QtQuick.Layouts 1.15 import QtQuick.Dialogs 1.0 import QtQml.Models 2.1 QQC2.Pane { id: mainPane visible:true width: 400 height: 600 anchors.centerIn:parent function insertFile(path) { for (var n=0;n0) { lblProgress.text=i18nd("lliurex-homework-harvester","Sending file %1 from %2",1+modelFiles.count-queue.count,modelFiles.count); pbar.value = 1.0-(queue.count/modelFiles.count); console.log("sending:",queue.get(0).name); console.log("send to2 ",modelTeachers.get(listTeachers.currentIndex).name); send_to_teacher.call([userName,modelTeachers.get(listTeachers.currentIndex).name,queue.get(0).path]); } else { msg.type=Kirigami.MessageType.Positive; msg.text=i18nd("lliurex-homework-harvester","Files successfully sent"); msg.visible=true; progress.visible=false; } } onError: { console.log("n4d error:\n",what); msg.type=Kirigami.MessageType.Error; msg.text=i18nd("lliurex-homework-harvester","Error sending files: %1",code); msg.visible=true; progress.visible=false; } } Component.onCompleted: { for (var file in files) { insertFile(files[file]); } share_get_paths.call([]); } FileDialog { id: fileDialog title: i18nd("lliurex-homework-harvester","Select files"); folder: shortcuts.home onAccepted: { console.log("You chose: " + fileDialog.fileUrls) for (var n=0;n