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

void TitleWidget::revertToSaved (  )  [private, slot]

Revert to last saved album.

make sure we want to proceed

Definition at line 676 of file titleWidget.cpp.

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

Referenced by TitleWidget().

{
  //if there are no changed then immediately return since reverting will have no effect
  //TODO: disable "revert" menu entry when no modifications exist
  if( !albm->albumModified() )
    return;
  
  ///make sure we want to proceed
  //if modifications exist and user wants to receive destructive action warnings,
  //ask if they are sure before creating a new album
  if( window->getConfig()->getBool( "alerts", "showDestructiveAlerts" ) )
  {
    QuestionDialog sure( tr("Revert to Saved?"),
                         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?"),
                         "alertIcons/warning.png",
                         this );
    if(!sure.exec())
      return;
  }    
  
  //reload album
  loadAlbum( QDir::convertSeparators( albm->getSaveLocation() + "/Album.xml") );  
}


Generated by  Doxygen 1.6.0   Back to index