Skip to content

Commit

Permalink
Blender LDraw Render - update label message on settings close
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Jul 7, 2023
1 parent c70d7f8 commit b19b90b
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 49 deletions.
2 changes: 1 addition & 1 deletion builds/linux/obs/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.7.3498
pkgver=2.4.7.3499
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.7.3498
pkgver=2.4.7.3499
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/alldeps/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.7.3498) debian; urgency=medium
lpub3d (2.4.7.3499) debian; urgency=medium

* LPub3D version 2.4.7.22.3498_20230707 for Linux
* LPub3D version 2.4.7.23.3499_20230707 for Linux

-- Trevor SANDY <[email protected]> Fri, 07 Jul 2023 03:41:19 +0200
-- Trevor SANDY <[email protected]> Fri, 07 Jul 2023 03:43:46 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.7.3498
Version: 2.4.7.3499
Maintainer: Trevor SANDY <[email protected]>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/alldeps/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.7.3498
Version: 2.4.7.3499
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -797,7 +797,7 @@ update-desktop-database || true
%endif

%changelog
* Fri Jul 07 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.7.3498
* Fri Jul 07 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.7.3499
- LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details

* Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.7.3498) debian; urgency=medium
lpub3d (2.4.7.3499) debian; urgency=medium

* LPub3D version 2.4.7.22.3498_20230707 for Linux
* LPub3D version 2.4.7.23.3499_20230707 for Linux

-- Trevor SANDY <[email protected]> Fri, 07 Jul 2023 03:41:21 +0200
-- Trevor SANDY <[email protected]> Fri, 07 Jul 2023 03:43:48 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.7.3498
Version: 2.4.7.3499
Maintainer: Trevor SANDY <[email protected]>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.7.3498
Version: 2.4.7.3499
Release: 1%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -313,7 +313,7 @@ update-desktop-database || true
%endif

%changelog
* Fri Jul 07 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.7.3498
* Fri Jul 07 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.7.3499
- LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details

* Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670
Expand Down
2 changes: 1 addition & 1 deletion builds/utilities/version.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2 4 7 22 3498 842f7ea93
2 4 7 23 3499 c70d7f8c1
6 changes: 3 additions & 3 deletions gitversion.pri
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ equals(GIT_DIR, undefined) {

# Check if we do not have a valid version number (i.e. no version tag found)
isEmpty(GIT_VERSION) {
GIT_REVISION = 22
GIT_REVISION = 23
GIT_SHA = $$system($$GIT_BASE_COMMAND rev-parse --short HEAD 2> $$NULL_DEVICE)
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
GIT_VERSION = v$${VERSION}-$${GIT_REVISION}-$${GIT_SHA}
Expand Down Expand Up @@ -69,7 +69,7 @@ equals(GIT_DIR, undefined) {
# Get commit count
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
isEmpty(GIT_COMMIT) {
GIT_COMMIT = 3498
GIT_COMMIT = 3499
message("~~~ ERROR! GIT_COMMIT NOT DEFINED, USING $$GIT_COMMIT ~~~")
}

Expand Down Expand Up @@ -117,7 +117,7 @@ if (equals(USE_GIT_VER_FILE, true)|equals(USE_VERSION_INFO_VAR, true)) {
GIT_VERSION = $$cat($$GIT_VER_FILE, lines)
} else {
message("~~~ ERROR! $$GIT_DIR_ENV VERSION_INFO FILE $$GIT_VER_FILE NOT FOUND ~~~")
GIT_VERSION = $${VERSION}.22.3498.842f7ea93
GIT_VERSION = $${VERSION}.23.3499.c70d7f8c1
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LPub3D 2.4.7.22.3498 (07 07 2023 03:41:21)
LPub3D 2.4.7.23.3499 (07 07 2023 03:43:48)

Features, enhancements, fixes and changes
------------
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/RELEASE_NOTES.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.7.4.3710 (23 06 2023 15:38:49)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.7.22.3498 (07 07 2023 03:41:21)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.7.23.3499 (07 07 2023 03:43:48)</h4>
<p>
<span class="tg-1pky">LPub3D Official release.</span><br>
Follow the links in the list below to review additional details for<br>
Expand Down
4 changes: 2 additions & 2 deletions mainApp/extras/LPub3D_Npp_UDL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
;;
;; Author......: Trevor SANDY
;; Name........: LPub3D_Npp_UDL.xml
;; Version.....: 2.4.7.22.3498
;; Last Update.: Fri, 07 Jul 2023 03:41:21 +0200
;; Version.....: 2.4.7.23.3499
;; Last Update.: Fri, 07 Jul 2023 03:43:48 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
4 changes: 2 additions & 2 deletions mainApp/lpub3d.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<binary>lpub3d24</binary>
​</provides>
<releases>
<release version="2.4.7.3498" date="2023-07-07">
<release version="2.4.7.3499" date="2023-07-07">
<description>
<p>LPub3D 07.07.2023 v2.4.7 r22 Continuous Build
<p>LPub3D 07.07.2023 v2.4.7 r23 Continuous Build
Change - Custom parts with underscore in the name #730.
Change - MLCad Part unknown! PART line error after mpd file save #734.
Change - Relative justify vertical axis on outside placement #729.
Expand Down
54 changes: 33 additions & 21 deletions mainApp/renderdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,16 @@ RenderDialog::RenderDialog(QWidget* Parent, int renderType, int importOnly)
mHaveKeys = true;
}

QString mn;
if (mHaveKeys && currentStep) {
bool const displayModel = currentStep->displayStep >= DT_MODEL_DEFAULT || currentStep->subModel.viewerSubmodel;
mn = tr("STEP %1").arg(currentStep->stepNumber.number);
mMn = tr("STEP %1").arg(currentStep->stepNumber.number);
if (displayModel) {
mn = currentStep->topOfStep().modelName;
mn = mn.replace(mn.indexOf(mn.at(0)),1,mn.at(0).toUpper());
mMn = currentStep->topOfStep().modelName;
mMn = mMn.replace(mMn.indexOf(mMn.at(0)),1,mMn.at(0).toUpper());
}
}

QString labelMessage = tr("Render image%1").arg(mn.isEmpty() ? "" : tr(" for <b>%1</b>").arg(mn));
QString labelMessage = tr("Render image%1").arg(mMn.isEmpty() ? "" : tr(" for <b>%1</b>").arg(mMn));

ui->RenderLabel->setText(labelMessage);

Expand All @@ -104,7 +103,7 @@ RenderDialog::RenderDialog(QWidget* Parent, int renderType, int importOnly)

if (showInput) {
ui->InputGenerateCheck->setToolTip(tr("Generate LDraw input file (csi_blender.ldr)%1")
.arg(tr(" from %1").arg(mn)));
.arg(tr(" from %1").arg(mMn)));
ui->InputEdit->setText(Render::getRenderModelFile(mRenderType, false/*save current model*/));
ui->InputEdit->setEnabled(false);
ui->InputBrowseButton->setEnabled(false);
Expand Down Expand Up @@ -146,14 +145,14 @@ RenderDialog::RenderDialog(QWidget* Parent, int renderType, int importOnly)
setWindowTitle(tr("Blender %1").arg(mImportOnly ? tr("LDraw Import") : tr("Image Render")));

setWhatsThis(lpubWT(WT_DIALOG_BLENDER_RENDER,windowTitle()));
bool blenderConfigured = !Preferences::blenderImportModule.isEmpty();
QString const blenderDir = QString("%1/Blender").arg(Preferences::lpub3d3rdPartyConfigDir);
if (!QDir(QString("%1/addons/%2").arg(blenderDir).arg(BLENDER_RENDER_ADDON_FOLDER)).isReadable()) {
blenderConfigured = false;
Preferences::setBlenderImportModule(QString());
}

bool blenderConfigured = !Preferences::blenderImportModule.isEmpty();

QString const blenderDir = QString("%1/Blender").arg(Preferences::lpub3d3rdPartyConfigDir);
if (!QDir(QString("%1/addons/%2").arg(blenderDir).arg(BLENDER_RENDER_ADDON_FOLDER)).isReadable()) {
blenderConfigured = false;
Preferences::setBlenderImportModule(QString());
}

if (blenderConfigured)
mImportModule = Preferences::blenderImportModule == QLatin1String("TN")
Expand All @@ -168,7 +167,7 @@ RenderDialog::RenderDialog(QWidget* Parent, int renderType, int importOnly)

if (mImportOnly) {
labelMessage = tr("Open%1 in Blender using %2")
.arg(mn.isEmpty() ? "" : tr(" <b>%1</b>").arg(mn)).arg(mImportModule);
.arg(mMn.isEmpty() ? "" : tr(" <b>%1</b>").arg(mMn)).arg(mImportModule);

ui->InputLabel->setMinimumWidth(0);
ui->InputBrowseButton->setMinimumWidth(0);
Expand Down Expand Up @@ -264,7 +263,20 @@ void RenderDialog::on_RenderSettingsButton_clicked()
if (Preferences::blenderImportModule.isEmpty())
ui->RenderButton->setToolTip(tr("Blender not configured. Click 'Settings' to configure."));
else
{
if (mImportOnly) {
mImportModule = Preferences::blenderImportModule == QLatin1String("TN")
? tr("LDraw Import TN")
: tr("LDraw Import MM");

QString labelMessage = tr("Open%1 in Blender using %2")
.arg(mMn.isEmpty() ? "" : tr(" <b>%1</b>").arg(mMn)).arg(mImportModule);
ui->RenderLabel->setText(labelMessage);
ui->RenderLabel->setAlignment(Qt::AlignTrailing | Qt::AlignVCenter);
}

ui->RenderButton->setEnabled(true);
}
}
}

Expand Down Expand Up @@ -848,10 +860,10 @@ void RenderDialog::WriteStdOut()
if (file.open(QFile::WriteOnly | QIODevice::Truncate | QFile::Text))
{
QTextStream Out(&file);

for (const QString& Line : mStdOutList)
Out << Line;

file.close();

ui->RenderOutputButton->setEnabled(true);
Expand Down Expand Up @@ -1205,13 +1217,13 @@ void RenderDialog::validateInput()
ui->InputGenerateCheck->setChecked(true);
ui->InputBrowseButton->setEnabled(false);
} else {
QString mn = fileInfo.fileName(), labelMessage;
mn = mn.replace(mn.indexOf(mn.at(0)),1,mn.at(0).toUpper());
QString mMn = fileInfo.fileName(), labelMessage;
mMn = mMn.replace(mMn.indexOf(mMn.at(0)),1,mMn.at(0).toUpper());
if (mImportOnly)
labelMessage = tr("Open%1 in Blender using %2")
.arg(mn.isEmpty() ? "" : tr(" <b>%1</b>").arg(mn)).arg(mImportModule);
.arg(mMn.isEmpty() ? "" : tr(" <b>%1</b>").arg(mMn)).arg(mImportModule);
else
labelMessage = tr("Render image%1").arg(mn.isEmpty() ? "" : tr(" for <b>%1</b>").arg(mn));
labelMessage = tr("Render image%1").arg(mMn.isEmpty() ? "" : tr(" for <b>%1</b>").arg(mMn));
ui->RenderLabel->setText(labelMessage);
}

Expand Down
9 changes: 5 additions & 4 deletions mainApp/renderdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class RenderProcess : public QProcess
Q_OBJECT

public:
explicit RenderProcess(QObject *parent = nullptr)
: QProcess(parent)
{
}
explicit RenderProcess(QObject *parent = nullptr)
: QProcess(parent)
{
}
~RenderProcess();
};

Expand Down Expand Up @@ -96,6 +96,7 @@ protected slots:
QString mViewerStepKey;
QString mModelFile;
QString mImportModule;
QString mMn;

QStringList mCsiKeyList;
QStringList mCsiKeyListData;
Expand Down

0 comments on commit b19b90b

Please sign in to comment.