diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index c589aa72..c762e70d 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -411,11 +411,15 @@ namespace pv break; } - dialogs::DSMessageBox *box = NULL; - MsgBox::Show("", title, details, this, &box, true); - // auto evo = _session->device_event_object(); - //connect(evo, SIGNAL(device_updated()), box, SLOT(accept())); - // box->exec(); + pv::dialogs::DSMessageBox msg(this, title); + msg.mBox()->setText(details); + msg.mBox()->setStandardButtons(QMessageBox::Ok); + msg.mBox()->setIcon(QMessageBox::Warning); + connect(_session->device_event_object(), SIGNAL(device_updated()), &msg, SLOT(accept())); + _msg = &msg; + msg.exec(); + _msg = NULL; + _session->clear_error(); } diff --git a/DSView/pv/ui/msgbox.cpp b/DSView/pv/ui/msgbox.cpp index 0397a114..d7946e9b 100644 --- a/DSView/pv/ui/msgbox.cpp +++ b/DSView/pv/ui/msgbox.cpp @@ -34,25 +34,27 @@ void MsgBox::Show(const QString text) { - MsgBox::Show("", text, "", NULL, NULL, true); + MsgBox::Show("", text, "", NULL, NULL); } void MsgBox::Show(const QString title, const QString text, QWidget *parent) { - MsgBox::Show(title, text, "", parent,NULL, true); + MsgBox::Show(title, text, "", parent,NULL); } void Show(const QString title, const QString text, const QString infoText) { - MsgBox::Show(title, text, infoText, NULL, NULL, true); + MsgBox::Show(title, text, infoText, NULL, NULL); } -void MsgBox::Show(const QString title, const QString text, QWidget *parent, pv::dialogs::DSMessageBox **box) +void MsgBox::Show(const QString title, const QString text, + QWidget *parent, pv::dialogs::DSMessageBox **box) { - MsgBox::Show(title, text, "", parent, box, true); + MsgBox::Show(title, text, "", parent, box); } -void MsgBox::Show(const QString title, const QString text, const QString infoText, QWidget *parent, pv::dialogs::DSMessageBox **box, bool bExecute) +void MsgBox::Show(const QString title, const QString text, const QString infoText, + QWidget *parent, pv::dialogs::DSMessageBox **box) { assert(!text.isEmpty()); @@ -78,9 +80,7 @@ void MsgBox::Show(const QString title, const QString text, const QString infoTex msg.mBox()->setInformativeText(infoText); } - if (bExecute){ - msg.exec(); - } + msg.exec(); } bool MsgBox::Confirm(const QString text, QWidget *parent) @@ -88,7 +88,8 @@ bool MsgBox::Confirm(const QString text, QWidget *parent) return MsgBox::Confirm(text, "", NULL, parent); } -bool MsgBox::Confirm(const QString text, const QString infoText, pv::dialogs::DSMessageBox **box, QWidget *parent) +bool MsgBox::Confirm(const QString text, const QString infoText, + pv::dialogs::DSMessageBox **box, QWidget *parent) { assert(!text.isEmpty()); diff --git a/DSView/pv/ui/msgbox.h b/DSView/pv/ui/msgbox.h index 05bb88f7..a067916b 100644 --- a/DSView/pv/ui/msgbox.h +++ b/DSView/pv/ui/msgbox.h @@ -38,7 +38,7 @@ public: static void Show(const QString title, const QString text, QWidget *parent=0); static void Show(const QString title, const QString text, const QString infoText); static void Show(const QString title, const QString text, QWidget *parent, pv::dialogs::DSMessageBox **box); - static void Show(const QString title, const QString text, const QString infoText, QWidget *parent, pv::dialogs::DSMessageBox **box, bool bExecute=true); + static void Show(const QString title, const QString text, const QString infoText, QWidget *parent, pv::dialogs::DSMessageBox **box); static bool Confirm(const QString text, QWidget *parent=0); static bool Confirm(const QString text, const QString infoText, pv::dialogs::DSMessageBox **box=0, QWidget *parent=0);