Skip to content

Commit

Permalink
[#83945182] Add singleShot timer and slot.
Browse files Browse the repository at this point in the history
  • Loading branch information
evanweaver committed Dec 8, 2014
1 parent f9d15ab commit 2b582e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion openstudiocore/src/openstudio_lib/OSAppBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include <QDir>
#include <QMessageBox>
#include <QTimer>

namespace openstudio {

Expand All @@ -47,7 +48,7 @@ OSAppBase::OSAppBase( int & argc, char ** argv, const QSharedPointer<MeasureMana

auto updateUserMeasures = true;
if (isNetworkPath(userMeasuresDir) && !isNetworkPathAvailable(userMeasuresDir)) {
QMessageBox::information(this->mainWidget(), "Cannot Update User Measures", "Your My Measures Directory appears to be on a network drive that is not currently available.\nYou can change your specified My Measures Directory using 'Preferences->Change My Measures Directory'.", QMessageBox::Ok);
QTimer::singleShot(0, this, SLOT(showMeasureUpdateDlg()));
updateUserMeasures = false;
}
else {
Expand All @@ -71,6 +72,10 @@ OSAppBase * OSAppBase::instance()
return qobject_cast<OSAppBase *>(QApplication::instance());
}

void OSAppBase::showMeasureUpdateDlg()
{
QMessageBox::information(this->mainWidget(), "Cannot Update User Measures", "Your My Measures Directory appears to be on a network drive that is not currently available.\nYou can change your specified My Measures Directory using 'Preferences->Change My Measures Directory'.", QMessageBox::Ok);
}

boost::optional<openstudio::analysisdriver::SimpleProject> OSAppBase::project()
{
Expand Down
2 changes: 2 additions & 0 deletions openstudiocore/src/openstudio_lib/OSAppBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class OPENSTUDIO_API OSAppBase : public QApplication, public BaseApp

virtual void reloadFile(const QString& fileToLoad, bool modified, bool saveCurrentTabs) = 0;

void showMeasureUpdateDlg();

private:

REGISTER_LOGGER("openstudio.OSAppBase");
Expand Down

4 comments on commit 2b582e7

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

83945182_UserMeasuresDir (evanweaver) - x86_64-Linux-Ubuntu-14.04-clang-3.5: Build Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

83945182_UserMeasuresDir (evanweaver) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

83945182_UserMeasuresDir (evanweaver) - i386-Windows-7-VisualStudio-12: Build Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

83945182_UserMeasuresDir (evanweaver) - Win64-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

Please sign in to comment.