mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 20:31:29 +02:00
Added async information and critical dialogs
This commit is contained in:
parent
616f15864a
commit
68e9d335cd
4 changed files with 31 additions and 4 deletions
|
@ -354,7 +354,7 @@ void ATPAssetMigrator::saveEntityServerFile() {
|
||||||
infoMessage += "You can re-attempt migration on those models\nby restarting this process with the newly saved file.";
|
infoMessage += "You can re-attempt migration on those models\nby restarting this process with the newly saved file.";
|
||||||
}
|
}
|
||||||
|
|
||||||
OffscreenUi::information(_dialogParent, "Success", infoMessage);
|
OffscreenUi::asyncInformation(_dialogParent, "Success", infoMessage);
|
||||||
} else {
|
} else {
|
||||||
OffscreenUi::asyncWarning(_dialogParent, "Error", "Could not gzip JSON data for new entities file.");
|
OffscreenUi::asyncWarning(_dialogParent, "Error", "Could not gzip JSON data for new entities file.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,11 +73,11 @@ void AddressBarDialog::loadForward() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddressBarDialog::displayAddressOfflineMessage() {
|
void AddressBarDialog::displayAddressOfflineMessage() {
|
||||||
OffscreenUi::critical("", "That user or place is currently offline");
|
OffscreenUi::asyncCritical("", "That user or place is currently offline");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddressBarDialog::displayAddressNotFoundMessage() {
|
void AddressBarDialog::displayAddressNotFoundMessage() {
|
||||||
OffscreenUi::critical("", "There is no address information for that user or place");
|
OffscreenUi::asyncCritical("", "There is no address information for that user or place");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddressBarDialog::observeShownChanged(bool visible) {
|
void AddressBarDialog::observeShownChanged(bool visible) {
|
||||||
|
|
|
@ -172,7 +172,7 @@ protected:
|
||||||
|
|
||||||
virtual QVariant waitForResult() {
|
virtual QVariant waitForResult() {
|
||||||
while (!_finished) {
|
while (!_finished) {
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||||
}
|
}
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
|
@ -295,6 +295,17 @@ QMessageBox::StandardButton OffscreenUi::information(const QString& title, const
|
||||||
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
return DependencyManager::get<OffscreenUi>()->messageBox(OffscreenUi::Icon::ICON_INFORMATION, title, text, buttons, defaultButton);
|
return DependencyManager::get<OffscreenUi>()->messageBox(OffscreenUi::Icon::ICON_INFORMATION, title, text, buttons, defaultButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OffscreenUi::asyncCritical(const QString& title, const QString& text,
|
||||||
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
|
DependencyManager::get<OffscreenUi>()->asyncMessageBox(OffscreenUi::Icon::ICON_CRITICAL, title, text, buttons, defaultButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OffscreenUi::asyncInformation(const QString& title, const QString& text,
|
||||||
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
|
DependencyManager::get<OffscreenUi>()->asyncMessageBox(OffscreenUi::Icon::ICON_INFORMATION, title, text, buttons, defaultButton);
|
||||||
|
}
|
||||||
|
|
||||||
QMessageBox::StandardButton OffscreenUi::question(const QString& title, const QString& text,
|
QMessageBox::StandardButton OffscreenUi::question(const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
return DependencyManager::get<OffscreenUi>()->messageBox(OffscreenUi::Icon::ICON_QUESTION, title, text, buttons, defaultButton);
|
return DependencyManager::get<OffscreenUi>()->messageBox(OffscreenUi::Icon::ICON_QUESTION, title, text, buttons, defaultButton);
|
||||||
|
|
|
@ -89,6 +89,16 @@ public:
|
||||||
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
|
||||||
return information(title, text, buttons, defaultButton);
|
return information(title, text, buttons, defaultButton);
|
||||||
}
|
}
|
||||||
|
static void asyncCritical(void* ignored, const QString& title, const QString& text,
|
||||||
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
||||||
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
|
||||||
|
return asyncCritical(title, text, buttons, defaultButton);
|
||||||
|
}
|
||||||
|
static void asyncInformation(void* ignored, const QString& title, const QString& text,
|
||||||
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
||||||
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
|
||||||
|
return asyncInformation(title, text, buttons, defaultButton);
|
||||||
|
}
|
||||||
/// Same design as QMessageBox::question(), will block, returns result
|
/// Same design as QMessageBox::question(), will block, returns result
|
||||||
static QMessageBox::StandardButton question(void* ignored, const QString& title, const QString& text,
|
static QMessageBox::StandardButton question(void* ignored, const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
|
QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
|
||||||
|
@ -119,6 +129,12 @@ public:
|
||||||
static QMessageBox::StandardButton information(const QString& title, const QString& text,
|
static QMessageBox::StandardButton information(const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
||||||
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||||
|
static void asyncCritical(const QString& title, const QString& text,
|
||||||
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
||||||
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||||
|
static void asyncInformation(const QString& title, const QString& text,
|
||||||
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
||||||
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||||
static QMessageBox::StandardButton question(const QString& title, const QString& text,
|
static QMessageBox::StandardButton question(const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
|
QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
|
||||||
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||||
|
|
Loading…
Reference in a new issue