AlbumShaper  1.0a3
addPhotosDialog.h
Go to the documentation of this file.
1 //Added by qt3to4:
2 #include <QCustomEvent>
3 #include <Q3GridLayout>
4 #include <QLabel>
5 //==============================================
6 // copyright : (C) 2003-2005 by Will Stokes
7 //==============================================
8 // This program is free software; you can redistribute it
9 // and/or modify it under the terms of the GNU General
10 // Public License as published by the Free Software
11 // Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //==============================================
14 
15 #ifndef GUI_DIALOGS_ADDPHOTOSDIALOG_H
16 #define GUI_DIALOGS_ADDPHOTOSDIALOG_H
17 
18 //--------------------
19 //forward declarations
20 class Q3GridLayout;
21 class Q3FileDialog;
22 class QCheckBox;
23 class QLabel;
24 //--------------------
25 
26 #include <q3filedialog.h>
27 #include <qmutex.h>
28 #include <qthread.h>
29 class FilePreview;
31 
32 //================================
34 {
35 public:
37  void start( QString filename);
38  virtual void run();
39  //--------------
40 private:
42  QString filename;
43 
47 
49  bool updating;
50 
52  QString queue;
53 
56  QMutex lockingMutex;
57 };
58 //==============================================
59 class FilePreview : public QWidget, public Q3FilePreview
60 {
61 public:
62  FilePreview( QWidget* parent=0 );
63  ~FilePreview();
64  QSize minimumSizeHint () const;
65 
67  void previewUrl( const Q3Url& ) {}
68 
70  void updatePreview( const QString& path );
71 
72 protected:
74  void customEvent( QCustomEvent * e );
75 
76 private:
79 
82 
87 };
88 //=====================================
91 //=====================================
93 {
94 Q_OBJECT
95 
96 public:
97  AddPhotosDialog(QString path, QWidget *parent=0, const char* name=0);
98 
101  QStringList getFilenames(bool& setDescriptions);
102 //----------------------
103 private:
105  QCheckBox* setDescriptions;
106 
109 //----------------------
110 private slots:
112  void updatePreview(const QString& filename);
113 //----------------------
114 };
115 //======================
116 
117 #endif //GUI_DIALOGS_ADDPHOTOSDIALOG_H
GeneratePreviewThread * generatorThread
a worker thread that actually generates the file preview image and details information that is displa...
FilePreview * filePreview
Used to preview selected files.
QLabel * fileDetails
details about last selected file
GeneratePreviewThread(FilePreview *previewWidget)
QString queue
next file to be processed by worker thread
bool updating
is the worker thread currently generating a file preview?
Simple dialog for browsing and select photos to add to a subalbum.
QLabel * filePreview
preview of last selected file
QMutex lockingMutex
locking mutex - necessary to prevent multiple threads from accessing the updating bool or queue varia...
void start(QString filename)
QString filename
current file being processed
QCheckBox * setDescriptions
Checkbox asking if filenames should be used to set image descriptions.
void previewUrl(const Q3Url &)
declared to make base class happy. we&#39;ll use an updatePreview function instead
FilePreview * previewWidget
handle on preview widget necessary for posting an update event once the current file has been process...