#include <subalbumWidget.h>
Definition at line 43 of file subalbumWidget.h.
Public Member Functions | |
| SubalbumWidget (Subalbum *salbum, QWidget *parent=0, const char *name=0) | |
| Creates layout based on backend object. | |
| ~SubalbumWidget () | |
| Deletes objects. | |
| void | setSubalbum (Subalbum *salbum) |
| Resets the subalbum this subalbum widget is displaying. | |
| void | refreshPhotos () |
| refreshes all photos | |
| void | refreshSelectedPhotos () |
| refreshes selected photos | |
| void | syncPhotos () |
| Syncs all photo data to backend objects. | |
| Subalbum * | getSubalbum () |
| returns a pointer to the backend subalbum | |
| Photo * | getSelectedPhoto () |
| Returns currently selected photo. If no or multiple photos selected returns NULL. | |
| QIconView * | getPhotos () |
| Returns pointer to icon view. | |
| void | updateButtons (bool enable) |
| Activates/Deactives remove/rotate/flip buttons. | |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *) |
Private Slots | |
| void | updateName (const QString &val) |
| Updates subalbum name. | |
| void | updateDescription (const QString &val) |
| Updates subalbum description. | |
| void | setImageAction () |
| Sets currently selected photo as the representative image for the subalbum. | |
| void | updateButtons () |
| Activates/Deactives remove/rotate/flip buttons depending on if an image is selected. | |
| void | addImageAction () |
| Adds an image to the subalbum. | |
| void | removeImageAction () |
| Remove an image from the subalbum. | |
| void | rotate90ImageAction () |
| Rotate clockwise selected images. | |
| void | rotate270ImageAction () |
| Rotate counter-clockwise selected images. | |
| void | flipHorizontallyImageAction () |
| Flip about horizontal axis selected images. | |
| void | flipVerticallyImageAction () |
| Flip about vertical axis selected images. | |
| void | editAction () |
| Brings up the edit dialog for the currently selected photo. | |
| void | rearrangeAndSaveCurrent (QIconViewItem *item) |
| Rearranges photos and saves their text. | |
| void | reorder () |
Private Attributes | |
| QGridLayout * | grid |
| Grid widgets are placed in. | |
| QFrame * | buttons |
| Grid lower buttons are placed in. | |
| QGridLayout * | grid2 |
| QLabel * | subalbumName |
| Label "Subalbum Name:". | |
| QLineEdit * | subalbumNameVal |
| Actual subalbum name. | |
| QLabel * | subalbumDescription |
| Label "Description:". | |
| QLineEdit * | subalbumDescriptionVal |
| Actual subalbum description. | |
| QLabel * | representativeImageText |
| Label which shows "set" image. | |
| QPixmap * | setImageImage |
| "Set" image | |
| QPushButton * | setImage |
| Button allowing user to set the representative image for the subalbum. | |
| QLabel * | representativeLogo |
| Label which shows the representative image. | |
| QPixmap * | representativeImage |
| Representative image. | |
| PhotosIconView * | photos |
| Photos layout. | |
| Subalbum * | subalbum |
| Pointer to backend subalbum. | |
| QPixmap * | addImageImage |
| "Add" image | |
| QPushButton * | addImage |
| "Add" button | |
| QPixmap * | removeImageImage |
| "Remove" image | |
| QPushButton * | removeImage |
| "Remove" button | |
| QPixmap * | rotate90ImageImage |
| "Rotate 90" image | |
| QPushButton * | rotate90Image |
| "Rotate 90" button | |
| QPixmap * | rotate270ImageImage |
| "Rotate 270" image | |
| QPushButton * | rotate270Image |
| "Rotate 270" button | |
| QPixmap * | flipHorizontallyImageImage |
| "Flip Horizontally" image | |
| QPushButton * | flipHorizontallyImage |
| "Flip Horizontally" button | |
| QPixmap * | flipVerticallyImageImage |
| "Flip Vertically" image | |
| QPushButton * | flipVerticallyImage |
| "Flip Vertically" button | |
| QPixmap * | editImage |
| "Edit"" image | |
| QPushButton * | editButton |
| "Edit" button | |
| LayoutWidget * | layout |
| Pointer to the parent layout widget. | |
| bool | buttonsState |
| cached enabled/disabled state of buttons | |
|
||||||||||||||||
|
Creates layout based on backend object.
Definition at line 44 of file subalbumWidget.cpp. References addImage, addImageAction(), addImageImage, buttons, editAction(), editButton, editImage, flipHorizontallyImage, flipHorizontallyImageAction(), flipHorizontallyImageImage, flipVerticallyImage, flipVerticallyImageAction(), flipVerticallyImageImage, Subalbum::getDescription(), Subalbum::getName(), Subalbum::getRepresentativeImage(), grid, grid2, IMAGE_PATH, layout, photos, rearrangeAndSaveCurrent(), removeImage, removeImageAction(), removeImageImage, reorder(), representativeImage, representativeImageText, representativeLogo, rotate270Image, rotate270ImageAction(), rotate270ImageImage, rotate90Image, rotate90ImageAction(), rotate90ImageImage, setImage, setImageAction(), setImageImage, SMALL, subalbum, subalbumDescription, subalbumDescriptionVal, subalbumName, subalbumNameVal, updateButtons(), updateDescription(), and updateName().
00046 :
00047 QWidget(parent,name)
00048 {
00049 //store subalbum pointer
00050 subalbum = salbum;
00051
00052 //store layout pointer
00053 layout = (LayoutWidget*)parent;
00054
00055 //create subalbum name and description label and text entries
00056 subalbumName = new QLabel( this );
00057 subalbumName->setText( "Subalbum Name:" );
00058 subalbumName->setFont( QFont( "Times", 12, QFont::Bold ) );
00059 subalbumNameVal = new QLineEdit( this );
00060 subalbumNameVal->setFont( QFont( "Times", 12, QFont::Bold ) );
00061 subalbumNameVal->setText( subalbum->getName() );
00062 connect( subalbumNameVal, SIGNAL(textChanged(const QString&)),
00063 SLOT(updateName(const QString&)) );
00064
00065 subalbumDescription = new QLabel( this );
00066 subalbumDescription->setText( "Description:" );
00067 subalbumDescription->setFont( QFont( "Times", 12, QFont::Bold ) );
00068 subalbumDescriptionVal = new QLineEdit( this );
00069 subalbumDescriptionVal->setFont( QFont( "Times", 12, QFont::Bold ) );
00070 subalbumDescriptionVal->setText( subalbum->getDescription() );
00071 connect( subalbumDescriptionVal, SIGNAL(textChanged(const QString&)),
00072 SLOT(updateDescription(const QString&)) );
00073
00074 //create set image button
00075 representativeImageText = new QLabel( this );
00076 representativeImageText->setText( "Thumbnail:" );
00077 representativeImageText->setFont( QFont( "Times", 12, QFont::Bold ) );
00078 setImageImage = new QPixmap( QString(IMAGE_PATH)+"set.png" );
00079 setImage = new QPushButton( this );
00080 setImage->setPixmap( *setImageImage );
00081 setImage->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00082 setImage->setEnabled(false);
00083 connect( setImage, SIGNAL(clicked()), SLOT(setImageAction()) );
00084
00085 //create representative image
00086 representativeImage = subalbum->getRepresentativeImage(SMALL);
00087 representativeLogo = new QLabel( this );
00088 representativeLogo->setPixmap( *representativeImage );
00089
00090 //create photo collection
00091 photos = new PhotosIconView( this );
00092
00093 //establish a top-down view such that the scrollbar is always placed on the right
00094 photos->setArrangement( QIconView::LeftToRight );
00095 photos->setVScrollBarMode( QScrollView::AlwaysOn );
00096
00097 //allow multiple photos to be selected with control and shift keys
00098 photos->setSelectionMode( QIconView::Extended ) ;
00099
00100 //set auto-scroll on for drag-n-drop
00101 photos->setDragAutoScroll(true);
00102 photos->setAcceptDrops(true);
00103
00104 //whenever photo names are changed sync with backend object
00105 connect( photos, SIGNAL(itemRenamed( QIconViewItem *)),
00106 this, SLOT(rearrangeAndSaveCurrent( QIconViewItem *)));
00107
00108 //connect selectionChanged signal to update buttons method
00109 connect( photos, SIGNAL(selectionChanged()),
00110 SLOT(updateButtons()) );
00111
00112 //connect rightButtonClicked signal to update buttons method
00113 connect( photos, SIGNAL(rightButtonClicked(QIconViewItem*, const QPoint&)),
00114 SLOT(updateButtons()) );
00115
00116 //if the set button is clicked set the representative image for the subalbum
00117 connect( setImage, SIGNAL(clicked()), SLOT(setImageAction()) );
00118
00119 //connect drop event on iconview to reorder slot
00120 connect( photos, SIGNAL(itemHasMoved()), SLOT(reorder()) );
00121
00122 buttons = new QFrame(this);
00123
00124 addImageImage = new QPixmap( QString(IMAGE_PATH)+"add.png" );
00125 addImage = new QPushButton( buttons );
00126 addImage->setPixmap( *addImageImage );
00127 addImage->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00128 connect( addImage, SIGNAL(clicked()), SLOT(addImageAction()) );
00129
00130 removeImageImage = new QPixmap( QString(IMAGE_PATH)+"remove.png" );
00131 removeImage = new QPushButton( buttons );
00132 removeImage->setPixmap( *removeImageImage );
00133 removeImage->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00134 connect( removeImage, SIGNAL(clicked()), SLOT(removeImageAction()) );
00135
00136 rotate90ImageImage = new QPixmap( QString(IMAGE_PATH)+"rotate90.png" );
00137 rotate90Image = new QPushButton( buttons );
00138 rotate90Image->setPixmap( *rotate90ImageImage );
00139 rotate90Image->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00140 connect( rotate90Image, SIGNAL(clicked()), SLOT(rotate90ImageAction()) );
00141
00142 rotate270ImageImage = new QPixmap( QString(IMAGE_PATH)+"rotate270.png" );
00143 rotate270Image = new QPushButton( buttons );
00144 rotate270Image->setPixmap( *rotate270ImageImage );
00145 rotate270Image->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00146 connect( rotate270Image, SIGNAL(clicked()), SLOT(rotate270ImageAction()) );
00147
00148 flipHorizontallyImageImage = new QPixmap( QString(IMAGE_PATH)+"flipHorizontally.png" );
00149 flipHorizontallyImage = new QPushButton( buttons );
00150 flipHorizontallyImage->setPixmap( *flipHorizontallyImageImage );
00151 flipHorizontallyImage->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00152 connect( flipHorizontallyImage, SIGNAL(clicked()), SLOT(flipHorizontallyImageAction()) );
00153
00154 flipVerticallyImageImage = new QPixmap( QString(IMAGE_PATH)+"flipVertically.png" );
00155 flipVerticallyImage = new QPushButton( buttons );
00156 flipVerticallyImage->setPixmap( *flipVerticallyImageImage );
00157 flipVerticallyImage->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00158 connect( flipVerticallyImage, SIGNAL(clicked()), SLOT(flipVerticallyImageAction()) );
00159
00160 editImage = new QPixmap( QString(IMAGE_PATH)+"editPhoto.png" );
00161 editButton = new QPushButton( buttons );
00162 editButton->setPixmap( *editImage );
00163 editButton->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00164 connect( editButton, SIGNAL(clicked()), SLOT(editAction()) );
00165
00166 //place all items in grid layout
00167 grid = new QGridLayout( this, 5, 5, 0 );
00168 grid->addWidget( subalbumName, 0, 0, Qt::AlignLeft );
00169 grid->addWidget( subalbumNameVal, 0, 1 );
00170 grid->addWidget( subalbumDescription, 1, 0, Qt::AlignLeft );
00171 grid->addWidget( subalbumDescriptionVal, 1, 1 );
00172 grid->addWidget( representativeImageText, 0, 2, Qt::AlignLeft );
00173 grid->addMultiCellWidget( setImage, 1, 1, 2, 2 );
00174 grid->addMultiCellWidget( representativeLogo, 0, 2, 3, 3 );
00175 grid->addMultiCellWidget( photos, 3, 3, 0, 4 );
00176
00177 grid2 = new QGridLayout( buttons, 1, 9, 0 );
00178 grid2->addWidget( addImage, 0, 1, Qt::AlignLeft );
00179 grid2->addWidget( removeImage, 0, 2, Qt::AlignLeft );
00180 grid2->addWidget( rotate90Image, 0, 3, Qt::AlignLeft );
00181 grid2->addWidget( rotate270Image, 0, 4, Qt::AlignLeft );
00182 grid2->addWidget( flipHorizontallyImage, 0, 5, Qt::AlignLeft );
00183 grid2->addWidget( flipVerticallyImage, 0, 6, Qt::AlignLeft );
00184 grid2->addWidget( editButton, 0, 7, Qt::AlignLeft );
00185
00186 //set first and last columns of grid2 to take up remaining space
00187 grid2->setColStretch( 0, 1 );
00188 grid2->setColStretch( 8, 1 );
00189 grid->addMultiCellWidget( buttons, 4, 4, 0, 4 );
00190
00191 //set the second column to stretch to fill any blank space
00192 grid->setColStretch( 4, 1 );
00193
00194 //set the last row to stretch to fill any blank space
00195 grid->setRowStretch( 3, 1 );
00196
00197 //Set the second column, the actual subalbum name and description
00198 //to have a minimum width
00199 grid->addColSpacing(1, 300 );
00200
00201 //set the background of the widget to be white
00202 setPaletteBackgroundColor( QColor(255, 255, 255) );
00203
00204 //by default no selected images so disable all buttons besides add
00205 removeImage->setEnabled(false);
00206 rotate90Image->setEnabled(false);
00207 rotate270Image->setEnabled(false);
00208 flipHorizontallyImage->setEnabled(false);
00209 flipVerticallyImage->setEnabled(false);
00210 editButton->setEnabled(false);
00211 }
|
|
|
Deletes objects.
Definition at line 213 of file subalbumWidget.cpp. References addImageImage, flipHorizontallyImageImage, flipVerticallyImageImage, removeImageImage, rotate270ImageImage, rotate90ImageImage, and setImageImage.
00214 {
00215 delete setImageImage;
00216 delete addImageImage;
00217 delete removeImageImage;
00218 delete rotate90ImageImage;
00219 delete rotate270ImageImage;
00220 delete flipHorizontallyImageImage;
00221 delete flipVerticallyImageImage;
00222 }
|
|
|
Adds an image to the subalbum.
Definition at line 271 of file subalbumWidget.cpp. References Subalbum::addPhoto(), Subalbum::getLast(), LayoutWidget::getSubalbums(), Window::getTitle(), LayoutWidget::getWindow(), layout, photos, TitleWidget::setBusy(), subalbum, updateButtons(), and SubalbumsWidget::updateButtons(). Referenced by SubalbumWidget().
00272 {
00273 //set busy flag and deactivate menu's/buttons, and selecting photos
00274 layout->getWindow()->getTitle()->setBusy(true);
00275 layout->getSubalbums()->updateButtons(false);
00276 updateButtons(false);
00277 photos->setSelectionMode( QIconView::NoSelection ) ;
00278
00279 //Get filename from user
00280 QStringList fileNames = QFileDialog::getOpenFileNames("Images (*.gif *.jpg *.jpeg *.png *.xpm *.GIF *.JPG *.JPEG *.PNG *.XPM)",
00281 NULL,
00282 this,
00283 "add photos dialog",
00284 "Select photos");
00285
00286 qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00287
00288 //iterate through each file and add to album
00289 QStringList::iterator it;
00290 for(it = fileNames.begin(); it != fileNames.end(); it++ )
00291 {
00292 //if successful adding photo add widget
00293 if(subalbum->addPhoto(*it))
00294 {
00295 PhotoWidget* p = new PhotoWidget( photos, subalbum->getLast() );
00296 p->setRenameEnabled(true);
00297 photos->ensureItemVisible(p);
00298 qApp->processEvents();
00299 }
00300 }
00301 photos->arrangeItemsInGrid();
00302
00303 //unset busy flag and activate menu's/buttons
00304 layout->getWindow()->getTitle()->setBusy(false);
00305 layout->getSubalbums()->updateButtons(true);
00306 updateButtons(true);
00307 photos->setSelectionMode( QIconView::Extended ) ;
00308 qApp->restoreOverrideCursor();
00309 }
|
|
|
Brings up the edit dialog for the currently selected photo.
Definition at line 501 of file subalbumWidget.cpp. References LayoutWidget::editPhoto(), getSelectedPhoto(), and layout. Referenced by SubalbumWidget().
00502 {
00503 Photo* selected = getSelectedPhoto();
00504 if(selected != NULL)
00505 layout->editPhoto( selected );
00506 else
00507 {
00508 //bring up dialog scolding user for trying to edit either no or multiple photos at once
00509 }
00510 }
|
|
|
Flip about horizontal axis selected images.
Definition at line 435 of file subalbumWidget.cpp. References LayoutWidget::getSubalbums(), Window::getTitle(), LayoutWidget::getWindow(), layout, photos, TitleWidget::setBusy(), updateButtons(), and SubalbumsWidget::updateButtons(). Referenced by SubalbumWidget().
00436 {
00437 //set busy flag and deactivate menu's/buttons
00438 qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00439 layout->getWindow()->getTitle()->setBusy(true);
00440 layout->getSubalbums()->updateButtons(false);
00441 photos->setSelectionMode( QIconView::NoSelection ) ;
00442 updateButtons(false);
00443
00444 //rotate the selected photos
00445 QIconViewItem* current = photos->firstItem();
00446 while(current != NULL)
00447 {
00448 if(current->isSelected())
00449 {
00450 ((PhotoWidget*)current)->getPhoto()->flipHorizontally();
00451 photos->ensureItemVisible(((PhotoWidget*)current));
00452 ((PhotoWidget*)current)->updateImage();
00453 qApp->processEvents();
00454 }
00455
00456 //move to next item
00457 current = current->nextItem();
00458 }
00459
00460 //not busy any more
00461 layout->getWindow()->getTitle()->setBusy(false);
00462 layout->getSubalbums()->updateButtons(true);
00463 updateButtons(true);
00464 photos->setSelectionMode( QIconView::Extended ) ;
00465 qApp->restoreOverrideCursor();
00466 }
|
|
|
Flip about vertical axis selected images.
Definition at line 468 of file subalbumWidget.cpp. References LayoutWidget::getSubalbums(), Window::getTitle(), LayoutWidget::getWindow(), layout, photos, TitleWidget::setBusy(), updateButtons(), and SubalbumsWidget::updateButtons(). Referenced by SubalbumWidget().
00469 {
00470 //set busy flag and deactivate menu's/buttons
00471 qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00472 layout->getWindow()->getTitle()->setBusy(true);
00473 layout->getSubalbums()->updateButtons(false);
00474 photos->setSelectionMode( QIconView::NoSelection ) ;
00475 updateButtons(false);
00476
00477 //rotate the selected photos
00478 QIconViewItem* current = photos->firstItem();
00479 while(current != NULL)
00480 {
00481 if(current->isSelected())
00482 {
00483 ((PhotoWidget*)current)->getPhoto()->flipVertically();
00484 photos->ensureItemVisible(((PhotoWidget*)current));
00485 ((PhotoWidget*)current)->updateImage();
00486 qApp->processEvents();
00487 }
00488
00489 //move to next item
00490 current = current->nextItem();
00491 }
00492
00493 //not busy any more
00494 layout->getWindow()->getTitle()->setBusy(false);
00495 layout->getSubalbums()->updateButtons(true);
00496 updateButtons(true);
00497 photos->setSelectionMode( QIconView::Extended ) ;
00498 qApp->restoreOverrideCursor();
00499 }
|
|
|
Returns pointer to icon view.
Definition at line 600 of file subalbumWidget.cpp. References photos. Referenced by SubalbumPreviewWidget::dropped().
00601 {
00602 return photos;
00603 }
|
|
|
Returns currently selected photo. If no or multiple photos selected returns NULL.
Definition at line 561 of file subalbumWidget.cpp. References photos. Referenced by editAction(), TitleWidget::setImageAction(), and setImageAction().
00562 {
00563 //determine if one photo is selected
00564 int numSelected = 0;
00565 QIconViewItem* current = photos->firstItem();
00566 QIconViewItem* selected = NULL;
00567 while(current != NULL)
00568 {
00569 //found a selected item!
00570 if(current->isSelected())
00571 {
00572 numSelected++;
00573 selected = current;
00574 }
00575
00576 //if more than one found then bail!
00577 if(numSelected > 1)
00578 break;
00579
00580 //move to next item
00581 current = current->nextItem();
00582 }
00583
00584 //if one item is selected then return photo pointer
00585 if(numSelected == 1)
00586 {
00587 return ((PhotoWidget*)selected)->getPhoto();
00588 }
00589 else
00590 {
00591 return NULL;
00592 }
00593 }
|
|
|
returns a pointer to the backend subalbum
Definition at line 556 of file subalbumWidget.cpp. References subalbum. Referenced by SubalbumPreviewWidget::dropped(), and LayoutWidget::updateSubalbum().
00557 {
00558 return subalbum;
00559 }
|
|
|
Rearranges photos and saves their text.
Definition at line 605 of file subalbumWidget.cpp. References photos. Referenced by SubalbumWidget().
00606 {
00607 ((PhotoWidget*)item)->sync();
00608 photos->arrangeItemsInGrid();
00609 }
|
|
|
refreshes all photos
Definition at line 512 of file subalbumWidget.cpp. References Subalbum::getFirst(), Photo::getNext(), photos, and subalbum. Referenced by setSubalbum(), and LayoutWidget::updateSubalbum().
00513 {
00514 //remove all thumbnails
00515 photos->clear();
00516
00517 //insert photo thumbnails
00518 Photo* currentPhoto = subalbum->getFirst();
00519 while(currentPhoto != NULL)
00520 {
00521 PhotoWidget* p = new PhotoWidget( photos, currentPhoto );
00522 p->setRenameEnabled(true);
00523 currentPhoto = currentPhoto->getNext();
00524 }
00525
00526 photos->arrangeItemsInGrid();
00527 }
|
|
|
refreshes selected photos
Definition at line 529 of file subalbumWidget.cpp. References photos. Referenced by LayoutWidget::stopEdit().
00530 {
00531 QIconViewItem* current = photos->firstItem();
00532 while(current != NULL)
00533 {
00534 //found a selected item!
00535 if(current->isSelected())
00536 {
00537 ((PhotoWidget*)current)->updateImage();
00538 ((PhotoWidget*)current)->updateDescription();
00539 }
00540
00541 //move to next item
00542 current = current->nextItem();
00543 }
00544 }
|
|
|
Remove an image from the subalbum.
Definition at line 311 of file subalbumWidget.cpp. References LayoutWidget::getSubalbums(), Window::getTitle(), LayoutWidget::getWindow(), layout, photos, Subalbum::removePhoto(), TitleWidget::setBusy(), subalbum, updateButtons(), and SubalbumsWidget::updateButtons(). Referenced by SubalbumWidget().
00312 {
00313 //set busy flag and deactivate menu's/buttons
00314 layout->getWindow()->getTitle()->setBusy(true);
00315 layout->getSubalbums()->updateButtons(false);
00316 updateButtons(false);
00317 photos->setSelectionMode( QIconView::NoSelection ) ;
00318
00319 //check if user is sure
00320 QuestionDialog sure( "Remove selected photos?",
00321 "Once removed photos cannot be restored. Furthermore apon resaving they are physically removed from your album.",
00322 "warning.png",
00323 this );
00324 //if user say yes then delete subalbum and refresh
00325 if(sure.exec())
00326 {
00327 qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00328 //iterate through all photos and remove those that are selected
00329 QIconViewItem* current = photos->firstItem();
00330 QIconViewItem* temp;
00331 while(current != NULL)
00332 {
00333 //if not selected move on
00334 if(!current->isSelected())
00335 {
00336 current = current->nextItem();
00337 continue;
00338 }
00339
00340 //get next pointer
00341 temp = current->nextItem();
00342
00343 //grab point to backend photo
00344 Photo* phto = ((PhotoWidget*)current)->getPhoto();
00345
00346 //delete photo widget
00347 delete current;
00348 current = temp;
00349
00350 //delete backend photo
00351 subalbum->removePhoto(phto);
00352
00353 //check if any photos selected, if not deactivate all buttons besides add button
00354 updateButtons();
00355 }
00356
00357 photos->arrangeItemsInGrid();
00358
00359 //unset busy flag and activate menu's/buttons
00360 qApp->restoreOverrideCursor();
00361 }
00362
00363 layout->getWindow()->getTitle()->setBusy(false);
00364 layout->getSubalbums()->updateButtons(true);
00365 updateButtons(true);
00366 photos->setSelectionMode( QIconView::Extended ) ;
00367 }
|
|
|
Definition at line 611 of file subalbumWidget.cpp. References photos, subalbum, and Subalbum::syncPhotoList(). Referenced by SubalbumWidget().
00612 {
00613 //so item has been moved, reorder linked list of items as necessary
00614 photos->sort( true );
00615 photos->arrangeItemsInGrid();
00616
00617 //sync lists
00618 subalbum->syncPhotoList((PhotoWidget*)photos->firstItem());
00619 }
|
|
|
Definition at line 595 of file subalbumWidget.cpp. References photos.
00596 {
00597 photos->arrangeItemsInGrid();
00598 }
|
|
|
Rotate counter-clockwise selected images.
Definition at line 402 of file subalbumWidget.cpp. References LayoutWidget::getSubalbums(), Window::getTitle(), LayoutWidget::getWindow(), layout, photos, TitleWidget::setBusy(), updateButtons(), and SubalbumsWidget::updateButtons(). Referenced by SubalbumWidget().
00403 {
00404 //set busy flag and deactivate menu's/buttons
00405 qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00406 layout->getWindow()->getTitle()->setBusy(true);
00407 layout->getSubalbums()->updateButtons(false);
00408 photos->setSelectionMode( QIconView::NoSelection ) ;
00409 updateButtons(false);
00410
00411 //rotate the selected photos
00412 QIconViewItem* current = photos->firstItem();
00413 while(current != NULL)
00414 {
00415 if(current->isSelected())
00416 {
00417 ((PhotoWidget*)current)->getPhoto()->rotate270();
00418 photos->ensureItemVisible(((PhotoWidget*)current));
00419 ((PhotoWidget*)current)->updateImage();
00420 qApp->processEvents();
00421 }
00422
00423 //move to next item
00424 current = current->nextItem();
00425 }
00426
00427 //not busy any more
00428 layout->getWindow()->getTitle()->setBusy(false);
00429 layout->getSubalbums()->updateButtons(true);
00430 updateButtons(true);
00431 photos->setSelectionMode( QIconView::Extended ) ;
00432 qApp->restoreOverrideCursor();
00433 }
|
|
|
Rotate clockwise selected images.
Definition at line 369 of file subalbumWidget.cpp. References LayoutWidget::getSubalbums(), Window::getTitle(), LayoutWidget::getWindow(), layout, photos, TitleWidget::setBusy(), updateButtons(), and SubalbumsWidget::updateButtons(). Referenced by SubalbumWidget().
00370 {
00371 //set busy flag and deactivate menu's/buttons
00372 qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
00373 layout->getWindow()->getTitle()->setBusy(true);
00374 layout->getSubalbums()->updateButtons(false);
00375 photos->setSelectionMode( QIconView::NoSelection ) ;
00376 updateButtons(false);
00377
00378 //rotate the selected photos
00379 QIconViewItem* current = photos->firstItem();
00380 while(current != NULL)
00381 {
00382 if(current->isSelected())
00383 {
00384 ((PhotoWidget*)current)->getPhoto()->rotate90();
00385 photos->ensureItemVisible(((PhotoWidget*)current));
00386 ((PhotoWidget*)current)->updateImage();
00387 qApp->processEvents();
00388 }
00389
00390 //move to next item
00391 current = current->nextItem();
00392 }
00393
00394 //not busy any more
00395 layout->getWindow()->getTitle()->setBusy(false);
00396 layout->getSubalbums()->updateButtons(true);
00397 updateButtons(true);
00398 photos->setSelectionMode( QIconView::Extended ) ;
00399 qApp->restoreOverrideCursor();
00400 }
|
|
|
Sets currently selected photo as the representative image for the subalbum.
Definition at line 243 of file subalbumWidget.cpp. References Photo::getImage(), Subalbum::getRepresentativeImage(), getSelectedPhoto(), layout, MEDIUM, representativeLogo, Subalbum::setRepresentativeImages(), SMALL, subalbum, THUMBNAIL, and LayoutWidget::updateSubalbumImage(). Referenced by SubalbumWidget().
00244 {
00245 //---------------------------------------------------------
00246 //get handle on photo widget
00247 Photo* selectedPhoto = getSelectedPhoto();
00248 if(selectedPhoto == NULL)
00249 return;
00250 //---------------------------------------------------------
00251 //set representative images
00252 subalbum->setRepresentativeImages( selectedPhoto->getImage(THUMBNAIL) );
00253 //---------------------------------------------------------
00254 //update onscreen images
00255 representativeLogo->setPixmap( *(subalbum->getRepresentativeImage(SMALL)) );
00256 layout->updateSubalbumImage( subalbum->getRepresentativeImage(MEDIUM) );
00257 //---------------------------------------------------------
00258 }
|
|
|
Resets the subalbum this subalbum widget is displaying.
Definition at line 224 of file subalbumWidget.cpp. References Subalbum::getDescription(), Subalbum::getName(), Subalbum::getRepresentativeImage(), refreshPhotos(), representativeImage, representativeLogo, SMALL, subalbum, subalbumDescriptionVal, subalbumNameVal, and updateButtons(). Referenced by LayoutWidget::updateSubalbum().
00225 {
00226 //set new subalbum pointer
00227 subalbum = salbum;
00228
00229 //update representative image, subalbum name and description
00230 subalbumNameVal->setText( subalbum->getName() );
00231 subalbumDescriptionVal->setText( subalbum->getDescription() );
00232 representativeImage = subalbum->getRepresentativeImage(SMALL);
00233 representativeLogo->setPixmap( *representativeImage );
00234
00235 //update photo listing
00236 refreshPhotos();
00237
00238 //disable/enable buttons as necessary
00239 updateButtons();
00240 }
|
|
|
Syncs all photo data to backend objects.
Definition at line 546 of file subalbumWidget.cpp. References photos, and PhotoWidget::sync(). Referenced by TitleWidget::saveAlbum(), and LayoutWidget::updateSubalbum().
00547 {
00548 PhotoWidget* current = (PhotoWidget*)photos->firstItem();
00549 while(current != NULL)
00550 {
00551 current->sync();
00552 current = (PhotoWidget*)current->nextItem();
00553 }
00554 }
|
|
|
Activates/Deactives remove/rotate/flip buttons depending on if an image is selected.
Definition at line 621 of file subalbumWidget.cpp. References editButton, flipHorizontallyImage, flipVerticallyImage, Window::getTitle(), LayoutWidget::getWindow(), layout, photos, removeImage, rotate270Image, rotate90Image, setImage, and TitleWidget::setSetButtonState(). Referenced by addImageAction(), flipHorizontallyImageAction(), flipVerticallyImageAction(), removeImageAction(), rotate270ImageAction(), rotate90ImageAction(), setSubalbum(), and SubalbumWidget().
00622 {
00623 bool anySelected = false;
00624 QIconViewItem* current = photos->firstItem();
00625 while(current != NULL)
00626 {
00627 if(current->isSelected())
00628 {
00629 anySelected = true;
00630 break;
00631 }
00632
00633 //move to next item
00634 current = current->nextItem();
00635 }
00636
00637 if(!anySelected)
00638 {
00639 removeImage->setEnabled(false);
00640 rotate90Image->setEnabled(false);
00641 rotate270Image->setEnabled(false);
00642 flipHorizontallyImage->setEnabled(false);
00643 flipVerticallyImage->setEnabled(false);
00644 editButton->setEnabled(false);
00645 layout->getWindow()->getTitle()->setSetButtonState(false);
00646 setImage->setEnabled(false);
00647 }
00648 else
00649 {
00650 removeImage->setEnabled(true);
00651 rotate90Image->setEnabled(true);
00652 rotate270Image->setEnabled(true);
00653 flipHorizontallyImage->setEnabled(true);
00654 flipVerticallyImage->setEnabled(true);
00655 editButton->setEnabled(true);
00656 layout->getWindow()->getTitle()->setSetButtonState(true);
00657 setImage->setEnabled(true);
00658 }
00659 }
|
|
|
Activates/Deactives remove/rotate/flip buttons.
Definition at line 661 of file subalbumWidget.cpp. References addImage, buttonsState, editButton, flipHorizontallyImage, flipVerticallyImage, removeImage, rotate270Image, rotate90Image, and setImage. Referenced by TitleWidget::loadAlbum(), and TitleWidget::saveAlbum().
00662 {
00663 if(!enable)
00664 {
00665 buttonsState = rotate90Image->isEnabled();
00666 addImage->setEnabled(enable);
00667 removeImage->setEnabled(enable);
00668 rotate90Image->setEnabled(enable);
00669 rotate270Image->setEnabled(enable);
00670 flipHorizontallyImage->setEnabled(enable);
00671 flipVerticallyImage->setEnabled(enable);
00672 editButton->setEnabled(enable);
00673 setImage->setEnabled(enable);
00674 }
00675 else
00676 {
00677 addImage->setEnabled(enable);
00678 removeImage->setEnabled(buttonsState);
00679 rotate90Image->setEnabled(buttonsState);
00680 rotate270Image->setEnabled(buttonsState);
00681 flipHorizontallyImage->setEnabled(buttonsState);
00682 flipVerticallyImage->setEnabled(buttonsState);
00683 editButton->setEnabled(buttonsState);
00684 setImage->setEnabled(buttonsState);
00685 }
00686 }
|
|
|
Updates subalbum description.
Definition at line 266 of file subalbumWidget.cpp. References Subalbum::setDescription(), and subalbum. Referenced by SubalbumWidget().
00267 {
00268 subalbum->setDescription(val);
00269 }
|
|
|
Updates subalbum name.
Definition at line 260 of file subalbumWidget.cpp. References layout, Subalbum::setName(), subalbum, and LayoutWidget::updateSubalbumName(). Referenced by SubalbumWidget().
00261 {
00262 subalbum->setName(val);
00263 layout->updateSubalbumName(val);
00264 }
|
|
|
"Add" button
Definition at line 169 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Add" image
Definition at line 166 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
Grid lower buttons are placed in.
Definition at line 128 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
cached enabled/disabled state of buttons
Definition at line 211 of file subalbumWidget.h. Referenced by updateButtons(). |
|
|
"Edit" button
Definition at line 205 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Edit"" image
Definition at line 202 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
"Flip Horizontally" button
Definition at line 193 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Flip Horizontally" image
Definition at line 190 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
"Flip Vertically" button
Definition at line 199 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Flip Vertically" image
Definition at line 196 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
Grid widgets are placed in.
Definition at line 125 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
Definition at line 130 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
Pointer to the parent layout widget.
Definition at line 208 of file subalbumWidget.h. Referenced by addImageAction(), editAction(), flipHorizontallyImageAction(), flipVerticallyImageAction(), removeImageAction(), rotate270ImageAction(), rotate90ImageAction(), setImageAction(), SubalbumWidget(), updateButtons(), and updateName(). |
|
|
Photos layout.
Definition at line 160 of file subalbumWidget.h. Referenced by addImageAction(), flipHorizontallyImageAction(), flipVerticallyImageAction(), getPhotos(), getSelectedPhoto(), rearrangeAndSaveCurrent(), refreshPhotos(), refreshSelectedPhotos(), removeImageAction(), reorder(), resizeEvent(), rotate270ImageAction(), rotate90ImageAction(), SubalbumWidget(), syncPhotos(), and updateButtons(). |
|
|
"Remove" button
Definition at line 175 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Remove" image
Definition at line 172 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
Representative image.
Definition at line 157 of file subalbumWidget.h. Referenced by setSubalbum(), and SubalbumWidget(). |
|
|
Label which shows "set" image.
Definition at line 145 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
Label which shows the representative image.
Definition at line 154 of file subalbumWidget.h. Referenced by setImageAction(), setSubalbum(), and SubalbumWidget(). |
|
|
"Rotate 270" button
Definition at line 187 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Rotate 270" image
Definition at line 184 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
"Rotate 90" button
Definition at line 181 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Rotate 90" image
Definition at line 178 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
Button allowing user to set the representative image for the subalbum.
Definition at line 151 of file subalbumWidget.h. Referenced by SubalbumWidget(), and updateButtons(). |
|
|
"Set" image
Definition at line 148 of file subalbumWidget.h. Referenced by SubalbumWidget(), and ~SubalbumWidget(). |
|
|
Pointer to backend subalbum.
Definition at line 163 of file subalbumWidget.h. Referenced by addImageAction(), getSubalbum(), refreshPhotos(), removeImageAction(), reorder(), setImageAction(), setSubalbum(), SubalbumWidget(), updateDescription(), and updateName(). |
|
|
Label "Description:".
Definition at line 139 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
Actual subalbum description.
Definition at line 142 of file subalbumWidget.h. Referenced by setSubalbum(), and SubalbumWidget(). |
|
|
Label "Subalbum Name:".
Definition at line 133 of file subalbumWidget.h. Referenced by SubalbumWidget(). |
|
|
Actual subalbum name.
Definition at line 136 of file subalbumWidget.h. Referenced by setSubalbum(), and SubalbumWidget(). |
1.3.1