From 5adcfb4027b1237878cb6c7fbf6d29391e518960 Mon Sep 17 00:00:00 2001 From: Trevor SANDY Date: Sat, 21 Sep 2019 18:47:33 +0200 Subject: [PATCH] Add stud logo preference and command line option (#387) * Add stud logo preference and command line option * Support add stud logo when using disk library --- common/lc_application.cpp | 17 +++++- common/lc_basewindow.h | 1 + common/lc_library.cpp | 97 ++++++++++++++++++++++++------- common/lc_library.h | 2 + common/lc_profile.cpp | 1 + common/lc_profile.h | 1 + qt/lc_qpreferencesdialog.cpp | 23 +++++++- qt/lc_qpreferencesdialog.h | 3 +- qt/lc_qpreferencesdialog.ui | 108 +++++++++++++++++++++++------------ 9 files changed, 190 insertions(+), 63 deletions(-) diff --git a/common/lc_application.cpp b/common/lc_application.cpp index b7eb3620..2805cba2 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -75,8 +75,8 @@ lcApplication::lcApplication(int& Argc, char** Argv) lcApplication::~lcApplication() { - delete mProject; - delete mLibrary; + delete mProject; + delete mLibrary; gApplication = nullptr; } @@ -189,6 +189,7 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& bool ImageHighlight = false; int ImageWidth = lcGetProfileInt(LC_PROFILE_IMAGE_WIDTH); int ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT); + int StudLogo = lcGetProfileInt(LC_PROFILE_STUD_LOGO); int ImageStart = 0; int ImageEnd = 0; int PartImagesWidth = -1; @@ -343,6 +344,11 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& } else if (Param == QLatin1String("--line-width")) ParseFloat(mPreferences.mLineWidth); + else if (Param == QLatin1String("-sl") || Param == QLatin1String("--stud-logo")) + { + ParseInteger(StudLogo); + lcSetProfileInt(LC_PROFILE_STUD_LOGO, StudLogo); + } else if (Param == QLatin1String("-obj") || Param == QLatin1String("--export-wavefront")) { SaveWavefront = true; @@ -392,6 +398,7 @@ bool lcApplication::Initialize(QList>& LibraryPaths, bool& printf(" -t, --to