Skip to content

Commit

Permalink
Restore override option to parseMessage #417
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Oct 1, 2020
1 parent 08a53d2 commit c033e7f
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 22 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.1967
pkgver=2.4.0.1968
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.1967) debian; urgency=medium
lpub3d (2.4.0.1968) debian; urgency=medium

* LPub3D version 2.4.0.1.1967_20201002 for Linux
* LPub3D version 2.4.0.1.1968_20201002 for Linux

-- Trevor SANDY <[email protected]> Fri, 02 Oct 2020 01:34:40 +0200
-- Trevor SANDY <[email protected]> Fri, 02 Oct 2020 01:35:22 +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.1967
Version: 2.4.0.1968
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.1967
Version: 2.4.0.1968
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.1967
* Fri Oct 02 2020 - trevor.dot.sandy.at.gmail.dot.com 2.4.0.1968
- 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 1967 5c42e4a
2 4 0 1 1968 08a53d2
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.1967 (02 10 2020 01:34:40)
LPub3D 2.4.0.1.1968 (02 10 2020 01:35: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 @@ -9,7 +9,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1967 (02 10 2020 01:34:40)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.0.1.1968 (02 10 2020 01:35:22)</h4>
<hr>
<p>
LPub3D Continuous release.<br>
Expand Down
4 changes: 2 additions & 2 deletions mainApp/lpub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5446,7 +5446,7 @@ void Gui::showLine(const Where &topOfStep, int type)
}
}

void Gui::parseError(const QString message, const Where &here, Preferences::MsgKey msgKey, bool option)
void Gui::parseError(const QString message, const Where &here, Preferences::MsgKey msgKey, bool option, bool override)
{
if (parsedMessages.contains(here))
return;
Expand All @@ -5469,7 +5469,7 @@ void Gui::parseError(const QString message, const Where &here, Preferences::MsgK
Where messageLine = here;
messageLine.setModelIndex(getSubmodelIndex(messageLine.modelName));
Preferences::MsgID msgID(msgKey,messageLine.indexToString());
Preferences::showMessage(msgID, parseMessage, keyType[msgID.msgKey][0], keyType[msgID.msgKey][1], option);
Preferences::showMessage(msgID, parseMessage, keyType[msgKey][0], keyType[msgKey][1], option, override);
}
if (writingToTmp)
emit progressPermMessageSig(QString("Writing submodel [Parse Error%1")
Expand Down
3 changes: 2 additions & 1 deletion mainApp/lpub.h
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,8 @@ public slots:
void parseError(const QString errorMsg,
const Where &here,
Preferences::MsgKey msgKey = Preferences::ParseErrors,
bool option = false);
bool option = false,
bool override = false);

void statusMessage(LogType logType, QString message);
void statusBarMsg(QString msg);
Expand Down
16 changes: 9 additions & 7 deletions mainApp/lpub_preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,7 @@ bool Preferences::getShowMessagePreference(MsgKey key)
return result;
}

int Preferences::showMessage(Preferences::MsgID msgID, const QString &message, const QString &title, const QString &type, bool option)
int Preferences::showMessage(Preferences::MsgID msgID, const QString &message, const QString &title, const QString &type, bool option, bool override)
{
foreach (QString messageNotShown, messagesNotShown)
if (messageNotShown.startsWith(msgID.toString()))
Expand All @@ -3274,12 +3274,14 @@ int Preferences::showMessage(Preferences::MsgID msgID, const QString &message,
box.setIcon(QMessageBox::Icon::Warning);
box.setStandardButtons (option ? QMessageBox::Ok | QMessageBox::Cancel : QMessageBox::Ok);
box.setDefaultButton (QMessageBox::Cancel);
QCheckBox *cb = new QCheckBox(QString("Do not show this %1 again.").arg(type));
box.setCheckBox(cb);
QObject::connect(cb, &QCheckBox::stateChanged, [&message, &msgID](int state) {
if (static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked)
messagesNotShown.append(QString(msgID.toString() + "|" + message));
});
if (!override) {
QCheckBox *cb = new QCheckBox(QString("Do not show this %1 again.").arg(type));
box.setCheckBox(cb);
QObject::connect(cb, &QCheckBox::stateChanged, [&message, &msgID](int state) {
if (static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked)
messagesNotShown.append(QString(msgID.toString() + "|" + message));
});
}
box.adjustSize();
return box.exec();
}
Expand Down
7 changes: 6 additions & 1 deletion mainApp/lpub_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ class Preferences
static void setBlenderVersionPreference(QString);
static void setDebugLogging(bool);

static int showMessage(Preferences::MsgID, const QString &message, const QString &title = "", const QString &type = "", bool option = false);
static int showMessage(Preferences::MsgID,
const QString &message,
const QString &title = "",
const QString &type = "",
bool option = false,
bool override = false);

static QString lpub3dAppName;
static QString ldrawLibPath;
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.1967" date="2020-10-02">
<release version="2.4.0.1968" date="2020-10-02">
<description>
<p>LPub3D Linux AppImage package</p>
</description>
Expand Down

0 comments on commit c033e7f

Please sign in to comment.