Changeset View
Changeset View
Standalone View
Standalone View
krusader/Dialogs/krpleasewait.h
Show All 37 Lines | |||||
38 | { | 38 | { | ||
39 | Q_OBJECT | 39 | Q_OBJECT | ||
40 | 40 | | |||
41 | public: | 41 | public: | ||
42 | explicit KRPleaseWaitHandler(QWidget *parentWindow); | 42 | explicit KRPleaseWaitHandler(QWidget *parentWindow); | ||
43 | 43 | | |||
44 | public slots: | 44 | public slots: | ||
45 | 45 | | |||
46 | void startWaiting(QString msg, int count = 0, bool cancel = false); | 46 | void startWaiting(const QString& msg, int count = 0, bool cancel = false); | ||
47 | void stopWait(); | 47 | void stopWait(); | ||
48 | void cycleProgress(); | 48 | void cycleProgress(); | ||
49 | void incProgress(int i); | 49 | void incProgress(int i); | ||
50 | void killJob(); | 50 | void killJob(); | ||
51 | void setJob(KIO::Job* j); | 51 | void setJob(KIO::Job* j); | ||
52 | bool wasCancelled() const { | 52 | bool wasCancelled() const { | ||
53 | return _wasCancelled; | 53 | return _wasCancelled; | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | private: | 56 | private: | ||
57 | QWidget *_parentWindow; | 57 | QWidget *_parentWindow; | ||
58 | QPointer<KIO::Job> job; | 58 | QPointer<KIO::Job> job; | ||
59 | KRPleaseWait * dlg; | 59 | KRPleaseWait * dlg; | ||
60 | bool cycle, cycleMutex, incMutex, _wasCancelled; | 60 | bool cycle, cycleMutex, incMutex, _wasCancelled; | ||
61 | }; | 61 | }; | ||
62 | 62 | | |||
63 | 63 | | |||
64 | class KRPleaseWait : public QProgressDialog | 64 | class KRPleaseWait : public QProgressDialog | ||
65 | { | 65 | { | ||
66 | Q_OBJECT | 66 | Q_OBJECT | ||
67 | public: | 67 | public: | ||
68 | KRPleaseWait(QString msg, QWidget *parent, int count = 0 , bool cancel = false); | 68 | KRPleaseWait(const QString& msg, QWidget *parent, int count = 0 , bool cancel = false); | ||
69 | 69 | | |||
70 | public slots: | 70 | public slots: | ||
71 | void incProgress(int howMuch); | 71 | void incProgress(int howMuch); | ||
72 | void cycleProgress(); | 72 | void cycleProgress(); | ||
73 | 73 | | |||
74 | protected: | 74 | protected: | ||
75 | bool inc; | 75 | bool inc; | ||
76 | QTimer* timer; | 76 | QTimer* timer; | ||
77 | virtual void closeEvent(QCloseEvent * e) Q_DECL_OVERRIDE; | 77 | void closeEvent(QCloseEvent * e) Q_DECL_OVERRIDE; | ||
78 | bool canClose; | 78 | bool canClose; | ||
79 | }; | 79 | }; | ||
80 | 80 | | |||
81 | #endif | 81 | #endif |