Skip to content

Commit

Permalink
Update command management filter action #602
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 8, 2023
1 parent d2a6363 commit bb793f2
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 42 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.3345
pkgver=2.4.6.3346
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.3345
pkgver=2.4.6.3346
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.3345) debian; urgency=medium
lpub3d (2.4.6.3346) debian; urgency=medium

* LPub3D version 2.4.6.234.3345_20230508 for Linux
* LPub3D version 2.4.6.235.3346_20230508 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:16:53 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:17:18 +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.3345
Version: 2.4.6.3346
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.3345
Version: 2.4.6.3346
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
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3345
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3346
- 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.3345) debian; urgency=medium
lpub3d (2.4.6.3346) debian; urgency=medium

* LPub3D version 2.4.6.234.3345_20230508 for Linux
* LPub3D version 2.4.6.235.3346_20230508 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:16:54 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:17:19 +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.3345
Version: 2.4.6.3346
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.3345
Version: 2.4.6.3346
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
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3345
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3346
- 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 234 3345 9ede08f94
2 4 6 235 3346 d2a636383
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 = 234
GIT_REVISION = 235
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 = 3345
GIT_COMMIT = 3346
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}.234.3345.9ede08f94
GIT_VERSION = $${VERSION}.235.3346.d2a636383
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
55 changes: 36 additions & 19 deletions mainApp/commands/filterlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ FilterLineEdit::FilterLineEdit(CommandCollection *collection, QWidget *parent)
: QLineEdit(parent)
, m_commandsCollection(collection)
, m_patternGroup(new QActionGroup(this))
{
m_menu = new QMenu(this);
m_useCompleterAction = m_menu->addAction(tr("Auto-complete"));
{
m_useCompleterAction = addAction(QIcon(":/resources/filter.png"), QLineEdit::TrailingPosition);
m_useCompleterAction->setData(QString("command").toLatin1());
setPlaceholderText(tr("Command filter"));
setPlaceholderText(tr("Filter commands"));
initialize();
}

Expand All @@ -83,55 +82,54 @@ FilterLineEdit::FilterLineEdit(SnippetCollection *collection, QWidget *parent)
, m_snippetsCollection(collection)
, m_patternGroup(new QActionGroup(this))
{
m_menu = new QMenu(this);
m_useCompleterAction = m_menu->addAction(tr("Auto-complete"));
m_useCompleterAction = addAction(QIcon(":/resources/filter.png"), QLineEdit::TrailingPosition);
m_useCompleterAction->setData(QString("snippet").toLatin1());
setPlaceholderText(tr("Snippet filter"));
setPlaceholderText(tr("Filter snippets"));
initialize();
}

void FilterLineEdit::initialize()
{
setClearButtonEnabled(true);

connect(this, &QLineEdit::textChanged, this, &FilterLineEdit::filterChanged);
connect(this, &QLineEdit::textChanged, this, &::FilterLineEdit::filterTextChanged);

m_useCompleterAction->setCheckable(true);
m_useCompleterAction->setChecked(false);
connect(m_useCompleterAction, &QAction::toggled, this, &FilterLineEdit::completerChanged);
connect(m_useCompleterAction, &QAction::triggered, this, &FilterLineEdit::filterTriggered);
completerChanged();

m_menu->addSeparator();
m_caseSensitivityAction = m_menu->addAction(tr("Case Sensitive"));
QMenu *menu = new QMenu(this);

m_caseSensitivityAction = menu->addAction(tr("Match Case"));
m_caseSensitivityAction->setCheckable(true);
connect(m_caseSensitivityAction, &QAction::toggled, this, &FilterLineEdit::filterChanged);

m_menu->addSeparator();
menu->addSeparator();
m_patternGroup->setExclusive(true);
QAction *patternAction = m_menu->addAction("Fixed String");
QAction *patternAction = menu->addAction("Fixed String");
patternAction->setData(QVariant(int(QRegExp::FixedString)));
patternAction->setCheckable(true);
patternAction->setChecked(true);
m_patternGroup->addAction(patternAction);
patternAction = m_menu->addAction("Regular Expression");
patternAction = menu->addAction("Regular Expression");
patternAction->setCheckable(true);
patternAction->setData(QVariant(int(QRegExp::RegExp2)));
m_patternGroup->addAction(patternAction);
patternAction = m_menu->addAction("Wildcard");
patternAction = menu->addAction("Wildcard");
patternAction->setCheckable(true);
patternAction->setData(QVariant(int(QRegExp::Wildcard)));
m_patternGroup->addAction(patternAction);
connect(m_patternGroup, &QActionGroup::triggered, this, &FilterLineEdit::filterChanged);

const QIcon icon = QIcon(QPixmap(":/resources/filter.png"));
QToolButton *optionsButton = new QToolButton;
#ifndef QT_NO_CURSOR
optionsButton->setCursor(Qt::ArrowCursor);
#endif
optionsButton->setFocusPolicy(Qt::NoFocus);
optionsButton->setStyleSheet("* { border: none; }");
optionsButton->setIcon(icon);
optionsButton->setMenu(m_menu);
optionsButton->setIcon(QIcon(":/resources/gear_in.png"));
optionsButton->setToolTip(tr("Filter Options..."));
optionsButton->setMenu(menu);
optionsButton->setPopupMode(QToolButton::InstantPopup);

QWidgetAction *optionsAction = new QWidgetAction(this);
Expand Down Expand Up @@ -173,6 +171,25 @@ void FilterLineEdit::completerChanged()
setCompleter(completer);
}

void FilterLineEdit::filterTextChanged(const QString& Text)
{
if (m_useCompleterAction) {
if (Text.isEmpty()) {
m_useCompleterAction->setIcon(QIcon(":/resources/filter.png"));
m_useCompleterAction->setToolTip("");
} else {
m_useCompleterAction->setIcon(QIcon(":/resources/resetaction.png"));
m_useCompleterAction->setToolTip(tr("Reset"));
}
}
emit filterChanged();
}

void FilterLineEdit::filterTriggered()
{
clear();
}

Qt::CaseSensitivity FilterLineEdit::caseSensitivity() const
{
return m_caseSensitivityAction->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive;
Expand Down
3 changes: 2 additions & 1 deletion mainApp/commands/filterlineedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ class FilterLineEdit : public QLineEdit

private slots:
void completerChanged();
void filterTriggered();
void filterTextChanged(const QString&);

private:
void initialize();
QMenu *m_menu;
CommandCollection *m_commandsCollection;
SnippetCollection *m_snippetsCollection;
QAction *m_caseSensitivityAction;
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.234.3345 (08 05 2023 15:16:54)
LPub3D 2.4.6.235.3346 (08 05 2023 15:17:19)

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.234.3345 (08 05 2023 15:16:54)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.235.3346 (08 05 2023 15:17:19)</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.234.3345
;; Last Update.: Mon, 08 May 2023 15:16:54 +0200
;; Version.....: 2.4.6.235.3346
;; Last Update.: Mon, 08 May 2023 15:17:19 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down

0 comments on commit bb793f2

Please sign in to comment.