Skip to content

Commit

Permalink
PyModalDialog: hideSplashScreen()
Browse files Browse the repository at this point in the history
to deal with #487
  • Loading branch information
devernay committed May 12, 2020
1 parent 5fc28e1 commit ec4b956
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
34 changes: 8 additions & 26 deletions Gui/GuiAppInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,6 @@ GuiAppInstance::findAndTryLoadUntitledAutoSave()
"Would you like to restore it?\n"
"Clicking No will remove this auto-save.");

appPTR->hideSplashScreen();

StandardButtonEnum ret = Dialogs::questionDialog(tr("Auto-save").toStdString(),
text.toStdString(), false, StandardButtons(eStandardButtonYes | eStandardButtonNo),
eStandardButtonYes);
Expand Down Expand Up @@ -611,9 +609,7 @@ GuiAppInstance::errorDialog(const std::string & title,
const std::string & message,
bool useHtml) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -634,9 +630,7 @@ GuiAppInstance::errorDialog(const std::string & title,
bool* stopAsking,
bool useHtml) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -656,9 +650,7 @@ GuiAppInstance::warningDialog(const std::string & title,
const std::string & message,
bool useHtml) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -679,9 +671,7 @@ GuiAppInstance::warningDialog(const std::string & title,
bool* stopAsking,
bool useHtml) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -701,9 +691,7 @@ GuiAppInstance::informationDialog(const std::string & title,
const std::string & message,
bool useHtml) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -724,9 +712,7 @@ GuiAppInstance::informationDialog(const std::string & title,
bool* stopAsking,
bool useHtml) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -748,9 +734,7 @@ GuiAppInstance::questionDialog(const std::string & title,
StandardButtons buttons,
StandardButtonEnum defaultButton) const
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand All @@ -775,9 +759,7 @@ GuiAppInstance::questionDialog(const std::string & title,
StandardButtonEnum defaultButton,
bool* stopAsking)
{
if ( appPTR->isSplashcreenVisible() ) {
appPTR->hideSplashScreen();
}
appPTR->hideSplashScreen();
{
QMutexLocker l(&_imp->_showingDialogMutex);
++_imp->_showingDialog;
Expand Down
1 change: 1 addition & 0 deletions Gui/GuiApplicationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ GuiApplicationManager::hideSplashScreen()
boost_adaptbx::floating_point::exception_trapping trap(0);
#endif
if (_imp->_splashScreen) {
_imp->_splashScreen->hide();
_imp->_splashScreen->close();
delete _imp->_splashScreen;
_imp->_splashScreen = 0;
Expand Down
2 changes: 2 additions & 0 deletions Gui/PythonPanels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ PyModalDialog::PyModalDialog(Gui* gui,
, UserParamHolder()
, _imp( new PyModalDialogPrivate(gui) )
{
appPTR->hideSplashScreen();

_imp->holder = new DialogParamHolder( QString(), gui->getApp(), this );
setHolder(_imp->holder);
_imp->holder->initializeKnobsPublic();
Expand Down

0 comments on commit ec4b956

Please sign in to comment.