aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2021-08-16 18:15:54 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-08-18 13:22:02 -0700
commitba6f7361da873609d72ab4ba3b1d55edd8f5569d (patch)
tree09549d48064f9dc78ba70f6e28420b6ae661dddd
parent6c4e890960036b127eab513ca967e9454bc63d54 (diff)
downloadsubsurface-ba6f7361da873609d72ab4ba3b1d55edd8f5569d.tar.gz
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 <torvalds@linux-foundation.org>
-rw-r--r--desktop-widgets/CMakeLists.txt3
-rw-r--r--desktop-widgets/tab-widgets/TabDiveComputer.cpp38
-rw-r--r--desktop-widgets/tab-widgets/TabDiveComputer.h23
-rw-r--r--desktop-widgets/tab-widgets/TabDiveComputer.ui33
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp3
5 files changed, 0 insertions, 100 deletions
diff --git a/desktop-widgets/CMakeLists.txt b/desktop-widgets/CMakeLists.txt
index 30a001056..95c4b1e9a 100644
--- a/desktop-widgets/CMakeLists.txt
+++ b/desktop-widgets/CMakeLists.txt
@@ -53,7 +53,6 @@ set (SUBSURFACE_UI
tab-widgets/TabDiveExtraInfo.ui
tab-widgets/TabDiveEquipment.ui
tab-widgets/TabDiveSite.ui
- tab-widgets/TabDiveComputer.ui
)
# the interface, in C++
@@ -124,8 +123,6 @@ set(SUBSURFACE_INTERFACE
tab-widgets/TabDiveStatistics.h
tab-widgets/TabDiveSite.cpp
tab-widgets/TabDiveSite.h
- tab-widgets/TabDiveComputer.cpp
- tab-widgets/TabDiveComputer.h
tab-widgets/maintab.cpp
tab-widgets/maintab.h
tableview.cpp
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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>TabDiveComputer</class>
- <widget class="QWidget" name="TabDiveComputer">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="TableView" name="devices">
- <property name="title">
- <string>Dive Computers</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>TableView</class>
- <extends>QWidget</extends>
- <header>desktop-widgets/tableview.h</header>
- <container>1</container>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
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 <QCompleter>
#include <QScrollBar>
@@ -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());