1 /***************************************************************************
2  *   Copyright (C) 2005-2009 by Rajko Albrecht                             *
3  *   ral@alwins-world.de                                                   *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20 #ifndef STOPDLG_H
21 #define STOPDLG_H
22 
23 #include "svnfrontend/fronthelpers/cursorstack.h"
24 
25 #include <QDialog>
26 #include <QTime>
27 
28 class QDialogButtonBox;
29 class QTimer;
30 class QLabel;
31 class QProgressBar;
32 class QTextBrowser;
33 class QHideEvent;
34 class QShowEvent;
35 class QVBoxLayout;
36 class CContextListener;
37 
38 /**
39 @author Rajko Albrecht
40 */
41 class StopDlg : public QDialog
42 {
43     Q_OBJECT
44 public:
45     StopDlg(CContextListener *listener, QWidget *parent, const QString &caption, const QString &text);
46     ~StopDlg();
47 
48 protected:
49     int m_MinDuration;
50     bool mCancelled;
51     QTimer *mShowTimer;
52     bool mShown, mWait;
53     QLabel *mLabel;
54     QProgressBar *m_ProgressBar;
55     QProgressBar *m_NetBar;
56     bool m_BarShown;
57     bool m_netBarShown;
58     QTime m_StopTick;
59     QTextBrowser *m_LogWindow;
60     QVBoxLayout *layout, *mainLayout;
61 
62     QString m_lastLog;
63     unsigned int m_lastLogLines;
64     CursorStack *cstack;
65     QDialogButtonBox *m_bBox;
66 
67     void showEvent(QShowEvent *e) override;
68     void hideEvent(QHideEvent *e) override;
69 
70 public slots:
71     virtual void slotTick();
72     virtual void slotWait(bool);
73     virtual void slotExtraMessage(const QString &);
74 
75 protected slots:
76     virtual void slotAutoShow();
77     virtual void slotCancel();
78     virtual void slotNetProgres(long long int, long long int);
79 signals:
80     void sigCancel(bool how);
81 };
82 
83 #endif
84