Resolved issue #180. Search field in tape app and dialog Increments.

--HG--
branch : develop
This commit is contained in:
Valentina Zhuravska 2016-06-11 15:51:48 +03:00
parent 67c174951b
commit 1ca5b4dfa6
8 changed files with 88 additions and 12 deletions

View File

@ -28,6 +28,7 @@
- [#487] True dart point always goes to origin when the label is moved.
- [#128] New Tool: Slash and Spread.
- [#409] New feature: Export measurement file to Excel .csv.
- [#180] New feature: Search field in tape app and dialog Increments.
# Version 0.4.5
- [#435] Valentina doesn't change the cursor.

View File

@ -12,8 +12,7 @@ SOURCES += \
$$PWD/dialogs/configpages/tapeconfigurationpage.cpp \
$$PWD/dialogs/configpages/tapepathpage.cpp \
$$PWD/dialogs/dialogexporttocsv.cpp \
$$PWD/vlitepattern.cpp \
$$PWD/vtablesearch.cpp
$$PWD/vlitepattern.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp
@ -29,8 +28,7 @@ HEADERS += \
$$PWD/dialogs/configpages/tapeconfigurationpage.h \
$$PWD/dialogs/configpages/tapepathpage.h \
$$PWD/dialogs/dialogexporttocsv.h \
$$PWD/vlitepattern.h \
$$PWD/vtablesearch.h
$$PWD/vlitepattern.h
FORMS += \
$$PWD/tmainwindow.ui \

View File

@ -58,14 +58,18 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
ui(new Ui::DialogIncrements),
data(data),
doc(doc),
formulaBaseHeight(0)
formulaBaseHeight(0),
search()
{
ui->setupUi(this);
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
ui->lineEditName->setClearButtonEnabled(true);
ui->lineEditFind->setClearButtonEnabled(true);
#endif
search = QSharedPointer<VTableSearch>(new VTableSearch(ui->tableWidgetIncrement));
formulaBaseHeight = ui->plainTextEditFormula->height();
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
@ -102,6 +106,9 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
connect(ui->lineEditName, &QLineEdit::editingFinished, this, &DialogIncrements::SaveIncrName);
connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrDescription);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogIncrements::SaveIncrFormula);
connect(ui->lineEditFind, &QLineEdit::textEdited, this, &DialogIncrements::Find);
connect(ui->toolButtonFindPrevious, &QToolButton::clicked, this, &DialogIncrements::FindPrevious);
connect(ui->toolButtonFindNext, &QToolButton::clicked, this, &DialogIncrements::FindNext);
if (ui->tableWidgetIncrement->rowCount() > 0)
{
@ -428,6 +435,8 @@ void DialogIncrements::FullUpdateFromFile()
FillLengthsCurves();
FillRadiusesArcs();
FillAnglesCurves();
search->RefreshList(ui->lineEditFind->text());
}
//---------------------------------------------------------------------------------------------------------------------
@ -775,6 +784,24 @@ void DialogIncrements::ShowIncrementDetails()
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::Find(const QString &term)
{
search->Find(term);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::FindPrevious()
{
search->FindPrevious();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::FindNext()
{
search->FindNext();
}
//---------------------------------------------------------------------------------------------------------------------
DialogIncrements::~DialogIncrements()
{

View File

@ -31,6 +31,7 @@
#include "../vtools/dialogs/tools/dialogtool.h"
#include "../xml/vpattern.h"
#include "../vmisc/vtablesearch.h"
class VIndividualMeasurements;
class QTableWidget;
@ -72,6 +73,9 @@ private slots:
void DeployFormula();
void Fx();
void FullUpdateFromFile();
void Find(const QString &term);
void FindPrevious();
void FindNext();
private:
Q_DISABLE_COPY(DialogIncrements)
@ -87,6 +91,8 @@ private:
int formulaBaseHeight;
QSharedPointer<VTableSearch> search;
template <typename T>
void FillTable(const QMap<QString, T> &varTable, QTableWidget *table);

View File

@ -39,13 +39,56 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabIncrements">
<attribute name="title">
<string>Increments</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="labelFind">
<property name="text">
<string>Find:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditFind">
<property name="placeholderText">
<string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonFindPrevious">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="go-previous" resource="../../../libs/vmisc/share/resources/theme.qrc">
<normaloff>:/icons/win.icon.theme/16x16/actions/go-previous.png</normaloff>:/icons/win.icon.theme/16x16/actions/go-previous.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonFindNext">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="go-next" resource="../../../libs/vmisc/share/resources/theme.qrc">
<normaloff>:/icons/win.icon.theme/16x16/actions/go-next.png</normaloff>:/icons/win.icon.theme/16x16/actions/go-next.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
@ -230,8 +273,7 @@
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
@ -245,8 +287,7 @@
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
@ -620,6 +661,7 @@
</tabstops>
<resources>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
<include location="../../../libs/vmisc/share/resources/theme.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -10,7 +10,8 @@ SOURCES += \
$$PWD/vcommonsettings.cpp \
$$PWD/vtapesettings.cpp \
$$PWD/commandoptions.cpp \
$$PWD/qxtcsvmodel.cpp
$$PWD/qxtcsvmodel.cpp \
$$PWD/vtablesearch.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp
@ -29,7 +30,8 @@ HEADERS += \
$$PWD/vlockguard.h \
$$PWD/vsysexits.h \
$$PWD/commandoptions.h \
$$PWD/qxtcsvmodel.h
$$PWD/qxtcsvmodel.h \
$$PWD/vtablesearch.h
# Qt's versions
# 5.0.0, 5.0.1, 5.0.2