• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

jobuidelegate.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
00003                        David Faure <faure@kde.org>
00004     Copyright (C) 2006 Kevin Ottens <ervin@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #include "jobuidelegate.h"
00023 #include <kdebug.h>
00024 
00025 #include <kmessagebox.h>
00026 #include <kjob.h>
00027 #include <QPointer>
00028 #include <QWidget>
00029 
00030 #include "kio/scheduler.h"
00031 
00032 #if defined Q_WS_X11
00033 #include <QX11Info>
00034 #include <netwm.h>
00035 #endif
00036 
00037 class KIO::JobUiDelegate::Private
00038 {
00039 public:
00040 };
00041 
00042 KIO::JobUiDelegate::JobUiDelegate()
00043     : d(new Private())
00044 {
00045 }
00046 
00047 KIO::JobUiDelegate::~JobUiDelegate()
00048 {
00049     delete d;
00050 }
00051 
00052 void KIO::JobUiDelegate::setWindow(QWidget *window)
00053 {
00054     KDialogJobUiDelegate::setWindow(window);
00055     KIO::Scheduler::registerWindow(window);
00056 }
00057 
00058 KIO::RenameDialog_Result KIO::JobUiDelegate::askFileRename(KJob * job,
00059                                                            const QString & caption,
00060                                                            const QString& src,
00061                                                            const QString & dest,
00062                                                            KIO::RenameDialog_Mode mode,
00063                                                            QString& newDest,
00064                                                            KIO::filesize_t sizeSrc,
00065                                                            KIO::filesize_t sizeDest,
00066                                                            time_t ctimeSrc,
00067                                                            time_t ctimeDest,
00068                                                            time_t mtimeSrc,
00069                                                            time_t mtimeDest)
00070 {
00071     kDebug() << "Observer::RenameDialog::open job=" << job;
00072     // We now do it in process => KDE4: move this code out of Observer (back to job.cpp), so that
00073     // opening the rename dialog doesn't start uiserver for nothing if progressId=0 (e.g. F2 in konq)
00074     KIO::RenameDialog dlg( window(), caption, src, dest, mode,
00075                                                      sizeSrc, sizeDest,
00076                                                      ctimeSrc, ctimeDest, mtimeSrc,
00077                                                      mtimeDest);
00078     KIO::RenameDialog_Result res = static_cast<RenameDialog_Result>(dlg.exec());
00079     newDest = dlg.newDestUrl().path();
00080     return res;
00081 }
00082 
00083 KIO::SkipDialog_Result KIO::JobUiDelegate::askSkip(KJob *,
00084                                               bool multi,
00085                                               const QString & error_text)
00086 {
00087     // We now do it in process. So this method is a useless wrapper around KIO::open_RenameDialog.
00088     KIO::SkipDialog dlg( window(), multi, error_text );
00089     return static_cast<KIO::SkipDialog_Result>(dlg.exec());
00090 }
00091 
00092 #include "jobuidelegate.moc"

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal