mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-02 03:37:13 +02:00
* add Info, Warning and Error presets * add canCopy options to display/hide copy to clipboard button * tweak paddings and font size
47 lines
1 KiB
QML
47 lines
1 KiB
QML
import QtQuick 2.9
|
|
import MaterialIcons 2.2
|
|
import Controls 1.0
|
|
|
|
/**
|
|
* DialogsFactory is utility object to instantiate generic purpose Dialogs.
|
|
*/
|
|
QtObject {
|
|
|
|
readonly property string defaultErrorText: "An unexpected error has occured"
|
|
|
|
property Component infoDialog: Component {
|
|
MessageDialog {
|
|
title: "Info"
|
|
preset: "Info"
|
|
visible: true
|
|
}
|
|
}
|
|
property Component warningDialog: Component {
|
|
MessageDialog {
|
|
title: "Warning"
|
|
preset: "Warning"
|
|
visible: true
|
|
}
|
|
}
|
|
property Component errorDialog: Component {
|
|
id: errorDialog
|
|
MessageDialog {
|
|
title: "Error"
|
|
preset: "Error"
|
|
text: defaultErrorText
|
|
visible: true
|
|
}
|
|
}
|
|
|
|
function info(window) {
|
|
return infoDialog.createObject(window)
|
|
}
|
|
|
|
function warning(window) {
|
|
return warningDialog.createObject(window)
|
|
}
|
|
|
|
function error(window) {
|
|
return errorDialog.createObject(window)
|
|
}
|
|
}
|