AlbumShaper  1.0a3
Public Member Functions | Private Slots | Private Attributes
AddPhotosDialog Class Reference

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

#include <addPhotosDialog.h>

Inheritance diagram for AddPhotosDialog:
Inheritance graph
[legend]
Collaboration diagram for AddPhotosDialog:
Collaboration graph
[legend]

List of all members.

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 88 of file addPhotosDialog.h.


Constructor & Destructor Documentation

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

Definition at line 238 of file addPhotosDialog.cpp.

References filePreview, setDescriptions, and updatePreview().

                                                                                 :
                                 QFileDialog(path,
                                 tr("Images") + " (*.gif *.jpg *.jpeg *.png *.xpm *.GIF *.JPG *.JPEG *.PNG *.XPM)",
                                 parent,name)
 {
   //setup filter filter and modes
   setMode( QFileDialog::ExistingFiles );
   setViewMode( QFileDialog::List );
 
   filePreview = new FilePreview();
   setContentsPreviewEnabled( true );
   setContentsPreview( filePreview, filePreview );
   setPreviewMode( QFileDialog::Contents );
   
   //create label and checkbox asking user if they want to
   //set image descriptions from filenames
   setDescriptions = new QCheckBox( tr("Use filenames for descriptions."), this );
   setDescriptions->setChecked( false );
   addWidgets( NULL, setDescriptions, NULL );

   //set window description
  setCaption( tr("Add Photos") );
  
  connect( this, SIGNAL( fileHighlighted(const QString&)),
           this, SLOT( updatePreview(const QString&)) );
}

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

References setDescriptions.

Referenced by SubalbumWidget::addImageAction().

{
  if( exec() == QDialog::Accepted )
  {
    setDescriptionsBool = setDescriptions->isChecked();
    return selectedFiles();
  }
  else {  return QStringList(); }
}
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().

{
  filePreview->updatePreview( filename ); 
}

Member Data Documentation

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: