00001 /** 00002 * @class wosh::gui::DialogProgress 00003 * @brief 00004 * 00005 * 00006 * 00007 **************************************************************************** 00008 * @version $Id: DialogProgress.h 3775 2011-01-01 16:38:17Z alex $ 00009 * @author Alessandro Polo 00010 ****************************************************************************/ 00011 /* Copyright (c) 2007-2011, WOSH - Wide Open Smart Home 00012 * by Alessandro Polo - OpenSmartHome.com 00013 * All rights reserved. 00014 * 00015 * Redistribution and use in source and binary forms, with or without 00016 * modification, are permitted provided that the following conditions are met: 00017 * * Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * * Redistributions in binary form must reproduce the above copyright 00020 * notice, this list of conditions and the following disclaimer in the 00021 * documentation and/or other materials provided with the distribution. 00022 * * Neither the name of the OpenSmartHome.com WOSH nor the 00023 * names of its contributors may be used to endorse or promote products 00024 * derived from this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY Alessandro Polo ''AS IS'' AND ANY 00027 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00028 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00029 * DISCLAIMED. IN NO EVENT SHALL Alessandro Polo BE LIABLE FOR ANY 00030 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00031 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00032 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00033 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00034 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 ****************************************************************************/ 00037 00038 #ifndef __WOSH_Gui_DialogProgress_H__ 00039 #define __WOSH_Gui_DialogProgress_H__ 00040 00041 #include <QtGui/QGroupBox> 00042 #include "ui_DialogProgress.h" 00043 00044 00045 namespace wosh { 00046 namespace gui { 00047 00048 00049 class DialogProgress : public QGroupBox { 00050 00051 Q_OBJECT 00052 00053 public: 00054 DialogProgress(QWidget *parent = 0) : QGroupBox(parent) { 00055 this->m_ui = new Ui::DialogProgress(); 00056 this->m_ui->setupUi(this); 00057 i = 0; 00058 connect(this->m_ui->pushButton, SIGNAL(clicked()), this, SLOT(clicked())); 00059 } 00060 00061 virtual ~DialogProgress() { 00062 delete this->m_ui; 00063 } 00064 00065 00066 00067 00068 public slots: 00069 00070 void clicked() { 00071 this->m_ui->pushButton->setText( QString("clicked %1").arg(++i) ); 00072 } 00073 00074 void setTitleText( const QString& text ) { 00075 this->m_ui->lblDialogTitle->setText(text); 00076 } 00077 00078 void setProgressText( const QString& text ) { 00079 this->m_ui->lblDialogProgress->setText(text); 00080 } 00081 00082 void setProgressValue( int value ) { 00083 this->m_ui->progressBarDialog->setValue(value); 00084 } 00085 00086 void setProgress( int value, const QString& text ) { 00087 setProgressValue(value); 00088 setProgressText(text); 00089 } 00090 00091 00092 private: 00093 Ui::DialogProgress *m_ui; 00094 00095 int i; 00096 00097 }; // class def 00098 00099 }; // namespace gui 00100 }; // namespace wosh 00101 00102 00103 #endif //__WOSH_Gui_DialogProgress_H__