1.9.5
This commit is contained in:
parent
22c6feb72f
commit
9546d97d0f
|
@ -623,7 +623,3 @@ void SafeShow(QWidget* pWidget) {
|
|||
pWidget->setProperty("windowOpacity", 1.0);
|
||||
}
|
||||
|
||||
int SafeExec(QDialog* pDialog){
|
||||
SafeShow(pDialog);
|
||||
return pDialog->exec();
|
||||
}
|
||||
|
|
|
@ -115,7 +115,6 @@ MISCHELPERS_EXPORT bool InitConsole(bool bCreateIfNeeded = true);
|
|||
#endif
|
||||
|
||||
MISCHELPERS_EXPORT void SafeShow(QWidget* pWidget);
|
||||
MISCHELPERS_EXPORT int SafeExec(QDialog* pDialog);
|
||||
|
||||
template <typename T>
|
||||
QSet<T> ListToSet(const QList<T>& qList) { return QSet<QString>(qList.begin(), qList.end()); }
|
||||
|
|
|
@ -1284,6 +1284,18 @@ bool CSandMan::IsSilentMode()
|
|||
return IsFullScreenMode();
|
||||
}
|
||||
|
||||
QWidget* g_GUIParent = NULL;
|
||||
|
||||
int CSandMan::SafeExec(QDialog* pDialog)
|
||||
{
|
||||
QWidget* pPrevParent = g_GUIParent;
|
||||
g_GUIParent = pDialog;
|
||||
SafeShow(pDialog);
|
||||
int ret = pDialog->exec();
|
||||
g_GUIParent = pPrevParent;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void CSandMan::OnMessage(const QString& MsgData)
|
||||
{
|
||||
QStringList Messages = MsgData.split("\n");
|
||||
|
|
|
@ -65,6 +65,8 @@ public:
|
|||
CSbieView* GetBoxView() { return m_pBoxView; }
|
||||
CFileView* GetFileView() { return m_pFileView; }
|
||||
|
||||
int SafeExec(QDialog* pDialog);
|
||||
|
||||
bool RunSandboxed(const QStringList& Commands, QString BoxName = QString(), const QString& WrkDir = QString());
|
||||
|
||||
QIcon GetBoxIcon(int boxType, bool inUse = false);// , bool inBusy = false);
|
||||
|
|
|
@ -38,7 +38,7 @@ void CNewBoxWizard::showHelp()
|
|||
QString CNewBoxWizard::CreateNewBox(bool bAlowTemp, QWidget* pParent)
|
||||
{
|
||||
CNewBoxWizard wizard(bAlowTemp, pParent);
|
||||
if (!wizard.exec())
|
||||
if (!theGUI->SafeExec(&wizard))
|
||||
return QString();
|
||||
|
||||
QString BoxName = wizard.field("boxName").toString();
|
||||
|
|
|
@ -54,7 +54,7 @@ void CSetupWizard::showHelp()
|
|||
bool CSetupWizard::ShowWizard()
|
||||
{
|
||||
CSetupWizard wizard;
|
||||
if (!wizard.exec())
|
||||
if (!theGUI->SafeExec(&wizard))
|
||||
return false;
|
||||
|
||||
//bool useBusiness = wizard.field("useBusiness").toBool();
|
||||
|
|
|
@ -54,7 +54,7 @@ QString CTemplateWizard::GetTemplateLabel(ETemplateType Type)
|
|||
bool CTemplateWizard::CreateNewTemplate(CSandBox* pBox, ETemplateType Type, QWidget* pParent)
|
||||
{
|
||||
CTemplateWizard wizard(Type, pParent);
|
||||
if (!wizard.exec())
|
||||
if (!theGUI->SafeExec(&wizard))
|
||||
return false;
|
||||
|
||||
if (Type == TmplCustom)
|
||||
|
|
Loading…
Reference in New Issue