FIX issue #19 where multiple widget values led to bad replacements in the command
[qgit4/redivivus.git] / src / smartbrowse.h
blob7c76255f355a8aafd188bee403d82649b2deebce
1 /*
2 Author: Marco Costalba (C) 2005-2007
4 Copyright: See COPYING file that comes with this distribution
6 */
7 #ifndef SMARTBROWSE_H
8 #define SMARTBROWSE_H
10 #include <QElapsedTimer>
11 #include <QLabel>
12 #include "revsview.h"
14 class SmartLabel : public QLabel {
15 Q_OBJECT
16 public:
17 SmartLabel(const QString& text, QWidget* par);
18 void paintEvent(QPaintEvent* event);
20 protected:
21 virtual void contextMenuEvent(QContextMenuEvent* e);
23 private slots:
24 void switchLinks();
27 class SmartBrowse : public QObject {
28 Q_OBJECT
29 public:
30 SmartBrowse(RevsView* par);
32 protected:
33 bool eventFilter(QObject *obj, QEvent *event);
35 public slots:
36 void updateVisibility();
37 void linkActivated(const QString&);
38 void flagChanged(uint);
40 private:
41 QTextEdit* curTextEdit(bool* isDiff = NULL);
42 void setVisible(bool b);
43 void updatePosition();
44 int visibilityFlags(bool* isDiff = NULL);
45 bool wheelRolled(int delta, int flags);
47 RevsView* rv;
48 SmartLabel* logTopLbl;
49 SmartLabel* logBottomLbl;
50 SmartLabel* diffTopLbl;
51 SmartLabel* diffBottomLbl;
52 QElapsedTimer scrollTimer, switchTimer, timeoutTimer;
53 int wheelCnt;
54 bool lablesEnabled;
57 #endif