progressdialog.h (krename-4.0.9) | : | progressdialog.h (krename-4.90.90) | ||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
/*************************************************************************** | /*************************************************************************** | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
***************************************************************************/ | ***************************************************************************/ | |||
#ifndef _PROGRESS_DIALOG_H_ | #ifndef PROGRESS_DIALOG_H | |||
#define _PROGRESS_DIALOG_H_ | #define PROGRESS_DIALOG_H | |||
#include <QDialog> | #include <QDialog> | |||
#include "ui_progressdialog.h" | #include "ui_progressdialog.h" | |||
#include "krenamefile.h" | #include "krenamefile.h" | |||
class BatchRenamer; | class BatchRenamer; | |||
class ProgressDialog : public QDialog { | class ProgressDialog : public QDialog | |||
{ | ||||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
ProgressDialog( ESplitMode eSplitMode, unsigned int dot, QWidget* parent = N | ProgressDialog(ESplitMode eSplitMode, unsigned int dot, QWidget *parent = nu | |||
ULL ); | llptr); | |||
/** Set the destination of the files | /** Set the destination of the files | |||
* so that the user can easily open a file browser | * so that the user can easily open a file browser | |||
* theres. | * theres. | |||
* | * | |||
* @param dest the destination directory | * @param dest the destination directory | |||
*/ | */ | |||
inline void setDestination( const KUrl & dest ); | inline void setDestination(const QUrl &dest); | |||
/** Set the number of total steps in the progressbar | /** Set the number of total steps in the progressbar | |||
* which is displayed to the user. | * which is displayed to the user. | |||
* | * | |||
* @param t the number of steps | * @param t the number of steps | |||
*/ | */ | |||
inline void setProgressTotalSteps( int t ); | inline void setProgressTotalSteps(int t); | |||
/** Set the current progress | /** Set the current progress | |||
* | * | |||
* @param p current progress (must be smaller | * @param p current progress (must be smaller | |||
* than the total number of steps and bigger than 0) | * than the total number of steps and bigger than 0) | |||
* | * | |||
* \see setProgressTotalSteps | * \see setProgressTotalSteps | |||
*/ | */ | |||
inline void setProgress( int p ); | inline void setProgress(int p); | |||
/** | /** | |||
* @returns true if the user has cancelled the operation (otherwise false) | * @returns true if the user has cancelled the operation (otherwise false) | |||
*/ | */ | |||
inline bool wasCancelled() const; | inline bool wasCancelled() const; | |||
/* | /* | |||
inline void setDestination( const KURL & dir ); | inline void setDestination( const KURL & dir ); | |||
inline void setRenamedFiles( RenamedList* list, unsigned int size ) ; | inline void setRenamedFiles( RenamedList* list, unsigned int size ) ; | |||
inline void setCreatedDirectories( const KURL::List & list ); | inline void setCreatedDirectories( const KURL::List & list ); | |||
* */ | * */ | |||
//void done( int errors, int successfull, bool allowundo ); | //void done( int errors, int successful, bool allowundo ); | |||
/** Print an information message to the user | /** Print an information message to the user | |||
* | * | |||
* @param text message | * @param text message | |||
* @param pixmap an optional icon | * @param pixmap an optional icon | |||
*/ | */ | |||
void print( const QString & text, const QString & pixmap = NULL ); | void print(const QString &text, const QString &pixmap = nullptr); | |||
/** Print an error message to the user | /** Print an error message to the user | |||
* | * | |||
* @param text message | * @param text message | |||
*/ | */ | |||
void error( const QString & text ); | void error(const QString &text); | |||
/** Print a warning message to the user | /** Print a warning message to the user | |||
* | * | |||
* @param text message | * @param text message | |||
*/ | */ | |||
void warning( const QString & text ); | void warning(const QString &text); | |||
/** Renaming is done. | /** Renaming is done. | |||
* | * | |||
* Mostly used to disable the cancel button | * Mostly used to disable the cancel button | |||
* and enable other buttons | * and enable other buttons | |||
* | * | |||
* @param enableMore if ture the more button will be enabled | * @param enableMore if ture the more button will be enabled | |||
* @param enableUndo if true the undo button will be enabled | * @param enableUndo if true the undo button will be enabled | |||
* @param batchRename is a handle to a batchrenamer instance that can be us ed to undo the operation and | * @param batchRename is a handle to a batchrenamer instance that can be us ed to undo the operation and | |||
* to determine URLs for a new renaming session | * to determine URLs for a new renaming session | |||
* @param errros the number of errors that have occurred. If errors have oc cured the user | * @param errros the number of errors that have occurred. If errors have oc curred the user | |||
* has the extra possibility to only rename files with errors again | * has the extra possibility to only rename files with errors again | |||
*/ | */ | |||
void renamingDone( bool enableMore, bool enableUndo, BatchRenamer* renamer, | void renamingDone(bool enableMore, bool enableUndo, BatchRenamer *renamer, i | |||
int errors ); | nt errors); | |||
private Q_SLOTS: | ||||
/** Called when the user cancels the operation | ||||
*/ | ||||
void slotCancelled(); | ||||
/** Called when the users presses the "Open Destination..." button | ||||
*/ | ||||
void slotOpenDestination(); | ||||
/** Called when the user wants to rename some more files | ||||
*/ | ||||
void slotRestartKRename(); | ||||
private slots: | /** Called when the user wants to rename all files again | |||
/** Called when the user cancels the operation | * that have been processed without an error. | |||
*/ | */ | |||
void slotCancelled(); | void slotRenameProcessedAgain(); | |||
/** Called when the users presses the "Open Destination..." button | /** Called when the user wants to rename all files again | |||
*/ | * that have been processed with an error. | |||
void slotOpenDestination(); | */ | |||
void slotRenameUnprocessedAgain(); | ||||
/** Called when the user wants to rename some more files | ||||
*/ | /** Called when the user wants to rename all files again. | |||
void slotRestartKRename(); | */ | |||
void slotRenameAllAgain(); | ||||
/** Called when the user wants to rename all files again | ||||
* that have been processed without an error. | /** Called when the user wants instant undo | |||
*/ | */ | |||
void slotRenameProcessedAgain(); | void slotUndo(); | |||
/** Called when the user wants to rename all files again | ||||
* that have been processed with an error. | ||||
*/ | ||||
void slotRenameUnprocessedAgain(); | ||||
/** Called when the user wants to rename all files again. | ||||
*/ | ||||
void slotRenameAllAgain(); | ||||
/** Called when the user wants instant undo | ||||
*/ | ||||
void slotUndo(); | ||||
private: | private: | |||
Ui::ProgressDialog m_widget; | Ui::ProgressDialog m_widget; | |||
bool m_canceled; ///< the current canceled state | bool m_canceled; ///< the current canceled state | |||
BatchRenamer* m_renamer; ///< A BatchRenamer that can undo the operation | BatchRenamer *m_renamer; ///< A BatchRenamer that can undo the operation | |||
KUrl m_dest; ///< files destination | QUrl m_dest; ///< files destination | |||
QPushButton* m_buttonUndo; | QPushButton *m_buttonUndo; | |||
QPushButton* m_buttonMore; | QPushButton *m_buttonMore; | |||
QPushButton* m_buttonDest; | QPushButton *m_buttonDest; | |||
QPushButton* m_buttonClose; | QPushButton *m_buttonClose; | |||
QAction* m_actProcessed; | QAction *m_actProcessed; | |||
QAction* m_actUnprocessed; | QAction *m_actUnprocessed; | |||
ESplitMode m_eSplitMode; | ESplitMode m_eSplitMode; | |||
unsigned int m_dot; | unsigned int m_dot; | |||
}; | }; | |||
void ProgressDialog::setDestination( const KUrl & dest ) | void ProgressDialog::setDestination(const QUrl &dest) | |||
{ | { | |||
m_dest = dest; | m_dest = dest; | |||
} | } | |||
void ProgressDialog::setProgressTotalSteps( int t ) | void ProgressDialog::setProgressTotalSteps(int t) | |||
{ | { | |||
m_widget.bar->setMaximum( t ); | m_widget.bar->setMaximum(t); | |||
} | } | |||
void ProgressDialog::setProgress( int p ) | void ProgressDialog::setProgress(int p) | |||
{ | { | |||
m_widget.bar->setValue( p ); | m_widget.bar->setValue(p); | |||
} | } | |||
bool ProgressDialog::wasCancelled() const | bool ProgressDialog::wasCancelled() const | |||
{ | { | |||
return m_canceled; | return m_canceled; | |||
} | } | |||
#endif // _PROGRESS_DIALOG_H_ | #endif // PROGRESS_DIALOG_H | |||
End of changes. 23 change blocks. | ||||
60 lines changed or deleted | 61 lines changed or added |