Skip to content

Commit

Permalink
Status message update #419
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Sep 20, 2020
1 parent 528f4bb commit 50970e2
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 99 deletions.
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 - 2020 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.0.1922
pkgver=2.4.0.1923
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.0.1922) debian; urgency=medium
lpub3d (2.4.0.1923) debian; urgency=medium

* LPub3D version 2.4.0.1.1922_20200920 for Linux
* LPub3D version 2.4.0.1.1923_20200920 for Linux

-- Trevor SANDY <[email protected]> Sun, 20 Sep 2020 11:57:11 +0200
-- Trevor SANDY <[email protected]> Sun, 20 Sep 2020 11:57:50 +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.0.1922
Version: 2.4.0.1923
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 @@ -116,7 +116,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.0.1922
Version: 2.4.0.1923
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -728,5 +728,5 @@ update-mime-database /usr/share/mime >/dev/null || true
update-desktop-database || true
%endif

* Sun Sep 20 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1922
* Sun Sep 20 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1923
- LPub3D Linux package (rpm) release
Binary file modified builds/utilities/ci/secure/.secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/utilities/version.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2 4 0 1 1922 f8dfa3b
2 4 0 1 1923 528f4bb
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.0.1.1922 (20 09 2020 11:57:11)
LPub3D 2.4.0.1.1923 (20 09 2020 11:57:50)

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 @@ -9,7 +9,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1922 (20 09 2020 11:57:11)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1923 (20 09 2020 11:57:50)</h4>
<hr>
<p>
LPub3D Continuous release.<br>
Expand Down
31 changes: 14 additions & 17 deletions mainApp/ldrawfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,23 +1093,23 @@ void LDrawFile::loadMPDFile(const QString &fileName, QDateTime &datetime)
&stageSubfiles,
&fileInfo,
&searchPaths,
&datetime] (int i) {
&datetime] (int fileIndx) {
bool alreadyLoaded;
QStringList contents;
QString subfileName;
MissingHeader headerMissing = NoneMissing;

emit gui->progressPermRangeSig(1, stageContents.size());
emit gui->progressPermMessageSig("Loading " + fileType() + " " + fileInfo.fileName() + "...");
emit gui->progressPermMessageSig(QString("Loading %1 %2").arg(fileType()).arg( fileInfo.fileName()));
#ifdef QT_DEBUG_MODE
emit gui->messageSig(LOG_DEBUG, QString("Stage Contents Size: %1, Start Index %2")
.arg(stageContents.size()).arg(i));
.arg(stageContents.size()).arg(fileIndx));
#endif
for (; i < stageContents.size(); i++) {
for (; fileIndx < stageContents.size(); fileIndx++) {

QString smLine = stageContents.at(i);
QString smLine = stageContents.at(fileIndx);

emit gui->progressPermSetValueSig(i);
emit gui->progressPermSetValueSig(fileIndx + 1);

bool sof = smLine.contains(_fileRegExp[SOF_RX]); //start of file
bool eof = smLine.contains(_fileRegExp[EOF_RX]); //end of file
Expand Down Expand Up @@ -1144,13 +1144,13 @@ void LDrawFile::loadMPDFile(const QString &fileName, QDateTime &datetime)
if (hdrTopFileNotFound) {
if (sof){
_file = _fileRegExp[SOF_RX].cap(1).replace(QFileInfo(_fileRegExp[SOF_RX].cap(1)).suffix(),"");
descriptionLine = i+1; //next line should be description
descriptionLine = fileIndx + 1; //next line should be description
hdrTopFileNotFound = false;
}
}

// One time populate model descriptkon
if (hdrDescNotFound && i == descriptionLine && ! isHeader(smLine)) {
if (hdrDescNotFound && fileIndx == descriptionLine && ! isHeader(smLine)) {
if (smLine.contains(_fileRegExp[DES_RX]))
_description = smLine;
else
Expand Down Expand Up @@ -1276,7 +1276,7 @@ void LDrawFile::loadMPDFile(const QString &fileName, QDateTime &datetime)
QString projectPath = QDir::toNativeSeparators(fileInfo.absolutePath());

// set index to bottom of stageContents
int i = stageContents.size();
int stageFileIndx = stageContents.size();
bool subFileFound =false;
for (QString subfile : stageSubfiles) {
#ifdef QT_DEBUG_MODE
Expand Down Expand Up @@ -1328,7 +1328,7 @@ void LDrawFile::loadMPDFile(const QString &fileName, QDateTime &datetime)
}
}
if (subFileFound) {
loadMPDContents(i);
loadMPDContents(stageFileIndx);
}
}
#ifdef QT_DEBUG_MODE
Expand All @@ -1338,7 +1338,7 @@ void LDrawFile::loadMPDFile(const QString &fileName, QDateTime &datetime)
#endif
};

loadMPDContents(0);
loadMPDContents(0/*fileIndx*/);

#ifdef QT_DEBUG_MODE
QHashIterator<QString, int> i(_ldcadGroups);
Expand Down Expand Up @@ -1426,9 +1426,7 @@ void LDrawFile::loadLDRFile(const QString &path, const QString &fileName)

emit gui->progressBarPermInitSig();
emit gui->progressPermRangeSig(1, contents.size());
emit gui->progressPermMessageSig("Processing model file...");

emit gui->messageSig(LOG_INFO, "Loading LDR " + fileType + " '" + fileInfo.fileName() + "'...");
emit gui->progressPermMessageSig(QString("Loading LDR %1 %2...").arg(fileType).arg(fileInfo.fileName()));

QDateTime datetime = fileInfo.lastModified();

Expand All @@ -1440,7 +1438,7 @@ void LDrawFile::loadLDRFile(const QString &path, const QString &fileName)

QString smLine = contents.at(i);

emit gui->progressPermSetValueSig(i);
emit gui->progressPermSetValueSig(i + 1);

// load LDCad groups
if (!ldcadGroupsLoaded && smLine.contains(_fileRegExp[LDG_RX])){
Expand Down Expand Up @@ -1930,8 +1928,7 @@ void LDrawFile::countParts(const QString &fileName) {

emit gui->progressBarPermInitSig();
emit gui->progressPermRangeSig(1, size(fileName));
emit gui->progressPermMessageSig("Counting parts...");
emit gui->messageSig(LOG_INFO, "Counting parts for " + fileName + "...");
emit gui->progressPermMessageSig("Counting parts for " + fileName + "...");

int topModelIndx = getSubmodelIndex(fileName);

Expand Down
15 changes: 6 additions & 9 deletions mainApp/lpub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3417,12 +3417,13 @@ void Gui::loadLDSearchDirParts() {
partWorkerLDSearchDirs.processLDSearchDirParts();
}

// left side progress bar
// left side progress bar - no longer used
void Gui::progressBarInit(){
if (okToInvokeProgressBar()) {
progressBar->setMaximumHeight(15);
statusBar()->addWidget(progressLabel);
statusBar()->addWidget(progressBar);
progressLabel->setAlignment(Qt::AlignRight);
progressLabel->show();
progressBar->show();
}
Expand All @@ -3432,14 +3433,13 @@ void Gui::progressBarSetText(const QString &progressText)
{
if (okToInvokeProgressBar()) {
progressLabel->setText(progressText);
QApplication::processEvents();
emit gui->messageSig(LOG_INFO, progressText);
}
}
void Gui::progressBarSetRange(int minimum, int maximum)
{
if (okToInvokeProgressBar()) {
progressBar->setRange(minimum,maximum);
QApplication::processEvents();
}
}
void Gui::progressBarSetValue(int value)
Expand All @@ -3453,7 +3453,6 @@ void Gui::progressBarReset()
{
if (okToInvokeProgressBar()) {
progressBar->reset();
QApplication::processEvents();
}
}

Expand All @@ -3470,9 +3469,9 @@ void Gui::progressBarPermInit(){
progressBarPerm->setMaximumHeight(15);
statusBar()->addPermanentWidget(progressLabelPerm);
statusBar()->addPermanentWidget(progressBarPerm);
progressLabelPerm->setAlignment(Qt::AlignRight);
progressLabelPerm->show();
progressBarPerm->show();
QApplication::processEvents();
}
}

Expand All @@ -3487,7 +3486,6 @@ void Gui::progressBarPermSetRange(int minimum, int maximum)
{
if (okToInvokeProgressBar()) {
progressBarPerm->setRange(minimum,maximum);
QApplication::processEvents();
}
}
void Gui::progressBarPermSetValue(int value)
Expand All @@ -3501,7 +3499,6 @@ void Gui::progressBarPermReset()
{
if (okToInvokeProgressBar()) {
progressBarPerm->reset();
QApplication::processEvents();
}
}

Expand Down Expand Up @@ -5472,8 +5469,8 @@ void Gui::showLineMessage(const QString errorMsg, const Where &here, Preferences
}
}
if (writingToTmp)
emit progressPermMessageSig(QString("Writing submodels [Parse error%1]...")
.arg(showMessagePreference ? "" : " - see log" ));
emit progressPermMessageSig(QString("Writing submodel [Parse Error%1")
.arg(showMessagePreference ? "]... " : " - see log]... " ));

logError() << parseMessage.replace("<br>"," ");

Expand Down
2 changes: 1 addition & 1 deletion mainApp/lpub.h
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ public slots:

bool okToInvokeProgressBar()
{
return (Preferences::lpub3dLoaded && Preferences::modeGUI);
return (Preferences::lpub3dLoaded && Preferences::modeGUI && !exporting());
}

#ifdef WATCHER
Expand Down
3 changes: 2 additions & 1 deletion mainApp/openclose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ void Gui::closeModelFile(){

setWindowTitle(tr("%1[*] - %2").arg(windowName).arg(windowVersion));
}

/***************************************************************************
* File opening closing stuff
**************************************************************************/
Expand Down Expand Up @@ -733,7 +734,7 @@ bool Gui::openFile(QString &fileName)
enableWatcher();

defaultResolutionType(Preferences::preferCentimeters);
emit messageSig(LOG_DEBUG, QString("File loaded - %1.").arg(fileName));
emit messageSig(LOG_INFO, QString("Open file '%1' completed.").arg(fileName));
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion mainApp/org.trevorsandy.lpub3d.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<binary>lpub3d24</binary>
​</provides>
<releases>
<release version="2.4.0.1922" date="2020-09-20">
<release version="2.4.0.1923" date="2020-09-20">
<description>
<p>LPub3D Linux AppImage package</p>
</description>
Expand Down
30 changes: 16 additions & 14 deletions mainApp/pli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ int Pli::createSubModelIcons()
splitBom = false;
isSubModel = true;
pliMeta = meta->LPub.pli;
int iconCount = gui->fileList().size();

auto setSubmodel = [this,&type,&color] (const int i)
{
Expand Down Expand Up @@ -885,29 +886,29 @@ int Pli::createSubModelIcons()

if (renderer->useLDViewSCall()) {

for (int i = 0; i < gui->fileList().size(); i++) {
for (int i = 0; i < iconCount; i++) {
setSubmodel(i);
}
rc = partSizeLDViewSCall();

} else {

if (Preferences::modeGUI && ! gui->exporting()) {
emit gui->progressPermResetSig();
emit gui->progressPermMessageSig("Rendering submodel icons...");
emit gui->progressPermRangeSig(1, gui->fileList().size());
}
for (int i = 0; i < gui->fileList().size(); i++) {
emit gui->progressPermResetSig();
emit gui->progressPermRangeSig(1, iconCount);

for (int i = 0; i < iconCount; i++) {

emit gui->progressPermSetValueSig(i + 1);
emit gui->progressPermMessageSig(QString("Rendering submodel icon %1 of %2...").arg(i + 1).arg(iconCount));

key = setSubmodel(i);
if ((createPartImage(parts[key]->nameKey,type,color,nullptr) != 0)) {
emit gui->messageSig(LOG_ERROR, QString("Failed to create submodel icon for key %1").arg(parts[key]->nameKey));
rc = -1;
continue;
}
}
if (Preferences::modeGUI && ! gui->exporting()) {
emit gui->progressPermSetValueSig(gui->fileList().size());
}
emit gui->progressPermSetValueSig(iconCount);
}

return rc;
Expand Down Expand Up @@ -2528,17 +2529,18 @@ int Pli::partSizeLDViewSCall() {
}
} // for every part

if (isSubModel && Preferences::modeGUI && ! gui->exporting()) {
if (isSubModel) {
emit gui->progressPermResetSig();
emit gui->progressPermMessageSig("Rendering submodel images...");
emit gui->progressPermRangeSig(1, ptn.size());
}

for (int pT = 0; pT < ptn.size(); pT++ ) { // for every part type

int ptRc = 0;
if (isSubModel && Preferences::modeGUI && ! gui->exporting())
if (isSubModel) {
emit gui->progressPermMessageSig(QString("Rendering submodel icon %1 of %2...").arg(pT + 1).arg(ptn.size()));
emit gui->progressPermSetValueSig(pT);
}

#ifdef QT_DEBUG_MODE
QString CurrentPartType = PartTypeNames[pT];
Expand Down Expand Up @@ -2578,7 +2580,7 @@ int Pli::partSizeLDViewSCall() {
}
}

if (isSubModel && Preferences::modeGUI && ! gui->exporting()) {
if (isSubModel) {
emit gui->progressPermSetValueSig(ptn.size());
}

Expand Down
Loading

0 comments on commit 50970e2

Please sign in to comment.