KRename – powerful batch renamer
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ProgressDialog.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. struct RenamedList
  21. {
  22. KURL src;
  23. KURL dst;
  24. bool dir;
  25. bool error;
  26. };
  27. class KRenameImpl;
  28. class TDEListView;
  29. class TDEPopupMenu;
  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. public:
  42. ProgressDialog( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
  43. ~ProgressDialog();
  44. void setProgressTotalSteps( int t );
  45. void setProgress( int p );
  46. inline bool wasCancelled() const;
  47. inline void setDestination( const KURL & dir );
  48. inline void setRenamedFiles( RenamedList* list, unsigned int size ) ;
  49. inline void setCreatedDirectories( const KURL::List & list );
  50. void done( int errors, int successfull, bool allowundo );
  51. void print( TQString text, TQString pixmap = 0 );
  52. void error( TQString text );
  53. void warning( TQString text );
  54. public slots:
  55. void show();
  56. private slots:
  57. void quitAll();
  58. void restart();
  59. void again();
  60. void unAgain();
  61. void allAgain();
  62. void openDest();
  63. void canceled();
  64. void undo();
  65. void slotTimer();
  66. private:
  67. TQString count();
  68. const TQString simplify( const TQString & text );
  69. protected:
  70. RenamedList* renamedFiles;
  71. unsigned int m_size;
  72. KURL m_dest;
  73. int m_count;
  74. bool m_canceled;
  75. KURL::List m_created;
  76. TQTimer* m_timer;
  77. TDEListView* display;
  78. KPushButton* buttonClose;
  79. KPushButton* buttonRestart;
  80. KPushButton* buttonOpenDest;
  81. KPushButton* buttonUndo;
  82. KPushButton* buttonCancel;
  83. TDEPopupMenu* mnuButton;
  84. TQProgressBar* bar;
  85. TQVBoxLayout* ProgressDialogLayout;
  86. TQHBoxLayout* Layout1;
  87. };
  88. bool ProgressDialog::wasCancelled() const
  89. {
  90. return m_canceled;
  91. }
  92. void ProgressDialog::setDestination( const KURL & dir )
  93. {
  94. m_dest = dir;
  95. }
  96. void ProgressDialog::setRenamedFiles( RenamedList* list, unsigned int size )
  97. {
  98. renamedFiles = list;
  99. m_size = size;
  100. }
  101. void ProgressDialog::setCreatedDirectories( const KURL::List & list )
  102. {
  103. m_created = list;
  104. }
  105. #endif // PROGRESSDIALOG_H