Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

AddPhotosDialog Class Reference

#include <addPhotosDialog.h>

Inheritance diagram for AddPhotosDialog:

Inheritance graph
[legend]
Collaboration diagram for AddPhotosDialog:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Definition at line 88 of file 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.
FilePreviewfilePreview
 Used to preview selected files.


Constructor & Destructor Documentation

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

Definition at line 233 of file addPhotosDialog.cpp.

References filePreview, setDescriptions, and updatePreview().

00233                                                                                  :
00234                                  QFileDialog(path,
00235                                  tr("Images") + " (*.gif *.jpg *.jpeg *.png *.xpm *.GIF *.JPG *.JPEG *.PNG *.XPM)",
00236                                  parent,name)
00237  {
00238    //setup filter filter and modes
00239    setMode( QFileDialog::ExistingFiles );
00240    setViewMode( QFileDialog::List );
00241  
00242    filePreview = new FilePreview();
00243    setContentsPreviewEnabled( true );
00244    setContentsPreview( filePreview, filePreview );
00245    setPreviewMode( QFileDialog::Contents );
00246    
00247    //create label and checkbox asking user if they want to
00248    //set image descriptions from filenames
00249    setDescriptions = new QCheckBox( tr("Use filenames for descriptions."), this );
00250    setDescriptions->setChecked( false );
00251    addWidgets( NULL, setDescriptions, NULL );
00252 
00253    //set window description
00254   setCaption( tr("Add Photos") );
00255   
00256   connect( this, SIGNAL( fileHighlighted(const QString&)),
00257            this, SLOT( updatePreview(const QString&)) );
00258 }
//==============================================


Member Function Documentation

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

References setDescriptions.

Referenced by SubalbumWidget::addImageAction().

00261 {
00262   if( exec() == QDialog::Accepted )
00263   {
00264     setDescriptionsBool = setDescriptions->isChecked();
00265     return selectedFiles();
00266   }
00267   else {  return QStringList(); }
00268 }

void AddPhotosDialog::updatePreview const QString &  filename  )  [private, slot]
 

handle the user selecting items by updating the file preview fields

Definition at line 270 of file addPhotosDialog.cpp.

References filePreview, and FilePreview::updatePreview().

Referenced by AddPhotosDialog().

00271 {
00272   filePreview->updatePreview( filename ); 
00273 }


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Sat Apr 2 05:44:49 2005 for AlbumShaper by  doxygen 1.3.9.1