mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1876bec08b
commit
063e6d9fbf
4 changed files with 4 additions and 33 deletions
|
@ -32,7 +32,7 @@
|
||||||
static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 500};
|
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),
|
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));
|
setItemDelegate(new DiveListDelegate(this));
|
||||||
setUniformRowHeights(true);
|
setUniformRowHeights(true);
|
||||||
|
@ -100,15 +100,6 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
|
||||||
|
|
||||||
|
|
||||||
header()->setStretchLastSection(true);
|
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()
|
DiveListView::~DiveListView()
|
||||||
|
@ -322,12 +313,6 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveListView::showSearchEdit()
|
|
||||||
{
|
|
||||||
searchBox.show();
|
|
||||||
searchBox.setFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DiveListView::eventFilter(QObject *, QEvent *event)
|
bool DiveListView::eventFilter(QObject *, QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() != QEvent::KeyPress)
|
if (event->type() != QEvent::KeyPress)
|
||||||
|
@ -335,11 +320,6 @@ bool DiveListView::eventFilter(QObject *, QEvent *event)
|
||||||
QKeyEvent *keyEv = static_cast<QKeyEvent *>(event);
|
QKeyEvent *keyEv = static_cast<QKeyEvent *>(event);
|
||||||
if (keyEv->key() != Qt::Key_Escape)
|
if (keyEv->key() != Qt::Key_Escape)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
searchBox.clear();
|
|
||||||
searchBox.hide();
|
|
||||||
QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel *>(model());
|
|
||||||
m->setFilterFixedString(QString());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -882,9 +862,3 @@ void DiveListView::updateLastImageTimeOffset(const int offset)
|
||||||
s.beginGroup("MainWindow");
|
s.beginGroup("MainWindow");
|
||||||
s.setValue("LastImageTimeOffset", offset);
|
s.setValue("LastImageTimeOffset", offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveListView::endSearch()
|
|
||||||
{
|
|
||||||
searchBox.clear();
|
|
||||||
searchBox.hide();
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ slots:
|
||||||
void toggleColumnVisibilityByIndex();
|
void toggleColumnVisibilityByIndex();
|
||||||
void reloadHeaderActions();
|
void reloadHeaderActions();
|
||||||
void headerClicked(int);
|
void headerClicked(int);
|
||||||
void showSearchEdit();
|
|
||||||
void removeFromTrip();
|
void removeFromTrip();
|
||||||
void deleteDive();
|
void deleteDive();
|
||||||
void markDiveInvalid();
|
void markDiveInvalid();
|
||||||
|
@ -52,7 +51,6 @@ slots:
|
||||||
void shiftTimes();
|
void shiftTimes();
|
||||||
void loadImages();
|
void loadImages();
|
||||||
static QString lastUsedImageDir();
|
static QString lastUsedImageDir();
|
||||||
void endSearch();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void currentDiveChanged(int divenr);
|
void currentDiveChanged(int divenr);
|
||||||
|
@ -63,7 +61,6 @@ private:
|
||||||
int sortColumn;
|
int sortColumn;
|
||||||
Qt::SortOrder currentOrder;
|
Qt::SortOrder currentOrder;
|
||||||
DiveTripModel::Layout currentLayout;
|
DiveTripModel::Layout currentLayout;
|
||||||
QLineEdit searchBox;
|
|
||||||
QModelIndex contextMenuIndex;
|
QModelIndex contextMenuIndex;
|
||||||
bool dontEmitDiveChangedSignal;
|
bool dontEmitDiveChangedSignal;
|
||||||
bool selectionSaved;
|
bool selectionSaved;
|
||||||
|
|
|
@ -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;
|
qDebug() << "trying to replan a dive that's not a planned dive:" << current_dive->dc.model;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ui.ListWidget->endSearch();
|
|
||||||
// put us in PLAN mode
|
// put us in PLAN mode
|
||||||
DivePlannerPointsModel::instance()->clear();
|
DivePlannerPointsModel::instance()->clear();
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||||
|
@ -479,7 +478,6 @@ void MainWindow::on_actionDivePlanner_triggered()
|
||||||
if (!plannerStateClean())
|
if (!plannerStateClean())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ui.ListWidget->endSearch();
|
|
||||||
// put us in PLAN mode
|
// put us in PLAN mode
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||||
|
|
||||||
|
@ -509,7 +507,6 @@ void MainWindow::on_actionAddDive_triggered()
|
||||||
dive_list()->clearSelection();
|
dive_list()->clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.ListWidget->endSearch();
|
|
||||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||||
|
|
||||||
// setup things so we can later create our starting dive
|
// setup things so we can later create our starting dive
|
||||||
|
|
|
@ -835,6 +835,9 @@ p, li { white-space: pre-wrap; }
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Filter by Tags</string>
|
<string>&Filter by Tags</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+F</string>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="profTissues">
|
<action name="profTissues">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
|
|
Loading…
Add table
Reference in a new issue