diff --git a/common/lc_application.cpp b/common/lc_application.cpp index 78ad82f3..80a964ef 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -77,9 +77,8 @@ void lcApplication::SetProject(Project* Project) for (int ViewIdx = 0; ViewIdx < Views.GetSize(); ViewIdx++) Views[ViewIdx]->SetModel(lcGetActiveModel()); + lcGetActiveModel()->UpdateInterface(); gMainWindow->UpdateAllViews(); - gMainWindow->UpdateModels(); - gMainWindow->UpdateTitle(); } void lcApplication::SetClipboard(const QByteArray& Clipboard) diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index 599ba18f..140dca91 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -190,9 +190,23 @@ bool lcMainWindow::OpenProject(const QString& FileName) if (NewProject->Load(LoadFileName)) { + NewProject->SetActiveModel(0); + g_App->SetProject(NewProject); AddRecentFile(LoadFileName); + for (int ViewIdx = 0; ViewIdx < mViews.GetSize(); ViewIdx++) + { + View* View = mViews[ViewIdx]; + + if (!View->mCamera->IsSimple()) + View->SetDefaultCamera(); + + View->ZoomExtents(); + } + + gMainWindow->UpdateAllViews(); + return true; } diff --git a/common/lc_model.cpp b/common/lc_model.cpp index f0336218..ede48b41 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -449,8 +449,6 @@ void lcModel::LoadLDraw(QTextStream& Stream) continue; } - // todo: load from disk - Info = lcGetPiecesLibrary()->FindPiece(PartID.toLatin1().constData(), true); if (Info != NULL) { @@ -772,27 +770,7 @@ bool lcModel::LoadBinary(lcFile* file) UpdateBackgroundTexture(); CalculateStep(mCurrentStep); -/* - gMainWindow->UpdateFocusObject(GetFocusObject()); - const lcArray& Views = gMainWindow->GetViews(); - for (int ViewIdx = 0; ViewIdx < Views.GetSize(); ViewIdx++) - { - View* view = Views[ViewIdx]; - - if (!view->mCamera->IsSimple()) - view->SetDefaultCamera(); - - view->ZoomExtents(); - } - - gMainWindow->UpdateLockSnap(); - gMainWindow->UpdateSnap(); - gMainWindow->UpdateCameraMenu(); - UpdateSelection(); - gMainWindow->UpdateCurrentStep(); - gMainWindow->UpdateAllViews(); -*/ return true; } diff --git a/common/project.cpp b/common/project.cpp index e028b265..6a01ae05 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -59,7 +59,6 @@ void Project::SetActiveModel(int ModelIndex) mActiveModel = mModels[ModelIndex]; mActiveModel->UpdateInterface(); - gMainWindow->UpdateModels(); const lcArray& Views = gMainWindow->GetViews(); for (int ViewIdx = 0; ViewIdx < Views.GetSize(); ViewIdx++) @@ -240,7 +239,6 @@ bool Project::Load(const QString& FileName) Model->CreatePieceInfo(); } - SetActiveModel(0); /*