2015-05-17 16:13:41 -03:00
|
|
|
#ifndef LOCATIONINFORMATION_H
|
|
|
|
#define LOCATIONINFORMATION_H
|
|
|
|
|
|
|
|
#include "ui_locationInformation.h"
|
|
|
|
#include <stdint.h>
|
2015-05-17 16:33:23 -03:00
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
2015-05-17 16:13:41 -03:00
|
|
|
class LocationInformationWidget : public QGroupBox {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-06-03 23:50:36 -03:00
|
|
|
enum mode{CREATE_DIVE_SITE, EDIT_DIVE_SITE};
|
2015-05-17 16:13:41 -03:00
|
|
|
LocationInformationWidget(QWidget *parent = 0);
|
2015-05-17 17:14:23 -03:00
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *);
|
2015-05-26 17:36:06 -03:00
|
|
|
|
2015-05-17 16:13:41 -03:00
|
|
|
public slots:
|
|
|
|
void acceptChanges();
|
|
|
|
void rejectChanges();
|
2015-06-03 23:50:36 -03:00
|
|
|
void updateGpsCoordinates();
|
|
|
|
void editDiveSite(uint32_t uuid);
|
|
|
|
void createDiveSite();
|
2015-05-17 16:13:41 -03:00
|
|
|
void markChangedWidget(QWidget *w);
|
|
|
|
void enableEdition();
|
|
|
|
void resetState();
|
|
|
|
void resetPallete();
|
|
|
|
void on_diveSiteCoordinates_textChanged(const QString& text);
|
|
|
|
void on_diveSiteDescription_textChanged(const QString& text);
|
|
|
|
void on_diveSiteName_textChanged(const QString& text);
|
|
|
|
void on_diveSiteNotes_textChanged();
|
2015-06-03 23:50:36 -03:00
|
|
|
private slots:
|
|
|
|
void setCurrentDiveSiteByUuid(uint32_t uuid);
|
2015-05-17 16:13:41 -03:00
|
|
|
signals:
|
2015-06-03 23:50:36 -03:00
|
|
|
void startEditDiveSite(uint32_t uuid);
|
|
|
|
void endEditDiveSite();
|
2015-05-17 16:13:41 -03:00
|
|
|
void informationManagementEnded();
|
2015-05-22 12:15:53 -07:00
|
|
|
void coordinatesChanged();
|
2015-05-26 17:36:06 -03:00
|
|
|
void startFilterDiveSite(uint32_t uuid);
|
2015-05-26 17:42:45 -03:00
|
|
|
void stopFilterDiveSite();
|
2015-05-17 16:13:41 -03:00
|
|
|
private:
|
|
|
|
struct dive_site *currentDs;
|
|
|
|
Ui::LocationInformation ui;
|
|
|
|
bool modified;
|
|
|
|
QAction *closeAction, *acceptAction, *rejectAction;
|
2015-06-03 23:50:36 -03:00
|
|
|
mode current_mode;
|
2015-05-17 16:13:41 -03:00
|
|
|
};
|
|
|
|
|
2015-06-26 13:23:53 -03:00
|
|
|
|
|
|
|
#include "ui_simpledivesiteedit.h"
|
|
|
|
class SimpleDiveSiteEditDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
SimpleDiveSiteEditDialog(QWidget *parent);
|
|
|
|
virtual ~SimpleDiveSiteEditDialog();
|
2015-06-26 15:12:37 -03:00
|
|
|
bool changed_dive_site;
|
2015-06-26 21:20:45 -03:00
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
2015-06-26 14:26:54 -03:00
|
|
|
public slots:
|
|
|
|
void on_diveSiteName_editingFinished();
|
|
|
|
void on_diveSiteCoordinates_editingFinished();
|
2015-06-26 21:20:45 -03:00
|
|
|
void diveSiteDescription_editingFinished();
|
|
|
|
void diveSiteNotes_editingFinished();
|
2015-06-26 13:46:54 -03:00
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *ev);
|
2015-06-26 13:23:53 -03:00
|
|
|
private:
|
|
|
|
Ui::SimpleDiveSiteEditDialog *ui;
|
|
|
|
|
|
|
|
};
|
2015-05-17 16:13:41 -03:00
|
|
|
#endif
|