Simple dialog for browsing and select photos to add to a subalbum. More...
#include <addPhotosDialog.h>
Public Member Functions | |
AddPhotosDialog (QString path, QWidget *parent=0, const char *name=0) | |
QStringList | getFilenames (bool &setDescriptions) |
returns the list of selected filenames, while setting setDescritions to the state the checkbox was left in. | |
Private Slots | |
void | updatePreview (const QString &filename) |
handle the user selecting items by updating the file preview fields | |
Private Attributes | |
QCheckBox * | setDescriptions |
Checkbox asking if filenames should be used to set image descriptions. | |
FilePreview * | filePreview |
Used to preview selected files. |
Simple dialog for browsing and select photos to add to a subalbum.
Definition at line 88 of file addPhotosDialog.h.
AddPhotosDialog::AddPhotosDialog | ( | QString | path, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
Definition at line 238 of file addPhotosDialog.cpp.
References filePreview, setDescriptions, and updatePreview().
00239 : 00240 QFileDialog(path, 00241 tr("Images") + " (*.gif *.jpg *.jpeg *.png *.xpm *.GIF *.JPG *.JPEG *.PNG *.XPM)", 00242 parent,name) 00243 { 00244 //setup filter filter and modes 00245 setMode( QFileDialog::ExistingFiles ); 00246 setViewMode( QFileDialog::List ); 00247 00248 filePreview = new FilePreview(); 00249 setContentsPreviewEnabled( true ); 00250 setContentsPreview( filePreview, filePreview ); 00251 setPreviewMode( QFileDialog::Contents ); 00252 00253 //create label and checkbox asking user if they want to 00254 //set image descriptions from filenames 00255 setDescriptions = new QCheckBox( tr("Use filenames for descriptions."), this ); 00256 setDescriptions->setChecked( false ); 00257 addWidgets( NULL, setDescriptions, NULL ); 00258 00259 //set window description 00260 setCaption( tr("Add Photos") ); 00261 00262 connect( this, SIGNAL( fileHighlighted(const QString&)), 00263 this, SLOT( updatePreview(const QString&)) ); }
QStringList AddPhotosDialog::getFilenames | ( | bool & | setDescriptions | ) |
returns the list of selected filenames, while setting setDescritions to the state the checkbox was left in.
Definition at line 265 of file addPhotosDialog.cpp.
References setDescriptions.
Referenced by SubalbumWidget::addImageAction().
00266 { 00267 if( exec() == QDialog::Accepted ) 00268 { 00269 setDescriptionsBool = setDescriptions->isChecked(); 00270 return selectedFiles(); 00271 } 00272 else { return QStringList(); } 00273 }
void AddPhotosDialog::updatePreview | ( | const QString & | filename | ) | [private, slot] |
handle the user selecting items by updating the file preview fields
Definition at line 275 of file addPhotosDialog.cpp.
References filePreview, and FilePreview::updatePreview().
Referenced by AddPhotosDialog().
00276 { 00277 filePreview->updatePreview( filename ); 00278 }
FilePreview* AddPhotosDialog::filePreview [private] |
Used to preview selected files.
Definition at line 104 of file addPhotosDialog.h.
Referenced by AddPhotosDialog(), and updatePreview().
QCheckBox* AddPhotosDialog::setDescriptions [private] |
Checkbox asking if filenames should be used to set image descriptions.
Definition at line 101 of file addPhotosDialog.h.
Referenced by AddPhotosDialog(), and getFilenames().