2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2013-04-14 03:44:02 +00:00
|
|
|
/*
|
|
|
|
* maintab.h
|
|
|
|
*
|
|
|
|
* header file for the main tab of Subsurface
|
|
|
|
*
|
|
|
|
*/
|
2013-04-07 22:20:43 +00:00
|
|
|
#ifndef MAINTAB_H
|
|
|
|
#define MAINTAB_H
|
|
|
|
|
|
|
|
#include <QTabWidget>
|
2013-04-13 13:17:59 +00:00
|
|
|
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/dive.h"
|
2020-02-03 18:33:06 +00:00
|
|
|
#include "core/subsurface-qt/divelistnotifier.h"
|
2013-04-07 22:20:43 +00:00
|
|
|
|
2017-04-04 17:21:30 +00:00
|
|
|
class TabBase;
|
2014-02-28 04:09:57 +00:00
|
|
|
class MainTab : public QTabWidget {
|
2013-04-07 22:20:43 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-02-09 18:23:30 +00:00
|
|
|
MainTab(QWidget *parent = 0);
|
2017-04-04 17:21:30 +00:00
|
|
|
void clearTabs();
|
2014-05-16 06:12:46 +00:00
|
|
|
void nextInputField(QKeyEvent *event);
|
2019-04-01 19:07:51 +00:00
|
|
|
void stealFocus();
|
2022-09-17 14:21:17 +00:00
|
|
|
bool includesCurrentDive(const QVector<dive *> &dives) const;
|
|
|
|
divecomputer *getCurrentDC() const;
|
2014-08-17 14:26:09 +00:00
|
|
|
|
2022-09-17 14:21:17 +00:00
|
|
|
dive *currentDive;
|
|
|
|
int currentDC;
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2022-09-04 09:04:01 +00:00
|
|
|
// Always called with non-null currentDive
|
|
|
|
void updateDiveInfo(const std::vector<dive *> &selection, dive *currentDive, int currentDC);
|
|
|
|
void settingsChanged();
|
2022-03-05 16:25:49 +00:00
|
|
|
void escDetected();
|
2020-11-02 20:10:33 +00:00
|
|
|
void colorsChanged();
|
2013-04-07 22:20:43 +00:00
|
|
|
private:
|
2017-11-30 19:33:43 +00:00
|
|
|
bool lastSelectedDive;
|
|
|
|
int lastTabSelectedDive;
|
|
|
|
int lastTabSelectedDiveTrip;
|
2017-04-04 17:21:30 +00:00
|
|
|
QList<TabBase*> extraWidgets;
|
2020-11-04 21:09:44 +00:00
|
|
|
void changeEvent(QEvent *ev) override;
|
|
|
|
bool isDark;
|
2013-04-07 22:20:43 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // MAINTAB_H
|