mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 23:12:16 +02:00
simple snapshot confirmation
This commit is contained in:
parent
5a0db63a6f
commit
fed775ff83
2 changed files with 10 additions and 2 deletions
|
@ -96,7 +96,7 @@ void WindowScriptingInterface::alert(const QString& message) {
|
|||
/// \param const QString& message message to display
|
||||
/// \return QScriptValue `true` if 'Yes' was clicked, `false` otherwise
|
||||
QScriptValue WindowScriptingInterface::confirm(const QString& message) {
|
||||
return QScriptValue((QMessageBox::Yes == OffscreenUi::question("", message)));
|
||||
return QScriptValue((QMessageBox::Yes == OffscreenUi::question("", message, QMessageBox::Yes | QMessageBox::No)));
|
||||
}
|
||||
|
||||
/// Display a prompt with a text box
|
||||
|
|
|
@ -20,6 +20,13 @@ var button = toolBar.addButton({
|
|||
alpha: 0.9,
|
||||
});
|
||||
|
||||
function confirmShare(data) {
|
||||
if (!Window.confirm("Share snapshot " + data.localPath + "?")) { // This dialog will be more elaborate...
|
||||
return;
|
||||
}
|
||||
Window.alert("Pretending to upload. That code will go here.");
|
||||
}
|
||||
|
||||
function onClicked() {
|
||||
// update button states
|
||||
resetOverlays = Menu.isOptionChecked("Overlays");
|
||||
|
@ -56,7 +63,8 @@ function resetButtons(path, notify) {
|
|||
button.writeProperty("defaultState", 1);
|
||||
button.writeProperty("hoverState", 3);
|
||||
Window.snapshotTaken.disconnect(resetButtons);
|
||||
}
|
||||
confirmShare({localPath: path});
|
||||
}
|
||||
|
||||
button.clicked.connect(onClicked);
|
||||
|
||||
|
|
Loading…
Reference in a new issue