2017-04-27 20:26:05 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2013-04-13 20:44:02 -07:00
|
|
|
/*
|
|
|
|
* maintab.h
|
|
|
|
*
|
|
|
|
* header file for the main tab of Subsurface
|
|
|
|
*
|
|
|
|
*/
|
2013-04-07 15:20:43 -07:00
|
|
|
#ifndef MAINTAB_H
|
|
|
|
#define MAINTAB_H
|
|
|
|
|
|
|
|
#include <QTabWidget>
|
2013-04-13 10:17:59 -03:00
|
|
|
#include <QDialog>
|
2013-08-16 13:31:52 -03:00
|
|
|
#include <QMap>
|
2015-02-11 10:14:45 -08:00
|
|
|
#include <QUuid>
|
2013-04-13 10:17:59 -03:00
|
|
|
|
2013-10-03 11:54:24 -07:00
|
|
|
#include "ui_maintab.h"
|
2016-04-04 22:02:03 -07:00
|
|
|
#include "qt-models/completionmodels.h"
|
|
|
|
#include "qt-models/divelocationmodel.h"
|
|
|
|
#include "core/dive.h"
|
2020-02-03 19:33:06 +01:00
|
|
|
#include "core/subsurface-qt/divelistnotifier.h"
|
2013-04-07 15:20:43 -07:00
|
|
|
|
2014-11-06 11:24:38 -08:00
|
|
|
class ExtraDataModel;
|
2015-05-29 14:42:57 -03:00
|
|
|
class DivePictureModel;
|
2013-08-13 10:49:59 -03:00
|
|
|
|
2017-04-04 19:21:30 +02:00
|
|
|
class TabBase;
|
2014-02-27 20:09:57 -08:00
|
|
|
class MainTab : public QTabWidget {
|
2013-04-07 15:20:43 -07:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-02-09 16:23:30 -02:00
|
|
|
MainTab(QWidget *parent = 0);
|
2017-04-04 19:21:30 +02:00
|
|
|
void clearTabs();
|
2013-04-13 10:17:59 -03:00
|
|
|
void reload();
|
2013-06-16 14:36:23 -03:00
|
|
|
void initialUiSetup();
|
2013-11-11 06:23:18 +09:00
|
|
|
bool isEditing();
|
2013-11-19 04:12:31 -08:00
|
|
|
void updateCoordinatesText(qreal lat, qreal lon);
|
2015-08-30 01:00:22 +02:00
|
|
|
void refreshDisplayedDiveSite();
|
2014-05-16 15:12:46 +09:00
|
|
|
void nextInputField(QKeyEvent *event);
|
2019-04-01 21:07:51 +02:00
|
|
|
void stealFocus();
|
2014-08-17 08:26:09 -06:00
|
|
|
|
2014-02-27 20:09:57 -08:00
|
|
|
public
|
|
|
|
slots:
|
2019-06-23 09:22:26 +02:00
|
|
|
void divesChanged(const QVector<dive *> &dives, DiveField field);
|
2019-03-29 17:48:08 +01:00
|
|
|
void diveSiteEdited(dive_site *ds, int field);
|
2019-02-24 21:22:33 +01:00
|
|
|
void tripChanged(dive_trip *trip, TripField field);
|
2019-03-29 18:29:08 +01:00
|
|
|
void updateDiveInfo();
|
2019-01-27 22:08:13 +01:00
|
|
|
void updateNotes(const struct dive *d);
|
2019-08-07 21:53:50 +02:00
|
|
|
void updateDateTime(const struct dive *d);
|
|
|
|
void updateTripDate(const struct dive_trip *t);
|
2019-03-20 21:46:58 +01:00
|
|
|
void updateDiveSite(struct dive *d);
|
2013-09-18 21:56:53 -03:00
|
|
|
void acceptChanges();
|
|
|
|
void rejectChanges();
|
2015-09-23 14:46:29 -03:00
|
|
|
void on_location_diveSiteSelected();
|
2019-04-25 13:16:30 +02:00
|
|
|
void on_locationPopupButton_clicked();
|
2019-02-07 21:23:00 +01:00
|
|
|
void on_divemaster_editingFinished();
|
2019-02-07 21:00:09 +01:00
|
|
|
void on_buddy_editingFinished();
|
2019-02-24 21:22:33 +01:00
|
|
|
void on_diveTripLocation_editingFinished();
|
2019-01-25 18:27:31 +01:00
|
|
|
void on_notes_editingFinished();
|
2019-02-10 17:37:06 +01:00
|
|
|
void on_duration_editingFinished();
|
|
|
|
void on_depth_editingFinished();
|
2020-05-06 21:02:10 +02:00
|
|
|
void on_dateEdit_editingFinished();
|
|
|
|
void on_timeEdit_editingFinished();
|
2013-05-18 20:42:59 -03:00
|
|
|
void on_rating_valueChanged(int value);
|
2019-02-07 19:59:34 +01:00
|
|
|
void on_tagWidget_editingFinished();
|
2013-12-03 21:44:48 +01:00
|
|
|
void hideMessage();
|
|
|
|
void closeMessage();
|
2019-05-24 21:11:20 +02:00
|
|
|
void closeWarning();
|
2013-12-03 21:44:48 +01:00
|
|
|
void displayMessage(QString str);
|
2020-03-02 16:03:32 +01:00
|
|
|
void enableEdition();
|
2014-06-03 15:29:28 -07:00
|
|
|
void escDetected(void);
|
2020-05-22 09:49:48 +02:00
|
|
|
void updateDateTimeFields();
|
2013-04-07 15:20:43 -07:00
|
|
|
private:
|
2013-10-03 11:54:25 -07:00
|
|
|
Ui::MainTab ui;
|
2020-03-18 22:42:47 +01:00
|
|
|
bool editMode;
|
2020-03-18 22:37:18 +01:00
|
|
|
bool ignoreInput; // When computionally editing fields, we have to ignore changed-signals
|
2014-02-11 18:46:14 +01:00
|
|
|
BuddyCompletionModel buddyModel;
|
|
|
|
DiveMasterCompletionModel diveMasterModel;
|
|
|
|
TagCompletionModel tagModel;
|
2017-11-30 20:33:43 +01:00
|
|
|
bool lastSelectedDive;
|
|
|
|
int lastTabSelectedDive;
|
|
|
|
int lastTabSelectedDiveTrip;
|
2019-05-31 16:09:14 +02:00
|
|
|
dive_trip *currentTrip;
|
2017-04-04 19:21:30 +02:00
|
|
|
QList<TabBase*> extraWidgets;
|
2019-05-24 21:11:20 +02:00
|
|
|
void divesEdited(int num); // Opens a warning window if more than one dive was edited
|
2013-04-07 15:20:43 -07:00
|
|
|
};
|
|
|
|
|
2014-02-11 19:14:46 +01:00
|
|
|
#endif // MAINTAB_H
|