forked from openkylin/ukui-search
Merge pull request #237 from iaom/0512-dev
Fix: Automatic completion won't work in next search after clicked actions in detial widget.
This commit is contained in:
commit
1f81c9bcb5
|
@ -24,12 +24,13 @@ public:
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
QString name;
|
QString name;
|
||||||
QVector<DescriptionInfo> description;
|
QVector<DescriptionInfo> description;
|
||||||
QMap<QString,QString> actionMap;//action name and action key
|
QStringList actionList; //all actions, take fist for double click action.
|
||||||
|
QString key;
|
||||||
};
|
};
|
||||||
virtual ~SearchPluginIface() {}
|
virtual ~SearchPluginIface() {}
|
||||||
virtual QString getPluginName() = 0;
|
virtual QString getPluginName() = 0;
|
||||||
virtual void KeywordSearch(QString keyword,QQueue<ResultInfo> *searchResult) = 0;
|
virtual void KeywordSearch(QString keyword,QQueue<ResultInfo> *searchResult) = 0;
|
||||||
virtual void openAction(QString name, QString key) = 0;
|
virtual void openAction(QString action, QString key) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ void ContentWidget::initUI() {
|
||||||
clearLayout(m_homePageLyt);
|
clearLayout(m_homePageLyt);
|
||||||
initHomePage();
|
initHomePage();
|
||||||
});
|
});
|
||||||
|
connect(m_detailView, &SearchDetailView::actionTriggerd, this, &ContentWidget::effectiveSearch);
|
||||||
m_resultDetailArea->setWidget(m_detailView);
|
m_resultDetailArea->setWidget(m_detailView);
|
||||||
m_resultDetailArea->setWidgetResizable(true);
|
m_resultDetailArea->setWidgetResizable(true);
|
||||||
m_resultListArea->setFrameShape(QFrame::NoFrame);
|
m_resultListArea->setFrameShape(QFrame::NoFrame);
|
||||||
|
@ -283,7 +284,7 @@ void ContentWidget::setupConnect(SearchListView * listview) {
|
||||||
connect(listview, &SearchListView::currentSelectPos, [ = ](QPoint pos) {
|
connect(listview, &SearchListView::currentSelectPos, [ = ](QPoint pos) {
|
||||||
m_resultListArea->ensureVisible(pos.x(), pos.y());
|
m_resultListArea->ensureVisible(pos.x(), pos.y());
|
||||||
});
|
});
|
||||||
connect(listview, &SearchListView::mousePressed, this, &ContentWidget::mousePressed);
|
connect(listview, &SearchListView::mousePressed, this, &ContentWidget::effectiveSearch);
|
||||||
connect(listview, &SearchListView::currentRowChanged, this, &ContentWidget::onListViewRowChanged);
|
connect(listview, &SearchListView::currentRowChanged, this, &ContentWidget::onListViewRowChanged);
|
||||||
connect(listview, &SearchListView::onRowDoubleClicked, this, &ContentWidget::onListViewRowDoubleClicked);
|
connect(listview, &SearchListView::onRowDoubleClicked, this, &ContentWidget::onListViewRowDoubleClicked);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ private:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void currentItemChanged();
|
void currentItemChanged();
|
||||||
void mousePressed();
|
void effectiveSearch();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void clearLayout(QLayout *);
|
void clearLayout(QLayout *);
|
||||||
|
|
|
@ -406,6 +406,7 @@ void SearchDetailView::execActions(const int& type, const int& option, const QSt
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Q_EMIT this->actionTriggerd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -105,6 +105,7 @@ private:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void configFileChanged();
|
void configFileChanged();
|
||||||
|
void actionTriggerd();
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void execActions(const int&, const int&, const QString&);
|
void execActions(const int&, const int&, const QString&);
|
||||||
void refreshIcon();
|
void refreshIcon();
|
||||||
|
|
|
@ -253,7 +253,7 @@ void MainWindow::initUi() {
|
||||||
mainlayout->addWidget(m_titleFrame);
|
mainlayout->addWidget(m_titleFrame);
|
||||||
mainlayout->addWidget(m_contentFrame);
|
mainlayout->addWidget(m_contentFrame);
|
||||||
mainlayout->addWidget(m_searchWidget);
|
mainlayout->addWidget(m_searchWidget);
|
||||||
connect(m_contentFrame, &ContentWidget::mousePressed, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord);
|
connect(m_contentFrame, &ContentWidget::effectiveSearch, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord);
|
||||||
|
|
||||||
connect(QApplication::primaryScreen(), &QScreen::geometryChanged,
|
connect(QApplication::primaryScreen(), &QScreen::geometryChanged,
|
||||||
this, &MainWindow::monitorResolutionChange);
|
this, &MainWindow::monitorResolutionChange);
|
||||||
|
|
Loading…
Reference in New Issue