mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
cded7ef5fe
On selection change, pass down selection (including current dive and dc) to the tab widgets. Ultimately, this should remove access to global variables. A number of new accesses are marked as TODO. They shall be removed in due course. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
41 lines
840 B
C++
41 lines
840 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* maintab.h
|
|
*
|
|
* header file for the main tab of Subsurface
|
|
*
|
|
*/
|
|
#ifndef MAINTAB_H
|
|
#define MAINTAB_H
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include "core/dive.h"
|
|
#include "core/subsurface-qt/divelistnotifier.h"
|
|
|
|
class TabBase;
|
|
class MainTab : public QTabWidget {
|
|
Q_OBJECT
|
|
public:
|
|
MainTab(QWidget *parent = 0);
|
|
void clearTabs();
|
|
void nextInputField(QKeyEvent *event);
|
|
void stealFocus();
|
|
|
|
public
|
|
slots:
|
|
// Always called with non-null currentDive
|
|
void updateDiveInfo(const std::vector<dive *> &selection, dive *currentDive, int currentDC);
|
|
void settingsChanged();
|
|
void escDetected();
|
|
void colorsChanged();
|
|
private:
|
|
bool lastSelectedDive;
|
|
int lastTabSelectedDive;
|
|
int lastTabSelectedDiveTrip;
|
|
QList<TabBase*> extraWidgets;
|
|
void changeEvent(QEvent *ev) override;
|
|
bool isDark;
|
|
};
|
|
|
|
#endif // MAINTAB_H
|