Skip to content

Commit

Permalink
Blender LDraw Render - get version file folder #416
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 12, 2023
1 parent 60213eb commit 42adc99
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 36 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.6.3370
pkgver=2.4.6.3371
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.6.3370
pkgver=2.4.6.3371
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.6.3370) debian; urgency=medium
lpub3d (2.4.6.3371) debian; urgency=medium

* LPub3D version 2.4.6.259.3370_20230512 for Linux
* LPub3D version 2.4.6.260.3371_20230512 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Fri, 12 May 2023 06:00:56 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Fri, 12 May 2023 06:01:21 +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.6.3370
Version: 2.4.6.3371
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
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.6.3370
Version: 2.4.6.3371
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 May 12 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3370
* Fri May 12 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3371
- 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.6.3370) debian; urgency=medium
lpub3d (2.4.6.3371) debian; urgency=medium

* LPub3D version 2.4.6.259.3370_20230512 for Linux
* LPub3D version 2.4.6.260.3371_20230512 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Fri, 12 May 2023 06:00:58 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Fri, 12 May 2023 06:01:22 +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.6.3370
Version: 2.4.6.3371
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
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.6.3370
Version: 2.4.6.3371
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 May 12 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3370
* Fri May 12 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3371
- 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 6 259 3370 f98247239
2 4 6 260 3371 60213eb05
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 = 259
GIT_REVISION = 260
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 = 3370
GIT_COMMIT = 3371
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}.259.3370.f98247239
GIT_VERSION = $${VERSION}.260.3371.60213eb05
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
36 changes: 22 additions & 14 deletions mainApp/blenderpreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,23 @@ BlenderPreferences::BlenderPreferences(
pathLineEdit->setText(mBlenderPaths[i].value);
pathLineEdit->setToolTip(mBlenderPaths[i].tooltip);

if (mAddonVersion.isEmpty()) {
mModulesBox->setEnabled(false);
mAddonUpdateButton->setEnabled(false);
mImportActBox->setChecked(true); // default addon module
} else {
mAddonVersionEdit->setText(mAddonVersion);
mRenderActBox->setChecked(true);
mImportActBox->setChecked( Preferences::blenderImportModule == QLatin1String("TN"));
mImportMMActBox->setChecked(Preferences::blenderImportModule == QLatin1String("MM"));
}

QString textColour, versionText, addonText;
if (mConfigured) {
textColour = QApplication::palette().text().color().name();
versionText = tr("Blender");
addonText = tr("Blender Addon");
mBlenderVersionEdit->setText(mBlenderVersion);
if (!mAddonVersion.isEmpty()) {
mModulesBox->setEnabled(true);
mAddonVersionEdit->setText(mAddonVersion);
mRenderActBox->setChecked(true);
mImportActBox->setChecked( Preferences::blenderImportModule == QLatin1String("TN"));
mImportMMActBox->setChecked(Preferences::blenderImportModule == QLatin1String("MM"));
}
} else {
textColour = Preferences::displayTheme == THEME_DARK
? Preferences::themeColors[THEME_DARK_DECORATE_LPUB3D_QUOTED_TEXT]
Expand Down Expand Up @@ -1385,14 +1389,18 @@ bool BlenderPreferences::getBlenderAddon(const QString &blenderDir)
"Archive file %2 may be open in another program.")
.arg(zip.getZipError()).arg(QFileInfo(blenderAddonFile).fileName());
emit gui->messageSig(LOG_WARNING, result);

// Download new archive
return false;
return false; // Download new archive
}
QString const versionFile = QLatin1String("addons/io_scene_lpub3d_importldraw/__version__.py");

QString const versionFile = QString("addons/%1/__version__.py").arg(BLENDER_RENDER_ADDON);
zip.setCurrentFile(versionFile);
QuaZipFile file(&zip);
file.open(QIODevice::ReadOnly);
if (!file.open(QIODevice::ReadOnly)) {
emit gui->messageSig(LOG_ERROR, QObject::tr("Cannot read addon archive file: [%1]<br>%2.")
.arg(versionFile)
.arg(file.errorString()));
return false; // Download new archive
}
QByteArray ba = file.readAll();
file.close();

Expand All @@ -1408,7 +1416,7 @@ bool BlenderPreferences::getBlenderAddon(const QString &blenderDir)
}
zip.close();
if (zip.getZipError() != UNZ_OK)
emit gui->messageSig(LOG_WARNING, tr("Archive close errorReturn code %1.").arg(zip.getZipError()));
emit gui->messageSig(LOG_WARNING, tr("Archive close error. Return code %1.").arg(zip.getZipError()));

lpub->downloadFile(VER_BLENDER_ADDON_LATEST_URL, tr("Latest Addon"),false/*promptRedirect*/,false/*showProgress*/);
QByteArray response_data = lpub->getDownloadedFile();
Expand Down Expand Up @@ -1602,8 +1610,8 @@ void BlenderPreferences::showResult()
mAddonVersionLabel->setText(tr("Blender Addon"));
mAddonVersionLabel->setStyleSheet(textColour);
mAddonVersionEdit->setText(mAddonVersion);
mModulesBox->setEnabled(true);
mAddonVersionEdit->setVisible(true);
mModulesBox->setEnabled(true);
mAddonUpdateButton->setEnabled(true);
Preferences::setBlenderVersionPreference(
QString("%1|%2").arg(mBlenderVersion).arg(mAddonVersion));
Expand Down
2 changes: 2 additions & 0 deletions mainApp/declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ enum ThemeColorType {
#define KEYBOARDSHORTCUTS "KeyboardShortcuts"
#define TABLAYOUTS "TabLayouts"

#define BLENDER_RENDER_ADDON "io_scene_lpub3d_renderldraw"

#define MAX_TABLAYOUTS 10

#define FADE_SFX "-fade"
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.6.259.3370 (12 05 2023 06:00:58)
LPub3D 2.4.6.260.3371 (12 05 2023 06:01:22)

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 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.259.3370 (12 05 2023 06:00:58)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.260.3371 (12 05 2023 06:01:22)</h4>
<hr>
<p>
<span class="tg-1pky">LPub3D Official release.</span><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.6.259.3370
;; Last Update.: Fri, 12 May 2023 06:00:58 +0200
;; Version.....: 2.4.6.260.3371
;; Last Update.: Fri, 12 May 2023 06:01:22 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down

0 comments on commit 42adc99

Please sign in to comment.