diff --git a/doric-Qt/doric/plugin/DoricModalPlugin.cpp b/doric-Qt/doric/plugin/DoricModalPlugin.cpp index 0054e04d..154134f1 100644 --- a/doric-Qt/doric/plugin/DoricModalPlugin.cpp +++ b/doric-Qt/doric/plugin/DoricModalPlugin.cpp @@ -95,6 +95,7 @@ void DoricModalPlugin::alert(QString jsValueString, QString callbackId) { window->setProperty("callbackId", callbackId); window->setProperty("title", titleVal.toString()); + window->setProperty("msg", msgVal.toString()); window->setProperty("okLabel", okBtn.toString()); QQuickWindow *parentWindow = @@ -148,6 +149,7 @@ void DoricModalPlugin::confirm(QString jsValueString, QString callbackId) { window->setProperty("callbackId", callbackId); window->setProperty("title", titleVal.toString()); + window->setProperty("msg", msgVal.toString()); window->setProperty("okLabel", okBtn.toString()); window->setProperty("cancelLabel", cancelBtn.toString()); diff --git a/doric-Qt/doric/resources/alert.qml b/doric-Qt/doric/resources/alert.qml index 5db745ce..f48e8c54 100644 --- a/doric-Qt/doric/resources/alert.qml +++ b/doric-Qt/doric/resources/alert.qml @@ -13,12 +13,17 @@ Window { property var callbackId property var title + property var msg property var okLabel onTitleChanged: { dialog.title = title } + onMsgChanged: { + content.text = msg + } + onOkLabelChanged: { dialog.standardButton(Dialog.Ok).text = qsTrId(okLabel) } @@ -27,6 +32,9 @@ Window { id: dialog standardButtons: Dialog.Ok modal: true + contentItem: Text { + id: content + } onAccepted: { dialogBridge.onAccepted(pointer, plugin, callbackId) diff --git a/doric-Qt/doric/resources/confirm.qml b/doric-Qt/doric/resources/confirm.qml index 7f90382f..997f1ba3 100644 --- a/doric-Qt/doric/resources/confirm.qml +++ b/doric-Qt/doric/resources/confirm.qml @@ -13,6 +13,7 @@ Window { property var callbackId property var title + property var msg property var okLabel property var cancelLabel @@ -20,6 +21,10 @@ Window { dialog.title = title } + onMsgChanged: { + content.text = msg + } + onOkLabelChanged: { dialog.standardButton(Dialog.Ok).text = qsTrId(okLabel) } @@ -32,6 +37,9 @@ Window { id: dialog standardButtons: Dialog.Ok | Dialog.Cancel modal: true + contentItem: Text { + id: content + } onAccepted: { dialogBridge.onAccepted(pointer, plugin, callbackId)