| 1 |
#ifndef SAVEHISTORYWIDGET_H |
| 2 |
#define SAVEHISTORYWIDGET_H |
| 3 |
|
| 4 |
#include <QtGui> |
| 5 |
#include <QDialog> |
| 6 |
#include <QPushButton> |
| 7 |
#include <QLabel> |
| 8 |
#include "molecule.h" |
| 9 |
#include "itsme.h" |
| 10 |
#include "codeeditor.h" |
| 11 |
|
| 12 |
|
| 13 |
class DragVersion : public QLabel { |
| 14 |
public: |
| 15 |
DragVersion(const int index,const QString &text, uint secs,const int cur, bool d, QWidget *parent=0); |
| 16 |
|
| 17 |
QString labelText() const; |
| 18 |
int index() const; |
| 19 |
uint secs() const; |
| 20 |
bool dark; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
private: |
| 25 |
QString m_labelText; |
| 26 |
int m_index; |
| 27 |
uint m_secs; |
| 28 |
}; |
| 29 |
|
| 30 |
class SaveHistoryWidget; |
| 31 |
|
| 32 |
|
| 33 |
class DragDropVersions : public QWidget { |
| 34 |
Q_OBJECT |
| 35 |
public: |
| 36 |
DragDropVersions(QString filename, bool d,QWidget *parent = 0); |
| 37 |
|
| 38 |
|
| 39 |
QDateTime now; |
| 40 |
QTimer *tick; |
| 41 |
bool dark; |
| 42 |
friend class SaveHistoryWidget; |
| 43 |
signals: |
| 44 |
void indexChanged(int index); |
| 45 |
public slots: |
| 46 |
void tack(); |
| 47 |
protected: |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
void mousePressEvent(QMouseEvent *event); |
| 52 |
|
| 53 |
void paintEvent ( QPaintEvent * event ) ; |
| 54 |
private: |
| 55 |
int itemheight, itemwidth, current, breite, hoehe; |
| 56 |
QList<DragVersion *> dragVersions; |
| 57 |
QStringList entries, headers; |
| 58 |
QList<QDateTime> zeiten; |
| 59 |
}; |
| 60 |
|
| 61 |
class SaveHistoryWidget : public QDialog { |
| 62 |
Q_OBJECT |
| 63 |
public: |
| 64 |
SaveHistoryWidget(QString filename, bool _dark, QWidget *parent = 0); |
| 65 |
QPushButton * ok; |
| 66 |
bool dark; |
| 67 |
|
| 68 |
public slots: |
| 69 |
void tock(); |
| 70 |
void updatePreview(int index); |
| 71 |
void accept(); |
| 72 |
private: |
| 73 |
int pvindex; |
| 74 |
CodeEditor *edi; |
| 75 |
QLabel *pvheader; |
| 76 |
DragDropVersions *dda; |
| 77 |
QString fileName,orginal; |
| 78 |
}; |
| 79 |
#endif |
| 80 |
|