|
From: Gustavo P. B. <gb...@us...> - 2005-06-23 19:39:08
|
Update of /cvsroot/kimageprocess/kimageprocess/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16273 Modified Files: kimageprocess.cpp kimageprocess.h ktprogressbar.cpp ktprogressbar_ui.ui Log Message: - Fixed progressbar stuff - added (testing) code for progressbar Index: kimageprocess.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/kimageprocess.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- kimageprocess.h 23 Jun 2005 18:32:24 -0000 1.10 +++ kimageprocess.h 23 Jun 2005 19:39:00 -0000 1.11 @@ -43,6 +43,7 @@ class KTMethodManager; class KTListView; class KRecentFilesAction; +class KTProgressBar; /** * This class serves as the main window for KImageProcess. It handles the @@ -117,12 +118,15 @@ void fileOpen(const KURL &url); + void calculationFinished(); + private: void setupAccel(); void setupActions(); KTSideBar *m_sideBar; KImageProcessView *m_view; + KTProgressBar *m_progressBar; KPrinter *m_printer; KToggleAction *m_toolbarAction; Index: ktprogressbar.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/ktprogressbar.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ktprogressbar.cpp 23 Jun 2005 19:29:40 -0000 1.2 +++ ktprogressbar.cpp 23 Jun 2005 19:39:00 -0000 1.3 @@ -24,6 +24,8 @@ #include <kprogress.h> #include <kpushbutton.h> +#include <qlayout.h> + #include "ktprogressbar.h" KTProgressBar::KTProgressBar(QWidget *parent, const char *name) : QFrame(parent, name) @@ -32,6 +34,8 @@ layout->setAutoAdd(true); m_ui = new ProgressBarUI(this); m_ui->show(); + + resize(332,112); } void KTProgressBar::startAction(int progressSteps, const QString& initialText) Index: kimageprocess.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/kimageprocess.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- kimageprocess.cpp 23 Jun 2005 18:32:24 -0000 1.22 +++ kimageprocess.cpp 23 Jun 2005 19:39:00 -0000 1.23 @@ -30,10 +30,13 @@ #include "ktfeaturemanager.h" #include "ktmethodmanager.h" #include "ktlistview.h" +#include "ktprogressbar.h" +#include "ktcalculation.h" #include <qdragobject.h> #include <qlayout.h> #include <qregexp.h> +#include <qtimer.h> #include <kglobal.h> #include <klocale.h> @@ -83,6 +86,8 @@ m_view->sizePolicy().setHorStretch( 4 ); m_view->sizePolicy().setHorData(QSizePolicy::Expanding); + m_progressBar = new KTProgressBar(); + // accept dnd setAcceptDrops(true); @@ -141,11 +146,22 @@ KTMethodManager::self()->loadMethods(); KTFeatureManager::self()->loadFeatures(); + + + //progress bar stuff + KTCalculation *calc = KTCalculation::self(); + connect(calc, SIGNAL(updateProgress()), + m_progressBar, SLOT(advanceProgress())); + connect(calc, SIGNAL(finished()), + this, SLOT(calculationFinished())); + } KImageProcess::~KImageProcess() { KConfig cfg("kimageprocessrc"); + + delete m_progressBar; m_recentFiles->saveEntries(&cfg); @@ -415,10 +431,18 @@ void KImageProcess::projectCalculateSampleData() { + m_progressBar->startAction(3, i18n("Calculating sample data...")); + m_progressBar->show(); + + QTimer::singleShot(0, KTCalculation::self(), SLOT(calculateSampleData())); } void KImageProcess::projectCalculateTestData() { + m_progressBar->startAction(5, i18n("Calculating testing data...")); + m_progressBar->show(); + + QTimer::singleShot(0, KTCalculation::self(), SLOT(calculateTestData())); } void KImageProcess::changeStatusbar(const QString& text) @@ -438,4 +462,9 @@ load(url); } +void KImageProcess::calculationFinished() +{ + m_progressBar->close(); +} + #include "kimageprocess.moc" Index: ktprogressbar_ui.ui =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/ktprogressbar_ui.ui,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ktprogressbar_ui.ui 23 Jun 2005 04:26:46 -0000 1.1 +++ ktprogressbar_ui.ui 23 Jun 2005 19:39:00 -0000 1.2 @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ProgressBarUI</class> -<widget class="QDialog"> +<widget class="QWidget"> <property name="name"> <cstring>ProgressBarUI</cstring> </property> @@ -23,9 +23,6 @@ <property name="caption"> <string>Status</string> </property> - <property name="sizeGripEnabled"> - <bool>true</bool> - </property> <widget class="KActiveLabel"> <property name="name"> <cstring>kalStatus</cstring> |