You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
4.8 KiB
165 lines
4.8 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
Copyright (C) 2000 Matej Koss <koss@miesto.sk>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License version 2 as published by the Free Software Foundation.
|
||
|
|
||
|
This library 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
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
#ifndef __defaultprogress_h__
|
||
|
#define __defaultprogress_h__
|
||
|
|
||
15 years ago
|
#include <tqlabel.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdeio/global.h>
|
||
15 years ago
|
|
||
|
#include <kprogress.h>
|
||
|
|
||
|
#include "progressbase.h"
|
||
|
|
||
|
class KLineEdit;
|
||
|
|
||
12 years ago
|
namespace TDEIO {
|
||
15 years ago
|
|
||
|
/*
|
||
|
* A default implementation of the progress dialog ProgressBase.
|
||
|
* ProgressBase
|
||
|
*/
|
||
12 years ago
|
class TDEIO_EXPORT DefaultProgress : public ProgressBase {
|
||
15 years ago
|
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
/**
|
||
|
* Creates a new default progress dialog.
|
||
|
* @param showNow true to show immediately, false to show when
|
||
|
* needed
|
||
|
*/
|
||
|
DefaultProgress( bool showNow = true );
|
||
|
/**
|
||
|
* Creates a new default progress dialog.
|
||
|
* @param parent the parent of the dialog (or 0 for top-level)
|
||
|
* @param name the name of the dialog, can be 0
|
||
|
* @since 3.1
|
||
|
*/
|
||
15 years ago
|
DefaultProgress( TQWidget* parent, const char* name = 0 );
|
||
15 years ago
|
~DefaultProgress();
|
||
|
|
||
|
bool keepOpen() const;
|
||
|
|
||
|
/// Shared with uiserver.cpp
|
||
15 years ago
|
static TQString makePercentString( unsigned long percent,
|
||
12 years ago
|
TDEIO::filesize_t totalSize,
|
||
15 years ago
|
unsigned long totalFiles );
|
||
|
|
||
|
public slots:
|
||
12 years ago
|
virtual void slotTotalSize( TDEIO::Job *job, TDEIO::filesize_t size );
|
||
|
virtual void slotTotalFiles( TDEIO::Job *job, unsigned long files );
|
||
|
virtual void slotTotalDirs( TDEIO::Job *job, unsigned long dirs );
|
||
15 years ago
|
|
||
12 years ago
|
virtual void slotProcessedSize( TDEIO::Job *job, TDEIO::filesize_t bytes );
|
||
|
virtual void slotProcessedFiles( TDEIO::Job *job, unsigned long files );
|
||
|
virtual void slotProcessedDirs( TDEIO::Job *job, unsigned long dirs );
|
||
15 years ago
|
|
||
12 years ago
|
virtual void slotSpeed( TDEIO::Job *job, unsigned long speed );
|
||
|
virtual void slotPercent( TDEIO::Job *job, unsigned long percent );
|
||
15 years ago
|
/**
|
||
|
* Called to set an information message.
|
||
12 years ago
|
* @param job the TDEIO::Job
|
||
15 years ago
|
* @param msg the message to set
|
||
|
*/
|
||
12 years ago
|
virtual void slotInfoMessage( TDEIO::Job *job, const TQString & msg );
|
||
15 years ago
|
|
||
12 years ago
|
virtual void slotCopying( TDEIO::Job* job, const KURL& src, const KURL& dest );
|
||
|
virtual void slotMoving( TDEIO::Job* job, const KURL& src, const KURL& dest );
|
||
|
virtual void slotDeleting( TDEIO::Job* job, const KURL& url );
|
||
15 years ago
|
/**
|
||
|
* Called when the job is transferring.
|
||
12 years ago
|
* @param job the TDEIO::Job
|
||
15 years ago
|
* @param url the url to transfer
|
||
|
* @since 3.1
|
||
|
*/
|
||
12 years ago
|
void slotTransferring( TDEIO::Job* job, const KURL& url );
|
||
|
virtual void slotCreatingDir( TDEIO::Job* job, const KURL& dir );
|
||
15 years ago
|
/**
|
||
|
* Called when the job is requesting a stat.
|
||
12 years ago
|
* @param job the TDEIO::Job
|
||
15 years ago
|
* @param dir the dir to stat
|
||
|
* @since 3.1
|
||
|
*/
|
||
12 years ago
|
virtual void slotStating( TDEIO::Job* job, const KURL& dir );
|
||
15 years ago
|
/**
|
||
|
* Called when the job is mounting.
|
||
12 years ago
|
* @param job the TDEIO::Job
|
||
15 years ago
|
* @param dev the device to mount
|
||
|
* @param point the mount point
|
||
|
*/
|
||
12 years ago
|
virtual void slotMounting( TDEIO::Job* job, const TQString & dev, const TQString & point );
|
||
15 years ago
|
/**
|
||
|
* Called when the job is unmounting.
|
||
12 years ago
|
* @param job the TDEIO::Job
|
||
15 years ago
|
* @param point the mount point
|
||
|
*/
|
||
12 years ago
|
virtual void slotUnmounting( TDEIO::Job* job, const TQString & point );
|
||
|
virtual void slotCanResume( TDEIO::Job* job, TDEIO::filesize_t from);
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Called when the job is cleaned.
|
||
|
* @since 3.1
|
||
|
*/
|
||
|
void slotClean();
|
||
|
|
||
|
protected:
|
||
|
/// @since 3.1
|
||
|
void init();
|
||
|
void showTotals();
|
||
|
void setDestVisible( bool visible );
|
||
|
/// @since 3.1
|
||
|
void checkDestination( const KURL& dest);
|
||
|
|
||
|
KLineEdit* sourceEdit;
|
||
|
KLineEdit* destEdit;
|
||
15 years ago
|
TQLabel* progressLabel;
|
||
|
TQLabel* destInvite;
|
||
|
TQLabel* speedLabel;
|
||
|
TQLabel* sizeLabel;
|
||
|
TQLabel* resumeLabel;
|
||
15 years ago
|
|
||
|
KProgress* m_pProgressBar;
|
||
|
|
||
12 years ago
|
TDEIO::filesize_t m_iTotalSize;
|
||
15 years ago
|
unsigned long m_iTotalFiles;
|
||
|
unsigned long m_iTotalDirs;
|
||
|
|
||
12 years ago
|
TDEIO::filesize_t m_iProcessedSize;
|
||
15 years ago
|
unsigned long m_iProcessedDirs;
|
||
|
unsigned long m_iProcessedFiles;
|
||
|
|
||
|
enum ModeType { Copy, Move, Delete, Create, Done };
|
||
|
ModeType mode;
|
||
|
|
||
|
protected:
|
||
|
virtual void virtual_hook( int id, void* data );
|
||
|
private:
|
||
|
class DefaultProgressPrivate;
|
||
|
DefaultProgressPrivate* d;
|
||
|
private slots:
|
||
|
void slotKeepOpenToggled(bool);
|
||
|
void slotOpenFile();
|
||
|
void slotOpenLocation();
|
||
|
};
|
||
|
|
||
|
} /* namespace */
|
||
|
|
||
|
#endif // __defaultprogress_h__
|
||
|
|