2013-06-04 21:51:27 +00:00
|
|
|
#ifndef SIMPLEWIDGETS_H
|
|
|
|
#define SIMPLEWIDGETS_H
|
|
|
|
|
|
|
|
class MinMaxAvgWidgetPrivate;
|
2013-06-17 16:41:00 +00:00
|
|
|
class QAbstractButton;
|
|
|
|
|
2013-06-04 21:51:27 +00:00
|
|
|
#include <QWidget>
|
2013-06-17 16:41:00 +00:00
|
|
|
#include <QDialog>
|
2014-03-25 17:54:37 +00:00
|
|
|
#include <stdint.h>
|
2013-06-04 21:51:27 +00:00
|
|
|
|
2013-10-03 22:38:49 +00:00
|
|
|
#include "ui_renumber.h"
|
2013-11-18 13:53:05 +00:00
|
|
|
#include "ui_shifttimes.h"
|
2014-01-27 13:44:26 +00:00
|
|
|
#include "ui_shiftimagetimes.h"
|
2014-08-16 15:32:23 +00:00
|
|
|
#include "ui_divecomponentselection.h"
|
2014-10-31 18:01:28 +00:00
|
|
|
#include "ui_listfilter.h"
|
2014-02-13 15:43:55 +00:00
|
|
|
#include "exif.h"
|
2013-10-03 18:54:24 +00:00
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
class MinMaxAvgWidget : public QWidget {
|
2013-06-04 21:51:27 +00:00
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
|
|
|
|
Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
|
|
|
|
Q_PROPERTY(double average READ average WRITE setAverage)
|
|
|
|
public:
|
|
|
|
MinMaxAvgWidget(QWidget *parent);
|
2013-11-30 17:18:02 +00:00
|
|
|
~MinMaxAvgWidget();
|
2013-06-04 21:51:27 +00:00
|
|
|
double minimum() const;
|
|
|
|
double maximum() const;
|
|
|
|
double average() const;
|
|
|
|
void setMinimum(double minimum);
|
|
|
|
void setMaximum(double maximum);
|
|
|
|
void setAverage(double average);
|
2014-02-28 04:09:57 +00:00
|
|
|
void setMinimum(const QString &minimum);
|
|
|
|
void setMaximum(const QString &maximum);
|
|
|
|
void setAverage(const QString &average);
|
2014-05-30 22:46:55 +00:00
|
|
|
void overrideMinToolTipText(const QString &newTip);
|
|
|
|
void overrideMaxToolTipText(const QString &newTip);
|
2013-06-04 21:51:27 +00:00
|
|
|
void clear();
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2013-06-04 21:51:27 +00:00
|
|
|
private:
|
2013-11-30 17:18:02 +00:00
|
|
|
QScopedPointer<MinMaxAvgWidgetPrivate> d;
|
2013-06-04 21:51:27 +00:00
|
|
|
};
|
|
|
|
|
2013-06-17 16:41:00 +00:00
|
|
|
class RenumberDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static RenumberDialog *instance();
|
2014-05-19 21:11:32 +00:00
|
|
|
void renumberOnlySelected(bool selected = true);
|
2014-02-28 04:09:57 +00:00
|
|
|
private
|
|
|
|
slots:
|
2013-06-17 16:41:00 +00:00
|
|
|
void buttonClicked(QAbstractButton *button);
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2013-06-17 16:41:00 +00:00
|
|
|
private:
|
2013-11-30 17:18:04 +00:00
|
|
|
explicit RenumberDialog(QWidget *parent);
|
2013-10-03 18:54:25 +00:00
|
|
|
Ui::RenumberDialog ui;
|
2014-05-19 21:11:32 +00:00
|
|
|
bool selectedOnly;
|
2013-06-17 16:41:00 +00:00
|
|
|
};
|
|
|
|
|
2013-11-18 13:53:05 +00:00
|
|
|
class ShiftTimesDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static ShiftTimesDialog *instance();
|
2014-05-22 18:40:22 +00:00
|
|
|
void showEvent(QShowEvent *event);
|
2014-02-28 04:09:57 +00:00
|
|
|
private
|
|
|
|
slots:
|
2013-11-18 13:53:05 +00:00
|
|
|
void buttonClicked(QAbstractButton *button);
|
2014-05-22 18:40:22 +00:00
|
|
|
void changeTime();
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2013-11-18 13:53:05 +00:00
|
|
|
private:
|
2013-11-30 17:18:04 +00:00
|
|
|
explicit ShiftTimesDialog(QWidget *parent);
|
2014-03-20 20:57:49 +00:00
|
|
|
int64_t when;
|
2013-11-18 13:53:05 +00:00
|
|
|
Ui::ShiftTimesDialog ui;
|
|
|
|
};
|
|
|
|
|
2014-01-27 13:44:26 +00:00
|
|
|
class ShiftImageTimesDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-08 22:56:47 +00:00
|
|
|
explicit ShiftImageTimesDialog(QWidget *parent);
|
2014-02-13 15:43:55 +00:00
|
|
|
time_t amount() const;
|
|
|
|
void setOffset(time_t offset);
|
2014-02-28 04:09:57 +00:00
|
|
|
private
|
|
|
|
slots:
|
2014-01-27 13:44:26 +00:00
|
|
|
void buttonClicked(QAbstractButton *button);
|
2014-02-13 15:43:55 +00:00
|
|
|
void syncCameraClicked();
|
|
|
|
void dcDateTimeChanged(const QDateTime &);
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2014-01-27 13:44:26 +00:00
|
|
|
private:
|
|
|
|
Ui::ShiftImageTimesDialog ui;
|
2014-02-13 15:43:55 +00:00
|
|
|
time_t m_amount;
|
|
|
|
time_t dcImageEpoch;
|
2014-01-27 13:44:26 +00:00
|
|
|
};
|
|
|
|
|
2014-06-19 18:42:05 +00:00
|
|
|
class QCalendarWidget;
|
|
|
|
|
2014-06-19 16:42:49 +00:00
|
|
|
class DateWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DateWidget(QWidget *parent = 0);
|
|
|
|
QDate date() const;
|
2014-09-17 22:39:49 +00:00
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void setDate(const QDate &date);
|
|
|
|
|
2014-06-19 16:42:49 +00:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event);
|
2014-06-19 18:42:05 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event);
|
2014-06-19 18:52:30 +00:00
|
|
|
void focusInEvent(QFocusEvent *);
|
|
|
|
void focusOutEvent(QFocusEvent *);
|
2014-06-19 18:58:27 +00:00
|
|
|
void keyPressEvent(QKeyEvent *);
|
2014-06-19 22:57:53 +00:00
|
|
|
void changeEvent(QEvent *);
|
2014-06-30 21:20:17 +00:00
|
|
|
bool eventFilter(QObject *, QEvent *);
|
2014-06-19 18:42:05 +00:00
|
|
|
signals:
|
2014-09-17 22:39:49 +00:00
|
|
|
void dateChanged(const QDate &date);
|
|
|
|
|
2014-06-19 16:42:49 +00:00
|
|
|
private:
|
|
|
|
QDate mDate;
|
2014-06-19 18:42:05 +00:00
|
|
|
QCalendarWidget *calendarWidget;
|
2014-06-19 16:42:49 +00:00
|
|
|
};
|
|
|
|
|
2014-08-16 15:32:23 +00:00
|
|
|
class DiveComponentSelection : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit DiveComponentSelection(QWidget *parent, struct dive *target, struct dive_components *_what);
|
|
|
|
private
|
|
|
|
slots:
|
|
|
|
void buttonClicked(QAbstractButton *button);
|
2014-09-17 22:39:49 +00:00
|
|
|
|
2014-08-16 15:32:23 +00:00
|
|
|
private:
|
|
|
|
Ui::DiveComponentSelectionDialog ui;
|
|
|
|
struct dive *targetDive;
|
|
|
|
struct dive_components *what;
|
|
|
|
};
|
|
|
|
|
2014-09-17 16:51:08 +00:00
|
|
|
class TagFilter : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-09-17 17:17:41 +00:00
|
|
|
TagFilter(QWidget *parent = 0);
|
2014-10-01 19:23:02 +00:00
|
|
|
virtual void showEvent(QShowEvent *);
|
|
|
|
virtual void hideEvent(QHideEvent *);
|
2014-09-17 17:17:41 +00:00
|
|
|
private:
|
2014-10-31 17:40:57 +00:00
|
|
|
Ui::FilterWidget ui;
|
2014-09-17 16:51:08 +00:00
|
|
|
};
|
|
|
|
|
2014-10-31 18:49:52 +00:00
|
|
|
class BuddyFilter : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
BuddyFilter(QWidget *parent = 0);
|
|
|
|
virtual void showEvent(QShowEvent *);
|
|
|
|
virtual void hideEvent(QHideEvent *);
|
|
|
|
private:
|
|
|
|
Ui::FilterWidget ui;
|
|
|
|
};
|
|
|
|
|
2014-10-31 17:22:21 +00:00
|
|
|
class MultiFilter : public QScrollArea {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MultiFilter(QWidget *parent);
|
|
|
|
};
|
|
|
|
|
2013-09-27 15:52:01 +00:00
|
|
|
bool isGnome3Session();
|
2014-09-17 22:39:49 +00:00
|
|
|
QImage grayImage(const QImage &coloredImg);
|
2013-09-27 15:52:01 +00:00
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // SIMPLEWIDGETS_H
|