diff options
| author | Holger Freyther <[email protected]> | 2006-11-29 09:30:41 +0000 |
|---|---|---|
| committer | Holger Freyther <[email protected]> | 2006-11-29 09:30:41 +0000 |
| commit | 9a4a17dd4d7f3d195ab4393e057e8eb90b0a3422 (patch) | |
| tree | 1f6b6146a37e8289e8585f9e738cc3cd571812d6 /src/dolphinmainwindow.cpp | |
| parent | 9b9bad8abe16609d400eb25118e86adc5b19e9e4 (diff) | |
Changes to Undo/Redo in regard to ProgressIndicator
It was not important to know where the operation was
executed, it is important where undo/redo was clicked
and this solely indicates where the progress should be
shown.
Now undo/redo get the MainWindow and can pass that to
ProgressIndicator.
I'm about to revive m_progressIndicator again
svn path=/trunk/playground/utils/dolphin/; revision=609020
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 0d4667db7..af9bd0a01 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -313,6 +313,16 @@ void DolphinMainWindow::slotSelectionChanged() emit selectionChanged(); } +void DolphinMainWindow::slotRedo() +{ + UndoManager::instance().redo(this); +} + +void DolphinMainWindow::slotUndo() +{ + UndoManager::instance().undo(this); +} + void DolphinMainWindow::closeEvent(QCloseEvent* event) { // KDE4-TODO @@ -417,7 +427,7 @@ void DolphinMainWindow::createFolder() statusBar->setMessage(i18n("Created folder %1.",url.path()), DolphinStatusBar::OperationCompleted); - DolphinCommand command(DolphinCommand::CreateFolder, KUrl::List(), url, this); + DolphinCommand command(DolphinCommand::CreateFolder, KUrl::List(), url); UndoManager::instance().addCommand(command); } else { @@ -524,7 +534,7 @@ void DolphinMainWindow::createFile() KUrl::List list; list.append(sourceUrl); - DolphinCommand command(DolphinCommand::CreateFile, list, destUrl, this); + DolphinCommand command(DolphinCommand::CreateFile, list, destUrl); UndoManager::instance().addCommand(command); } @@ -1233,16 +1243,16 @@ void DolphinMainWindow::setupActions() // setup 'Edit' menu UndoManager& undoManager = UndoManager::instance(); - KStdAction::undo(&undoManager, - SLOT(undo()), + KStdAction::undo(this, + SLOT(slotUndo()), actionCollection()); connect(&undoManager, SIGNAL(undoAvailable(bool)), this, SLOT(slotUndoAvailable(bool))); connect(&undoManager, SIGNAL(undoTextChanged(const QString&)), this, SLOT(slotUndoTextChanged(const QString&))); - KStdAction::redo(&undoManager, - SLOT(redo()), + KStdAction::redo(this, + SLOT(slotRedo()), actionCollection()); connect(&undoManager, SIGNAL(redoAvailable(bool)), this, SLOT(slotRedoAvailable(bool))); @@ -1625,7 +1635,7 @@ void DolphinMainWindow::addPendingUndoJob(KIO::Job* job, UndoInfo undoInfo; undoInfo.id = job->progressId(); - undoInfo.command = DolphinCommand(commandType, source, dest, this); + undoInfo.command = DolphinCommand(commandType, source, dest); m_pendingUndoJobs.append(undoInfo); } |
