svgui
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2007-2008 QMUL. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _PROGRESS_DIALOG_H_ 00017 00018 #include "base/ProgressReporter.h" 00019 00020 class QProgressDialog; 00021 class QTimer; 00022 00023 class ProgressDialog : public ProgressReporter 00024 { 00025 Q_OBJECT 00026 00027 public: 00028 ProgressDialog(QString message, bool cancellable, 00029 int timeBeforeShow = 0, QWidget *parent = 0); 00030 virtual ~ProgressDialog(); 00031 00032 virtual bool isDefinite() const; 00033 virtual void setDefinite(bool definite); 00034 00035 virtual bool wasCancelled() const; 00036 00037 signals: 00038 void showing(); 00039 void cancelled(); 00040 00041 public slots: 00042 virtual void setMessage(QString text); 00043 virtual void setProgress(int percentage); 00044 00045 protected slots: 00046 virtual void showTimerElapsed(); 00047 void canceled(); 00048 00049 protected: 00050 QProgressDialog *m_dialog; 00051 QTimer *m_showTimer; 00052 bool m_timerElapsed; 00053 bool m_cancelled; 00054 }; 00055 00056 #endif