|
From: Herton R. K. <he...@us...> - 2005-06-23 04:26:54
|
Update of /cvsroot/kimageprocess/kimageprocess/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19032 Modified Files: Makefile.am Added Files: ktprogressbar.cpp ktprogressbar.h ktprogressbar_ui.ui Log Message: - Added progress bar classes and QWidget, with may be useful slots. - Cosmetics. --- NEW FILE: ktprogressbar.cpp --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include <kactivelabel.h> #include <klocale.h> #include <kprogress.h> #include <kpushbutton.h> #include "ktprogressbar.h" KTProgressBar::KTProgressBar(QWidget *parent, const char *name) : QFrame(parent, name) { m_ui = new ProgressBarUI(this); } void KTProgressBar::startAction(int progressSteps, const QString& initialText) { m_ui->kalStatus->setText(initialText); m_ui->kpStatus->reset(); m_ui->kpStatus->setTotalSteps(progressSteps); } void KTProgressBar::finishAction() { m_ui->kalStatus->setText(i18n("Finished.")); m_ui->kpStatus->setProgress(m_ui->kpStatus->totalSteps()); } void KTProgressBar::updateText(const QString& text) { m_ui->kalStatus->setText(text); } void KTProgressBar::advanceProgress() { int p = m_ui->kpStatus->progress(); m_ui->kpStatus->setProgress(++p); } #include "ktprogressbar.moc" Index: Makefile.am =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 23 Mar 2005 20:47:54 -0000 1.6 +++ Makefile.am 23 Jun 2005 04:26:46 -0000 1.7 @@ -15,13 +15,14 @@ libktimgview/libktimgview.la $(LIB_KFILE) $(LIB_KDEPRINT) # which sources should be compiled for kimageprocess -kimageprocess_SOURCES = main.cpp kimageprocess.cpp kimageprocessview.cpp pref.cpp \ - kimageprocessiface.skel ktfeaturechooser.cpp ktfeaturechooser_ui.ui kimageprocessoptions_ui.ui \ - kttextureoptions.cpp ktsidebar.cpp \ - ktlistview.cpp +kimageprocess_SOURCES = main.cpp kimageprocess.cpp kimageprocessview.cpp \ + pref.cpp kimageprocessiface.skel ktfeaturechooser.cpp ktfeaturechooser_ui.ui \ + kimageprocessoptions_ui.ui kttextureoptions.cpp ktsidebar.cpp ktlistview.cpp \ + ktprogressbar_ui.ui ktprogressbar.cpp # these are the headers for your project -noinst_HEADERS = kimageprocess.h kimageprocessview.h pref.h ktlistview.h +noinst_HEADERS = kimageprocess.h kimageprocessview.h pref.h ktlistview.h \ + ktprogressbar.h # let automoc handle all of the meta source files (moc) --- NEW FILE: ktprogressbar.h --- /*************************************************************************** * Copyright (C) 2004 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef KTPROGRESSBAR_H #define KTPROGRESSBAR_H #include <ktprogressbar_ui.h> class KTProgressBar : public QFrame { Q_OBJECT public: KTProgressBar(QWidget *parent = 0, const char *name = 0); private: ProgressBarUI *m_ui; public slots: void startAction(int progressSteps, const QString& initialText); void finishAction(); void updateText(const QString& text); void advanceProgress(); }; #endif --- NEW FILE: ktprogressbar_ui.ui --- <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ProgressBarUI</class> <widget class="QDialog"> <property name="name"> <cstring>ProgressBarUI</cstring> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>332</width> <height>112</height> </rect> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>5</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="caption"> <string>Status</string> </property> <property name="sizeGripEnabled"> <bool>true</bool> </property> <widget class="KActiveLabel"> <property name="name"> <cstring>kalStatus</cstring> </property> <property name="geometry"> <rect> <x>10</x> <y>10</y> <width>310</width> <height>21</height> </rect> </property> <property name="text"> <string>Text status</string> </property> </widget> <widget class="KProgress"> <property name="name"> <cstring>kpStatus</cstring> </property> <property name="geometry"> <rect> <x>10</x> <y>40</y> <width>310</width> <height>25</height> </rect> </property> </widget> <widget class="KPushButton"> <property name="name"> <cstring>kpbCancel</cstring> </property> <property name="geometry"> <rect> <x>210</x> <y>70</y> <width>111</width> <height>31</height> </rect> </property> <property name="text"> <string>Ca&ncel</string> </property> <property name="accel"> <string>Alt+N</string> </property> </widget> </widget> <layoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kactivelabel.h</includehint> <includehint>kprogress.h</includehint> <includehint>kpushbutton.h</includehint> </includehints> </UI> |