Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 by Savoir-faire Linux |
| 3 | * Author: Yang Wang <yang.wang@savoirfairelinux.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | import QtQuick 2.15 |
| 20 | import QtQuick.Controls 2.14 |
| 21 | import QtQuick.Layouts 1.14 |
| 22 | import QtQuick.Controls.Styles 1.4 |
| 23 | import QtQuick.Dialogs 1.3 |
| 24 | |
| 25 | MessageDialog { |
| 26 | id: messageBox |
| 27 | |
| 28 | visible: false |
| 29 | modality: Qt.NonModal |
| 30 | width: 300 |
| 31 | height: 200 |
| 32 | |
| 33 | onRejected: {} |
| 34 | |
| 35 | function openWithParameters(titleToDisplay, infoToDisplay, infoIconMode = StandardIcon.Information, buttons = StandardButton.Ok){ |
| 36 | title = titleToDisplay |
| 37 | text = infoToDisplay |
| 38 | icon = infoIconMode |
| 39 | standardButtons = buttons |
| 40 | messageBox.open() |
| 41 | } |
| 42 | } |