feat(settings): Correct spelling of 'folder' & add deleting folder method.

Description: 更正文件夹单词的拼写并添加设置列表删除功能

Log: 更正文件夹单词的拼写并添加设置列表删除功能
This commit is contained in:
zhangjiaping 2020-12-31 09:09:13 +08:00
parent d33ea025a4
commit c2d678492c
9 changed files with 155 additions and 120 deletions

View File

@ -1 +1,7 @@
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/app-match.h \
SOURCES += \
$$PWD/app-match.cpp \

View File

@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD
HEADERS += \ HEADERS += \
$$PWD/config-file.h \ $$PWD/config-file.h \
$$PWD/floder-list-item.h \ $$PWD/folder-list-item.h \
$$PWD/search-list-view.h \ $$PWD/search-list-view.h \
$$PWD/search-detail-view.h \ $$PWD/search-detail-view.h \
$$PWD/option-view.h \ $$PWD/option-view.h \
@ -10,7 +10,7 @@ HEADERS += \
SOURCES += \ SOURCES += \
$$PWD/config-file.cpp \ $$PWD/config-file.cpp \
$$PWD/floder-list-item.cpp \ $$PWD/folder-list-item.cpp \
$$PWD/search-list-view.cpp \ $$PWD/search-list-view.cpp \
$$PWD/search-detail-view.cpp \ $$PWD/search-detail-view.cpp \
$$PWD/option-view.cpp \ $$PWD/option-view.cpp \

View File

@ -1,22 +1,22 @@
#include "floder-list-item.h" #include "folder-list-item.h"
#include <QIcon> #include <QIcon>
#include <QEvent> #include <QEvent>
FloderListItem::FloderListItem(QWidget *parent, const QString &path) : QWidget(parent) FolderListItem::FolderListItem(QWidget *parent, const QString &path) : QWidget(parent)
{ {
m_path = path; m_path = path;
initUi(); initUi();
} }
FloderListItem::~FloderListItem() FolderListItem::~FolderListItem()
{ {
} }
/** /**
* @brief FloderListItem::initUi ui * @brief FolderListItem::initUi ui
*/ */
void FloderListItem::initUi() { void FolderListItem::initUi() {
m_layout = new QVBoxLayout(this); m_layout = new QVBoxLayout(this);
m_layout->setSpacing(0); m_layout->setSpacing(0);
m_layout->setContentsMargins(0,0,0,0); m_layout->setContentsMargins(0,0,0,0);
@ -33,7 +33,7 @@ void FloderListItem::initUi() {
m_delLabel = new QLabel(m_widget); m_delLabel = new QLabel(m_widget);
m_iconLabel->setPixmap(QIcon::fromTheme("inode-directory").pixmap(QSize(16, 16))); m_iconLabel->setPixmap(QIcon::fromTheme("inode-directory").pixmap(QSize(16, 16)));
m_pathLabel->setText(m_path); m_pathLabel->setText(m_path);
m_delLabel->setText(tr("Delete the floder out of blacklist")); m_delLabel->setText(tr("Delete the folder out of blacklist"));
m_pathLabel->setStyleSheet("QLabel{color: palette(text); background: transparent;}"); m_pathLabel->setStyleSheet("QLabel{color: palette(text); background: transparent;}");
m_delLabel->setStyleSheet("QLabel{color: #3790FA; background: transparent;}"); m_delLabel->setStyleSheet("QLabel{color: #3790FA; background: transparent;}");
m_delLabel->setCursor(QCursor(Qt::PointingHandCursor)); m_delLabel->setCursor(QCursor(Qt::PointingHandCursor));
@ -46,20 +46,28 @@ void FloderListItem::initUi() {
} }
/** /**
* @brief FloderListItem::enterEvent * @brief FolderListItem::getPath
* @return
*/
QString FolderListItem::getPath() {
return m_path;
}
/**
* @brief FolderListItem::enterEvent
* @param event * @param event
*/ */
void FloderListItem::enterEvent(QEvent *event){ void FolderListItem::enterEvent(QEvent *event){
m_delLabel->show(); m_delLabel->show();
m_widget->setStyleSheet("QWidget#mWidget{background: rgba(0,0,0,0.1);}"); m_widget->setStyleSheet("QWidget#mWidget{background: rgba(0,0,0,0.1);}");
QWidget::enterEvent(event); QWidget::enterEvent(event);
} }
/** /**
* @brief FloderListItem::leaveEvent * @brief FolderListItem::leaveEvent
* @param event * @param event
*/ */
void FloderListItem::leaveEvent(QEvent *event){ void FolderListItem::leaveEvent(QEvent *event){
m_delLabel->hide(); m_delLabel->hide();
m_widget->setStyleSheet("QWidget#mWidget{background: transparent;}"); m_widget->setStyleSheet("QWidget#mWidget{background: transparent;}");
QWidget::leaveEvent(event); QWidget::leaveEvent(event);
@ -67,15 +75,16 @@ void FloderListItem::leaveEvent(QEvent *event){
/** /**
* @brief FloderListItem::eventFilter * @brief FolderListItem::eventFilter
* @param watched * @param watched
* @param event * @param event
* @return * @return
*/ */
bool FloderListItem::eventFilter(QObject *watched, QEvent *event){ bool FolderListItem::eventFilter(QObject *watched, QEvent *event){
if (watched == m_delLabel) { if (watched == m_delLabel) {
if (event->type() == QEvent::MouseButtonPress) { if (event->type() == QEvent::MouseButtonPress) {
// qDebug()<<"pressed!"; // qDebug()<<"pressed!";
Q_EMIT this->onDelBtnClicked(m_path);
} }
} }
return QObject::eventFilter(watched, event); return QObject::eventFilter(watched, event);

View File

@ -1,21 +1,22 @@
#ifndef FLODERLISTITEM_H #ifndef FOLDERLISTITEM_H
#define FLODERLISTITEM_H #define FOLDERLISTITEM_H
#include <QWidget> #include <QWidget>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QLabel> #include <QLabel>
class FloderListItem : public QWidget class FolderListItem : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit FloderListItem(QWidget *parent = nullptr, const QString &path = 0); explicit FolderListItem(QWidget *parent = nullptr, const QString &path = 0);
~FloderListItem(); ~FolderListItem();
QString getPath();
protected: protected:
virtual void enterEvent(QEvent * event); virtual void enterEvent(QEvent *);
virtual void leaveEvent(QEvent * event); virtual void leaveEvent(QEvent *);
bool eventFilter(QObject *, QEvent *); bool eventFilter(QObject *, QEvent *);
private: private:
@ -30,6 +31,7 @@ private:
QLabel * m_pathLabel = nullptr; QLabel * m_pathLabel = nullptr;
QLabel * m_delLabel = nullptr; QLabel * m_delLabel = nullptr;
Q_SIGNALS: Q_SIGNALS:
void onDelBtnClicked(const QString&);
}; };
#endif // FLODERLISTITEM_H #endif // FOLDERLISTITEM_H

View File

@ -4,63 +4,63 @@
<context> <context>
<name>ContentWidget</name> <name>ContentWidget</name>
<message> <message>
<location filename="../../src/content-widget.cpp" line="80"/> <location filename="../../content-widget.cpp" line="80"/>
<source>Recently Opened</source> <source>Recently Opened</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="99"/> <location filename="../../content-widget.cpp" line="99"/>
<source>Open Quickly</source> <source>Open Quickly</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="104"/> <location filename="../../content-widget.cpp" line="104"/>
<source>Commonly Used</source> <source>Commonly Used</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="212"/> <location filename="../../content-widget.cpp" line="212"/>
<source>Apps</source> <source>Apps</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="214"/> <location filename="../../content-widget.cpp" line="214"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="216"/> <location filename="../../content-widget.cpp" line="216"/>
<source>Files</source> <source>Files</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="218"/> <location filename="../../content-widget.cpp" line="218"/>
<source>Dirs</source> <source>Dirs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="220"/> <location filename="../../content-widget.cpp" line="220"/>
<source>Best Matches</source> <source>Best Matches</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="222"/> <location filename="../../content-widget.cpp" line="222"/>
<source>Unknown</source> <source>Unknown</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>FloderListItem</name> <name>FolderListItem</name>
<message> <message>
<location filename="../../control/floder-list-item.cpp" line="36"/> <location filename="../../control/folder-list-item.cpp" line="36"/>
<source>Delete the floder out of blacklist</source> <source>Delete the folder out of blacklist</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../../src/mainwindow.cpp" line="125"/> <location filename="../../mainwindow.cpp" line="119"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -96,7 +96,7 @@
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../../src/main.cpp" line="71"/> <location filename="../../main.cpp" line="71"/>
<source>ukui-search is already running!</source> <source>ukui-search is already running!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -127,88 +127,88 @@
<context> <context>
<name>SettingsWidget</name> <name>SettingsWidget</name>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="49"/> <location filename="../../settings-widget.cpp" line="49"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="66"/> <location filename="../../settings-widget.cpp" line="66"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="72"/> <location filename="../../settings-widget.cpp" line="72"/>
<source>Index State</source> <source>Index State</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="75"/> <location filename="../../settings-widget.cpp" line="75"/>
<location filename="../../src/settings-widget.cpp" line="77"/> <location filename="../../settings-widget.cpp" line="77"/>
<source>...</source> <source>...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="84"/> <location filename="../../settings-widget.cpp" line="84"/>
<source>File Index Settings</source> <source>File Index Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="87"/> <location filename="../../settings-widget.cpp" line="87"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source> <source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="96"/> <location filename="../../settings-widget.cpp" line="96"/>
<source>Add ignored folders</source> <source>Add ignored folders</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="117"/> <location filename="../../settings-widget.cpp" line="117"/>
<source>Search Engine Settings</source> <source>Search Engine Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="120"/> <location filename="../../settings-widget.cpp" line="120"/>
<source>Please select search engine you preferred.</source> <source>Please select search engine you preferred.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="133"/> <location filename="../../settings-widget.cpp" line="133"/>
<source>baidu</source> <source>baidu</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="135"/> <location filename="../../settings-widget.cpp" line="135"/>
<source>sougou</source> <source>sougou</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="137"/> <location filename="../../settings-widget.cpp" line="137"/>
<source>360</source> <source>360</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="160"/> <location filename="../../settings-widget.cpp" line="160"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="164"/> <location filename="../../settings-widget.cpp" line="164"/>
<source>Confirm</source> <source>Confirm</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="194"/> <location filename="../../settings-widget.cpp" line="194"/>
<source>Creating ...</source> <source>Creating ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="197"/> <location filename="../../settings-widget.cpp" line="197"/>
<source>Done</source> <source>Done</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="205"/> <location filename="../../settings-widget.cpp" line="205"/>
<source>Index Entry: %1</source> <source>Index Entry: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -4,63 +4,63 @@
<context> <context>
<name>ContentWidget</name> <name>ContentWidget</name>
<message> <message>
<location filename="../../src/content-widget.cpp" line="80"/> <location filename="../../content-widget.cpp" line="80"/>
<source>Recently Opened</source> <source>Recently Opened</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="99"/> <location filename="../../content-widget.cpp" line="99"/>
<source>Open Quickly</source> <source>Open Quickly</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="104"/> <location filename="../../content-widget.cpp" line="104"/>
<source>Commonly Used</source> <source>Commonly Used</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="212"/> <location filename="../../content-widget.cpp" line="212"/>
<source>Apps</source> <source>Apps</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="214"/> <location filename="../../content-widget.cpp" line="214"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="216"/> <location filename="../../content-widget.cpp" line="216"/>
<source>Files</source> <source>Files</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="218"/> <location filename="../../content-widget.cpp" line="218"/>
<source>Dirs</source> <source>Dirs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="220"/> <location filename="../../content-widget.cpp" line="220"/>
<source>Best Matches</source> <source>Best Matches</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="222"/> <location filename="../../content-widget.cpp" line="222"/>
<source>Unknown</source> <source>Unknown</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>FloderListItem</name> <name>FolderListItem</name>
<message> <message>
<location filename="../../control/floder-list-item.cpp" line="36"/> <location filename="../../control/folder-list-item.cpp" line="36"/>
<source>Delete the floder out of blacklist</source> <source>Delete the folder out of blacklist</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../../src/mainwindow.cpp" line="125"/> <location filename="../../mainwindow.cpp" line="119"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -96,7 +96,7 @@
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../../src/main.cpp" line="71"/> <location filename="../../main.cpp" line="71"/>
<source>ukui-search is already running!</source> <source>ukui-search is already running!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -127,88 +127,88 @@
<context> <context>
<name>SettingsWidget</name> <name>SettingsWidget</name>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="49"/> <location filename="../../settings-widget.cpp" line="49"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="66"/> <location filename="../../settings-widget.cpp" line="66"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="72"/> <location filename="../../settings-widget.cpp" line="72"/>
<source>Index State</source> <source>Index State</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="75"/> <location filename="../../settings-widget.cpp" line="75"/>
<location filename="../../src/settings-widget.cpp" line="77"/> <location filename="../../settings-widget.cpp" line="77"/>
<source>...</source> <source>...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="84"/> <location filename="../../settings-widget.cpp" line="84"/>
<source>File Index Settings</source> <source>File Index Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="87"/> <location filename="../../settings-widget.cpp" line="87"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source> <source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="96"/> <location filename="../../settings-widget.cpp" line="96"/>
<source>Add ignored folders</source> <source>Add ignored folders</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="117"/> <location filename="../../settings-widget.cpp" line="117"/>
<source>Search Engine Settings</source> <source>Search Engine Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="120"/> <location filename="../../settings-widget.cpp" line="120"/>
<source>Please select search engine you preferred.</source> <source>Please select search engine you preferred.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="133"/> <location filename="../../settings-widget.cpp" line="133"/>
<source>baidu</source> <source>baidu</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="135"/> <location filename="../../settings-widget.cpp" line="135"/>
<source>sougou</source> <source>sougou</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="137"/> <location filename="../../settings-widget.cpp" line="137"/>
<source>360</source> <source>360</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="160"/> <location filename="../../settings-widget.cpp" line="160"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="164"/> <location filename="../../settings-widget.cpp" line="164"/>
<source>Confirm</source> <source>Confirm</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="194"/> <location filename="../../settings-widget.cpp" line="194"/>
<source>Creating ...</source> <source>Creating ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="197"/> <location filename="../../settings-widget.cpp" line="197"/>
<source>Done</source> <source>Done</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="205"/> <location filename="../../settings-widget.cpp" line="205"/>
<source>Index Entry: %1</source> <source>Index Entry: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -4,63 +4,63 @@
<context> <context>
<name>ContentWidget</name> <name>ContentWidget</name>
<message> <message>
<location filename="../../src/content-widget.cpp" line="80"/> <location filename="../../content-widget.cpp" line="80"/>
<source>Recently Opened</source> <source>Recently Opened</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="99"/> <location filename="../../content-widget.cpp" line="99"/>
<source>Open Quickly</source> <source>Open Quickly</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="104"/> <location filename="../../content-widget.cpp" line="104"/>
<source>Commonly Used</source> <source>Commonly Used</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="212"/> <location filename="../../content-widget.cpp" line="212"/>
<source>Apps</source> <source>Apps</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="214"/> <location filename="../../content-widget.cpp" line="214"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="216"/> <location filename="../../content-widget.cpp" line="216"/>
<source>Files</source> <source>Files</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="218"/> <location filename="../../content-widget.cpp" line="218"/>
<source>Dirs</source> <source>Dirs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="220"/> <location filename="../../content-widget.cpp" line="220"/>
<source>Best Matches</source> <source>Best Matches</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/content-widget.cpp" line="222"/> <location filename="../../content-widget.cpp" line="222"/>
<source>Unknown</source> <source>Unknown</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>FloderListItem</name> <name>FolderListItem</name>
<message> <message>
<location filename="../../control/floder-list-item.cpp" line="36"/> <location filename="../../control/folder-list-item.cpp" line="36"/>
<source>Delete the floder out of blacklist</source> <source>Delete the folder out of blacklist</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../../src/mainwindow.cpp" line="125"/> <location filename="../../mainwindow.cpp" line="119"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -96,7 +96,7 @@
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="../../src/main.cpp" line="71"/> <location filename="../../main.cpp" line="71"/>
<source>ukui-search is already running!</source> <source>ukui-search is already running!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -127,88 +127,88 @@
<context> <context>
<name>SettingsWidget</name> <name>SettingsWidget</name>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="49"/> <location filename="../../settings-widget.cpp" line="49"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="66"/> <location filename="../../settings-widget.cpp" line="66"/>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="72"/> <location filename="../../settings-widget.cpp" line="72"/>
<source>Index State</source> <source>Index State</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="75"/> <location filename="../../settings-widget.cpp" line="75"/>
<location filename="../../src/settings-widget.cpp" line="77"/> <location filename="../../settings-widget.cpp" line="77"/>
<source>...</source> <source>...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="84"/> <location filename="../../settings-widget.cpp" line="84"/>
<source>File Index Settings</source> <source>File Index Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="87"/> <location filename="../../settings-widget.cpp" line="87"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source> <source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="96"/> <location filename="../../settings-widget.cpp" line="96"/>
<source>Add ignored folders</source> <source>Add ignored folders</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="117"/> <location filename="../../settings-widget.cpp" line="117"/>
<source>Search Engine Settings</source> <source>Search Engine Settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="120"/> <location filename="../../settings-widget.cpp" line="120"/>
<source>Please select search engine you preferred.</source> <source>Please select search engine you preferred.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="133"/> <location filename="../../settings-widget.cpp" line="133"/>
<source>baidu</source> <source>baidu</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="135"/> <location filename="../../settings-widget.cpp" line="135"/>
<source>sougou</source> <source>sougou</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="137"/> <location filename="../../settings-widget.cpp" line="137"/>
<source>360</source> <source>360</source>
<translation type="unfinished">360</translation> <translation type="unfinished">360</translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="160"/> <location filename="../../settings-widget.cpp" line="160"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="164"/> <location filename="../../settings-widget.cpp" line="164"/>
<source>Confirm</source> <source>Confirm</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="194"/> <location filename="../../settings-widget.cpp" line="194"/>
<source>Creating ...</source> <source>Creating ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="197"/> <location filename="../../settings-widget.cpp" line="197"/>
<source>Done</source> <source>Done</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/settings-widget.cpp" line="205"/> <location filename="../../settings-widget.cpp" line="205"/>
<source>Index Entry: %1</source> <source>Index Entry: %1</source>
<translation type="unfinished">: %1</translation> <translation type="unfinished">: %1</translation>
</message> </message>

View File

@ -4,7 +4,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QDir> #include <QDir>
#include <QDebug> #include <QDebug>
#include "floder-list-item.h" #include "folder-list-item.h"
extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent) SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent)
@ -178,13 +178,30 @@ void SettingsWidget::initUi() {
*/ */
void SettingsWidget::setupBlackList(const QStringList& list) { void SettingsWidget::setupBlackList(const QStringList& list) {
Q_FOREACH(QString path, list) { Q_FOREACH(QString path, list) {
FloderListItem * item = new FloderListItem(m_dirListWidget, path); FolderListItem * item = new FolderListItem(m_dirListWidget, path);
m_dirListLyt->addWidget(item); m_dirListLyt->addWidget(item);
item->setMaximumWidth(470); item->setMaximumWidth(470);
//测试用,实际调用中应等待后端完成操作后删除该控件
connect(item, SIGNAL(onDelBtnClicked(const QString&)), this, SLOT(onBtnDelClicked(const QString&)));
} }
m_dirListLyt->addStretch(); m_dirListLyt->addStretch();
} }
/**
* @brief SettingsWidget::onBtnDelClicked
* @param path
*/
void SettingsWidget::onBtnDelClicked(const QString& path) {
qDebug()<<path;
Q_FOREACH (FolderListItem * item, m_dirListWidget->findChildren<FolderListItem*>()) {
if (item->getPath() == path) {
item->deleteLater();
item = NULL;
return;
}
}
}
/** /**
* @brief setIndexState * @brief setIndexState
* @param isCreatingIndex * @param isCreatingIndex

View File

@ -73,6 +73,7 @@ private Q_SLOTS:
void onBtnConfirmClicked(); void onBtnConfirmClicked();
void onBtnCancelClicked(); void onBtnCancelClicked();
void onBtnAddClicked(); void onBtnAddClicked();
void onBtnDelClicked(const QString&);
}; };
#endif // SETTINGSWIDGET_H #endif // SETTINGSWIDGET_H