Skip to content

Commit

Permalink
Default placement selector for display submodel #237
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Apr 23, 2019
1 parent 956fd56 commit 614e913
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 29 deletions.
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
Expand Up @@ -2,7 +2,7 @@
# Last Update: March 23, 2019
# Copyright (c) 2017 - 2019 by Trevor SANDY
pkgname=lpub3d
pkgver=2.3.10.1230
pkgver=2.3.10.1231
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
@@ -1,5 +1,5 @@
lpub3d (2.3.10.1230) debian; urgency=medium
lpub3d (2.3.10.1231) debian; urgency=medium

* LPub3D version 2.3.10.1.1230_20190423 for Linux
* LPub3D version 2.3.10.1.1231_20190423 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Tue, 23 Apr 2019 12:06:05 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Tue, 23 Apr 2019 12:07:42 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.3.10.1230
Version: 2.3.10.1231
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
Expand Up @@ -118,7 +118,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.3.10.1230
Version: 2.3.10.1231
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -717,5 +717,5 @@ update-mime-database /usr/share/mime >/dev/null || true
update-desktop-database || true
%endif

* Tue Apr 23 2019 - trevor.dot.sandy.at.gmail.dot.com 2.3.10.1230
* Tue Apr 23 2019 - trevor.dot.sandy.at.gmail.dot.com 2.3.10.1231
- 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
@@ -1 +1 @@
2 3 10 1 1230 8ab1547
2 3 10 1 1231 956fd56
2 changes: 1 addition & 1 deletion mainApp/docs/README.txt
@@ -1,4 +1,4 @@
LPub3D 2.3.10.1.1230 (23 04 2019 12:06:05)
LPub3D 2.3.10.1.1231 (23 04 2019 12:07:42)

Features, enhancements, fixes and changes
------------
Expand Down
3 changes: 2 additions & 1 deletion mainApp/docs/RELEASE_NOTES.html
Expand Up @@ -9,7 +9,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.3.10.1.1230 (23 04 2019 12:06:05)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.3.10.1.1231 (23 04 2019 12:07:42)</h4>
<hr>
<p>
LPub3D version 2.3.10 addresses blocker fixes for HTML part list sorting<br>
Expand All @@ -19,6 +19,7 @@ <h4><a id="LPub3D_0"></a>LPub3D 2.3.10.1.1230 (23 04 2019 12:06:05)</h4>
<h4><a id="Features_enhancements_fixes_and_changes_7"></a>Features, enhancements, fixes and changes</h4>
</th>
</tr>
<tr><td class="tg-buh4"><a href="https://github.com/trevorsandy/lpub3d/issues/226">Enhancement - Default placement selector for display submodel #237</td></tr>
<tr><td class="tg-buh4"><a href="https://github.com/trevorsandy/lpub3d/issues/226">Enhancement - Make display submodel instance count optional #236</td></tr>
<tr><td class="tg-buh4"><a href="https://github.com/trevorsandy/lpub3d/issues/235">Fix - HTML Part List sort function broken #235</td></tr>
<tr>
Expand Down
2 changes: 2 additions & 0 deletions mainApp/globals.h
Expand Up @@ -204,6 +204,7 @@ class GlobalSubModelDialog : public QDialog
Q_OBJECT
private:
GlobalSubModelPrivate *data;
QGroupBox *instanceCountBox;

public:
GlobalSubModelDialog(QString &topLevelFile, Meta &meta);
Expand All @@ -213,6 +214,7 @@ class GlobalSubModelDialog : public QDialog
public slots:
void accept();
void cancel();
void instanceCountClicked(bool);
};

/*****************************************************************
Expand Down
58 changes: 58 additions & 0 deletions mainApp/metagui.cpp
Expand Up @@ -3215,6 +3215,8 @@ ShowSubModelGui::ShowSubModelGui(
showInstanceCountBox->setChecked(meta->showInstanceCount.value());
connect(showInstanceCountBox,SIGNAL(clicked(bool)),
this, SLOT(showInstanceCountChange(bool)));
connect(showInstanceCountBox,SIGNAL(clicked(bool)),
this, SIGNAL(instanceCountClicked(bool)));
grid->addWidget(showInstanceCountBox,9,0,1,2);

showInstanceCountDefaultSettings = Settings.contains(QString("%1/%2").arg(SETTINGS,"ShowInstanceCount"));
Expand All @@ -3228,10 +3230,26 @@ ShowSubModelGui::ShowSubModelGui(
showInstanceCountMetaBox->setChecked(!showInstanceCountDefaultSettings);
grid->addWidget(showInstanceCountMetaBox,10,1);

line = new QFrame();
line->setFrameShape(QFrame::HLine);
grid->addWidget(line,11,0,1,2);

QLabel *placementLabel = new QLabel("Default placement",parent);
grid->addWidget(placementLabel,12,0);

placementButton = new QPushButton("Change Placement",parent);
placementButton->setToolTip("Set Submodel default placement");
connect(placementButton,SIGNAL(clicked( bool)),
this, SLOT( placementChanged(bool)));
grid->addWidget(placementButton,12,1);

showSubmodelsModified = false;
showTopModelModified = false;
showSubmodelInCalloutModified = false;
showInstanceCountModified = false;
placementModified = false;

enableSubmodelControls(meta->show.value());
}

void ShowSubModelGui::showSubmodelsChange(bool checked)
Expand All @@ -3240,6 +3258,7 @@ void ShowSubModelGui::showSubmodelsChange(bool checked)
meta->show.setValue(checked);
modified = showSubmodelsModified = true;
}
enableSubmodelControls(checked);
}

void ShowSubModelGui::showTopModelChange(bool checked)
Expand All @@ -3266,6 +3285,39 @@ void ShowSubModelGui::showInstanceCountChange(bool checked)
}
}

void ShowSubModelGui::placementChanged(bool clicked)
{
Q_UNUSED(clicked);
PlacementData placementData = meta->placement.value();
bool ok;
ok = PlacementDialog
::getPlacement(SingleStepType,SubModelType,placementData,"Submodel Placement",ContentPage);
if (ok) {
meta->placement.setValue(placementData);
modified = placementModified = true;
}
}

void ShowSubModelGui::enableSubmodelControls(bool checked)
{
showSubmodelsDefaultBox->setEnabled(checked);
showSubmodelsMetaBox->setEnabled(checked);

showTopModelBox->setEnabled(checked);
showTopModelDefaultBox->setEnabled(checked);
showTopModelMetaBox->setEnabled(checked);

showSubmodelInCalloutBox->setEnabled(checked);
showSubmodelInCalloutDefaultBox->setEnabled(checked);
showSubmodelInCalloutMetaBox->setEnabled(checked);

showInstanceCountBox->setEnabled(checked);
showInstanceCountDefaultBox->setEnabled(checked);
showInstanceCountMetaBox->setEnabled(checked);

placementButton->setEnabled(checked);
}

void ShowSubModelGui::apply(QString &topLevelFile)
{
QSettings Settings;
Expand Down Expand Up @@ -3358,6 +3410,12 @@ void ShowSubModelGui::apply(QString &topLevelFile)
mi.endMacro();
}
}
if (placementModified){
MetaItem mi;
mi.beginMacro("PlacementModified");
mi.setGlobalMeta(topLevelFile,&meta->placement);
mi.endMacro();
}
}

/***********************************************************************
Expand Down
8 changes: 8 additions & 0 deletions mainApp/metagui.h
Expand Up @@ -1004,21 +1004,29 @@ class ShowSubModelGui : public MetaGui
QCheckBox *showInstanceCountDefaultBox;
QCheckBox *showInstanceCountMetaBox;

QPushButton *placementButton;

bool showSubmodelsModified;
bool showTopModelModified;
bool showSubmodelInCalloutModified;
bool showInstanceCountModified;
bool placementModified;

bool showSubmodelsDefaultSettings;
bool showTopModelDefaultSettings;
bool showSubmodelInCalloutDefaultSettings;
bool showInstanceCountDefaultSettings;

signals:
void instanceCountClicked(bool);

public slots:
void enableSubmodelControls(bool checked);
void showSubmodelsChange(bool checked);
void showTopModelChange(bool checked);
void showSubmodelInCalloutChange(bool checked);
void showInstanceCountChange(bool checked);
void placementChanged(bool);
};

/***********************************************************************
Expand Down
2 changes: 1 addition & 1 deletion mainApp/org.trevorsandy.lpub3d.appdata.xml
Expand Up @@ -68,7 +68,7 @@
<binary>lpub3d23</binary>
​</provides>
<releases>
<release version="2.3.10.1230" date="2019-04-23">
<release version="2.3.10.1231" date="2019-04-23">
<description>
<p>LPub3D Linux AppImage package</p>
</description>
Expand Down
2 changes: 1 addition & 1 deletion mainApp/pliglobals.cpp
Expand Up @@ -150,7 +150,7 @@ GlobalPliDialog::GlobalPliDialog(
&pliMeta->modelScale,
pliMeta->modelScale._min,
pliMeta->modelScale._max,
0.01);
float(0.01));
data->children.append(child);
data->clearCache = child->modified;
childlayout->addWidget(child);
Expand Down

0 comments on commit 614e913

Please sign in to comment.