mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
fa7dfa3710
If we want to include dive computer names in the undo system, there should be visual feedback on undo/redo. This would mean opening the divecomputer dialog, which would appear quite strange. Therefore, add a tab. This is not ideal, but consistent with the dive site tab, which probably shouldn't be there either. In the future, the UI needs some rethinking. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
32 lines
867 B
C++
32 lines
867 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "TabDiveComputer.h"
|
|
#include "ui_TabDiveExtraInfo.h"
|
|
|
|
TabDiveComputer::TabDiveComputer(QWidget *parent) : TabBase(parent)
|
|
{
|
|
ui.setupUi(this);
|
|
sortedModel.setSourceModel(&model);
|
|
ui.table->setModel(&sortedModel);
|
|
ui.table->view()->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
ui.table->view()->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
ui.table->view()->setSortingEnabled(true);
|
|
ui.table->view()->sortByColumn(DiveComputerModel::MODEL, Qt::AscendingOrder);
|
|
connect(ui.table, &TableView::itemClicked, this, &TabDiveComputer::tableClicked);
|
|
}
|
|
|
|
void TabDiveComputer::updateData()
|
|
{
|
|
}
|
|
|
|
void TabDiveComputer::clear()
|
|
{
|
|
}
|
|
|
|
void TabDiveComputer::tableClicked(const QModelIndex &index)
|
|
{
|
|
if (!index.isValid())
|
|
return;
|
|
|
|
if (index.column() == DiveComputerModel::REMOVE)
|
|
sortedModel.remove(index);
|
|
}
|