forked from Ivasoft/DSView
fix: The confirm box to swich device is too much
This commit is contained in:
@@ -1921,9 +1921,11 @@ namespace pv
|
||||
{
|
||||
QString msgText = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TO_SWITCH_DEVICE), "To switch the new device?");
|
||||
|
||||
if (MsgBox::Confirm(msgText) == false){
|
||||
if (MsgBox::Confirm(msgText, "", &_msg, NULL) == false){
|
||||
_msg = NULL;
|
||||
return;
|
||||
}
|
||||
_msg = NULL;
|
||||
}
|
||||
|
||||
// The store confirm is not processed.
|
||||
|
||||
@@ -85,10 +85,10 @@ void MsgBox::Show(const QString title, const QString text, const QString infoTex
|
||||
|
||||
bool MsgBox::Confirm(const QString text, QWidget *parent)
|
||||
{
|
||||
return MsgBox::Confirm(text, "", parent);
|
||||
return MsgBox::Confirm(text, "", NULL, parent);
|
||||
}
|
||||
|
||||
bool MsgBox::Confirm(const QString text, const QString infoText, QWidget *parent)
|
||||
bool MsgBox::Confirm(const QString text, const QString infoText, pv::dialogs::DSMessageBox **box, QWidget *parent)
|
||||
{
|
||||
assert(!text.isEmpty());
|
||||
|
||||
@@ -110,6 +110,10 @@ bool MsgBox::Confirm(const QString text, const QString infoText, QWidget *parent
|
||||
msg.mBox()->setInformativeText(infoText);
|
||||
}
|
||||
|
||||
if (box != NULL){
|
||||
*box = &msg;
|
||||
}
|
||||
|
||||
msg.exec();
|
||||
return msg.IsYes();
|
||||
}
|
||||
|
||||
@@ -41,5 +41,5 @@ public:
|
||||
static void Show(const QString title, const QString text, const QString infoText, QWidget *parent, pv::dialogs::DSMessageBox **box, bool bExecute=true);
|
||||
|
||||
static bool Confirm(const QString text, QWidget *parent=0);
|
||||
static bool Confirm(const QString text, const QString infoText, QWidget *parent=0);
|
||||
static bool Confirm(const QString text, const QString infoText, pv::dialogs::DSMessageBox **box=0, QWidget *parent=0);
|
||||
};
|
||||
Reference in New Issue
Block a user