@@ -277,7 +277,7 @@ void OpenStudioApp::onMeasureManagerAndLibraryReady() {
277
277
boost::optional<openstudio::model::Model> model = versionTranslator.loadModel (toPath (fileName));
278
278
if (model) {
279
279
280
- m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), model, fileName));
280
+ m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), model, fileName, false , startTabIndex () ));
281
281
282
282
connectOSDocumentSignals ();
283
283
@@ -325,7 +325,7 @@ bool OpenStudioApp::openFile(const QString& fileName, bool restoreTabs) {
325
325
bool wasQuitOnLastWindowClosed = this ->quitOnLastWindowClosed ();
326
326
this ->setQuitOnLastWindowClosed (false );
327
327
328
- int startTabIndex = 0 ;
328
+ int startTabIndex = this -> startTabIndex () ;
329
329
int startSubTabIndex = 0 ;
330
330
if (m_osDocument) {
331
331
@@ -453,7 +453,7 @@ void OpenStudioApp::newFromEmptyTemplateSlot() {
453
453
}
454
454
455
455
void OpenStudioApp::newFromTemplateSlot (NewFromTemplateEnum newFromTemplateEnum) {
456
- m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath ()));
456
+ m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), boost::none, QString (), false , startTabIndex () ));
457
457
458
458
connectOSDocumentSignals ();
459
459
@@ -552,7 +552,7 @@ void OpenStudioApp::importIdf() {
552
552
processEvents ();
553
553
}
554
554
555
- m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), model));
555
+ m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), model, QString (), false , startTabIndex () ));
556
556
m_osDocument->markAsModified ();
557
557
// ETH: parent should change now ...
558
558
// parent = m_osDocument->mainWindow();
@@ -678,7 +678,7 @@ void OpenStudioApp::importIFC() {
678
678
processEvents ();
679
679
}
680
680
681
- m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), *model));
681
+ m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), *model, QString (), false , startTabIndex () ));
682
682
683
683
m_osDocument->markAsModified ();
684
684
@@ -740,7 +740,7 @@ void OpenStudioApp::import(OpenStudioApp::fileType type) {
740
740
processEvents ();
741
741
}
742
742
743
- m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), *model));
743
+ m_osDocument = std::shared_ptr<OSDocument>(new OSDocument (componentLibrary (), resourcesPath (), *model, QString (), false , startTabIndex () ));
744
744
m_osDocument->markAsModified ();
745
745
// ETH: parent should change now ...
746
746
// parent = m_osDocument->mainWindow();
@@ -1356,6 +1356,23 @@ void OpenStudioApp::writeLibraryPaths(std::vector<openstudio::path> paths) {
1356
1356
}
1357
1357
}
1358
1358
1359
+ int OpenStudioApp::startTabIndex () const {
1360
+ int result = OSDocument::VerticalTabID::SITE;
1361
+ if (qEnvironmentVariableIsSet (" OPENSTUDIO_APPLICATION_START_TAB_INDEX" )) {
1362
+ LOG (Debug, " OPENSTUDIO_APPLICATION_START_TAB_INDEX is set" );
1363
+ bool ok;
1364
+ int test = qEnvironmentVariableIntValue (" OPENSTUDIO_APPLICATION_START_TAB_INDEX" , &ok);
1365
+ if (ok) {
1366
+ if ((test >= OSDocument::VerticalTabID::SITE) && (test <= OSDocument::VerticalTabID::RESULTS_SUMMARY)) {
1367
+ result = test;
1368
+ LOG (Debug, " OPENSTUDIO_APPLICATION_START_TAB_INDEX is " << result);
1369
+ }
1370
+ }
1371
+ }
1372
+
1373
+ return result;
1374
+ }
1375
+
1359
1376
void OpenStudioApp::loadLibrary () {
1360
1377
if (this ->currentDocument ()) {
1361
1378
QWidget* parent = this ->currentDocument ()->mainWindow ();
0 commit comments