KRename – powerful batch renamer
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.

131 lines
3.5KB

  1. /***************************************************************************
  2. ProgressDialog.h - description
  3. -------------------
  4. begin : Die Mai 15 15:34:19 CEST 2001
  5. copyright : (C) 2001 by Dominik Seichter
  6. email : domseichter@web.de
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #ifndef PROGRESSDIALOG_H
  17. #define PROGRESSDIALOG_H
  18. #include <tqwidget.h>
  19. #include <kurl.h>
  20. typedef struct RenamedList
  21. {
  22. KURL src;
  23. KURL dst;
  24. bool dir;
  25. bool error;
  26. };
  27. class KRenameImpl;
  28. class KListView;
  29. class KPopupMenu;
  30. class KPushButton;
  31. class TQProgressBar;
  32. class TQStringList;
  33. class TQStrList;
  34. class TQString;
  35. class TQTimer;
  36. class TQHBoxLayout;
  37. class TQVBoxLayout;
  38. class ProgressDialog : public TQWidget
  39. {
  40. Q_OBJECT
  41. TQ_OBJECT
  42. public:
  43. ProgressDialog( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
  44. ~ProgressDialog();
  45. void setProgressTotalSteps( int t );
  46. void setProgress( int p );
  47. inline bool wasCancelled() const;
  48. inline void setDestination( const KURL & dir );
  49. inline void setRenamedFiles( RenamedList* list, unsigned int size ) ;
  50. inline void setCreatedDirectories( const KURL::List & list );
  51. void done( int errors, int successfull, bool allowundo );
  52. void print( TQString text, TQString pixmap = 0 );
  53. void error( TQString text );
  54. void warning( TQString text );
  55. public slots:
  56. void show();
  57. private slots:
  58. void quitAll();
  59. void restart();
  60. void again();
  61. void unAgain();
  62. void allAgain();
  63. void openDest();
  64. void canceled();
  65. void undo();
  66. void slotTimer();
  67. private:
  68. TQString count();
  69. const TQString simplify( const TQString & text );
  70. protected:
  71. RenamedList* renamedFiles;
  72. unsigned int m_size;
  73. KURL m_dest;
  74. int m_count;
  75. bool m_canceled;
  76. KURL::List m_created;
  77. TQTimer* m_timer;
  78. KListView* display;
  79. KPushButton* buttonClose;
  80. KPushButton* buttonRestart;
  81. KPushButton* buttonOpenDest;
  82. KPushButton* buttonUndo;
  83. KPushButton* buttonCancel;
  84. KPopupMenu* mnuButton;
  85. TQProgressBar* bar;
  86. TQVBoxLayout* ProgressDialogLayout;
  87. TQHBoxLayout* Layout1;
  88. };
  89. bool ProgressDialog::wasCancelled() const
  90. {
  91. return m_canceled;
  92. }
  93. void ProgressDialog::setDestination( const KURL & dir )
  94. {
  95. m_dest = dir;
  96. }
  97. void ProgressDialog::setRenamedFiles( RenamedList* list, unsigned int size )
  98. {
  99. renamedFiles = list;
  100. m_size = size;
  101. }
  102. void ProgressDialog::setCreatedDirectories( const KURL::List & list )
  103. {
  104. m_created = list;
  105. }
  106. #endif // PROGRESSDIALOG_H