mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Create window widget after the library is loaded.
This commit is contained in:
parent
06f11badde
commit
1f1c93c28b
2 changed files with 10 additions and 5 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "lc_mainwindow.h"
|
#include "lc_mainwindow.h"
|
||||||
#include "lc_shortcuts.h"
|
#include "lc_shortcuts.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
#include "lc_qmainwindow.h"
|
||||||
|
|
||||||
lcApplication* g_App;
|
lcApplication* g_App;
|
||||||
|
|
||||||
|
@ -270,6 +271,8 @@ bool lcApplication::Initialize(int argc, char* argv[], const char* LibraryInstal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gMainWindow = new lcMainWindow();
|
||||||
|
|
||||||
if (!LoadPiecesLibrary(LibPath, LibraryInstallPath, LDrawPath, LibraryCachePath))
|
if (!LoadPiecesLibrary(LibPath, LibraryInstallPath, LDrawPath, LibraryCachePath))
|
||||||
{
|
{
|
||||||
if (SaveImage || SaveWavefront)
|
if (SaveImage || SaveWavefront)
|
||||||
|
@ -286,6 +289,8 @@ bool lcApplication::Initialize(int argc, char* argv[], const char* LibraryInstal
|
||||||
"Please visit http://www.leocad.org for information on how to download and install a library.", LC_MB_OK | LC_MB_ICONERROR);
|
"Please visit http://www.leocad.org for information on how to download and install a library.", LC_MB_OK | LC_MB_ICONERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gMainWindow->mHandle = new lcQMainWindow;
|
||||||
|
|
||||||
// Create a new project.
|
// Create a new project.
|
||||||
Project* NewProject = new Project();
|
Project* NewProject = new Project();
|
||||||
SetProject(NewProject);
|
SetProject(NewProject);
|
||||||
|
|
|
@ -175,18 +175,16 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
QDir dir;
|
QDir dir;
|
||||||
dir.mkpath(cachePath);
|
dir.mkpath(cachePath);
|
||||||
gMainWindow = new lcMainWindow();
|
|
||||||
lcQMainWindow w;
|
|
||||||
gMainWindow->mHandle = &w;
|
|
||||||
|
|
||||||
if (!g_App->Initialize(argc, argv, libPath, LDrawPath, cachePath.toLocal8Bit().data()))
|
if (!g_App->Initialize(argc, argv, libPath, LDrawPath, cachePath.toLocal8Bit().data()))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
w.LibraryLoaded();
|
lcQMainWindow* MainWindow = (lcQMainWindow*)gMainWindow->mHandle;
|
||||||
|
MainWindow->LibraryLoaded();
|
||||||
lcGetActiveModel()->UpdateInterface();
|
lcGetActiveModel()->UpdateInterface();
|
||||||
gMainWindow->SetColorIndex(lcGetColorIndex(4));
|
gMainWindow->SetColorIndex(lcGetColorIndex(4));
|
||||||
gMainWindow->UpdateRecentFiles();
|
gMainWindow->UpdateRecentFiles();
|
||||||
w.show();
|
MainWindow->show();
|
||||||
|
|
||||||
#if !LC_DISABLE_UPDATE_CHECK
|
#if !LC_DISABLE_UPDATE_CHECK
|
||||||
lcDoInitialUpdateCheck();
|
lcDoInitialUpdateCheck();
|
||||||
|
@ -199,6 +197,8 @@ int main(int argc, char *argv[])
|
||||||
delete g_App;
|
delete g_App;
|
||||||
g_App = NULL;
|
g_App = NULL;
|
||||||
|
|
||||||
|
delete MainWindow;
|
||||||
|
|
||||||
return execReturn;
|
return execReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue