diff options
| author | Holger Freyther <[email protected]> | 2006-11-29 00:02:19 +0000 |
|---|---|---|
| committer | Holger Freyther <[email protected]> | 2006-11-29 00:02:19 +0000 |
| commit | f31a541925033c2ef5e27b85c099d47791b50121 (patch) | |
| tree | 11cc728aa7d247ca5b075776c438be0f381be765 /src/progressindicator.cpp | |
| parent | 68e81f7280c810e26cabf6cd2897b9dc8466f458 (diff) | |
Make it (almost) possible to have more than one Dolphin KMainWindow
Create a DolphinApplication, holding DolphinMainWindows and update
the code to use the DolphinView to get the MainWindow, or get a ptr
to the MainWindow directly. Or if all windows are effected go through
the DolphinApplication to update every mainwindow.
The UndowManager and ProgressIndicator have a rather strange relationship
and will need some more attention but as UndoManager will be killed
anyway I have skipped this.
More cleanup, debugging and thinking is needed.
svn path=/trunk/playground/utils/dolphin/; revision=608945
Diffstat (limited to 'src/progressindicator.cpp')
| -rw-r--r-- | src/progressindicator.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/progressindicator.cpp b/src/progressindicator.cpp index a09552c06..b42bc2ea5 100644 --- a/src/progressindicator.cpp +++ b/src/progressindicator.cpp @@ -19,19 +19,21 @@ ***************************************************************************/ #include "progressindicator.h" -#include "dolphin.h" +#include "dolphinmainwindow.h" #include "dolphinstatusbar.h" -ProgressIndicator::ProgressIndicator(const QString& progressText, +ProgressIndicator::ProgressIndicator(DolphinMainWindow* mainWindow, + const QString& progressText, const QString& finishedText, int operationsCount) - : m_showProgress(false), + : m_mainWindow(mainWindow), + m_showProgress(false), m_operationsCount(operationsCount), m_operationsIndex(0), m_startTime(QTime::currentTime()), m_finishedText(finishedText) { - DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar(); + DolphinStatusBar* statusBar = mainWindow->activeView()->statusBar(); statusBar->clear(); statusBar->setProgressText(progressText); statusBar->setProgress(0); @@ -40,13 +42,13 @@ ProgressIndicator::ProgressIndicator(const QString& progressText, ProgressIndicator::~ProgressIndicator() { - DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar(); + DolphinStatusBar* statusBar = m_mainWindow->activeView()->statusBar(); statusBar->setProgressText(QString::null); statusBar->setProgress(100); statusBar->setMessage(m_finishedText, DolphinStatusBar::OperationCompleted); if (m_showProgress) { - Dolphin::mainWin().setEnabled(true); + m_mainWindow->setEnabled(true); } } @@ -59,7 +61,7 @@ void ProgressIndicator::execOperation() if (elapsed > 500) { // the operations took already more than 500 milliseconds, // therefore show a progress indication - Dolphin::mainWin().setEnabled(false); + m_mainWindow->setEnabled(false); m_showProgress = true; } } @@ -69,8 +71,9 @@ void ProgressIndicator::execOperation() if (m_startTime.msecsTo(currentTime) > 100) { m_startTime = currentTime; - DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar(); + DolphinStatusBar* statusBar = m_mainWindow->activeView()->statusBar(); statusBar->setProgress((m_operationsIndex * 100) / m_operationsCount); +#warning "EVIL, DANGER, FIRE" kapp->processEvents(); statusBar->repaint(); } |
