mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: remove maintab.ui
This file was so confusing: A tabwidget containing a layout containing a tabwidget. This strange situation is probably due to moving the multi-dive warning message. Remove the file, there seems to be nothing of importance in there. All the UI was moved to the individual tabs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
357e115121
commit
ec96cbaab5
4 changed files with 14 additions and 49 deletions
|
@ -51,7 +51,6 @@ set (SUBSURFACE_UI
|
||||||
tripselectiodialog.ui
|
tripselectiodialog.ui
|
||||||
urldialog.ui
|
urldialog.ui
|
||||||
webservices.ui
|
webservices.ui
|
||||||
tab-widgets/maintab.ui
|
|
||||||
tab-widgets/TabDiveNotes.ui
|
tab-widgets/TabDiveNotes.ui
|
||||||
tab-widgets/TabDiveStatistics.ui
|
tab-widgets/TabDiveStatistics.ui
|
||||||
tab-widgets/TabDiveInformation.ui
|
tab-widgets/TabDiveInformation.ui
|
||||||
|
|
|
@ -32,22 +32,20 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
lastTabSelectedDive(0),
|
lastTabSelectedDive(0),
|
||||||
lastTabSelectedDiveTrip(0)
|
lastTabSelectedDiveTrip(0)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
|
||||||
|
|
||||||
extraWidgets << new TabDiveNotes(this);
|
extraWidgets << new TabDiveNotes(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Notes"));
|
addTab(extraWidgets.last(), tr("Notes"));
|
||||||
extraWidgets << new TabDiveEquipment(this);
|
extraWidgets << new TabDiveEquipment(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Equipment"));
|
addTab(extraWidgets.last(), tr("Equipment"));
|
||||||
extraWidgets << new TabDiveInformation(this);
|
extraWidgets << new TabDiveInformation(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Information"));
|
addTab(extraWidgets.last(), tr("Information"));
|
||||||
extraWidgets << new TabDiveStatistics(this);
|
extraWidgets << new TabDiveStatistics(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Summary"));
|
addTab(extraWidgets.last(), tr("Summary"));
|
||||||
extraWidgets << new TabDivePhotos(this);
|
extraWidgets << new TabDivePhotos(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Media"));
|
addTab(extraWidgets.last(), tr("Media"));
|
||||||
extraWidgets << new TabDiveExtraInfo(this);
|
extraWidgets << new TabDiveExtraInfo(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Extra Info"));
|
addTab(extraWidgets.last(), tr("Extra Info"));
|
||||||
extraWidgets << new TabDiveSite(this);
|
extraWidgets << new TabDiveSite(this);
|
||||||
ui.tabWidget->addTab(extraWidgets.last(), tr("Dive sites"));
|
addTab(extraWidgets.last(), tr("Dive sites"));
|
||||||
|
|
||||||
// make sure we know if this is a light or dark mode
|
// make sure we know if this is a light or dark mode
|
||||||
isDark = paletteIsDark(palette());
|
isDark = paletteIsDark(palette());
|
||||||
|
@ -125,24 +123,24 @@ void MainTab::updateDiveInfo()
|
||||||
// 1) this disrupts the user-experience and
|
// 1) this disrupts the user-experience and
|
||||||
// 2) the filter is reset, potentially erasing the current trip under our feet.
|
// 2) the filter is reset, potentially erasing the current trip under our feet.
|
||||||
// TODO: Don't hard code tab location!
|
// TODO: Don't hard code tab location!
|
||||||
bool onDiveSiteTab = ui.tabWidget->currentIndex() == 6;
|
bool onDiveSiteTab = currentIndex() == 6;
|
||||||
if (single_selected_trip()) {
|
if (single_selected_trip()) {
|
||||||
// Remember the tab selected for last dive but only if we're not on the dive site tab
|
// Remember the tab selected for last dive but only if we're not on the dive site tab
|
||||||
if (lastSelectedDive && !onDiveSiteTab)
|
if (lastSelectedDive && !onDiveSiteTab)
|
||||||
lastTabSelectedDive = ui.tabWidget->currentIndex();
|
lastTabSelectedDive = currentIndex();
|
||||||
ui.tabWidget->setTabText(0, tr("Trip notes"));
|
setTabText(0, tr("Trip notes"));
|
||||||
// Recover the tab selected for last dive trip but only if we're not on the dive site tab
|
// Recover the tab selected for last dive trip but only if we're not on the dive site tab
|
||||||
if (lastSelectedDive && !onDiveSiteTab)
|
if (lastSelectedDive && !onDiveSiteTab)
|
||||||
ui.tabWidget->setCurrentIndex(lastTabSelectedDiveTrip);
|
setCurrentIndex(lastTabSelectedDiveTrip);
|
||||||
lastSelectedDive = false;
|
lastSelectedDive = false;
|
||||||
} else {
|
} else {
|
||||||
// Remember the tab selected for last dive trip but only if we're not on the dive site tab
|
// Remember the tab selected for last dive trip but only if we're not on the dive site tab
|
||||||
if (!lastSelectedDive && !onDiveSiteTab)
|
if (!lastSelectedDive && !onDiveSiteTab)
|
||||||
lastTabSelectedDiveTrip = ui.tabWidget->currentIndex();
|
lastTabSelectedDiveTrip = currentIndex();
|
||||||
ui.tabWidget->setTabText(0, tr("Notes"));
|
setTabText(0, tr("Notes"));
|
||||||
// Recover the tab selected for last dive but only if we're not on the dive site tab
|
// Recover the tab selected for last dive but only if we're not on the dive site tab
|
||||||
if (!lastSelectedDive && !onDiveSiteTab)
|
if (!lastSelectedDive && !onDiveSiteTab)
|
||||||
ui.tabWidget->setCurrentIndex(lastTabSelectedDive);
|
setCurrentIndex(lastTabSelectedDive);
|
||||||
lastSelectedDive = true;
|
lastSelectedDive = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
#include "ui_maintab.h"
|
|
||||||
#include "core/dive.h"
|
#include "core/dive.h"
|
||||||
#include "core/subsurface-qt/divelistnotifier.h"
|
#include "core/subsurface-qt/divelistnotifier.h"
|
||||||
|
|
||||||
|
@ -29,7 +28,6 @@ slots:
|
||||||
void escDetected();
|
void escDetected();
|
||||||
void colorsChanged();
|
void colorsChanged();
|
||||||
private:
|
private:
|
||||||
Ui::MainTab ui;
|
|
||||||
bool lastSelectedDive;
|
bool lastSelectedDive;
|
||||||
int lastTabSelectedDive;
|
int lastTabSelectedDive;
|
||||||
int lastTabSelectedDiveTrip;
|
int lastTabSelectedDiveTrip;
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>MainTab</class>
|
|
||||||
<widget class="QWidget" name="MainTab">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>555</width>
|
|
||||||
<height>848</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
|
||||||
<item>
|
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources>
|
|
||||||
<include location="../../subsurface.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
Loading…
Add table
Reference in a new issue