diff --git a/debian/control b/debian/control index 25d2fd7..fc44d18 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,8 @@ Build-Depends: debhelper (>=9.0.0), libkf5windowsystem-dev, libgsettings-qt-dev, libqt5x11extras5-dev, - libuchardet-dev + libuchardet-dev, + qtwebengine5-dev Standards-Version: 4.5.0 Homepage: https://www.ukui.org/ Vcs-Git: https://github.com/ukui/ukui-search.git diff --git a/src/content-widget.cpp b/src/content-widget.cpp index a10f23e..aa45f85 100644 --- a/src/content-widget.cpp +++ b/src/content-widget.cpp @@ -28,6 +28,7 @@ ContentWidget::ContentWidget(QWidget * parent):QStackedWidget(parent) { initUI(); initListView(); + m_quicklyOpenList<<"/usr/share/applications/peony.desktop"<<"/usr/share/applications/ukui-control-center.desktop"<<"Background/背景/更改壁纸"; } ContentWidget::~ContentWidget() @@ -236,6 +237,7 @@ void ContentWidget::setupConnect(SearchListView * listview) { m_detailView->setContent(m_contentDetailList.at(listview->currentIndex().row()), m_keyword); } m_detailView->setupWidget(type, path); +// m_detailView->setWebWidget(this->m_keyword); listview->is_current_list = true; Q_EMIT this->currentItemChanged(); listview->is_current_list = false; @@ -308,11 +310,9 @@ void ContentWidget::initHomePage() { commonlyList = map.value("Commonly"); QStringList recentlyList; recentlyList = map.value("Recently"); - QStringList quicklyList; - quicklyList<<"/usr/share/applications/peony.desktop"<<"/usr/share/applications/ukui-control-center.desktop"<<"Background/背景/更改壁纸"; lists.append(commonlyList); lists.append(recentlyList); - lists.append(quicklyList); + lists.append(m_quicklyOpenList); for (int i = 0; i < lists.count(); i++) { if (lists.at(i).isEmpty()) @@ -650,3 +650,12 @@ void ContentWidget::setKeyword(QString keyword) m_appListView->setKeyword(keyword); m_bestListView->setKeyword(keyword); } + +/** + * @brief ContentWidget::setQuicklyOpenList 设置快速打开列表 + * @param list + */ +void ContentWidget::setQuicklyOpenList(const QStringList & list) +{ + m_quicklyOpenList = list; +} diff --git a/src/content-widget.h b/src/content-widget.h index 2cd54a4..4ec3daa 100644 --- a/src/content-widget.h +++ b/src/content-widget.h @@ -44,6 +44,7 @@ public: void initHomePage(); void setContentList(const QStringList&); void setKeyword(QString); + void setQuicklyOpenList(const QStringList &); private: void initUI(); void initListView(); @@ -88,6 +89,7 @@ private: QStringList m_dirList; QStringList m_fileList; QStringList m_contentList; + QStringList m_quicklyOpenList; int m_currentType = 0; diff --git a/src/control/search-detail-view.cpp b/src/control/search-detail-view.cpp index cc6d9de..b8a7477 100644 --- a/src/control/search-detail-view.cpp +++ b/src/control/search-detail-view.cpp @@ -43,7 +43,6 @@ SearchDetailView::SearchDetailView(QWidget *parent) : QWidget(parent) SearchDetailView::~SearchDetailView() { if (m_layout) { - clearLayout(); delete m_layout; m_layout = NULL; } @@ -108,6 +107,23 @@ int SearchDetailView::getType() return m_type; } +/** + * @brief SearchDetailView::setWebWidget 显示为网页 + * @param keyword 关键词 + */ +//void SearchDetailView::setWebWidget(const QString& keyword) +//{ +// QWebEngineView * m_webView = new QWebEngineView(this); +// m_webView->move(0, 0); +// m_webView->setFixedSize(360, 522); +// m_isEmpty = false; +// clearLayout(); + +// QString str = "http://m.baidu.com/s?word=" + keyword; +// m_webView->load(str); +// m_webView->show(); +//} + QString SearchDetailView::getHtmlText(const QString & text, const QString & keyword) { QString htmlString; bool boldOpenned = false; @@ -404,6 +420,8 @@ void SearchDetailView::initUI() m_layout->addStretch(); + + this->clearLayout(); //初始化时隐藏所有控件 } diff --git a/src/control/search-detail-view.h b/src/control/search-detail-view.h index 01de00b..6015139 100644 --- a/src/control/search-detail-view.h +++ b/src/control/search-detail-view.h @@ -22,6 +22,7 @@ #define SEARCHDETAILVIEW_H #include +#include #include "option-view.h" class SearchDetailView : public QWidget @@ -36,6 +37,7 @@ public: void setContent(const QString&, const QString&); bool isEmpty(); int getType(); +// void setWebWidget(const QString&); protected: void paintEvent(QPaintEvent *); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index dec53c5..b20e349 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -72,6 +72,7 @@ MainWindow::MainWindow(QWidget *parent) : this->setAutoFillBackground(false); this->setFocusPolicy(Qt::StrongFocus); this->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); + this->setWindowTitle(tr("ukui-search")); initUi(); QPainterPath path; @@ -234,6 +235,7 @@ void MainWindow::initUi() }); //初始化homepage +// m_contentFrame->setQuicklyOpenList(list); //如需自定义快捷打开使用本函数 m_contentFrame->initHomePage(); } diff --git a/src/settings-widget.cpp b/src/settings-widget.cpp index dcf6871..2c7f4f2 100644 --- a/src/settings-widget.cpp +++ b/src/settings-widget.cpp @@ -34,6 +34,7 @@ extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int tran SettingsWidget::SettingsWidget(QWidget *parent) : QDialog(parent) { this->setWindowIcon(QIcon::fromTheme("kylin-search")); + this->setWindowTitle(tr("ukui-search")); this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); this->setAttribute(Qt::WA_TranslucentBackground); initUi(); diff --git a/src/src.pro b/src/src.pro index 3f960e2..74ffe0d 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,4 +1,4 @@ -QT += core gui dbus KWindowSystem xml x11extras +QT += core gui dbus KWindowSystem xml x11extras webenginewidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets diff --git a/translations/ukui-search/bo.ts b/translations/ukui-search/bo.ts index d83283b..71aef87 100644 --- a/translations/ukui-search/bo.ts +++ b/translations/ukui-search/bo.ts @@ -65,12 +65,17 @@ MainWindow - + + ukui-search + + + + Global Search - + Search @@ -106,7 +111,7 @@ QObject - + ukui-search is already running! @@ -122,22 +127,22 @@ SearchDetailView - + Path - + Last time modified - + Application - + Document @@ -145,121 +150,126 @@ SettingsWidget - - - - + + + + Search - - + + ... - + Following folders will not be searched. You can set it by adding and removing folders. - + Add ignored folders - + Please select search engine you preferred. - + baidu - + sougou - + 360 - + Cancel - + Creating ... - + + ukui-search + + + + <h2>Settings</h2> - + <h3>Index State</h3> - + <h3>File Index Settings</h3> - + <h3>Search Engine Settings</h3> - + Whether to delete this directory? - + Done - + Index Entry: %1 - + Directories - + select blocked folder - + Select - + Position: - + FileName: - + FileType: diff --git a/translations/ukui-search/tr.ts b/translations/ukui-search/tr.ts index d83283b..71aef87 100644 --- a/translations/ukui-search/tr.ts +++ b/translations/ukui-search/tr.ts @@ -65,12 +65,17 @@ MainWindow - + + ukui-search + + + + Global Search - + Search @@ -106,7 +111,7 @@ QObject - + ukui-search is already running! @@ -122,22 +127,22 @@ SearchDetailView - + Path - + Last time modified - + Application - + Document @@ -145,121 +150,126 @@ SettingsWidget - - - - + + + + Search - - + + ... - + Following folders will not be searched. You can set it by adding and removing folders. - + Add ignored folders - + Please select search engine you preferred. - + baidu - + sougou - + 360 - + Cancel - + Creating ... - + + ukui-search + + + + <h2>Settings</h2> - + <h3>Index State</h3> - + <h3>File Index Settings</h3> - + <h3>Search Engine Settings</h3> - + Whether to delete this directory? - + Done - + Index Entry: %1 - + Directories - + select blocked folder - + Select - + Position: - + FileName: - + FileType: diff --git a/translations/ukui-search/zh_CN.ts b/translations/ukui-search/zh_CN.ts index 4708052..859406e 100644 --- a/translations/ukui-search/zh_CN.ts +++ b/translations/ukui-search/zh_CN.ts @@ -65,12 +65,17 @@ MainWindow - + + ukui-search + 搜索 + + + Global Search 搜索 - + Search 搜索 @@ -106,7 +111,7 @@ QObject - + ukui-search is already running! @@ -122,22 +127,22 @@ SearchDetailView - + Path 路径 - + Last time modified 上次修改时间 - + Application 应用 - + Document 文件 @@ -145,121 +150,126 @@ SettingsWidget - - - - + + + + Search 搜索 - + <h2>Settings</h2> <h2>设置</h2> - + <h3>Index State</h3> <h3>索引状态</h3> - - + + ... - + <h3>File Index Settings</h3> <h3>文件索引设置</h3> - + Following folders will not be searched. You can set it by adding and removing folders. 搜索将不再查看以下文件夹。通过增加和删除文件夹可进行文件索引设置。 - + Add ignored folders 添加文件夹至黑名单 - + <h3>Search Engine Settings</h3> <h3>搜索引擎设置</h3> - + Please select search engine you preferred. 设置互联网搜索引擎 - + baidu 百度 - + sougou 搜狗 - + 360 360 - + Whether to delete this directory? 是否要删除此目录 - + Cancel 取消 - + Creating ... 正在索引 - + + ukui-search + 搜索 + + + Done 索引完成 - + Index Entry: %1 索引项: %1 - + Directories 文件夹 - + select blocked folder 选择屏蔽文件夹 - + Select 选择 - + Position: 位置: - + FileName: 名称: - + FileType: 类型: @@ -276,7 +286,7 @@ Retract - <u>收起< + 收起