Changeset View
Changeset View
Standalone View
Standalone View
plugins/grepview/grepoutputview.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 69 | { | |||
---|---|---|---|---|---|
79 | m_collapseAll = new QAction(QIcon::fromTheme(QStringLiteral("arrow-left-double")), i18n("C&ollapse All"), this); // TODO change icon | 79 | m_collapseAll = new QAction(QIcon::fromTheme(QStringLiteral("arrow-left-double")), i18n("C&ollapse All"), this); // TODO change icon | ||
80 | m_collapseAll->setEnabled(false); | 80 | m_collapseAll->setEnabled(false); | ||
81 | m_expandAll = new QAction(QIcon::fromTheme(QStringLiteral("arrow-right-double")), i18n("&Expand All"), this); // TODO change icon | 81 | m_expandAll = new QAction(QIcon::fromTheme(QStringLiteral("arrow-right-double")), i18n("&Expand All"), this); // TODO change icon | ||
82 | m_expandAll->setEnabled(false); | 82 | m_expandAll->setEnabled(false); | ||
83 | QAction *separator = new QAction(this); | 83 | QAction *separator = new QAction(this); | ||
84 | separator->setSeparator(true); | 84 | separator->setSeparator(true); | ||
85 | QAction *newSearchAction = new QAction(QIcon::fromTheme(QStringLiteral("edit-find")), i18n("New &Search"), this); | 85 | QAction *newSearchAction = new QAction(QIcon::fromTheme(QStringLiteral("edit-find")), i18n("New &Search"), this); | ||
86 | m_clearSearchHistory = new QAction(QIcon::fromTheme(QStringLiteral("edit-clear-list")), i18n("Clear Search History"), this); | 86 | m_clearSearchHistory = new QAction(QIcon::fromTheme(QStringLiteral("edit-clear-list")), i18n("Clear Search History"), this); | ||
87 | QAction *refreshAction = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("Refresh"), this); | ||||
87 | 88 | | |||
88 | addAction(m_prev); | 89 | addAction(m_prev); | ||
89 | addAction(m_next); | 90 | addAction(m_next); | ||
90 | addAction(m_collapseAll); | 91 | addAction(m_collapseAll); | ||
91 | addAction(m_expandAll); | 92 | addAction(m_expandAll); | ||
92 | addAction(separator); | 93 | addAction(separator); | ||
93 | addAction(newSearchAction); | 94 | addAction(newSearchAction); | ||
95 | addAction(refreshAction); | ||||
94 | addAction(m_clearSearchHistory); | 96 | addAction(m_clearSearchHistory); | ||
95 | 97 | | |||
96 | separator = new QAction(this); | 98 | separator = new QAction(this); | ||
97 | separator->setSeparator(true); | 99 | separator->setSeparator(true); | ||
98 | addAction(separator); | 100 | addAction(separator); | ||
99 | 101 | | |||
100 | QWidgetAction *statusWidget = new QWidgetAction(this); | 102 | QWidgetAction *statusWidget = new QWidgetAction(this); | ||
101 | m_statusLabel = new QLabel(this); | 103 | m_statusLabel = new QLabel(this); | ||
Show All 22 Lines | |||||
124 | replacementCombo->setInsertPolicy(QComboBox::InsertAtTop); | 126 | replacementCombo->setInsertPolicy(QComboBox::InsertAtTop); | ||
125 | applyButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok-apply"))); | 127 | applyButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok-apply"))); | ||
126 | 128 | | |||
127 | connect(replacementCombo, &KComboBox::editTextChanged, this, &GrepOutputView::replacementTextChanged); | 129 | connect(replacementCombo, &KComboBox::editTextChanged, this, &GrepOutputView::replacementTextChanged); | ||
128 | connect(replacementCombo, static_cast<void(KComboBox::*)()>(&KComboBox::returnPressed), this, &GrepOutputView::onApply); | 130 | connect(replacementCombo, static_cast<void(KComboBox::*)()>(&KComboBox::returnPressed), this, &GrepOutputView::onApply); | ||
129 | 131 | | |||
130 | connect(newSearchAction, &QAction::triggered, this, &GrepOutputView::showDialog); | 132 | connect(newSearchAction, &QAction::triggered, this, &GrepOutputView::showDialog); | ||
131 | 133 | | |||
134 | connect(refreshAction, &QAction::triggered, this, &GrepOutputView::refresh); | ||||
135 | | ||||
132 | resultsTreeView->header()->setStretchLastSection(true); | 136 | resultsTreeView->header()->setStretchLastSection(true); | ||
133 | 137 | | |||
134 | resultsTreeView->header()->setStretchLastSection(true); | 138 | resultsTreeView->header()->setStretchLastSection(true); | ||
135 | 139 | | |||
136 | updateCheckable(); | 140 | updateCheckable(); | ||
137 | } | 141 | } | ||
138 | 142 | | |||
139 | void GrepOutputView::replacementTextChanged(QString) | 143 | void GrepOutputView::replacementTextChanged(QString) | ||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 258 | { | |||
269 | } | 273 | } | ||
270 | } | 274 | } | ||
271 | 275 | | |||
272 | void GrepOutputView::showDialog() | 276 | void GrepOutputView::showDialog() | ||
273 | { | 277 | { | ||
274 | m_plugin->showDialog(true); | 278 | m_plugin->showDialog(true); | ||
275 | } | 279 | } | ||
276 | 280 | | |||
281 | void GrepOutputView::refresh() | ||||
282 | { | ||||
283 | m_plugin->showDialog(true, QString(), false); | ||||
kfunk: This will use the pattern from the current selection instead of the last search pattern. This… | |||||
284 | } | ||||
285 | | ||||
277 | void GrepOutputView::expandElements(const QModelIndex& index) | 286 | void GrepOutputView::expandElements(const QModelIndex& index) | ||
278 | { | 287 | { | ||
279 | m_prev->setEnabled(true); | 288 | m_prev->setEnabled(true); | ||
280 | m_next->setEnabled(true); | 289 | m_next->setEnabled(true); | ||
281 | m_collapseAll->setEnabled(true); | 290 | m_collapseAll->setEnabled(true); | ||
282 | m_expandAll->setEnabled(true); | 291 | m_expandAll->setEnabled(true); | ||
283 | 292 | | |||
284 | resultsTreeView->expand(index); | 293 | resultsTreeView->expand(index); | ||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |
This will use the pattern from the current selection instead of the last search pattern. This is not what we want unfortunately.