AlbumShaper
1.0a3
|
00001 //============================================== 00002 // copyright : (C) 2003-2005 by Will Stokes 00003 //============================================== 00004 // This program is free software; you can redistribute it 00005 // and/or modify it under the terms of the GNU General 00006 // Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 //============================================== 00010 00011 #ifndef GUI_DIALOGS_ADDPHOTOSDIALOG_H 00012 #define GUI_DIALOGS_ADDPHOTOSDIALOG_H 00013 00014 //-------------------- 00015 //forward declarations 00016 class QGridLayout; 00017 class QFileDialog; 00018 class QCheckBox; 00019 class QLabel; 00020 //-------------------- 00021 00022 #include <qfiledialog.h> 00023 #include <qmutex.h> 00024 #include <qthread.h> 00025 class FilePreview; 00026 class GeneratePreviewThread; 00027 00028 //================================ 00029 class GeneratePreviewThread : public QThread 00030 { 00031 public: 00032 GeneratePreviewThread( FilePreview* previewWidget ); 00033 void start( QString filename); 00034 virtual void run(); 00035 //-------------- 00036 private: 00038 QString filename; 00039 00042 FilePreview* previewWidget; 00043 00045 bool updating; 00046 00048 QString queue; 00049 00052 QMutex lockingMutex; 00053 }; 00054 //============================================== 00055 class FilePreview : public QWidget, public QFilePreview 00056 { 00057 public: 00058 FilePreview( QWidget* parent=0 ); 00059 ~FilePreview(); 00060 QSize minimumSizeHint () const; 00061 00063 void previewUrl( const QUrl& ) {} 00064 00066 void updatePreview( const QString& path ); 00067 00068 protected: 00070 void customEvent( QCustomEvent * e ); 00071 00072 private: 00074 QLabel* filePreview; 00075 00077 QLabel* fileDetails; 00078 00082 GeneratePreviewThread* generatorThread; 00083 }; 00084 //===================================== 00087 //===================================== 00088 class AddPhotosDialog : public QFileDialog 00089 { 00090 Q_OBJECT 00091 00092 public: 00093 AddPhotosDialog(QString path, QWidget *parent=0, const char* name=0); 00094 00097 QStringList getFilenames(bool& setDescriptions); 00098 //---------------------- 00099 private: 00101 QCheckBox* setDescriptions; 00102 00104 FilePreview* filePreview; 00105 //---------------------- 00106 private slots: 00108 void updatePreview(const QString& filename); 00109 //---------------------- 00110 }; 00111 //====================== 00112 00113 #endif //GUI_DIALOGS_ADDPHOTOSDIALOG_H