Skip to content

Commit

Permalink
Validate highlight line out of bounds lines #417
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Oct 1, 2020
1 parent 78f7b96 commit 0703d90
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 17 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.1975
pkgver=2.4.0.1976
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.1975) debian; urgency=medium
lpub3d (2.4.0.1976) debian; urgency=medium

* LPub3D version 2.4.0.1.1975_20201002 for Linux
* LPub3D version 2.4.0.1.1976_20201002 for Linux

-- Trevor SANDY <[email protected]> Fri, 02 Oct 2020 01:40:14 +0200
-- Trevor SANDY <[email protected]> Fri, 02 Oct 2020 01:40:55 +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.1975
Version: 2.4.0.1976
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.1975
Version: 2.4.0.1976
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

* Fri Oct 02 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1975
* Fri Oct 02 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1976
- 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 1975 5059b4e
2 4 0 1 1976 78f7b96
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.1975 (02 10 2020 01:40:14)
LPub3D 2.4.0.1.1976 (02 10 2020 01:40:55)

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.1975 (02 10 2020 01:40:14)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1976 (02 10 2020 01:40:55)</h4>
<hr>
<p>
LPub3D Continuous release.<br>
Expand Down
1 change: 1 addition & 0 deletions mainApp/name.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum SceneObjectInfo { ObjectId };

enum PartSource {
NOT_FOUND = -1, // -1
OUT_OF_BOUNDS = NOT_FOUND, // -1
NEW_PART = NOT_FOUND, // -1
NEW_MODEL = NOT_FOUND, // -1
EDITOR_LINE, // 0
Expand Down
15 changes: 9 additions & 6 deletions mainApp/nativeviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3101,7 +3101,8 @@ void Gui::SelectedPartLines(QVector<TypeLine> &indexes, PartSource source){
// New part lines are added in createBuildModification() routine
if (lineIndex != NEW_PART) {
validLine = getSelectedLine(modelIndex, lineIndex, source, lineNumber);
lines.append(lineNumber);
if (lineNumber != OUT_OF_BOUNDS)
lines.append(lineNumber);
}

if (validLine) {
Expand Down Expand Up @@ -3129,17 +3130,19 @@ void Gui::SelectedPartLines(QVector<TypeLine> &indexes, PartSource source){
.arg(modelName);
} else if (validLine) {
Message = tr("Selected part modelName [%1] lineNumber: [%2] at step line index [%3]")
.arg(modelName).arg(lineNumber).arg(lineIndex);
.arg(modelName).arg(lineNumber).arg(lineIndex < 0 ? "undefined" : QString::number(lineIndex));
} else {
Message = tr("%1 part lineNumber [%2] for step line index [%3]")
.arg(indexes.size() ? "Out of bounds" : "Invalid").arg(lineNumber).arg(lineIndex);
.arg(indexes.size() ? "Out of bounds" : "Invalid")
.arg(lineNumber).arg(lineIndex < 0 ? "undefined" : QString::number(lineNumber));
}
} else if (validLine) { // valid and not from viewer
Message = tr("Selected part modelName [%1] lineNumber: [%2] at step line index [%3]")
.arg(modelName).arg(lineIndex).arg(lineNumber);
.arg(modelName).arg(lineIndex).arg(lineNumber < 0 ? "undefined" : QString::number(lineIndex));
} else { // invalid and not from viewer
Message = tr("%1 part lineNumber [%2] for step line index [%3]") // index and number flipped
.arg(indexes.size() ? "Out of bounds" : "Invalid").arg(lineIndex).arg(lineNumber);
.arg(indexes.size() ? "Out of bounds" : "Invalid")
.arg(lineIndex).arg(lineNumber < 0 ? "undefined" : QString::number(lineNumber));
}
emit messageSig(LOG_TRACE, Message);
}
Expand All @@ -3159,7 +3162,7 @@ void Gui::SelectedPartLines(QVector<TypeLine> &indexes, PartSource source){
.arg(modelName));
}
} else { // indexes from editor
if (gMainWindow->isVisible())
if (lines.size() && gMainWindow->isVisible())
emit setSelectedPiecesSig(lines);
}
} // not exporting
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.1975" date="2020-10-02">
<release version="2.4.0.1976" date="2020-10-02">
<description>
<p>LPub3D Linux AppImage package</p>
</description>
Expand Down

0 comments on commit 0703d90

Please sign in to comment.