Debian Codegraph @

savehistorywidget.h

raw symbols SCIP
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 //! DragVersion is a QLabel that represents an earlier version of a res file and shows the time elapsed since it was saved. Used in SaveHistoryWidget
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;//!< \returns the DragVersion text.
18 int index() const;//!< \returns positional index
19 uint secs() const;//!< \returns seconds elapsed since it was created
20 bool dark;
21 //protected:
22 // void paintEvent ( QPaintEvent * event ) ;
23
24 private:
25 QString m_labelText;
26 int m_index;
27 uint m_secs;
28 };
29
30 class SaveHistoryWidget;
31
32 //! DragDropVersions is a widget that contains DragVersion s it is used in the SaveHistoryWidget.
33 class DragDropVersions : public QWidget {
34 Q_OBJECT
35 public:
36 DragDropVersions(QString filename, bool d,QWidget *parent = 0);
37 // QString seit(int wann);
38 // QString seitkurzem(int wann);
39 QDateTime now;//!< now is the the current QDateTime.
40 QTimer *tick;//!< tick is a QTime creating ticks every second.
41 bool dark;
42 friend class SaveHistoryWidget;
43 signals:
44 void indexChanged(int index);//!< When a DragVersion is clicked the version viewed changes
45 public slots:
46 void tack();//!< called every second by tick to change the displayed time on each DragVersion
47 protected:
48 // void dragEnterEvent(QDragEnterEvent *event);
49 // void dragMoveEvent(QDragMoveEvent *event);
50 // void dropEvent(QDropEvent *event);
51 void mousePressEvent(QMouseEvent *event);
52 // void mouseMoveEvent(QMouseEvent *event);
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 //! SaveHistoryWidget is a QDialog to load and compare earlier versions of the res file.
61 class SaveHistoryWidget : public QDialog {
62 Q_OBJECT
63 public:
64 SaveHistoryWidget(QString filename, bool _dark, QWidget *parent = 0);
65 QPushButton * ok;//!> the ok button
66 bool dark;
67 //signals:
68 public slots:
69 void tock();
70 void updatePreview(int index);
71 void accept();
72 private:
73 int pvindex;
74 CodeEditor *edi; //!> Editor for the save history file difference.
75 QLabel *pvheader;
76 DragDropVersions *dda;
77 QString fileName,orginal;
78 };
79 #endif
80