diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-10-31 14:17:01 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-31 13:52:51 -0700 |
commit | 063e6d9fbf221cac4d0f5be314c4f7c005e805b1 (patch) | |
tree | a1709103c486a02ba96c7b31806419657528fef5 /qt-ui | |
parent | 1876bec08bd8cce51bc18872bc8134bdd12500f7 (diff) | |
download | subsurface-063e6d9fbf221cac4d0f5be314c4f7c005e805b1.tar.gz |
Ctrl+F now opens the Tag Filter
And old code for the old searchbar removed.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelistview.cpp | 28 | ||||
-rw-r--r-- | qt-ui/divelistview.h | 3 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 3 | ||||
-rw-r--r-- | qt-ui/mainwindow.ui | 3 |
4 files changed, 4 insertions, 33 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 474cb0661..6963958ac 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -32,7 +32,7 @@ static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 500}; DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelection(false), sortColumn(0), - currentOrder(Qt::DescendingOrder), searchBox(this), dontEmitDiveChangedSignal(false), selectionSaved(false) + currentOrder(Qt::DescendingOrder), dontEmitDiveChangedSignal(false), selectionSaved(false) { setItemDelegate(new DiveListDelegate(this)); setUniformRowHeights(true); @@ -100,15 +100,6 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec header()->setStretchLastSection(true); - QAction *showSearchBox = new QAction(tr("Show search box"), this); - showSearchBox->setShortcut(Qt::CTRL + Qt::Key_F); - showSearchBox->setShortcutContext(Qt::WindowShortcut); - addAction(showSearchBox); - - searchBox.installEventFilter(this); - searchBox.hide(); -// connect(showSearchBox, SIGNAL(triggered(bool)), this, SLOT(showSearchEdit())); -// connect(&searchBox, SIGNAL(textChanged(QString)), model, SLOT(setFilterFixedString(QString))); } DiveListView::~DiveListView() @@ -322,12 +313,6 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection) return; } -void DiveListView::showSearchEdit() -{ - searchBox.show(); - searchBox.setFocus(); -} - bool DiveListView::eventFilter(QObject *, QEvent *event) { if (event->type() != QEvent::KeyPress) @@ -335,11 +320,6 @@ bool DiveListView::eventFilter(QObject *, QEvent *event) QKeyEvent *keyEv = static_cast<QKeyEvent *>(event); if (keyEv->key() != Qt::Key_Escape) return false; - - searchBox.clear(); - searchBox.hide(); - QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel *>(model()); - m->setFilterFixedString(QString()); return true; } @@ -882,9 +862,3 @@ void DiveListView::updateLastImageTimeOffset(const int offset) s.beginGroup("MainWindow"); s.setValue("LastImageTimeOffset", offset); } - -void DiveListView::endSearch() -{ - searchBox.clear(); - searchBox.hide(); -} diff --git a/qt-ui/divelistview.h b/qt-ui/divelistview.h index 332c1795f..a2e33a09d 100644 --- a/qt-ui/divelistview.h +++ b/qt-ui/divelistview.h @@ -36,7 +36,6 @@ slots: void toggleColumnVisibilityByIndex(); void reloadHeaderActions(); void headerClicked(int); - void showSearchEdit(); void removeFromTrip(); void deleteDive(); void markDiveInvalid(); @@ -52,7 +51,6 @@ slots: void shiftTimes(); void loadImages(); static QString lastUsedImageDir(); - void endSearch(); signals: void currentDiveChanged(int divenr); @@ -63,7 +61,6 @@ private: int sortColumn; Qt::SortOrder currentOrder; DiveTripModel::Layout currentLayout; - QLineEdit searchBox; QModelIndex contextMenuIndex; bool dontEmitDiveChangedSignal; bool selectionSaved; diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index f5794b6d7..a86eb8e99 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -457,7 +457,6 @@ void MainWindow::on_actionReplanDive_triggered() qDebug() << "trying to replan a dive that's not a planned dive:" << current_dive->dc.model; return; } - ui.ListWidget->endSearch(); // put us in PLAN mode DivePlannerPointsModel::instance()->clear(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); @@ -479,7 +478,6 @@ void MainWindow::on_actionDivePlanner_triggered() if (!plannerStateClean()) return; - ui.ListWidget->endSearch(); // put us in PLAN mode DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); @@ -509,7 +507,6 @@ void MainWindow::on_actionAddDive_triggered() dive_list()->clearSelection(); } - ui.ListWidget->endSearch(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); // setup things so we can later create our starting dive diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 4d1f4b43a..4e9c94a2d 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -835,6 +835,9 @@ p, li { white-space: pre-wrap; } <property name="text"> <string>&Filter by Tags</string> </property> + <property name="shortcut"> + <string>Ctrl+F</string> + </property> </action> <action name="profTissues"> <property name="checkable"> |