org.kde.koala

Class ProgressBase

public class ProgressBase extends QWidget

This class does all initialization stuff for progress, like connecting signals to slots. All slots are implemented as pure methods. All custom IO progress dialog should inherit this class. Add your GUI code to the constructor and implemement those virtual methods which you need in order to display progress. E.g. StatusbarProgress only implements slotTotalSize(), slotPercent() and slotSpeed(). Custom progress dialog will be used like this :
 // create job
 CopyJob job = KIO.copy(...);
 // create a dialog
 MyCustomProgress customProgress;
 customProgress = new MyCustomProgress();
 // connect progress with job
 customProgress.setJob( job );
 ...
 
There is a special method setStopOnClose() that controls the behavior of the dialog. See ProgressBaseSignals for signals emitted by ProgressBase

Author: Matej Koss

UNKNOWN: Base class for IO progress dialogs.

Constructor Summary
protected ProgressBase(Class dummy)
ProgressBase(QWidget parent)
Creates a new progress dialog.
Method Summary
StringclassName()
protected voidcloseEvent(QCloseEvent arg1)
voidfinished()
Call when the operation finished.
QMetaObjectmetaObject()
booleanonlyClean()
Checks whether the dialog should be deleted or cleaned.
voidsetJob(Job job)
Assign a KIO.Job to this progress dialog.
voidsetJob(CopyJob job)
Assign a KIO.Job to this progress dialog.
voidsetJob(DeleteJob job)
Assign a KIO.Job to this progress dialog.
voidsetOnlyClean(boolean onlyClean)
This controls whether the dialog should be deleted or only cleaned when the KIO.Job is finished (or canceled).
voidsetStopOnClose(boolean stopOnClose)
voidslotCanResume(Job job, long from)
Called when the job is resuming..
voidslotClean()
This method is called when the widget should be cleaned (after job is finished). redefine this for custom behavior.
voidslotCopying(Job job, KURL src, KURL dest)
Called when the job is copying.
voidslotCreatingDir(Job job, KURL dir)
Called when the job is creating a directory.
voidslotDeleting(Job job, KURL url)
Called when the job is deleting.
protected voidslotFinished(Job arg1)
voidslotMoving(Job job, KURL src, KURL dest)
Called when the job is moving.
voidslotPercent(Job job, long percent)
Called to set the percentage.
voidslotProcessedDirs(Job job, long dirs)
Called to set the number of processed directories.
voidslotProcessedFiles(Job job, long files)
Called to set the number of processed files.
voidslotProcessedSize(Job job, long bytes)
Called to set the processed size.
voidslotSpeed(Job job, long speed)
Called to set the speed.
voidslotStop()
This method should be called for correct cancellation of IO operation Connect this to the progress widgets buttons etc.
voidslotTotalDirs(Job job, long dirs)
Called to set the total number of directories.
voidslotTotalFiles(Job job, long files)
Called to set the total number of files.
voidslotTotalSize(Job job, long size)
Called to set the total size.
booleanstopOnClose()

Constructor Detail

ProgressBase

protected ProgressBase(Class dummy)

ProgressBase

public ProgressBase(QWidget parent)
Creates a new progress dialog.

Parameters: parent the parent of this dialog window, or 0

UNKNOWN: Creates a new progress dialog.

Method Detail

className

public String className()

closeEvent

protected void closeEvent(QCloseEvent arg1)

finished

public void finished()
Call when the operation finished.

UNKNOWN: Call when the operation finished.

metaObject

public QMetaObject metaObject()

onlyClean

public boolean onlyClean()
Checks whether the dialog should be deleted or cleaned.

Returns: true if the dialog only calls slotClean, false if it will be deleted

See Also: ProgressBase

UNKNOWN: Checks whether the dialog should be deleted or cleaned.

setJob

public void setJob(Job job)
Assign a KIO.Job to this progress dialog.

Parameters: job the job to assign

UNKNOWN: Assign a KIO.Job to this progress dialog.

setJob

public void setJob(CopyJob job)
Assign a KIO.Job to this progress dialog.

Parameters: job the job to assign

UNKNOWN: Assign a KIO.Job to this progress dialog.

setJob

public void setJob(DeleteJob job)
Assign a KIO.Job to this progress dialog.

Parameters: job the job to assign

UNKNOWN: Assign a KIO.Job to this progress dialog.

setOnlyClean

public void setOnlyClean(boolean onlyClean)
This controls whether the dialog should be deleted or only cleaned when the KIO.Job is finished (or canceled). If your dialog is an embedded widget and not a separate window, you should setOnlyClean(true) in the constructor of your custom dialog.

Parameters: onlyClean If true the dialog will only call method slotClean. If false the dialog will be deleted.

See Also: ProgressBase

UNKNOWN: This controls whether the dialog should be deleted or only cleaned when the KIO.Job is finished (or canceled).

setStopOnClose

public void setStopOnClose(boolean stopOnClose)

slotCanResume

public void slotCanResume(Job job, long from)
Called when the job is resuming..

Parameters: job the KIO.Job from the position to resume from in bytes

UNKNOWN: Called when the job is resuming.

slotClean

public void slotClean()
This method is called when the widget should be cleaned (after job is finished). redefine this for custom behavior.

UNKNOWN: This method is called when the widget should be cleaned (after job is finished).

slotCopying

public void slotCopying(Job job, KURL src, KURL dest)
Called when the job is copying.

Parameters: job the KIO.Job src the source of the operation dest the destination of the operation

UNKNOWN: Called when the job is copying.

slotCreatingDir

public void slotCreatingDir(Job job, KURL dir)
Called when the job is creating a directory.

Parameters: job the KIO.Job dir the URL of the directory to create

UNKNOWN: Called when the job is creating a directory.

slotDeleting

public void slotDeleting(Job job, KURL url)
Called when the job is deleting.

Parameters: job the KIO.Job url the URL to delete

UNKNOWN: Called when the job is deleting.

slotFinished

protected void slotFinished(Job arg1)

slotMoving

public void slotMoving(Job job, KURL src, KURL dest)
Called when the job is moving.

Parameters: job the KIO.Job src the source of the operation dest the destination of the operation

UNKNOWN: Called when the job is moving.

slotPercent

public void slotPercent(Job job, long percent)
Called to set the percentage.

Parameters: job the KIO.Job percent the percentage

UNKNOWN: Called to set the percentage.

slotProcessedDirs

public void slotProcessedDirs(Job job, long dirs)
Called to set the number of processed directories.

Parameters: job the KIO.Job dirs the number of directories

UNKNOWN: Called to set the number of processed directories.

slotProcessedFiles

public void slotProcessedFiles(Job job, long files)
Called to set the number of processed files.

Parameters: job the KIO.Job files the number of files

UNKNOWN: Called to set the number of processed files.

slotProcessedSize

public void slotProcessedSize(Job job, long bytes)
Called to set the processed size.

Parameters: job the KIO.Job bytes the processed size in bytes

UNKNOWN: Called to set the processed size.

slotSpeed

public void slotSpeed(Job job, long speed)
Called to set the speed.

Parameters: job the KIO.Job speed the speed in bytes/second

UNKNOWN: Called to set the speed.

slotStop

public void slotStop()
This method should be called for correct cancellation of IO operation Connect this to the progress widgets buttons etc.

UNKNOWN: This method should be called for correct cancellation of IO operation Connect this to the progress widgets buttons etc.

slotTotalDirs

public void slotTotalDirs(Job job, long dirs)
Called to set the total number of directories.

Parameters: job the KIO.Job dirs the number of directories

UNKNOWN: Called to set the total number of directories.

slotTotalFiles

public void slotTotalFiles(Job job, long files)
Called to set the total number of files.

Parameters: job the KIO.Job files the number of files

UNKNOWN: Called to set the total number of files.

slotTotalSize

public void slotTotalSize(Job job, long size)
Called to set the total size.

Parameters: job the KIO.Job size the total size in bytes

UNKNOWN: Called to set the total size.

stopOnClose

public boolean stopOnClose()