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

TitleWidget Class Reference

#include <titleWidget.h>

Inheritance diagram for TitleWidget:

Inheritance graph
[legend]
Collaboration diagram for TitleWidget:

Collaboration graph
[legend]
List of all members.

Detailed Description

Widget which displays album name, description, representative image, and album shaper logo.

Definition at line 48 of file titleWidget.h.

Public Slots

void albumStatisticsClosed ()
 Frees album statistics dialog once closed.
void aboutClosed ()
 Frees about dialog once closed.
void helpClosed ()
 Frees HelpWindow once closed.
void quitApplication ()
 Quit slot.
void settingsWindowClosed ()
void updateAlbumAnnotations ()
 Updates subalbum annotations.
void refreshCollectionAnnotations (Subalbum *collection)
 Update displayed collection name and cover image.
void setAlbumImage (Photo *photo)
 Sets the album image to the passed in photo.
void setSubalbumImage (Photo *photo)
 Sets the subalbum image to the passed in photo.
void aboutProgram (int mode=ABOUT)
 Pops up about dialog.
void help ()
 Pops up HelpWindow.
void windowStateChanged (bool state)
 Enables/disables "minimize" window menu entry depending on window state.
void updateMenus (bool anySelected=false, bool anyRevertable=false)
 update begin presentation menu entry - disabled when no photos in album

Signals

void subalbumNameChanged ()
 Emitted when user changes subalbum name.

Public Member Functions

 TitleWidget (QWidget *parent=0, const char *name=0)
 Creates layout.
 ~TitleWidget ()
 Deletes stuff!
void useAnimation (bool val)
 Use animation for rep images?
void setAlbum (Album *val)
 Sets new pointer to the album object.
AlbumgetAlbum ()
 Returns a pointer to the album object.
void refresh ()
 Refreshs data from backend objects.
bool getBusy ()
 is program busy?
void setBusy (bool val)
 set program busy state
RecentAlbumsgetRecentAlbums ()
 returns handle to recent albums object

Protected Member Functions

void dragEnterEvent (QDragEnterEvent *e)
void dropEvent (QDropEvent *e)
QString createTmpDir (QString albumPath=QString::null)

Private Slots

void storeAnnotations ()
 Store annotations.
void setAlbumImage ()
 Sets the Album Image.
void unsetAlbumImage ()
 Unsets the Album Image.
void setSubalbumImage ()
 Sets the Subalbum Image.
void unsetSubalbumImage ()
 Unsets the Subalbum Image.
void newAlbum ()
 Resets to empty album.
void loadAlbum ()
 Loads an album specified with file chooser.
void loadRecentAlbum (int index)
 Loads a recent album.
bool proceedWithLoad ()
 Helper function for load methods, checks if there are any unsaved changes and if so warns user any such changes will be lost if they proceed.
void loadAlbum (QString location)
 Loads a specified album.
void saveAlbum ()
 Saves album.
void saveAsAlbum ()
 Saves album as.
void revertToSaved ()
 Revert to last saved album.
void exportSmallWebGallery ()
 Export small web gallery (excludes full size images and Album.xml file).
void exportLargeImages ()
 Export large images only to a new directory for printing purposes.
void settings ()
 Pops up settings window.
void removeSelectedPhotoDesc ()
 Strip descriptions from selected photos.
void revertPhotos ()
 Revert selected photos to original form.
void albumStatistics ()
 Pops up album statistics window.
void clearOpenRecentMenu ()
 Clears albums from open recent menu.

Private Member Functions

void refreshOpenRecentMenu ()
 Refreshes open recent menu.

Private Attributes

QMenuBar * menu
 Menubar file menu and help menu inserted in.
QPopupMenu * file
 File menu.
QPopupMenu * openRecent
 Open recent submenu.
QPopupMenu * photoMenu
 Photos menu.
QPopupMenu * tools
 Tools menu.
QPopupMenu * helpMenu
 Help menu.
QGridLayout * mainGrid
 Main grid.
QFramemainFrame
QGridLayout * albumAnnotationGrid
 Album annotation grid.
QFramealbumAnnotationFrame
ALabelalbumImage
QLabelalbumName
QLineEdit * albumNameVal
QLabelalbumDescription
QLineEdit * albumDescriptionVal
QLabelalbumAuthor
QLineEdit * albumAuthorVal
QGridLayout * subalbumAnnotationGrid
 Subalbum annotation grid.
QFramesubalbumAnnotationFrame
ALabelsubalbumImage
QLabelsubalbumName
QLineEdit * subalbumNameVal
QLabelsubalbumDescription
QLineEdit * subalbumDescriptionVal
Albumalbm
 Backend album object.
Windowwindow
 Window pointer.
AlbumStatisticsalbumStats
 Album Statistics dialog pointer.
ConfigurationWidgetsettingsWindow
 Settings dialog pointer.
Aboutabout
 About dialog pointer.
HelpWindowhelpWindow
 HelpWindow pointer.
bool busy
 Is the program currently busy? helps block other operations.
bool detectModifications
int NEW_ALBUM
int OPEN_ALBUM
int SAVE_ALBUM
int SAVEAS_ALBUM
int REVERT_TO_SAVED_ALBUM
int EXPORT_SMALL_WEB_GALLERY
int EXPORT_LARGE_IMAGES
int REMOVE_DESCRIPTIONS
 photos menu item id's
int REVERT_PHOTOS
int BEGIN_PRESENTATION
 tools menu item id's
int BEGIN_PRESENTATION_AT
bool cacheSetButtonState
 cached set button state
QString tmpDirErrorMessage
 error message and description when temp directory cannot be created
QString tmpDirErrorDesc
 error message and description when temp directory cannot be created
RecentAlbums recentAlbums


Constructor & Destructor Documentation

TitleWidget::TitleWidget QWidget parent = 0,
const char *  name = 0
 

Creates layout.

Store parent pointer

program not busy at first

no windows open by default

Definition at line 62 of file titleWidget.cpp.

References about, aboutProgram(), albm, albumAnnotationFrame, albumAnnotationGrid, albumAuthor, albumAuthorVal, albumDescription, albumDescriptionVal, albumImage, albumName, albumNameVal, albumStatistics(), albumStats, busy, createTmpDir(), detectModifications, EXPORT_LARGE_IMAGES, EXPORT_SMALL_WEB_GALLERY, exportLargeImages(), exportSmallWebGallery(), file, Window::getConfig(), RecentAlbums::getMaxItems(), Configuration::getString(), Album::getTmpDir(), help(), helpMenu, helpWindow, IMAGE_PATH, RecentAlbums::insertEntry(), loadAlbum(), mainFrame, mainGrid, menu, NEW_ALBUM, newAlbum(), OPEN_ALBUM, openRecent, photoMenu, quitApplication(), recentAlbums, refreshOpenRecentMenu(), REMOVE_DESCRIPTIONS, removeSelectedPhotoDesc(), REP_IMAGE_HEIGHT, REVERT_PHOTOS, REVERT_TO_SAVED_ALBUM, revertPhotos(), revertToSaved(), SAVE_ALBUM, saveAlbum(), SAVEAS_ALBUM, saveAsAlbum(), settings(), settingsWindow, storeAnnotations(), subalbumAnnotationFrame, subalbumAnnotationGrid, subalbumDescription, subalbumDescriptionVal, subalbumImage, subalbumName, subalbumNameVal, tmpDirErrorDesc, tmpDirErrorMessage, tools, unsetAlbumImage(), unsetSubalbumImage(), WIDGET_SPACING, and window.

00063                                                     : QFrame(parent,name)
00064 {
00065   tmpDirErrorMessage = tr("Error! Unable to create temp directory!");
00066   tmpDirErrorDesc = tr("Album Shaper was unable to create the necessary temp directory required: ");
00067   //--------------------------------------------------------------
00068   QColor white(255, 255, 255);
00069   QColor lightBlue(193, 210, 238);
00070   QColor darkBlue(35, 75, 139);
00071   QColor black(0, 0, 0);
00072   //--------------------------------------------------------------
00074   window = (Window*)parent;
00075 
00077   busy = false;
00078 
00079   //detect changes to text fields
00080   detectModifications = true;
00081 
00083   albumStats = NULL;
00084   settingsWindow = NULL;
00085   about = NULL;
00086   helpWindow = NULL;
00087 
00088   //create backend album object
00089   albm = new Album( createTmpDir() );
00090   if(albm->getTmpDir().isNull() )
00091   {
00092       AlertDialog alert( tmpDirErrorMessage, tmpDirErrorDesc + window->getConfig()->getString( "loadSave", "tempImageDirectory" ),
00093       "alertIcons/warning.png", this );
00094       alert.exec();
00095       quitApplication();
00096   }
00097   //-------------------------------------
00098   //initialize recent albums object
00099   int i;
00100   QString recentName, recentLocation, recentPhotoCount;
00101   for(i = 0; i<recentAlbums.getMaxItems(); i++)
00102   {
00103     //get album name and location
00104     recentName = window->getConfig()->getString(    "recentAlbums", QString("%1_name").arg(i)     );
00105     recentLocation = window->getConfig()->getString("recentAlbums", QString("%1_location").arg(i) );
00106     recentPhotoCount = window->getConfig()->getString("recentAlbums", QString("%1_photoCount").arg(i) );
00107 
00108     //no such listing? since listings are continious all listings must be loaded
00109     if(recentLocation.compare("-1") == 0)
00110       break;
00111 
00112     //insert item into list
00113     recentAlbums.insertEntry( recentName, recentLocation, recentPhotoCount ); 
00114   }      
00115   //--------------------------------------------------------------
00116   //create menus
00117   menu = new QMenuBar( this, "menuBar" );
00118   //---
00119   //File menu
00120   file = new QPopupMenu( this, "fileMenu" );
00121   NEW_ALBUM = file->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/new.png") ),
00122                                 tr("&New"), this, SLOT(newAlbum()), CTRL+Key_N );
00123 
00124   OPEN_ALBUM = file->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/open.png") ),
00125                                  tr("&Open..."), this, SLOT(loadAlbum()), CTRL+Key_O );
00126 
00127   openRecent = new QPopupMenu( this, "openRecentMenu" );
00128   refreshOpenRecentMenu();
00129   file->insertItem( tr("Open Recent"), openRecent );
00130   //----------------------
00131   file->insertSeparator();
00132   //----------------------  
00133   SAVE_ALBUM = file->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/save.png") ),
00134                                  tr("&Save"), this, SLOT(saveAlbum()), CTRL+Key_S );
00135 
00136   SAVEAS_ALBUM = file->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/saveas.png") ),
00137                                    tr("&Save As..."), this, SLOT(saveAsAlbum()), CTRL+SHIFT+Key_S );
00138 
00139   REVERT_TO_SAVED_ALBUM = file->insertItem( tr("Revert to Saved"), this, SLOT(revertToSaved()) );
00140   file->setItemEnabled( REVERT_TO_SAVED_ALBUM, false );  
00141   //----------------------
00142   file->insertSeparator();
00143   //----------------------
00144   QPopupMenu* exportAs = new QPopupMenu( this, "exportAs" );
00145   EXPORT_SMALL_WEB_GALLERY = exportAs->insertItem( tr("Small Web Gallery"), 
00146                                                    this, SLOT(exportSmallWebGallery()) );
00147   EXPORT_LARGE_IMAGES = exportAs->insertItem( tr("Images for Printing"), 
00148                                               this, SLOT(exportLargeImages()) );
00149   
00150   file->insertItem( tr("Export..."), exportAs );
00151   //----------------------  
00152   file->insertSeparator();
00153   //----------------------
00154   file->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/quit.png") ),
00155                     tr("&Quit"), this, SLOT(quitApplication()), CTRL+Key_Q);
00156 
00157   
00158   menu->insertItem( tr("&File"), file );
00159   //---
00160   //Photo menu
00161   photoMenu = new QPopupMenu( this, "phooMenu" );
00162     
00163   REMOVE_DESCRIPTIONS = photoMenu->insertItem( tr("Remove Description"), this, SLOT(removeSelectedPhotoDesc()) );
00164   REVERT_PHOTOS = photoMenu->insertItem( tr("Revert to Original"), this, SLOT(revertPhotos()) );
00165   
00166   menu->insertItem( tr("&Photos"), photoMenu );
00167   //---
00168   //Tools menu
00169   tools = new QPopupMenu( this, "toolsMenu" );
00170 /*
00171   BEGIN_PRESENTATION_AT = tools->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/startPresentation.png") ),
00172                                           tr("Begin Presentation"), 
00173                                           window, SLOT(startSlideshowWithSelectedPhoto()), CTRL+Key_P );   
00174   BEGIN_PRESENTATION = tools->insertItem( tr("Begin Presentation at Beginning"), 
00175                                              window, SLOT(startSlideshowAtBeginning()), CTRL+SHIFT+Key_P ); 
00176   updateMenus();
00177  */
00178 
00179   tools->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/albumStatistics.png") ),
00180                      tr("Album Statistics"), this, SLOT(albumStatistics()), CTRL+Key_I );
00181 
00182   tools->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/settings.png") ),
00183                      tr("Settings"), this, SLOT(settings()) );
00184 
00185   menu->insertItem( tr("&Tools"), tools );
00186   //---
00187   //PLATFORM_SPECIFIC_CODE
00188   //Window menu
00189   #if defined(Q_OS_MACX)
00190   windowMenu = new QPopupMenu( this, "windoMenu" );
00191   WINDOW_MINIMIZE = windowMenu->insertItem( tr("&Minimize"), (QWidget*)window, SLOT(showMinimized()), CTRL+Key_M );
00192   menu->insertItem( tr("&Window"), windowMenu );
00193   #endif
00194   //---    
00195   //Help menu
00196   helpMenu = new QPopupMenu( this, "helpMenu" );
00197   helpMenu->insertItem( tr("Album Shaper Help"), this, SLOT(help()), CTRL+Key_Question );
00198 
00199   helpMenu->insertItem( QIconSet( QPixmap(QString(IMAGE_PATH)+"menuIcons/about.png") ),
00200                     tr("About"), this, SLOT(aboutProgram()) );
00201   menu->insertSeparator();
00202   menu->insertItem( tr("&Help"), helpMenu );
00203   //--------------------------------------------------------------
00204   //create all widgets
00205   mainFrame = new QFrame( this, "mainFrame" );
00206   mainFrame->setPaletteBackgroundColor( darkBlue );
00207   //------
00208   //album annotations
00209   albumAnnotationFrame = new QFrame( mainFrame, "albumAnnotationFrame" );
00210   albumAnnotationFrame->setLineWidth(2);
00211   albumAnnotationFrame->setMidLineWidth(0);
00212   albumAnnotationFrame->setFrameStyle( QFrame::Panel | QFrame::Plain );
00213   albumAnnotationFrame->setPaletteForegroundColor( white );
00214   albumAnnotationFrame->setPaletteBackgroundColor( darkBlue );
00215 
00216   QFrame* albumImageFrame = new QFrame( albumAnnotationFrame, "albumImageFrame" );
00217   albumImage = new ALabel( albumImageFrame, "albumImage",
00218                                                new QPixmap( QString(IMAGE_PATH)+"buttonIcons/removeImage.png") );
00219   connect( albumImage, SIGNAL(mouseRelease()),
00220                 this, SLOT(unsetAlbumImage()) );
00221 
00222   //allow drop events
00223   this->setAcceptDrops(true);
00224 
00225   albumName = new QLabel( tr("Album Name:"), albumAnnotationFrame, "albumName" );
00226   albumNameVal = new QLineEdit( albumAnnotationFrame, "albumNameVal" );
00227   connect( albumNameVal, SIGNAL(textChanged( const QString&)),
00228            SLOT( storeAnnotations()) );
00229 
00230   albumDescription = new QLabel( tr("Description:"), albumAnnotationFrame, "albumDescription" );
00231   albumDescriptionVal = new QLineEdit( albumAnnotationFrame, "albumDescriptionVal" );
00232   connect( albumDescriptionVal, SIGNAL(textChanged( const QString&)),
00233            SLOT( storeAnnotations()) );
00234 
00235   albumAuthor = new QLabel( tr("Author:"), albumAnnotationFrame, "albumAuthor" );
00236   albumAuthorVal = new QLineEdit( albumAnnotationFrame, "albumAuthorVal" );
00237   connect( albumAuthorVal, SIGNAL(textChanged( const QString&)),
00238            SLOT( storeAnnotations()) );
00239   //------
00240   //subalbum annotations
00241   subalbumAnnotationFrame = new QFrame( mainFrame, "subalbumAnnotationFrame" );
00242   subalbumAnnotationFrame->setLineWidth(2);
00243   subalbumAnnotationFrame->setMidLineWidth(0);
00244   subalbumAnnotationFrame->setFrameStyle( QFrame::Panel | QFrame::Plain );
00245   subalbumAnnotationFrame->setPaletteForegroundColor( white );
00246   subalbumAnnotationFrame->setPaletteBackgroundColor( darkBlue );
00247 
00248   QFrame* subalbumImageFrame = new QFrame( subalbumAnnotationFrame, "subalbumImageFrame" );
00249   subalbumImage = new ALabel( subalbumImageFrame, "subalbumImage",
00250                                                     new QPixmap( QString(IMAGE_PATH)+"buttonIcons/removeImage.png") );
00251 
00252   connect( subalbumImage, SIGNAL(mouseRelease()),
00253                  this, SLOT(unsetSubalbumImage()) );
00254 
00255   subalbumName = new QLabel( tr("Collection Name:"), subalbumAnnotationFrame );
00256   subalbumNameVal = new QLineEdit( subalbumAnnotationFrame );
00257   connect( subalbumNameVal, SIGNAL(textChanged( const QString&)),
00258            SLOT( storeAnnotations()) );
00259 
00260   subalbumDescription = new QLabel( tr("Description:"), subalbumAnnotationFrame );
00261   subalbumDescriptionVal = new QLineEdit( subalbumAnnotationFrame );
00262   connect( subalbumDescriptionVal, SIGNAL(textChanged( const QString&)),
00263            SLOT( storeAnnotations()) );
00264   //--------------------------------------------------------------
00265   //Set fonts + colors
00266   QFont labelFont = albumName->font();
00267   labelFont.setWeight(QFont::Bold);
00268 
00269   albumName->setFont( labelFont );
00270   albumName->setPaletteForegroundColor( white );
00271   albumName->setPaletteBackgroundColor( darkBlue );
00272 
00273   albumNameVal->setFont( labelFont );
00274   albumNameVal->setPaletteForegroundColor( black );
00275   albumNameVal->setPaletteBackgroundColor( lightBlue );
00276   albumNameVal->setFrameShape ( QFrame::NoFrame );
00277 
00278   albumDescription->setFont( labelFont );
00279   albumDescription->setPaletteForegroundColor( white );
00280   albumDescription->setPaletteBackgroundColor( darkBlue );
00281 
00282   albumDescriptionVal->setFont( labelFont );
00283   albumDescriptionVal->setPaletteForegroundColor( black );
00284   albumDescriptionVal->setPaletteBackgroundColor( lightBlue );
00285   albumDescriptionVal->setFrameShape ( QFrame::NoFrame );
00286 
00287   albumAuthor->setFont( labelFont );
00288   albumAuthor->setPaletteForegroundColor( white );
00289   albumAuthor->setPaletteBackgroundColor( darkBlue );
00290 
00291   albumAuthorVal->setFont( labelFont );
00292   albumAuthorVal->setPaletteForegroundColor( black );
00293   albumAuthorVal->setPaletteBackgroundColor( lightBlue );
00294   albumAuthorVal->setFrameShape ( QFrame::NoFrame );
00295 
00296   subalbumName->setFont( labelFont );
00297   subalbumName->setPaletteForegroundColor( white );
00298   subalbumName->setPaletteBackgroundColor( darkBlue );
00299 
00300   subalbumNameVal->setFont( labelFont );
00301   subalbumNameVal->setPaletteForegroundColor( black );
00302   subalbumNameVal->setPaletteBackgroundColor( lightBlue );
00303   subalbumNameVal->setFrameShape ( QFrame::NoFrame );
00304 
00305   subalbumDescription->setFont( labelFont );
00306   subalbumDescription->setPaletteForegroundColor( white );
00307   subalbumDescription->setPaletteBackgroundColor( darkBlue );
00308 
00309   subalbumDescriptionVal->setFont( labelFont );
00310   subalbumDescriptionVal->setPaletteForegroundColor( black );
00311   subalbumDescriptionVal->setPaletteBackgroundColor( lightBlue );
00312   subalbumDescriptionVal->setFrameShape ( QFrame::NoFrame );
00313   //--------------------------------------------------------------
00314   //place widgets in grids
00315   //------------------------
00316   //album annotations
00317   QGridLayout* albumImageGrid = new QGridLayout( albumImageFrame, 1, 1 );
00318   albumImageGrid->addWidget( albumImage, 0, 0 );
00319   albumImageGrid->setRowSpacing( 0, REP_IMAGE_HEIGHT );
00320 
00321   albumAnnotationGrid =      new QGridLayout( albumAnnotationFrame, 3, 3);
00322   albumAnnotationGrid->setMargin(WIDGET_SPACING);
00323   albumAnnotationGrid->setSpacing(WIDGET_SPACING);
00324 
00325   albumAnnotationGrid->addMultiCellWidget( albumImageFrame, 0, 2, 0, 0 );
00326 
00327   albumAnnotationGrid->addWidget          ( albumName, 0, 1, Qt::AlignLeft);
00328   albumAnnotationGrid->addWidget          ( albumDescription, 1, 1, Qt::AlignLeft);
00329   albumAnnotationGrid->addWidget          ( albumAuthor, 2, 1, Qt::AlignLeft);
00330 
00331   albumAnnotationGrid->setColStretch(2, 1);
00332   albumAnnotationGrid->addWidget( albumNameVal, 0, 2);
00333   albumAnnotationGrid->addWidget( albumDescriptionVal, 1, 2);
00334   albumAnnotationGrid->addWidget( albumAuthorVal, 2, 2);
00335   //------------------------
00336   //subalbum annotations
00337   QGridLayout* subalbumImageGrid = new QGridLayout( subalbumImageFrame, 1, 1 );
00338   subalbumImageGrid->addWidget( subalbumImage, 0, 0 );
00339   subalbumImageGrid->setRowSpacing( 0, REP_IMAGE_HEIGHT );
00340 
00341   subalbumAnnotationGrid = new QGridLayout( subalbumAnnotationFrame, 5, 5);
00342   subalbumAnnotationGrid->setMargin(WIDGET_SPACING);
00343   subalbumAnnotationGrid->setSpacing(WIDGET_SPACING);
00344 
00345   subalbumAnnotationGrid->addMultiCellWidget( subalbumImageFrame, 0, 2, 0, 0);
00346 
00347   subalbumAnnotationGrid->setRowStretch(2, 1);
00348   subalbumAnnotationGrid->addWidget          ( subalbumName, 0, 1, Qt::AlignLeft);
00349   subalbumAnnotationGrid->addWidget          ( subalbumDescription, 1, 1, Qt::AlignLeft);
00350 
00351   subalbumAnnotationGrid->setColStretch(2, 1);
00352   subalbumAnnotationGrid->addWidget( subalbumNameVal, 0, 2);
00353   subalbumAnnotationGrid->addWidget( subalbumDescriptionVal, 1, 2);
00354   //------------------------
00355   //place menu and album and subalbum annotations into main grid
00356   mainGrid =                       new QGridLayout( mainFrame, 1, 2);
00357   mainGrid->setMargin(WIDGET_SPACING);
00358   mainGrid->setSpacing(WIDGET_SPACING);
00359 
00360   mainGrid->addWidget          ( albumAnnotationFrame, 0, 0);
00361   mainGrid->setColStretch(0, 1);
00362 
00363   mainGrid->addWidget          ( subalbumAnnotationFrame, 0, 1);
00364   mainGrid->setColStretch(1, 1);
00365 
00366   QVBoxLayout* vb = new QVBoxLayout(this);
00367   this->layout()->setMenuBar( menu );
00368   vb->addWidget(mainFrame);
00369   //-----------------------------------------------
00370 }

TitleWidget::~TitleWidget  ) 
 

Deletes stuff!

Definition at line 390 of file titleWidget.cpp.

References albm.

00391 {
00392   //delete old album
00393   delete albm;
00394   albm = NULL;
00395 }


Member Function Documentation

void TitleWidget::aboutClosed  )  [slot]
 

Frees about dialog once closed.

Definition at line 1221 of file titleWidget.cpp.

References about.

Referenced by aboutProgram().

01222 {
01223   delete about;
01224   about = NULL;
01225 }

void TitleWidget::aboutProgram int  mode = ABOUT  )  [slot]
 

Pops up about dialog.

Definition at line 1183 of file titleWidget.cpp.

References about, aboutClosed(), and centerWindow().

Referenced by WelcomeWindow::itemClicked(), and TitleWidget().

01184 {
01185   //create window and center if not already present
01186   if(about == NULL)
01187   {
01188     about = new About(mode);
01189     connect( about, SIGNAL(closed()),
01190              this, SLOT(aboutClosed()));
01191     about->show();
01192     centerWindow(about);
01193   }
01194 
01195   about->raise();
01196   about->setActiveWindow();
01197 }

void TitleWidget::albumStatistics  )  [private, slot]
 

Pops up album statistics window.

Definition at line 1124 of file titleWidget.cpp.

References albm, albumStatisticsClosed(), albumStats, and centerWindow().

Referenced by TitleWidget().

01125 {
01126   //create window and center if not already present
01127   if(albumStats == NULL)
01128   {
01129     albumStats = new AlbumStatistics(albm);
01130     connect( albumStats, SIGNAL(closed()),
01131            this, SLOT(albumStatisticsClosed()));
01132     albumStats->show();
01133     centerWindow(albumStats);
01134   }
01135 
01136   albumStats->raise();
01137   albumStats->setActiveWindow();
01138 }

void TitleWidget::albumStatisticsClosed  )  [slot]
 

Frees album statistics dialog once closed.

Definition at line 1215 of file titleWidget.cpp.

References albumStats.

Referenced by albumStatistics().

01216 {
01217   delete albumStats;
01218   albumStats = NULL;
01219 }

void TitleWidget::clearOpenRecentMenu  )  [private, slot]
 

Clears albums from open recent menu.

Definition at line 1351 of file titleWidget.cpp.

References RecentAlbums::clearList(), recentAlbums, and refreshOpenRecentMenu().

Referenced by refreshOpenRecentMenu().

01352 {
01353   //clear recent list
01354   recentAlbums.clearList();
01355   
01356   //refresh menu
01357   refreshOpenRecentMenu();
01358 }

QString TitleWidget::createTmpDir QString  albumPath = QString::null  )  [protected]
 

Definition at line 1292 of file titleWidget.cpp.

References Window::getConfig(), Configuration::getString(), Configuration::resetSetting(), and window.

Referenced by loadAlbum(), newAlbum(), and TitleWidget().

01293 {
01294   //if album path provided attempt to create tmp directory in there to
01295   //minimize cost of doing moves when saving album changes.
01296   //the other reasoning is that user will have hopefully provided enough
01297   //space for saving large files on directory where they previously saved,
01298   //so this minmizes the chance of running out of disk hopefully
01299   if(!albumPath.isNull())
01300   {
01301     QDir rootDir( albumPath );
01302     if(rootDir.exists( "tmp" ) || rootDir.mkdir( "tmp" ))
01303     return QDir::convertSeparators( albumPath + "/tmp" );
01304   }
01305 
01306   //otherwise create unique tmp dir under scratch dir user specified in preferences
01307   QDate date = QDate::currentDate();
01308   QTime time = QTime::currentTime();
01309   QString baseDir = window->getConfig()->getString( "loadSave", "tempImageDirectory" );
01310 
01311   QDir testPath(baseDir);
01312   if(!testPath.exists())
01313   {
01314     window->getConfig()->resetSetting( "loadSave", "tempImageDirectory" );
01315     baseDir = window->getConfig()->getString( "loadSave", "tempImageDirectory" );
01316   }
01317 
01318   QString tmpDir = QString("albumshaper_tmp%1%2%3%4%5%6%7").arg( date.year() ).arg( date.month() ).arg
01319                                   ( date.day() ).arg( time.hour() ).arg( time.minute() ).arg( time.second() ).arg( time.msec() );
01320 
01321   QDir rootDir( baseDir );
01322   if(rootDir.exists() && (rootDir.exists( tmpDir ) || rootDir.mkdir( tmpDir) ) )
01323   {
01324 /*    AlertDialog alert( "tmpDir:", QDir::convertSeparators( QString("(" + baseDir + "/" + tmpDir ) ),
01325     "alertIcons/warning.png", this );
01326     alert.exec();
01327 */
01328     return QDir::convertSeparators( baseDir + "/" + tmpDir );
01329   }
01330   else
01331   {
01332 //    cout << "ERROR!\n";
01333     return QString::null;
01334   }
01335 }

void TitleWidget::dragEnterEvent QDragEnterEvent *  e  )  [protected]
 

Definition at line 1270 of file titleWidget.cpp.

01271 {
01272   e->accept(true);
01273 }

void TitleWidget::dropEvent QDropEvent *  e  )  [protected]
 

Definition at line 1275 of file titleWidget.cpp.

References Window::getLayout(), SubalbumWidget::getPhotos(), LayoutWidget::getSubalbum(), setAlbumImage(), setSubalbumImage(), width, and window.

01276 {
01277   //force redraw so we don't see missing unpainted
01278   //region while we resize an image which takes a while.
01279   repaint(false);
01280   qApp->processEvents();
01281 
01282   //if the source is not the origanize icon view then ignore the event
01283   if(e->source()->parentWidget() != window->getLayout()->getSubalbum()->getPhotos())
01284     return;
01285   
01286   if( e->pos().x() < (width() / 2) )
01287     setAlbumImage();
01288   else
01289     setSubalbumImage();
01290 }

void TitleWidget::exportLargeImages  )  [private, slot]
 

Export large images only to a new directory for printing purposes.

Definition at line 799 of file titleWidget.cpp.

References Album::exportLargeImages(), fixFilename(), getAlbum(), Window::getConfig(), Window::getLayout(), Album::getName(), Album::getNumPhotos(), Album::getSaveLocation(), Window::getStatus(), Configuration::getString(), LayoutWidget::getSubalbum(), LayoutWidget::getSubalbums(), Album::prevSave(), setBusy(), StatusWidget::setStatus(), StatusWidget::showProgressBar(), SubalbumWidget::updateButtons(), SubalbumsWidget::updateButtons(), and window.

Referenced by TitleWidget().

00800 {
00801   //setup dialog title and default path
00802   QString dialogTitle = tr( "Album Shaper: Export Large Images" );
00803 
00804   //new directory name in which all images will be contained
00805   QString newDir;
00806   if(getAlbum()->prevSave())
00807   { newDir = QDir( getAlbum()->getSaveLocation() ).dirName() + "_IMAGES"; }
00808   else
00809   { newDir = getAlbum()->getName() + "_IMAGES"; }
00810   newDir = fixFilename( newDir );
00811   
00812   //get filename from user
00813   QFileDialog* fd = new QFileDialog( this, "file dialog", TRUE );
00814   fd->setCaption( tr("Export Location") );
00815   fd->setMode( QFileDialog::DirectoryOnly );
00816   fd->setDir( window->getConfig()->getString( "loadSave", "loadSaveDir" ) );
00817   
00818   //user canceled operation
00819   if ( !fd->exec() == QDialog::Accepted ) { return; }
00820 
00821   //get export path
00822   QString exportPath = QDir::convertSeparators( fd->selectedFile() + "/" + newDir );
00823 
00824   //check to make sure the album is not in this location, if so raise red flag and abort!!
00825   if( getAlbum()->prevSave() && getAlbum()->getSaveLocation().compare( exportPath ) == 0 )
00826   {
00827     QString errorMessage = tr("Error! Cannot export to album location on disk!");
00828     QString errorDesc = tr("Exporting large images to the same location the album is stored will corrupt it and is not allowed. Try using the default location when exporting images, or chose a different directory.");
00829     AlertDialog alert( errorMessage, errorDesc,
00830                        "alertIcons/warning.png", this );
00831     alert.exec();
00832     return;
00833   }
00834 
00835   //otherwise check if directory already exists, if so warn user and ask before proceeding
00836   QDir tmpDir;
00837   if(tmpDir.exists( exportPath ) )
00838   {
00839     QString warningMessage = 
00840     QString(tr("Warning! A directory named %1 already exists in %2. Continue with export?")).arg
00841     ( newDir ).arg( fd->selectedFile() );
00842     
00843     QuestionDialog sure( tr("Directory Exists!"),
00844                          warningMessage, "alertIcons/warning.png",
00845                          this );
00846     if(!sure.exec()) { return; }
00847   }    
00848   //else create directory
00849   else
00850   {
00851     if( !tmpDir.mkdir( exportPath ) )
00852     {
00853       AlertDialog alert( tr("Error creating directory!"),
00854                          tr("Unable to create directory to export images to.Perhaps you are running out of disk space or you don't have sufficient privledges?"),
00855                            "alertIcons/warning.png", this );
00856       alert.exec();
00857       return;
00858     }
00859   }
00860 
00861   //set busy flag and disable buttons
00862   setBusy(true);
00863   window->getLayout()->getSubalbums()->updateButtons(false);
00864   if(window->getLayout()->getSubalbum() != NULL)
00865     window->getLayout()->getSubalbum()->updateButtons(false);
00866   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00867 
00868   //setup progress bar
00869   int numPhotos = getAlbum()->getNumPhotos();  
00870   QString exportMessage = tr( "Exporting %1 photos" );
00871   window->getStatus()->showProgressBar( exportMessage.arg(numPhotos), numPhotos );
00872   qApp->processEvents();
00873   
00874   //export large images
00875   getAlbum()->exportLargeImages(window->getStatus(), exportPath, exportMessage);  
00876 
00877   //remove progress bar
00878   window->getStatus()->setStatus( tr("Exporting photos complete.") );
00879 
00880   //nolonger busy
00881   setBusy(false);
00882   window->getLayout()->getSubalbums()->updateButtons(true);
00883   if(window->getLayout()->getSubalbum() != NULL)
00884     window->getLayout()->getSubalbum()->updateButtons(true);
00885   qApp->restoreOverrideCursor();
00886 }

void TitleWidget::exportSmallWebGallery  )  [private, slot]
 

Export small web gallery (excludes full size images and Album.xml file).

Definition at line 699 of file titleWidget.cpp.

References Album::exportCompressedWebAlbum(), fixFilename(), getAlbum(), Window::getConfig(), Window::getLayout(), Album::getName(), Album::getNumPhotos(), Album::getSaveLocation(), Window::getStatus(), Configuration::getString(), LayoutWidget::getSubalbum(), LayoutWidget::getSubalbums(), Album::prevSave(), setBusy(), StatusWidget::setStatus(), StatusWidget::showProgressBar(), SaveDialog::themeAvailable(), SubalbumWidget::updateButtons(), SubalbumsWidget::updateButtons(), and window.

Referenced by TitleWidget().

00700 {
00701   //if the Album's theme is not currently available alert user and bail
00702   if(!SaveDialog::themeAvailable( getAlbum()->getTheme() ))
00703   {
00704     AlertDialog alert( tr("Previous theme not available!"),
00705                        QString(tr("Theme previously used to save this album not available on this machine. Before exporting the %1 theme must be installed, or the album must be resaved using a differnt theme.")).arg( getAlbum()->getTheme() ),
00706                         "alertIcons/warning.png", this );
00707     alert.exec();
00708     return;
00709   }
00710   
00711   
00712   //setup dialog title and default path
00713   QString dialogTitle = tr( "Album Shaper: Export Small Web Gallery" );
00714   
00715   //new directory name in which all images will be contained
00716   QString newDir;
00717   if(getAlbum()->prevSave())
00718   { newDir = QDir( getAlbum()->getSaveLocation() ).dirName() + "_WEB"; }
00719   else
00720   { newDir = getAlbum()->getName() + "_WEB"; }
00721   newDir = fixFilename( newDir );
00722   
00723   //get filename from user
00724   QFileDialog* fd = new QFileDialog( this, "file dialog", TRUE );
00725   fd->setCaption( tr("Export Location") );
00726   fd->setMode( QFileDialog::DirectoryOnly );
00727   fd->setDir( window->getConfig()->getString( "loadSave", "loadSaveDir" ) );
00728   
00729   //user canceled operation
00730   if ( !fd->exec() == QDialog::Accepted ) { return; }
00731   
00732   //get export path
00733   QString exportPath = QDir::convertSeparators( fd->selectedFile() + "/" + newDir );
00734   
00735   //check to make sure the album is not in this location, if so raise red flag and abort!!
00736   if( getAlbum()->prevSave() && getAlbum()->getSaveLocation().compare( exportPath ) == 0 )
00737   {
00738     QString errorMessage = tr("Error! Cannot export to album location on disk!");
00739     QString errorDesc = tr("Exporting small web galleries to the same location the album is stored will corrupt it and is not allowed. Try using the default location when exporting images, or chose a different directory.");
00740     AlertDialog alert( errorMessage, errorDesc,
00741                        "alertIcons/warning.png", this );
00742     alert.exec();
00743     return;
00744   }
00745   
00746   //otherwise check if directory already exists, if so warn user and ask before proceeding
00747   QDir tmpDir;
00748   if(tmpDir.exists( exportPath ) )
00749   {
00750     QString warningMessage = 
00751     QString(tr("Warning! A directory named %1 already exists in %2. Continue with export?")).arg
00752     ( newDir ).arg( fd->selectedFile() );
00753     
00754     QuestionDialog sure( tr("Directory Exists!"),
00755                          warningMessage, "alertIcons/warning.png",
00756                          this );
00757     if(!sure.exec()) { return; }
00758   }    
00759   //else create directory
00760   else
00761   {
00762     if( !tmpDir.mkdir( exportPath ) )
00763     {
00764       AlertDialog alert( tr("Error creating directory!"),
00765                          tr("Unable to create directory to export images to.Perhaps you are running out of disk space or you don't have sufficient privledges?"),
00766                          "alertIcons/warning.png", this );
00767       alert.exec();
00768       return;
00769     }
00770   }
00771   
00772   //set busy flag and disable buttons
00773   setBusy(true);
00774   window->getLayout()->getSubalbums()->updateButtons(false);
00775   if(window->getLayout()->getSubalbum() != NULL)
00776     window->getLayout()->getSubalbum()->updateButtons(false);
00777   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00778   
00779   //setup progress bar
00780   int numPhotos = getAlbum()->getNumPhotos();  
00781   QString exportMessage = tr( "Exporting %1 photos to web gallery" );
00782   window->getStatus()->showProgressBar( exportMessage.arg(numPhotos), numPhotos );
00783   qApp->processEvents();
00784   
00785   //export large images
00786   getAlbum()->exportCompressedWebAlbum(window->getStatus(), exportPath, exportMessage);  
00787   
00788   //remove progress bar
00789   window->getStatus()->setStatus( tr("Exporting photos complete.") );
00790   
00791   //nolonger busy
00792   setBusy(false);
00793   window->getLayout()->getSubalbums()->updateButtons(true);
00794   if(window->getLayout()->getSubalbum() != NULL)
00795     window->getLayout()->getSubalbum()->updateButtons(true);
00796   qApp->restoreOverrideCursor();
00797 }

Album * TitleWidget::getAlbum  ) 
 

Returns a pointer to the album object.

Definition at line 486 of file titleWidget.cpp.

Referenced by Window::closeEvent(), SubalbumsWidget::createAction(), SubalbumsWidget::deleteAction(), exportLargeImages(), exportSmallWebGallery(), SubalbumsWidget::refreshCollectionsList(), SubalbumsWidget::reorder(), saveAlbum(), and saveAsAlbum().

00487 {
00488   return albm;
00489 }

bool TitleWidget::getBusy  ) 
 

is program busy?

Definition at line 1239 of file titleWidget.cpp.

Referenced by SubalbumsWidget::handleSelectionAttempt().

01240 {
01241   return busy;
01242 }

RecentAlbums * TitleWidget::getRecentAlbums  ) 
 

returns handle to recent albums object

Definition at line 1459 of file titleWidget.cpp.

Referenced by Window::~Window().

01460 {
01461   return &recentAlbums; 
01462 }

void TitleWidget::help  )  [slot]
 

Pops up HelpWindow.

Definition at line 1199 of file titleWidget.cpp.

References centerWindow(), helpClosed(), and helpWindow.

Referenced by WelcomeWindow::itemClicked(), and TitleWidget().

01200 {
01201   //create window and center if not already present
01202   if(helpWindow == NULL)
01203   {
01204     helpWindow = new HelpWindow(0);
01205     connect( helpWindow, SIGNAL(closed()),
01206              this, SLOT(helpClosed()));
01207     helpWindow->show();
01208     centerWindow(helpWindow);
01209   }
01210 
01211   helpWindow->raise();
01212   helpWindow->setActiveWindow();
01213 }

void TitleWidget::helpClosed  )  [slot]
 

Frees HelpWindow once closed.

Definition at line 1227 of file titleWidget.cpp.

References helpWindow.

Referenced by help().

01228 {
01229   delete helpWindow;
01230   helpWindow = NULL;
01231 }

void TitleWidget::loadAlbum QString  location  )  [private, slot]
 

Loads a specified album.

Definition at line 888 of file titleWidget.cpp.

References albm, createTmpDir(), file, Configuration::getBool(), Window::getConfig(), Album::getFirstSubalbum(), Window::getLayout(), Album::getName(), Album::getNumPhotos(), Album::getSaveLocation(), Window::getStatus(), Configuration::getString(), LayoutWidget::getSubalbum(), LayoutWidget::getSubalbums(), Album::getTmpDir(), Album::importFromDisk(), RecentAlbums::insertEntry(), quitApplication(), recentAlbums, refresh(), refreshOpenRecentMenu(), ALabel::removePixmap(), REVERT_TO_SAVED_ALBUM, setBusy(), Album::setModified(), Configuration::setString(), SubalbumWidget::setSubalbum(), subalbumAnnotationFrame, subalbumImage, tmpDirErrorDesc, tmpDirErrorMessage, SubalbumWidget::updateButtons(), SubalbumsWidget::updateButtons(), updateMenus(), and window.

00889 {
00890   //enable busy cursor, set busy flag, and deactivate buttons
00891   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00892   setBusy(true);
00893   window->getLayout()->getSubalbums()->updateButtons(false);
00894   if(window->getLayout()->getSubalbum() != NULL)
00895     window->getLayout()->getSubalbum()->updateButtons(false);
00896 
00897   //store load/save location
00898   QDir lastDir = QDir( QFileInfo(albumXML).dirPath() );
00899   lastDir.cdUp();
00900   window->getConfig()->setString( "loadSave", "loadSaveDir", lastDir.path() );
00901  
00902   //create a new album (with no subalbums, hense false)
00903   delete albm;
00904 
00905   albm = new Album( createTmpDir( QFileInfo(albumXML).dirPath() ), false );
00906   if(albm->getTmpDir().isNull() )
00907   {
00908       AlertDialog alert( tmpDirErrorMessage, tmpDirErrorDesc + window->getConfig()->getString( "loadSave", "tempImageDirectory" ),
00909       "alertIcons/warning.png", this );
00910       alert.exec();
00911       quitApplication();
00912   }
00913 
00914   //attempt to load xml file
00915   int errorCode = albm->importFromDisk(window->getStatus(), albumXML,
00916                                        window->getConfig()->getBool( "loadSave", "disableCheckPhotoMods" ) );
00917 
00918   //if no subalbums in album then hide subalbum annotations
00919   if(albm->getFirstSubalbum() == NULL)
00920   {
00921     subalbumAnnotationFrame->hide();
00922     subalbumImage->removePixmap(true);
00923   }
00924   
00925   //reset editing interface since old pointers are invalid
00926   window->getLayout()->getSubalbum()->setSubalbum( NULL );
00927   refresh();
00928 
00929   //set album as not modified
00930   albm->setModified(false);
00931     
00932   //update recent albums listing
00933   recentAlbums.insertEntry( albm->getName(), albm->getSaveLocation(), 
00934                            QString("%1").arg(albm->getNumPhotos()), false );
00935   refreshOpenRecentMenu();  
00936   
00937   //nolonger busy
00938   qApp->restoreOverrideCursor();
00939   setBusy(false);
00940   window->getLayout()->getSubalbums()->updateButtons(true);
00941   if(window->getLayout()->getSubalbum() != NULL)
00942     window->getLayout()->getSubalbum()->updateButtons(true);
00943   
00944   //load successful
00945   if(errorCode == ALBUM_LOADED)
00946   {
00947     //enable "revert" menu option
00948     file->setItemEnabled( REVERT_TO_SAVED_ALBUM, true );    
00949 
00950     //update presentation command based on if there are photos in this album
00951     updateMenus();
00952   }
00953   //else display appropriate error message
00954   else
00955   {  
00956     QString errorMessage, errorDescription;
00957     if(errorCode == ALBUM_READ_ERROR)
00958     {
00959       errorMessage = tr("Unable to open file!");
00960       errorDescription = tr("An error was encountered attempting to load the XML file. Perhaps you do not have read access?");
00961     }
00962     else if(errorCode == ALBUM_XML_ERROR)
00963     {
00964       errorMessage = tr("Unable to construct DOM!");
00965       errorDescription = tr("The XML file you selected is not valid XML.");
00966     }
00967     else
00968     {
00969       errorMessage = tr("Unknown loading error!");
00970       errorDescription = tr("An unknown error was encountered loading the specified file.");
00971     }
00972 
00973     AlertDialog alert( errorMessage, errorDescription, "alertIcons/warning.png", this );
00974     alert.exec();
00975   }
00976 }

void TitleWidget::loadAlbum  )  [private, slot]
 

Loads an album specified with file chooser.

make sure we want to proceed

Definition at line 620 of file titleWidget.cpp.

References Window::getConfig(), Configuration::getString(), proceedWithLoad(), Configuration::resetSetting(), and window.

Referenced by loadRecentAlbum(), revertToSaved(), and TitleWidget().

00621 {
00623   if(!proceedWithLoad())
00624     return;
00625 
00626   QString path = window->getConfig()->getString( "loadSave", "loadSaveDir" );
00627   QDir testPath(path);
00628   if(!testPath.exists())
00629   {
00630     window->getConfig()->resetSetting( "loadSave", "loadSaveDir" );
00631     path = window->getConfig()->getString( "loadSave", "loadSaveDir" );
00632   }
00633   
00634   QString albumXML = QFileDialog::getOpenFileName( path,
00635                                                    tr("XML Files (*.xml)"),
00636                                                    this,
00637                                                    "open file dialog",
00638                                                    tr("Choose an album to load") );
00639   
00640   //if null bail
00641   if(albumXML.isNull()) return;
00642   
00643   //attempt to load album
00644   loadAlbum( albumXML );    
00645 }  

void TitleWidget::loadRecentAlbum int  index  )  [private, slot]
 

Loads a recent album.

make sure we want to proceed

Definition at line 647 of file titleWidget.cpp.

References RecentAlbums::getEntry(), loadAlbum(), proceedWithLoad(), and recentAlbums.

Referenced by refreshOpenRecentMenu().

00648 {
00650   if(!proceedWithLoad())
00651     return;
00652   //load album
00653   QString recentName, recentLocation, recentPhotoCount;
00654   recentAlbums.getEntry( index, recentName, recentLocation, recentPhotoCount );
00655   loadAlbum( QDir::convertSeparators( recentLocation + "/Album.xml") );             
00656 }

void TitleWidget::newAlbum  )  [private, slot]
 

Resets to empty album.

Definition at line 578 of file titleWidget.cpp.

References albm, albumImage, Album::albumModified(), createTmpDir(), file, Configuration::getBool(), Window::getConfig(), Window::getLayout(), Configuration::getString(), LayoutWidget::getSubalbum(), Album::getTmpDir(), quitApplication(), refresh(), ALabel::removePixmap(), REVERT_TO_SAVED_ALBUM, Album::setModified(), SubalbumWidget::setSubalbum(), subalbumImage, tmpDirErrorDesc, tmpDirErrorMessage, and window.

Referenced by TitleWidget().

00579 {
00580   //if modifications exist and user wants to receive destructive action warnings,
00581   //ask if they are sure before creating a new album
00582   if( albm->albumModified() && window->getConfig()->getBool( "alerts", "showDestructiveAlerts" ) )
00583   {
00584     QuestionDialog sure( tr("New album?"),
00585                                    tr("Warning, unsaved modifications to the current album exist. Creating a new album will result in lost work. Are you sure you want to do this?"),
00586                                    "alertIcons/warning.png",
00587                                    this );
00588     if(!sure.exec())
00589       return;
00590   }
00591 
00592   //delete old album
00593   delete albm;
00594 
00595   //create new one
00596   albm = new Album( createTmpDir() );
00597   
00598   if(albm->getTmpDir().isNull() )
00599   {
00600       AlertDialog alert( tmpDirErrorMessage, tmpDirErrorDesc + window->getConfig()->getString( "loadSave", "tempImageDirectory" ),
00601       "alertIcons/warning.png", this );
00602       alert.exec();
00603       quitApplication();
00604   }
00605 
00606   //refresh screen
00607   albumImage->removePixmap();
00608   subalbumImage->removePixmap(true);
00609 
00610   //disable revert menu option since there is no loaded album
00611   file->setItemEnabled( REVERT_TO_SAVED_ALBUM, false );  
00612   
00613   //reset editing interface since old pointers are invalid
00614   window->getLayout()->getSubalbum()->setSubalbum( NULL );
00615   refresh();
00616 
00617   albm->setModified(false);
00618 }

bool TitleWidget::proceedWithLoad  )  [private, slot]
 

Helper function for load methods, checks if there are any unsaved changes and if so warns user any such changes will be lost if they proceed.

Definition at line 658 of file titleWidget.cpp.

References albm, Album::albumModified(), Configuration::getBool(), Window::getConfig(), and window.

Referenced by loadAlbum(), and loadRecentAlbum().

00659 {
00660   //if modifications exist and user wants to receive destructive action warnings,
00661   //ask if they are sure before creating a new album
00662   if( albm->albumModified() && window->getConfig()->getBool( "alerts", "showDestructiveAlerts" ) )
00663   {
00664     QuestionDialog sure( tr("Load album?"),
00665                          tr("Warning, unsaved modifications to the current album exist. Loading a new album will result in lost work. Are you sure you want to do this?"),
00666                          "alertIcons/warning.png",
00667                          this );
00668     if(!sure.exec())
00669       return false;
00670   }  
00671   
00672   return true;
00673 }

void TitleWidget::quitApplication  )  [slot]
 

Quit slot.

Definition at line 1265 of file titleWidget.cpp.

References window.

Referenced by loadAlbum(), newAlbum(), and TitleWidget().

01266 {
01267   window->close();
01268 }

void TitleWidget::refresh  ) 
 

Refreshs data from backend objects.

Definition at line 565 of file titleWidget.cpp.

References Window::refresh(), updateAlbumAnnotations(), and window.

Referenced by loadAlbum(), and newAlbum().

00566 {
00567   //first refresh the subalbums listing. this is 
00568   //IMPERATIVE! Right now current subalbum selection contains a pointer
00569   //to dead memory where previous subalbum was deleted. 
00570   //AKA not refreshing the subalbums iconview first will cause a crash!
00571   window->refresh();
00572 
00573   //update the album annotations (name, desc, author, images)
00574   //subalbum auto updated since window refresh auto selected first item
00575   updateAlbumAnnotations();
00576 }

void TitleWidget::refreshCollectionAnnotations Subalbum collection  )  [slot]
 

Update displayed collection name and cover image.

Definition at line 448 of file titleWidget.cpp.

References detectModifications, Subalbum::getDescription(), Subalbum::getName(), Subalbum::getRepresentativeImage(), LARGE, ALabel::removePixmap(), ALabel::setPixmap(), SMALL, subalbumAnnotationFrame, subalbumDescriptionVal, subalbumImage, and subalbumNameVal.

00449 {
00450   //disable modification detection while updating fields
00451   detectModifications = false;
00452 
00453   //get subalbum pointer
00454   if( collection == NULL )
00455   {
00456     subalbumAnnotationFrame->hide();
00457     subalbumImage->removePixmap(true);
00458   }
00459   else
00460   {
00461     subalbumAnnotationFrame->show();
00462 
00463     //if no image then remove pixmap
00464     if( collection->getRepresentativeImage(LARGE) != NULL)
00465       subalbumImage->setPixmap( *collection->getRepresentativeImage(SMALL) );
00466     else
00467       subalbumImage->removePixmap();
00468 
00469     subalbumNameVal->setText( collection->getName() );
00470     subalbumNameVal->setCursorPosition(0);
00471     subalbumDescriptionVal->setText( collection->getDescription() );
00472     subalbumDescriptionVal->setCursorPosition(0);
00473   }
00474 
00475   //enable modification detection
00476   detectModifications = true;
00477 }

void TitleWidget::refreshOpenRecentMenu  )  [private]
 

Refreshes open recent menu.

Definition at line 1360 of file titleWidget.cpp.

References clearOpenRecentMenu(), RecentAlbums::getEntry(), loadRecentAlbum(), RecentAlbums::numEntries(), openRecent, recentAlbums, and scaleImage().

Referenced by clearOpenRecentMenu(), loadAlbum(), saveAlbum(), saveAsAlbum(), and TitleWidget().

01361 {
01362   //flush all entries
01363   openRecent->clear();
01364 
01365   //insert recent albums into menu
01366   int i;
01367   int numEntries = recentAlbums.numEntries();
01368   QString recentName, recentLocation, recentPhotoCount;
01369   for(i = 0; i<numEntries; i++)
01370   {
01371     Key key;
01372     if(i == 0) key = Key_1;
01373     else if(i == 1) key = Key_2;
01374     else if(i == 2) key = Key_3;
01375     else if(i == 3) key = Key_4;
01376     else if(i == 4) key = Key_5;
01377     else if(i == 5) key = Key_6;
01378     else if(i == 6) key = Key_7;
01379     else if(i == 7) key = Key_8;
01380     else if(i == 8) key = Key_9;
01381     else key = Key_unknown;
01382     
01383     //get album name + location
01384     recentAlbums.getEntry( i, recentName, recentLocation, recentPhotoCount );
01385 
01386     int recentItem;
01387     QDir tempDir;
01388     //----------------------------------------------    
01389     //PLATFORM_SPECIFIC_CODE
01390     //Mac OS X does not support custom painted system menu entries. :(
01391     #if defined(Q_OS_MACX)
01392     QString albumImageLocation = QDir::convertSeparators( recentLocation + "/img/album.jpg" );
01393     
01394     //don't photo count if not available (-1)
01395     if(recentPhotoCount.compare("-1") == 0)
01396       recentPhotoCount = "";
01397     else
01398       recentPhotoCount = " (" + recentPhotoCount + ")";
01399 
01400     //if album image exits resize it and use for menu item icon
01401     if( tempDir.exists( albumImageLocation ) )
01402     {
01403       //scale image
01404       QImage scaledAlbumImage;
01405       scaleImage( albumImageLocation, scaledAlbumImage, 32, 32 );
01406       
01407       //construct pixmap and insert menu entry
01408       QPixmap scaledAlbumImagePixmap;
01409       scaledAlbumImagePixmap.convertFromImage( scaledAlbumImage );
01410 
01411       recentItem = openRecent->insertItem( QIconSet( scaledAlbumImagePixmap ),
01412                                            QString("%1%2").arg(recentName).
01413                                            arg(recentPhotoCount), 
01414                                            this, SLOT(loadRecentAlbum(int)) );  
01415     }      
01416     //otherwise simply display the album name and number of phots (if available)
01417     else
01418     {
01419       //insert menu entry using text alone
01420       recentItem = openRecent->insertItem( QString("%1%2").arg(recentName).
01421                                            arg(recentPhotoCount), 
01422                                            this, SLOT(loadRecentAlbum(int)) );
01423     }
01424     
01425     //Set accelerator key sequence if valid    
01426     if( key != Key_unknown )
01427       openRecent->setAccel( CTRL+key, recentItem ); 
01428     
01429     //----------------------------------------------    
01430     //Under other operating systems (Windows, Linux, FreeBSD) use custom recent album menu item 
01431     //such that album image is larger and more detail is provided
01432     #else  
01433       recentItem = openRecent->insertItem( new RecentAlbumMenuItem(recentName, 
01434                                                                    recentLocation, 
01435                                                                    recentPhotoCount) );                                                            
01436       openRecent->connectItem( recentItem, this, SLOT(loadRecentAlbum(int)) );
01437       if( key != Key_unknown )
01438         openRecent->setAccel( CTRL+key, recentItem ); 
01439     #endif   
01440     //----------------------------------------------         
01441     //set slot param
01442     openRecent->setItemParameter( recentItem, i );
01443 
01444     //if the Album.xml file is unavailable then disable menu entry
01445     if( !tempDir.exists( QDir::convertSeparators(recentLocation + "/Album.xml") ) )
01446       openRecent->setItemEnabled( recentItem, false );    
01447   }
01448 
01449   //insert separator and "clear menu" entry.
01450   //if there are no entries, don't use separator and disable "clear entries" menu item
01451   if(numEntries > 0) {  openRecent->insertSeparator(); }
01452 
01453   int CLEAR_MENU = openRecent->insertItem( tr("Clear Menu"), this, SLOT(clearOpenRecentMenu()) );  
01454 
01455   if(numEntries == 0)
01456     openRecent->setItemEnabled( CLEAR_MENU, false );      
01457 }

void TitleWidget::removeSelectedPhotoDesc  )  [private, slot]
 

Strip descriptions from selected photos.

Definition at line 1140 of file titleWidget.cpp.

References SubalbumWidget::anyPhotosSelected(), Configuration::getBool(), Window::getConfig(), Window::getLayout(), LayoutWidget::getSubalbum(), SubalbumWidget::stripDescriptionsFromSelectedPhotos(), and window.

Referenced by TitleWidget().

01141 {
01142   //if no subalbum or photos selected ignore command
01143   if(window->getLayout()->getSubalbum() == NULL ||
01144      !window->getLayout()->getSubalbum()->anyPhotosSelected())
01145      return;
01146 
01147   //ask user if they are sure they want to remove selected photo descriptions
01148   if( window->getConfig()->getBool( "alerts", "showDestructiveAlerts" ) )
01149   {
01150     QuestionDialog sure( tr("Remove Selected Photo Descriptions?"),
01151                                    tr("This action cannot be undone. Are you sure you want to proceed?"),
01152                                    "alertIcons/warning.png",
01153                                    this );
01154     if(!sure.exec())
01155       return;
01156   }
01157 
01158   //proceed with stripping of photo descriptions
01159   window->getLayout()->getSubalbum()->stripDescriptionsFromSelectedPhotos();
01160 }

void TitleWidget::revertPhotos  )  [private, slot]
 

Revert selected photos to original form.

Definition at line 1162 of file titleWidget.cpp.

References Window::getLayout(), LayoutWidget::revertPhotos(), and window.

Referenced by TitleWidget().

01163 {  
01164   window->getLayout()->revertPhotos();
01165 }

void TitleWidget::revertToSaved  )  [private, slot]
 

Revert to last saved album.

make sure we want to proceed

Definition at line 675 of file titleWidget.cpp.

References albm, Album::albumModified(), Configuration::getBool(), Window::getConfig(), Album::getSaveLocation(), loadAlbum(), and window.

Referenced by TitleWidget().

00676 {
00677   //if there are no changed then immediately return since reverting will have no effect
00678   //TODO: disable "revert" menu entry when no modifications exist
00679   if( !albm->albumModified() )
00680     return;
00681   
00683   //if modifications exist and user wants to receive destructive action warnings,
00684   //ask if they are sure before creating a new album
00685   if( window->getConfig()->getBool( "alerts", "showDestructiveAlerts" ) )
00686   {
00687     QuestionDialog sure( tr("Revert to Saved?"),
00688                          tr("Warning, unsaved modifications to the current album exist. These changes will be lost if you revert to the album's last saved form. Are you sure you want to do this?"),
00689                          "alertIcons/warning.png",
00690                          this );
00691     if(!sure.exec())
00692       return;
00693   }    
00694   
00695   //reload album
00696   loadAlbum( QDir::convertSeparators( albm->getSaveLocation() + "/Album.xml") );  
00697 }

void TitleWidget::saveAlbum  )  [private, slot]
 

Saves album.

Definition at line 978 of file titleWidget.cpp.

References albm, Album::exportToDisk(), file, getAlbum(), Window::getConfig(), Window::getLayout(), Album::getName(), Album::getNumPhotos(), Album::getSaveLocation(), Window::getStatus(), LayoutWidget::getSubalbum(), LayoutWidget::getSubalbums(), RecentAlbums::insertEntry(), Album::prevSave(), recentAlbums, refreshOpenRecentMenu(), REVERT_TO_SAVED_ALBUM, saveAsAlbum(), setBusy(), Configuration::setString(), SaveDialog::themeAvailable(), SubalbumWidget::updateButtons(), SubalbumsWidget::updateButtons(), and window.

Referenced by TitleWidget().

00979 {
00980   //if album not previously saved then
00981   //run saveas dialog
00982   if(!getAlbum()->prevSave())
00983   {
00984     saveAsAlbum();
00985     return;
00986   }
00987 
00988   //if previously used theme not available for use again alert user,
00989   //then run saveas dialog
00990   if(!SaveDialog::themeAvailable( getAlbum()->getTheme() ))
00991   {
00992     AlertDialog alert( tr("Previous theme not available!"),
00993                             tr("Theme previously used to save this album not available on this machine. Click ok to open the save-as dialog to save an alternative theme."),
00994                             "alertIcons/warning.png", this );
00995     alert.exec();
00996     saveAsAlbum();
00997     return;
00998   }
00999 
01000   //set busy flag and disable buttons
01001   setBusy(true);
01002   window->getLayout()->getSubalbums()->updateButtons(false);
01003   if(window->getLayout()->getSubalbum() != NULL)
01004     window->getLayout()->getSubalbum()->updateButtons(false);
01005   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
01006 
01007   getAlbum()->exportToDisk(window->getStatus());
01008 
01009   window->getConfig()->setString( "loadSave", "lastUsedTheme",  getAlbum()->getTheme() );
01010 
01011   //update recent albums listing
01012   recentAlbums.insertEntry( albm->getName(), albm->getSaveLocation(), 
01013                             QString("%1").arg(albm->getNumPhotos()), false );
01014   refreshOpenRecentMenu();  
01015 
01016   //enable revert command since saved album now exists
01017   file->setItemEnabled( REVERT_TO_SAVED_ALBUM, true );    
01018   
01019   //nolonger busy
01020   setBusy(false);
01021   window->getLayout()->getSubalbums()->updateButtons(true);
01022   if(window->getLayout()->getSubalbum() != NULL)
01023     window->getLayout()->getSubalbum()->updateButtons(true);
01024   qApp->restoreOverrideCursor();
01025 }

void TitleWidget::saveAsAlbum  )  [private, slot]
 

Saves album as.

Definition at line 1027 of file titleWidget.cpp.

References albm, albumAuthorVal, Album::exportToDisk(), file, getAlbum(), Window::getConfig(), Window::getLayout(), Album::getName(), Album::getNumPhotos(), Album::getSaveLocation(), Window::getStatus(), Configuration::getString(), LayoutWidget::getSubalbum(), LayoutWidget::getSubalbums(), Album::getTheme(), RecentAlbums::insertEntry(), Album::prevSave(), recentAlbums, refreshOpenRecentMenu(), REVERT_TO_SAVED_ALBUM, SaveDialog::selectThemeAndPath(), setBusy(), Configuration::setString(), SubalbumWidget::updateButtons(), SubalbumsWidget::updateButtons(), and window.

Referenced by saveAlbum(), and TitleWidget().

01028 {
01029   //setup dialog title and default path
01030   QString dialogTitle = tr( "Album Shaper: Save As" );
01031   QString defaultPath;
01032 
01033   if(getAlbum()->prevSave())
01034     defaultPath = getAlbum()->getSaveLocation();
01035   else
01036   {
01037     defaultPath = getAlbum()->getName();
01038     defaultPath.replace( QChar(' '), "_" );
01039     defaultPath.replace( "<", "" );
01040     defaultPath.replace( ">", "" );
01041     defaultPath.replace( "&", "and" );
01042     defaultPath.replace( "\"", "" );
01043     defaultPath.replace( "\'", "" );
01044     defaultPath.replace( "?", "" );
01045     defaultPath = QDir::convertSeparators
01046        ( window->getConfig()->getString( "loadSave", "loadSaveDir" ) + "/" + defaultPath );
01047   }
01048 
01049   //get directory name in which album directory will be placed in
01050   QString theme, savePath;
01051 
01052   //if abum saved before then auto select last used theme
01053   if(getAlbum()->getTheme().compare("-1") != 0)
01054     theme = getAlbum()->getTheme();
01055   else
01056   {
01057     if(window->getConfig()->getString( "loadSave", "defaultTheme" ).compare( "Last Used" ) == 0)
01058       theme = window->getConfig()->getString( "loadSave", "lastUsedTheme" );
01059     else
01060       theme = window->getConfig()->getString( "loadSave", "defaultTheme" );
01061   }
01062 
01063   if( !SaveDialog::selectThemeAndPath( dialogTitle, defaultPath, theme, savePath ) )
01064     return;
01065 
01066   //check if directory already exists, if not attempt to create it
01067   QDir d(savePath);
01068   if(!d.exists())
01069   {
01070     if(!d.mkdir(savePath))
01071     {
01072       AlertDialog alert( tr("Error creating directory!"),
01073                               tr("Unable to create directory to save album in. Perhaps you are running out of disk space or you don't have sufficient privledges?"),
01074                               "alertIcons/warning.png", this );
01075       alert.exec();
01076       return;
01077     }
01078   }
01079   else
01080   {
01081     if(!d.isReadable())
01082     {
01083       AlertDialog alert( tr("Destination directory not readable!"),
01084                               tr("The destination directory is not readable. Perhaps you don't have sufficient privledges?"),
01085                               "alertIcons/warning.png", this );
01086       alert.exec();
01087       return;
01088     }
01089   }
01090 
01091   //store this load/Save location
01092   QDir lastDir = QDir( savePath );
01093   lastDir.cdUp();
01094   window->getConfig()->setString( "loadSave", "loadSaveDir", lastDir.path() );
01095   window->getConfig()->setString( "loadSave", "lastUsedTheme",  theme );
01096 
01097   //set busy flag and disable buttons
01098   setBusy(true);
01099   window->getLayout()->getSubalbums()->updateButtons(false);
01100   if(window->getLayout()->getSubalbum() != NULL)
01101     window->getLayout()->getSubalbum()->updateButtons(false);
01102   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
01103 
01104   //save
01105   getAlbum()->exportToDisk(window->getStatus(), savePath, theme);
01106   window->getConfig()->setString( "misc", "defaultAuthor", albumAuthorVal->text() );
01107 
01108   //update recent albums listing
01109   recentAlbums.insertEntry( albm->getName(), albm->getSaveLocation(), 
01110                             QString("%1").arg(albm->getNumPhotos()), false );
01111   refreshOpenRecentMenu();  
01112   
01113   //enable revert command since saved album now exists
01114   file->setItemEnabled( REVERT_TO_SAVED_ALBUM, true );    
01115   
01116   //nolonger busy
01117   setBusy(false);
01118   window->getLayout()->getSubalbums()->updateButtons(true);
01119   if(window->getLayout()->getSubalbum() != NULL)
01120     window->getLayout()->getSubalbum()->updateButtons(true);
01121   qApp->restoreOverrideCursor();
01122 }

void TitleWidget::setAlbum Album val  ) 
 

Sets new pointer to the album object.

Definition at line 479 of file titleWidget.cpp.

References albm.

00480 {
00481   //delete old album
00482   delete albm;
00483   albm = val;
00484 }

void TitleWidget::setAlbumImage  )  [private, slot]
 

Sets the Album Image.

Definition at line 491 of file titleWidget.cpp.

References Window::getLayout(), SubalbumWidget::getSelectedPhoto(), LayoutWidget::getSubalbum(), and window.

Referenced by dropEvent().

00492 {
00493   //---------------------------------------------------------
00494   //determine if a subalbum is even selected
00495   SubalbumWidget* sw = window->getLayout()->getSubalbum();
00496   if(sw == NULL)
00497     return;
00498   //---------------------------------------------------------
00499   //set image to photo
00500   setAlbumImage( sw->getSelectedPhoto() );
00501 }

void TitleWidget::setAlbumImage Photo photo  )  [slot]
 

Sets the album image to the passed in photo.

Definition at line 503 of file titleWidget.cpp.

References albm, albumImage, Photo::getImageFilename(), Album::getRepresentativeImage(), ALabel::setPixmap(), Album::setRepresentativeImages(), and SMALL.

00504 {
00505   if(selectedPhoto == NULL)
00506     return;
00507   //---------------------------------------------------------
00508   //set album image
00509   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00510   albm->setRepresentativeImages( selectedPhoto->getImageFilename() );
00511   //---------------------------------------------------------
00512   //update onscreen image
00513   albumImage->setPixmap( *albm->getRepresentativeImage(SMALL) );
00514   qApp->restoreOverrideCursor();
00515   //---------------------------------------------------------
00516 }

void TitleWidget::setBusy bool  val  ) 
 

set program busy state

Definition at line 1244 of file titleWidget.cpp.

References busy, file, NEW_ALBUM, OPEN_ALBUM, SAVE_ALBUM, and SAVEAS_ALBUM.

Referenced by SubalbumWidget::addImageAction(), exportLargeImages(), exportSmallWebGallery(), loadAlbum(), SubalbumWidget::removeImageAction(), SubalbumWidget::rotate270ImageAction(), SubalbumWidget::rotate90ImageAction(), saveAlbum(), and saveAsAlbum().

01245 {
01246   busy = val;
01247 
01248   //disable/enable file operations
01249   if(busy)
01250   {
01251     file->setItemEnabled(NEW_ALBUM, false);
01252     file->setItemEnabled(OPEN_ALBUM, false);
01253     file->setItemEnabled(SAVE_ALBUM, false);
01254     file->setItemEnabled(SAVEAS_ALBUM, false);
01255   }
01256   else
01257   {
01258     file->setItemEnabled(NEW_ALBUM, true);
01259     file->setItemEnabled(OPEN_ALBUM, true);
01260     file->setItemEnabled(SAVE_ALBUM, true);
01261     file->setItemEnabled(SAVEAS_ALBUM, true);
01262   }
01263 }

void TitleWidget::setSubalbumImage  )  [private, slot]
 

Sets the Subalbum Image.

Definition at line 523 of file titleWidget.cpp.

References Window::getLayout(), SubalbumWidget::getSelectedPhoto(), LayoutWidget::getSubalbum(), and window.

Referenced by dropEvent().

00524 {
00525   //---------------------------------------------------------
00526   //determine if a subalbum is even selected
00527   SubalbumWidget* sw = window->getLayout()->getSubalbum();
00528   if(sw == NULL)
00529     return;
00530   //---------------------------------------------------------
00531   //set collection image to selected photo
00532   setSubalbumImage( sw->getSelectedPhoto() );
00533 }

void TitleWidget::setSubalbumImage Photo photo  )  [slot]
 

Sets the subalbum image to the passed in photo.

Definition at line 535 of file titleWidget.cpp.

References SubalbumsWidget::getCurrentSelection(), Window::getLayout(), Subalbum::getRepresentativeImage(), SubalbumWidget::getSubalbum(), LayoutWidget::getSubalbum(), LayoutWidget::getSubalbums(), Photo::getThumbnailFilename(), MEDIUM, ALabel::setPixmap(), Subalbum::setRepresentativeImage(), SMALL, subalbumImage, and window.

00536 {
00537   if(selectedPhoto == NULL)
00538     return;
00539 
00540   //---------------------------------------------------------
00541   //set subalbum image
00542   qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00543   SubalbumWidget* sw = window->getLayout()->getSubalbum();
00544   sw->getSubalbum()->setRepresentativeImage( selectedPhoto->getThumbnailFilename() );  
00545   //---------------------------------------------------------
00546   //update onscreen image
00547   subalbumImage->setPixmap( *sw->getSubalbum()->getRepresentativeImage(SMALL) );
00548   SubalbumPreviewWidget* item = (SubalbumPreviewWidget*)window->getLayout()->getSubalbums()->getCurrentSelection();
00549   item->setPixmap( *sw->getSubalbum()->getRepresentativeImage(MEDIUM), false );
00550   qApp->restoreOverrideCursor();
00551   //---------------------------------------------------------
00552 }

void TitleWidget::settings  )  [private, slot]
 

Pops up settings window.

Definition at line 1167 of file titleWidget.cpp.

References centerWindow(), Window::getConfig(), settingsWindow, settingsWindowClosed(), and window.

Referenced by TitleWidget().

01168 {
01169   //create window and center if not already present
01170   if(settingsWindow == NULL)
01171   {
01172     settingsWindow = new ConfigurationWidget( window->getConfig() );
01173     connect( settingsWindow, SIGNAL(closed()),
01174                   this, SLOT(settingsWindowClosed()));
01175     settingsWindow->show();
01176     centerWindow(settingsWindow);
01177   }
01178 
01179   settingsWindow->raise();
01180   settingsWindow->setActiveWindow();
01181 }

void TitleWidget::settingsWindowClosed  )  [slot]
 

Definition at line 1233 of file titleWidget.cpp.

References settingsWindow.

Referenced by settings().

01234 {
01235   delete settingsWindow;
01236   settingsWindow = NULL;
01237 }

void TitleWidget::storeAnnotations  )  [private, slot]
 

Store annotations.

Definition at line 397 of file titleWidget.cpp.

References albm, albumAuthorVal, albumDescriptionVal, albumNameVal, Window::getLayout(), Subalbum::getName(), SubalbumsWidget::getSelectedSubalbum(), LayoutWidget::getSubalbums(), Album::setAuthor(), Subalbum::setDescription(), Album::setDescription(), Subalbum::setName(), Album::setName(), subalbumDescriptionVal, subalbumNameChanged(), subalbumNameVal, and window.

Referenced by TitleWidget().

00398 {
00399   //only sync backend album/collection data when detectModifications is enabled
00400   if( !detectModifications ) return;
00401 
00402   //set album annotations
00403   albm->setName        ( albumNameVal->text()        );
00404   albm->setDescription ( albumDescriptionVal->text() );
00405   albm->setAuthor      ( albumAuthorVal->text()      );
00406 
00407   //get subalbum pointer
00408   Subalbum* collection = window->getLayout()->getSubalbums()->getSelectedSubalbum();
00409   if(collection != NULL )
00410   {
00411     //store old subalbum name
00412     QString oldName =  collection->getName();
00413 
00414     //set name and description
00415     collection->setName(  subalbumNameVal->text()   );
00416     collection->setDescription(  subalbumDescriptionVal->text()   );
00417 
00418     //if subalbum name has changed emit signal
00419     if(oldName.compare( collection->getName() ) != 0)
00420       emit subalbumNameChanged();
00421   }
00422 }

void TitleWidget::subalbumNameChanged  )  [signal]
 

Emitted when user changes subalbum name.

Referenced by storeAnnotations().

void TitleWidget::unsetAlbumImage  )  [private, slot]
 

Unsets the Album Image.

Definition at line 518 of file titleWidget.cpp.

References albm, and Album::setRepresentativeImages().

Referenced by TitleWidget().

00519 {
00520   albm->setRepresentativeImages( QString::null );
00521 }

void TitleWidget::unsetSubalbumImage  )  [private, slot]
 

Unsets the Subalbum Image.

Definition at line 554 of file titleWidget.cpp.

References SubalbumsWidget::getCurrentSelection(), Window::getLayout(), Subalbum::getRepresentativeImage(), SubalbumPreviewWidget::getSubalbum(), LayoutWidget::getSubalbums(), MEDIUM, Subalbum::setRepresentativeImage(), and window.

Referenced by TitleWidget().

00555 {
00556   SubalbumPreviewWidget* item = (SubalbumPreviewWidget*)window->getLayout()->getSubalbums()->getCurrentSelection();
00557   if(item != NULL && ((SubalbumPreviewWidget*)item)->getSubalbum() != NULL)
00558   {
00559     Subalbum* subalbm =  ((SubalbumPreviewWidget*)item)->getSubalbum();
00560     subalbm->setRepresentativeImage( QString::null );
00561     item->setPixmap( *subalbm->getRepresentativeImage(MEDIUM), false );
00562   }
00563 }

void TitleWidget::updateAlbumAnnotations  )  [slot]
 

Updates subalbum annotations.

Definition at line 424 of file titleWidget.cpp.

References albm, albumAuthorVal, albumDescriptionVal, albumImage, albumNameVal, detectModifications, Album::getAuthor(), Album::getDescription(), Album::getName(), Album::getRepresentativeImage(), LARGE, ALabel::removePixmap(), ALabel::setPixmap(), and SMALL.

Referenced by refresh().

00425 {
00426   //disable modification detection while updating fields
00427   detectModifications = false;
00428 
00429   //set album annotations
00430 
00431   //if no image then remove pixmap
00432   if( albm->getRepresentativeImage(LARGE) != NULL)
00433     albumImage->setPixmap( *albm->getRepresentativeImage(SMALL) );
00434   else
00435     albumImage->removePixmap();
00436 
00437   albumNameVal->setText( albm->getName() );
00438   albumNameVal->setCursorPosition(0);
00439   albumDescriptionVal->setText( albm->getDescription() );
00440   albumDescriptionVal->setCursorPosition(0);
00441   albumAuthorVal->setText( albm->getAuthor() );
00442   albumAuthorVal->setCursorPosition(0);
00443 
00444   //enable modification detection
00445   detectModifications = true;
00446 }

void TitleWidget::updateMenus bool  anySelected = false,
bool  anyRevertable = false
[slot]
 

update begin presentation menu entry - disabled when no photos in album

Definition at line 1464 of file titleWidget.cpp.

References photoMenu, REMOVE_DESCRIPTIONS, and REVERT_PHOTOS.

Referenced by SubalbumWidget::addImageAction(), SubalbumsWidget::deleteAction(), loadAlbum(), and LayoutWidget::photoStateChangedEvent().

01465 {
01466   //no photos? disable begin presentation command
01467 //  tools->setItemEnabled( BEGIN_PRESENTATION, albm->getNumPhotos() != 0 );
01468 //  tools->setItemEnabled( BEGIN_PRESENTATION_AT, albm->getNumPhotos() != 0 );  
01469 
01470   //none selected? disable removing photo descriptions
01471   photoMenu->setItemEnabled( REMOVE_DESCRIPTIONS, anySelected );
01472 
01473   //none revertable? disable revert photos
01474   photoMenu->setItemEnabled( REVERT_PHOTOS, anyRevertable );
01475 }

void TitleWidget::useAnimation bool  val  ) 
 

Use animation for rep images?

Definition at line 372 of file titleWidget.cpp.

References albumImage, FADE_TRANSITION, ALabel::setAnimationMethods(), SLIDE_IN_LEFT, SLIDE_OUT_LEFT, and subalbumImage.

Referenced by Window::Window().

00373 {
00374   //enable animation
00375   if(val)
00376   {
00377     albumImage->setAnimationMethods( SLIDE_IN_LEFT, SLIDE_OUT_LEFT,
00378                                                                 FADE_TRANSITION, FADE_TRANSITION);
00379     subalbumImage->setAnimationMethods( SLIDE_IN_LEFT, SLIDE_OUT_LEFT,
00380                                                                 FADE_TRANSITION, FADE_TRANSITION);
00381   }
00382   //disable animation
00383   else
00384   {
00385     albumImage->setAnimationMethods();
00386     subalbumImage->setAnimationMethods();
00387   }
00388 }

void TitleWidget::windowStateChanged bool  state  )  [slot]
 

Enables/disables "minimize" window menu entry depending on window state.

Definition at line 1345 of file titleWidget.cpp.

Referenced by Window::event(), Window::hideEvent(), and Window::showEvent().

01346 { 
01347 //Do nothing 
01348 }


Member Data Documentation

About* TitleWidget::about [private]
 

About dialog pointer.

Definition at line 262 of file titleWidget.h.

Referenced by aboutClosed(), aboutProgram(), and TitleWidget().

Album* TitleWidget::albm [private]
 

Backend album object.

Definition at line 250 of file titleWidget.h.

Referenced by albumStatistics(), loadAlbum(), newAlbum(), proceedWithLoad(), revertToSaved(), saveAlbum(), saveAsAlbum(), setAlbum(), setAlbumImage(), storeAnnotations(), TitleWidget(), unsetAlbumImage(), updateAlbumAnnotations(), and ~TitleWidget().

QFrame* TitleWidget::albumAnnotationFrame [private]
 

Definition at line 231 of file titleWidget.h.

Referenced by TitleWidget().

QGridLayout* TitleWidget::albumAnnotationGrid [private]
 

Album annotation grid.

Definition at line 230 of file titleWidget.h.

Referenced by TitleWidget().

QLabel* TitleWidget::albumAuthor [private]
 

Definition at line 237 of file titleWidget.h.

Referenced by TitleWidget().

QLineEdit* TitleWidget::albumAuthorVal [private]
 

Definition at line 238 of file titleWidget.h.

Referenced by saveAsAlbum(), storeAnnotations(), TitleWidget(), and updateAlbumAnnotations().

QLabel* TitleWidget::albumDescription [private]
 

Definition at line 235 of file titleWidget.h.

Referenced by TitleWidget().

QLineEdit* TitleWidget::albumDescriptionVal [private]
 

Definition at line 236 of file titleWidget.h.

Referenced by storeAnnotations(), TitleWidget(), and updateAlbumAnnotations().

ALabel* TitleWidget::albumImage [private]
 

Definition at line 232 of file titleWidget.h.

Referenced by newAlbum(), setAlbumImage(), TitleWidget(), updateAlbumAnnotations(), and useAnimation().

QLabel* TitleWidget::albumName [private]
 

Definition at line 233 of file titleWidget.h.

Referenced by TitleWidget().

QLineEdit* TitleWidget::albumNameVal [private]
 

Definition at line 234 of file titleWidget.h.

Referenced by storeAnnotations(), TitleWidget(), and updateAlbumAnnotations().

AlbumStatistics* TitleWidget::albumStats [private]
 

Album Statistics dialog pointer.

Definition at line 256 of file titleWidget.h.

Referenced by albumStatistics(), albumStatisticsClosed(), and TitleWidget().

int TitleWidget::BEGIN_PRESENTATION [private]
 

tools menu item id's

Definition at line 287 of file titleWidget.h.

int TitleWidget::BEGIN_PRESENTATION_AT [private]
 

Definition at line 288 of file titleWidget.h.

bool TitleWidget::busy [private]
 

Is the program currently busy? helps block other operations.

Definition at line 268 of file titleWidget.h.

Referenced by setBusy(), and TitleWidget().

bool TitleWidget::cacheSetButtonState [private]
 

cached set button state

Definition at line 291 of file titleWidget.h.

bool TitleWidget::detectModifications [private]
 

Definition at line 271 of file titleWidget.h.

Referenced by refreshCollectionAnnotations(), TitleWidget(), and updateAlbumAnnotations().

int TitleWidget::EXPORT_LARGE_IMAGES [private]
 

Definition at line 280 of file titleWidget.h.

Referenced by TitleWidget().

int TitleWidget::EXPORT_SMALL_WEB_GALLERY [private]
 

Definition at line 279 of file titleWidget.h.

Referenced by TitleWidget().

QPopupMenu* TitleWidget::file [private]
 

File menu.

Definition at line 204 of file titleWidget.h.

Referenced by loadAlbum(), newAlbum(), saveAlbum(), saveAsAlbum(), setBusy(), and TitleWidget().

QPopupMenu* TitleWidget::helpMenu [private]
 

Help menu.

Definition at line 223 of file titleWidget.h.

Referenced by TitleWidget().

HelpWindow* TitleWidget::helpWindow [private]
 

HelpWindow pointer.

Definition at line 265 of file titleWidget.h.

Referenced by help(), helpClosed(), and TitleWidget().

QFrame* TitleWidget::mainFrame [private]
 

Definition at line 227 of file titleWidget.h.

Referenced by TitleWidget().

QGridLayout* TitleWidget::mainGrid [private]
 

Main grid.

Definition at line 226 of file titleWidget.h.

Referenced by TitleWidget().

QMenuBar* TitleWidget::menu [private]
 

Menubar file menu and help menu inserted in.

Definition at line 201 of file titleWidget.h.

Referenced by TitleWidget().

int TitleWidget::NEW_ALBUM [private]
 

Definition at line 274 of file titleWidget.h.

Referenced by setBusy(), and TitleWidget().

int TitleWidget::OPEN_ALBUM [private]
 

Definition at line 275 of file titleWidget.h.

Referenced by setBusy(), and TitleWidget().

QPopupMenu* TitleWidget::openRecent [private]
 

Open recent submenu.

Definition at line 207 of file titleWidget.h.

Referenced by refreshOpenRecentMenu(), and TitleWidget().

QPopupMenu* TitleWidget::photoMenu [private]
 

Photos menu.

Definition at line 210 of file titleWidget.h.

Referenced by TitleWidget(), and updateMenus().

RecentAlbums TitleWidget::recentAlbums [private]
 

Definition at line 297 of file titleWidget.h.

Referenced by clearOpenRecentMenu(), loadAlbum(), loadRecentAlbum(), refreshOpenRecentMenu(), saveAlbum(), saveAsAlbum(), and TitleWidget().

int TitleWidget::REMOVE_DESCRIPTIONS [private]
 

photos menu item id's

Definition at line 283 of file titleWidget.h.

Referenced by TitleWidget(), and updateMenus().

int TitleWidget::REVERT_PHOTOS [private]
 

Definition at line 284 of file titleWidget.h.

Referenced by TitleWidget(), and updateMenus().

int TitleWidget::REVERT_TO_SAVED_ALBUM [private]
 

Definition at line 278 of file titleWidget.h.

Referenced by loadAlbum(), newAlbum(), saveAlbum(), saveAsAlbum(), and TitleWidget().

int TitleWidget::SAVE_ALBUM [private]
 

Definition at line 276 of file titleWidget.h.

Referenced by setBusy(), and TitleWidget().

int TitleWidget::SAVEAS_ALBUM [private]
 

Definition at line 277 of file titleWidget.h.

Referenced by setBusy(), and TitleWidget().

ConfigurationWidget* TitleWidget::settingsWindow [private]
 

Settings dialog pointer.

Definition at line 259 of file titleWidget.h.

Referenced by settings(), settingsWindowClosed(), and TitleWidget().

QFrame* TitleWidget::subalbumAnnotationFrame [private]
 

Definition at line 242 of file titleWidget.h.

Referenced by loadAlbum(), refreshCollectionAnnotations(), and TitleWidget().

QGridLayout* TitleWidget::subalbumAnnotationGrid [private]
 

Subalbum annotation grid.

Definition at line 241 of file titleWidget.h.

Referenced by TitleWidget().

QLabel* TitleWidget::subalbumDescription [private]
 

Definition at line 246 of file titleWidget.h.

Referenced by TitleWidget().

QLineEdit* TitleWidget::subalbumDescriptionVal [private]
 

Definition at line 247 of file titleWidget.h.

Referenced by refreshCollectionAnnotations(), storeAnnotations(), and TitleWidget().

ALabel* TitleWidget::subalbumImage [private]
 

Definition at line 243 of file titleWidget.h.

Referenced by loadAlbum(), newAlbum(), refreshCollectionAnnotations(), setSubalbumImage(), TitleWidget(), and useAnimation().

QLabel* TitleWidget::subalbumName [private]
 

Definition at line 244 of file titleWidget.h.

Referenced by TitleWidget().

QLineEdit* TitleWidget::subalbumNameVal [private]
 

Definition at line 245 of file titleWidget.h.

Referenced by refreshCollectionAnnotations(), storeAnnotations(), and TitleWidget().

QString TitleWidget::tmpDirErrorDesc [private]
 

error message and description when temp directory cannot be created

Definition at line 294 of file titleWidget.h.

Referenced by loadAlbum(), newAlbum(), and TitleWidget().

QString TitleWidget::tmpDirErrorMessage [private]
 

error message and description when temp directory cannot be created

Definition at line 294 of file titleWidget.h.

Referenced by loadAlbum(), newAlbum(), and TitleWidget().

QPopupMenu* TitleWidget::tools [private]
 

Tools menu.

Definition at line 213 of file titleWidget.h.

Referenced by TitleWidget().

Window* TitleWidget::window [private]
 

Window pointer.

Definition at line 253 of file titleWidget.h.

Referenced by createTmpDir(), dropEvent(), exportLargeImages(), exportSmallWebGallery(), loadAlbum(), newAlbum(), proceedWithLoad(), quitApplication(), refresh(), removeSelectedPhotoDesc(), revertPhotos(), revertToSaved(), saveAlbum(), saveAsAlbum(), setAlbumImage(), setSubalbumImage(), settings(), storeAnnotations(), TitleWidget(), and unsetSubalbumImage().


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