ImportDialog.qml 1.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
    Copyright (C) 2018 Volker Krause <vkrause@kde.org>

    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or (at your
    option) any later version.

    This program 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 Library General Public
    License for more details.

    You should have received a copy of the GNU General Public License
15
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
16 17 18
*/

import QtQuick 2.0
19
import Qt.labs.platform 1.0 as Platform
20 21 22 23 24 25 26

Item {
    function importReservation()
    {
        fileDialog.visible = true;
    }

27
    Platform.FileDialog {
28
        id: fileDialog
Volker Krause's avatar
Volker Krause committed
29 30
        title: i18n("Import Reservation")
        nameFilters: [i18n("PkPass files (*.pkpass)"), i18n("JSON files (*.json)"), i18n("PDF files (*.pdf)")]
31
        folder: Platform.StandardPaths.writableLocation(Platform.StandardPaths.DocumentsLocation)
32
        onAccepted: {
Volker Krause's avatar
Volker Krause committed
33
            _appController.importFromUrl(fileDialog.file);
34 35 36
        }
    }
}