From ba6f7361da873609d72ab4ba3b1d55edd8f5569d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 16 Aug 2021 18:15:54 -1000 Subject: Remove the divecomputer naming tab The TabDiveComputer model won't work in the new world order, where you can't even insert a new device entry without a nickname to be edited. Signed-off-by: Linus Torvalds --- desktop-widgets/tab-widgets/TabDiveComputer.cpp | 38 ------------------------- desktop-widgets/tab-widgets/TabDiveComputer.h | 23 --------------- desktop-widgets/tab-widgets/TabDiveComputer.ui | 33 --------------------- desktop-widgets/tab-widgets/maintab.cpp | 3 -- 4 files changed, 97 deletions(-) delete mode 100644 desktop-widgets/tab-widgets/TabDiveComputer.cpp delete mode 100644 desktop-widgets/tab-widgets/TabDiveComputer.h delete mode 100644 desktop-widgets/tab-widgets/TabDiveComputer.ui (limited to 'desktop-widgets/tab-widgets') diff --git a/desktop-widgets/tab-widgets/TabDiveComputer.cpp b/desktop-widgets/tab-widgets/TabDiveComputer.cpp deleted file mode 100644 index d4b0f5cce..000000000 --- a/desktop-widgets/tab-widgets/TabDiveComputer.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "TabDiveComputer.h" -#include "ui_TabDiveExtraInfo.h" -#include "qt-models/divecomputermodel.h" - -TabDiveComputer::TabDiveComputer(QWidget *parent) : TabBase(parent) -{ - ui.setupUi(this); - - DiveComputerModel *model = new DiveComputerModel(this); - sortedModel = new DiveComputerSortedModel(this); - - sortedModel->setSourceModel(model); - ui.devices->setModel(sortedModel); - ui.devices->view()->setSelectionBehavior(QAbstractItemView::SelectRows); - ui.devices->view()->setSelectionMode(QAbstractItemView::SingleSelection); - ui.devices->view()->setSortingEnabled(true); - ui.devices->view()->sortByColumn(DiveComputerModel::MODEL, Qt::AscendingOrder); - ui.devices->view()->horizontalHeader()->setStretchLastSection(true); - connect(ui.devices, &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); -} diff --git a/desktop-widgets/tab-widgets/TabDiveComputer.h b/desktop-widgets/tab-widgets/TabDiveComputer.h deleted file mode 100644 index f5f6900c3..000000000 --- a/desktop-widgets/tab-widgets/TabDiveComputer.h +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef TAB_DIVE_COMPUTER_H -#define TAB_DIVE_COMPUTER_H - -#include "TabBase.h" -#include "ui_TabDiveComputer.h" - -class DiveComputerSortedModel; - -class TabDiveComputer : public TabBase { - Q_OBJECT -public: - TabDiveComputer(QWidget *parent = 0); - void updateData() override; - void clear() override; -public slots: - void tableClicked(const QModelIndex &index); -private: - Ui::TabDiveComputer ui; - DiveComputerSortedModel *sortedModel; -}; - -#endif diff --git a/desktop-widgets/tab-widgets/TabDiveComputer.ui b/desktop-widgets/tab-widgets/TabDiveComputer.ui deleted file mode 100644 index af9ba60c2..000000000 --- a/desktop-widgets/tab-widgets/TabDiveComputer.ui +++ /dev/null @@ -1,33 +0,0 @@ - - - TabDiveComputer - - - - 0 - 0 - 400 - 300 - - - - - - - Dive Computers - - - - - - - - TableView - QWidget -
desktop-widgets/tableview.h
- 1 -
-
- - -
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 295b13b1d..49170525d 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -31,7 +31,6 @@ #include "TabDivePhotos.h" #include "TabDiveStatistics.h" #include "TabDiveSite.h" -#include "TabDiveComputer.h" #include #include @@ -72,8 +71,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.tabWidget->addTab(extraWidgets.last(), tr("Extra Info")); extraWidgets << new TabDiveSite(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Dive sites")); - extraWidgets << new TabDiveComputer(this); - ui.tabWidget->addTab(extraWidgets.last(), tr("Device names")); // make sure we know if this is a light or dark mode isDark = paletteIsDark(palette()); -- cgit v1.2.3-70-g09d2