Merged feature-filter into master
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include "sforeader.h"
|
#include "sforeader.h"
|
||||||
#include "confirmdialog.h"
|
#include "confirmdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "filterlineedit.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
@@ -199,4 +200,22 @@ void BackupManagerForm::loadBackupListing(int index)
|
|||||||
|
|
||||||
vert_header->setUpdatesEnabled(true);
|
vert_header->setUpdatesEnabled(true);
|
||||||
db->mutex.unlock();
|
db->mutex.unlock();
|
||||||
|
|
||||||
|
// apply filter
|
||||||
|
this->on_filterLineEdit_textChanged(ui->filterLineEdit->text());
|
||||||
|
}
|
||||||
|
|
||||||
|
void BackupManagerForm::on_filterLineEdit_textChanged(const QString &arg1)
|
||||||
|
{
|
||||||
|
if(arg1 != tr("Filter")) {
|
||||||
|
for(int i = 0; i < ui->tableWidget->rowCount(); ++i) {
|
||||||
|
BackupItem *item = (BackupItem*) ui->tableWidget->cellWidget(i, 0);
|
||||||
|
|
||||||
|
if(item->title.contains(arg1, Qt::CaseInsensitive)) {
|
||||||
|
ui->tableWidget->setRowHidden(i, false);
|
||||||
|
} else {
|
||||||
|
ui->tableWidget->setRowHidden(i, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,6 +48,8 @@ private:
|
|||||||
public slots:
|
public slots:
|
||||||
void loadBackupListing(int index);
|
void loadBackupListing(int index);
|
||||||
void removeEntry(BackupItem *item);
|
void removeEntry(BackupItem *item);
|
||||||
|
private slots:
|
||||||
|
void on_filterLineEdit_textChanged(const QString &arg1);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BACKUPMANAGERFORM_H
|
#endif // BACKUPMANAGERFORM_H
|
||||||
|
@@ -100,10 +100,40 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="FilterLineEdit" name="filterLineEdit">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color:gray;font-style:italic</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Filter</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>FilterLineEdit</class>
|
||||||
|
<extends>QLineEdit</extends>
|
||||||
|
<header>filterlineedit.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
53
filterlineedit.cpp
Normal file
53
filterlineedit.cpp
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#include "filterlineedit.h"
|
||||||
|
|
||||||
|
#include <QStyle>
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
|
FilterLineEdit::FilterLineEdit(QWidget *parent) :
|
||||||
|
QLineEdit(parent)
|
||||||
|
{
|
||||||
|
clearButton = new QToolButton(this);
|
||||||
|
QIcon clearIcon(":/main/resources/edit-clear-locationbar-rtl.png");
|
||||||
|
clearButton->setIcon(clearIcon);
|
||||||
|
clearButton->setCursor(Qt::ArrowCursor);
|
||||||
|
clearButton->setStyleSheet("border:none;padding:0px");
|
||||||
|
clearButton->hide();
|
||||||
|
connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
|
||||||
|
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void FilterLineEdit::updateCloseButton(const QString& text)
|
||||||
|
{
|
||||||
|
if(text.isEmpty() || text == tr("Filter"))
|
||||||
|
clearButton->setVisible(false);
|
||||||
|
else
|
||||||
|
clearButton->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FilterLineEdit::focusInEvent(QFocusEvent *e)
|
||||||
|
{
|
||||||
|
if(this->styleSheet() == "color:gray;font-style:italic")
|
||||||
|
this->clear();
|
||||||
|
|
||||||
|
this->setStyleSheet(QString("color:black;font-style:normal;padding-right:%1").arg(clearButton->sizeHint().width()));
|
||||||
|
|
||||||
|
QLineEdit::focusInEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FilterLineEdit::focusOutEvent(QFocusEvent *e)
|
||||||
|
{
|
||||||
|
if(this->text().isEmpty()) {
|
||||||
|
this->setText(tr("Filter"));
|
||||||
|
this->setStyleSheet("color:gray;font-style:italic");
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit::focusOutEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FilterLineEdit::resizeEvent(QResizeEvent *e)
|
||||||
|
{
|
||||||
|
QSize sz = clearButton->sizeHint();
|
||||||
|
clearButton->move(rect().right() - sz.width(), (rect().bottom() - sz.height())/2);
|
||||||
|
|
||||||
|
QLineEdit::resizeEvent(e);
|
||||||
|
}
|
31
filterlineedit.h
Normal file
31
filterlineedit.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef FILTERLINEEDIT_H
|
||||||
|
#define FILTERLINEEDIT_H
|
||||||
|
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
|
class FilterLineEdit : public QLineEdit
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit FilterLineEdit(QWidget *parent = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateCloseButton(const QString &text);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void focusInEvent(QFocusEvent *e);
|
||||||
|
void focusOutEvent(QFocusEvent *e);
|
||||||
|
|
||||||
|
void resizeEvent(QResizeEvent *e);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QToolButton *clearButton;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FILTERLINEEDIT_H
|
6
qcma.pro
6
qcma.pro
@@ -32,7 +32,8 @@ SOURCES += main.cpp \
|
|||||||
backupitem.cpp \
|
backupitem.cpp \
|
||||||
confirmdialog.cpp \
|
confirmdialog.cpp \
|
||||||
progressform.cpp \
|
progressform.cpp \
|
||||||
pinform.cpp
|
pinform.cpp \
|
||||||
|
filterlineedit.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
capability.h \
|
capability.h \
|
||||||
@@ -53,7 +54,8 @@ HEADERS += \
|
|||||||
backupitem.h \
|
backupitem.h \
|
||||||
confirmdialog.h \
|
confirmdialog.h \
|
||||||
progressform.h \
|
progressform.h \
|
||||||
pinform.h
|
pinform.h \
|
||||||
|
filterlineedit.h
|
||||||
|
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
PKGCONFIG += libvitamtp libavformat libavcodec libavutil libswscale
|
PKGCONFIG += libvitamtp libavformat libavcodec libavutil libswscale
|
||||||
|
@@ -6,5 +6,6 @@
|
|||||||
<file>resources/translations/qcma.ja.qm</file>
|
<file>resources/translations/qcma.ja.qm</file>
|
||||||
<file>resources/psv_icon_16.png</file>
|
<file>resources/psv_icon_16.png</file>
|
||||||
<file>resources/qcma.png</file>
|
<file>resources/qcma.png</file>
|
||||||
|
<file>resources/edit-clear-locationbar-rtl.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
BIN
resources/edit-clear-locationbar-rtl.png
Normal file
BIN
resources/edit-clear-locationbar-rtl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 859 B |
@@ -72,22 +72,28 @@
|
|||||||
<translation>Uso de disco en respaldos</translation>
|
<translation>Uso de disco en respaldos</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="54"/>
|
<location filename="../../backupmanagerform.ui" line="122"/>
|
||||||
|
<location filename="../../backupmanagerform.cpp" line="210"/>
|
||||||
|
<source>Filter</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../backupmanagerform.cpp" line="55"/>
|
||||||
<source>Default account</source>
|
<source>Default account</source>
|
||||||
<translation>Cuenta por defecto</translation>
|
<translation>Cuenta por defecto</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="61"/>
|
<location filename="../../backupmanagerform.cpp" line="62"/>
|
||||||
<source>Are you sure to remove the backup of the following entry?</source>
|
<source>Are you sure to remove the backup of the following entry?</source>
|
||||||
<translation>¿Estas seguro de borrar la siguiente entrada?</translation>
|
<translation>¿Estas seguro de borrar la siguiente entrada?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="84"/>
|
<location filename="../../backupmanagerform.cpp" line="85"/>
|
||||||
<source>Backup disk usage: %1</source>
|
<source>Backup disk usage: %1</source>
|
||||||
<translation>Uso de disco en respaldos: %1</translation>
|
<translation>Uso de disco en respaldos: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="175"/>
|
<location filename="../../backupmanagerform.cpp" line="176"/>
|
||||||
<source> - (Launcher only)</source>
|
<source> - (Launcher only)</source>
|
||||||
<translation> - (Solo lanzador LiveArea)</translation>
|
<translation> - (Solo lanzador LiveArea)</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -293,6 +299,15 @@
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>FilterLineEdit</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../../filterlineedit.cpp" line="21"/>
|
||||||
|
<location filename="../../filterlineedit.cpp" line="40"/>
|
||||||
|
<source>Filter</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
<message>
|
<message>
|
||||||
|
@@ -72,22 +72,28 @@
|
|||||||
<translation>バックアップディスク使用容量</translation>
|
<translation>バックアップディスク使用容量</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="54"/>
|
<location filename="../../backupmanagerform.ui" line="122"/>
|
||||||
|
<location filename="../../backupmanagerform.cpp" line="210"/>
|
||||||
|
<source>Filter</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../backupmanagerform.cpp" line="55"/>
|
||||||
<source>Default account</source>
|
<source>Default account</source>
|
||||||
<translation>標準アカウント</translation>
|
<translation>標準アカウント</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="61"/>
|
<location filename="../../backupmanagerform.cpp" line="62"/>
|
||||||
<source>Are you sure to remove the backup of the following entry?</source>
|
<source>Are you sure to remove the backup of the following entry?</source>
|
||||||
<translation>次の項目のバックアップを削除してもよろしいですか?</translation>
|
<translation>次の項目のバックアップを削除してもよろしいですか?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="84"/>
|
<location filename="../../backupmanagerform.cpp" line="85"/>
|
||||||
<source>Backup disk usage: %1</source>
|
<source>Backup disk usage: %1</source>
|
||||||
<translation>バックアップディスク使用容量: %1</translation>
|
<translation>バックアップディスク使用容量: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../backupmanagerform.cpp" line="175"/>
|
<location filename="../../backupmanagerform.cpp" line="176"/>
|
||||||
<source> - (Launcher only)</source>
|
<source> - (Launcher only)</source>
|
||||||
<translation> - (LiveArea専用)</translation>
|
<translation> - (LiveArea専用)</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -294,6 +300,15 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>FilterLineEdit</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../../filterlineedit.cpp" line="21"/>
|
||||||
|
<location filename="../../filterlineedit.cpp" line="40"/>
|
||||||
|
<source>Filter</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
<message>
|
<message>
|
||||||
|
Reference in New Issue
Block a user