Logo Search packages:      
Sourcecode: albumshaper version File versions  Download package

void EditingInterface::revertCurrentPhoto (  ) 

reverts current photo and updates display

Revert photo

Definition at line 1003 of file editingInterface.cpp.

References displayWidth, effectPreviewImageFilename, SelectionInterface::getDisplaySize(), Photo::getImageFilename(), Window::getStatus(), LayoutWidget::getWindow(), imageWidth, layout, Photo::originalImageFilename(), photo, Photo::revertPhoto(), selectEffect(), selectionInterface, and SelectionInterface::setPhoto().

Referenced by LayoutWidget::revertPhotos().

{
  //if current photo not revertable immediately bail
  if( ! currentPhotoRevertable() ) return;
  
  //set busy cursor
  qApp->setOverrideCursor( QCursor(Qt::WaitCursor));
  
  //disable user input
  layout->getWindow()->getStatus()->grabInput();

  //get current and reverted image sizes and compare to see if size has changed.
  //if so reset selected region
  int origWidth, origHeight;
  getImageSize( photo->originalImageFilename(), origWidth, origHeight );  
  bool resetSelection = (origWidth != imageWidth) || (origHeight != imageHeight);
  
  ///Revert photo
  photo->revertPhoto();

  //Reload photo view
  selectionInterface->setPhoto( photo->getImageFilename(), resetSelection );  
  
  //update image dimension variables
  getImageSize( photo->getImageFilename(), imageWidth, imageHeight );  
  
  //get display size photo dimensions
  selectionInterface->getDisplaySize( displayWidth, displayHeight );
  
  //update effect preview
  scaleImage( photo->getImageFilename(), effectPreviewImageFilename, EFFECT_PREVIEW_WIDTH, EFFECT_PREVIEW_HEIGHT );
  selectEffect();  
  
  //emit modified signal
  emit photoModified();

  //enable user input
  layout->getWindow()->getStatus()->releaseInput();

  //remove busy cursor
  qApp->restoreOverrideCursor();
}


Generated by  Doxygen 1.6.0   Back to index