AlbumShaper 1.0a3
AddPhotosDialog Class Reference

Simple dialog for browsing and select photos to add to a subalbum. More...

#include <addPhotosDialog.h>

Inheritance diagram for AddPhotosDialog:
Collaboration diagram for AddPhotosDialog:

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.
 
FilePreviewfilePreview
 Used to preview selected files.
 

Detailed Description

Simple dialog for browsing and select photos to add to a subalbum.

Definition at line 92 of file addPhotosDialog.h.

Constructor & Destructor Documentation

◆ AddPhotosDialog()

AddPhotosDialog::AddPhotosDialog ( QString path,
QWidget * parent = 0,
const char * name = 0 )

Definition at line 241 of file addPhotosDialog.cpp.

241 :
242 Q3FileDialog(path,
243 tr("Images") + " (*.gif *.jpg *.jpeg *.png *.xpm *.GIF *.JPG *.JPEG *.PNG *.XPM)",
244 parent,name)
245 {
246 //setup filter filter and modes
247 setMode( Q3FileDialog::ExistingFiles );
248 setViewMode( Q3FileDialog::List );
249
250 filePreview = new FilePreview();
251 setContentsPreviewEnabled( true );
252 setContentsPreview( filePreview, filePreview );
253 setPreviewMode( Q3FileDialog::Contents );
254
255 //create label and checkbox asking user if they want to
256 //set image descriptions from filenames
257 setDescriptions = new QCheckBox( tr("Use filenames for descriptions."), this );
258 setDescriptions->setChecked( false );
259 addWidgets( NULL, setDescriptions, NULL );
260
261 //set window description
262 setCaption( tr("Add Photos") );
263
264 connect( this, SIGNAL( fileHighlighted(const QString&)),
265 this, SLOT( updatePreview(const QString&)) );
266}
FilePreview * filePreview
Used to preview selected files.
QCheckBox * setDescriptions
Checkbox asking if filenames should be used to set image descriptions.
void updatePreview(const QString &filename)
handle the user selecting items by updating the file preview fields

References filePreview, setDescriptions, and updatePreview().

Member Function Documentation

◆ getFilenames()

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 268 of file addPhotosDialog.cpp.

269{
270 if( exec() == QDialog::Accepted )
271 {
272 setDescriptionsBool = setDescriptions->isChecked();
273 return selectedFiles();
274 }
275 else { return QStringList(); }
276}

References setDescriptions.

Referenced by SubalbumWidget::addImageAction().

◆ updatePreview

void AddPhotosDialog::updatePreview ( const QString & filename)
privateslot

handle the user selecting items by updating the file preview fields

Definition at line 278 of file addPhotosDialog.cpp.

279{
280 filePreview->updatePreview( filename );
281}
void updatePreview(const QString &path)
call this function to update the file preview

References filePreview, and FilePreview::updatePreview().

Referenced by AddPhotosDialog().

Member Data Documentation

◆ filePreview

FilePreview* AddPhotosDialog::filePreview
private

Used to preview selected files.

Definition at line 108 of file addPhotosDialog.h.

Referenced by AddPhotosDialog(), and updatePreview().

◆ setDescriptions

QCheckBox* AddPhotosDialog::setDescriptions
private

Checkbox asking if filenames should be used to set image descriptions.

Definition at line 105 of file addPhotosDialog.h.

Referenced by AddPhotosDialog(), and getFilenames().


The documentation for this class was generated from the following files: