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
|
|
|
|
2013-10-03 18:54:24 +00:00
|
|
|
#include "ui_maintab.h"
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "qt-models/completionmodels.h"
|
|
|
|
#include "qt-models/divelocationmodel.h"
|
|
|
|
#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
|
|
|
|
2014-11-06 19:24:38 +00:00
|
|
|
class ExtraDataModel;
|
2015-05-29 17:42:57 +00:00
|
|
|
class DivePictureModel;
|
2013-08-13 13:49:59 +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();
|
2013-11-10 21:23:18 +00:00
|
|
|
bool isEditing();
|
2015-08-29 23:00:22 +00:00
|
|
|
void refreshDisplayedDiveSite();
|
2014-05-16 06:12:46 +00:00
|
|
|
void nextInputField(QKeyEvent *event);
|
2019-04-01 19:07:51 +00:00
|
|
|
void stealFocus();
|
2014-08-17 14:26:09 +00:00
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2019-06-23 07:22:26 +00:00
|
|
|
void divesChanged(const QVector<dive *> &dives, DiveField field);
|
2019-03-29 16:48:08 +00:00
|
|
|
void diveSiteEdited(dive_site *ds, int field);
|
2019-02-24 20:22:33 +00:00
|
|
|
void tripChanged(dive_trip *trip, TripField field);
|
2019-03-29 17:29:08 +00:00
|
|
|
void updateDiveInfo();
|
2019-01-27 21:08:13 +00:00
|
|
|
void updateNotes(const struct dive *d);
|
2019-08-07 19:53:50 +00:00
|
|
|
void updateDateTime(const struct dive *d);
|
|
|
|
void updateTripDate(const struct dive_trip *t);
|
2019-03-20 20:46:58 +00:00
|
|
|
void updateDiveSite(struct dive *d);
|
2013-09-19 00:56:53 +00:00
|
|
|
void acceptChanges();
|
|
|
|
void rejectChanges();
|
2015-09-23 17:46:29 +00:00
|
|
|
void on_location_diveSiteSelected();
|
2019-04-25 11:16:30 +00:00
|
|
|
void on_locationPopupButton_clicked();
|
2022-02-12 13:03:18 +00:00
|
|
|
void on_diveguide_editingFinished();
|
2019-02-07 20:00:09 +00:00
|
|
|
void on_buddy_editingFinished();
|
2019-02-24 20:22:33 +00:00
|
|
|
void on_diveTripLocation_editingFinished();
|
2019-01-25 17:27:31 +00:00
|
|
|
void on_notes_editingFinished();
|
2019-02-10 16:37:06 +00:00
|
|
|
void on_duration_editingFinished();
|
|
|
|
void on_depth_editingFinished();
|
2020-05-06 19:02:10 +00:00
|
|
|
void on_dateEdit_editingFinished();
|
|
|
|
void on_timeEdit_editingFinished();
|
2013-05-18 23:42:59 +00:00
|
|
|
void on_rating_valueChanged(int value);
|
2019-02-07 18:59:34 +00:00
|
|
|
void on_tagWidget_editingFinished();
|
2013-12-03 20:44:48 +00:00
|
|
|
void hideMessage();
|
|
|
|
void closeMessage();
|
2019-05-24 19:11:20 +00:00
|
|
|
void closeWarning();
|
2013-12-03 20:44:48 +00:00
|
|
|
void displayMessage(QString str);
|
2020-03-02 15:03:32 +00:00
|
|
|
void enableEdition();
|
2014-06-03 22:29:28 +00:00
|
|
|
void escDetected(void);
|
2020-05-22 07:49:48 +00:00
|
|
|
void updateDateTimeFields();
|
2020-11-02 20:10:33 +00:00
|
|
|
void colorsChanged();
|
2013-04-07 22:20:43 +00:00
|
|
|
private:
|
2013-10-03 18:54:25 +00:00
|
|
|
Ui::MainTab ui;
|
2020-03-18 21:42:47 +00:00
|
|
|
bool editMode;
|
2020-03-18 21:37:18 +00:00
|
|
|
bool ignoreInput; // When computionally editing fields, we have to ignore changed-signals
|
2014-02-11 17:46:14 +00:00
|
|
|
BuddyCompletionModel buddyModel;
|
2022-02-12 13:03:18 +00:00
|
|
|
DiveGuideCompletionModel diveGuideModel;
|
2014-02-11 17:46:14 +00:00
|
|
|
TagCompletionModel tagModel;
|
2017-11-30 19:33:43 +00:00
|
|
|
bool lastSelectedDive;
|
|
|
|
int lastTabSelectedDive;
|
|
|
|
int lastTabSelectedDiveTrip;
|
2019-05-31 14:09:14 +00:00
|
|
|
dive_trip *currentTrip;
|
2017-04-04 17:21:30 +00:00
|
|
|
QList<TabBase*> extraWidgets;
|
2019-05-24 19:11:20 +00:00
|
|
|
void divesEdited(int num); // Opens a warning window if more than one dive was edited
|
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
|