Do not show "Continue" while on Save format warning

It makes no sense, only on Save As makes sense
remotes/origin/dont-use-docdata-for-annots-and-forms
Albert Astals Cid 8 years ago committed by Albert Astals Cid
parent f63aa211dc
commit 481676dced
  1. 62
      part.cpp

@ -2516,27 +2516,49 @@ bool Part::saveAs( const QUrl & saveUrl, SaveAsFlags flags )
if ( wontSaveAnnotations ) listOfwontSaves << i18n( "User annotations" );
if ( !listOfwontSaves.isEmpty() )
{
const QString warningMessage = m_document->canSwapBackingFile() ?
i18n( "You are about to save changes, but the current file format does not support saving the following elements. Please use the <i>Okular document archive</i> format to preserve them. Click <i>Continue</i> to save the document and discard these elements." ) :
i18n( "You are about to save changes, but the current file format does not support saving the following elements. Please use the <i>Okular document archive</i> format to preserve them. Click <i>Continue</i> to save, but you will lose these elements as well as the undo/redo history." );
const QString continueMessage = m_document->canSwapBackingFile() ?
i18n( "Continue" ) :
i18n( "Continue losing changes" );
const int result = KMessageBox::warningYesNoCancelList( widget(),
warningMessage,
listOfwontSaves, i18n( "Warning" ),
KGuiItem( i18n( "Save as Okular document archive..." ), "document-save-as" ), // <- KMessageBox::Yes
KGuiItem( continueMessage, "arrow-right" ) ); // <- KMessageBox::NO
switch (result)
if ( saveUrl == url() )
{
case KMessageBox::Yes: // -> Save as Okular document archive
return slotSaveFileAs( true /* showOkularArchiveAsDefaultFormat */ );
case KMessageBox::No: // -> Continue
setModifiedAfterSave = m_document->canSwapBackingFile();
break;
case KMessageBox::Cancel:
return false;
// Save
const QString warningMessage = i18n( "You are about to save changes, but the current file format does not support saving the following elements. Please use the <i>Okular document archive</i> format to preserve them." );
const int result = KMessageBox::warningYesNoList( widget(),
warningMessage,
listOfwontSaves, i18n( "Warning" ),
KGuiItem( i18n( "Save as Okular document archive..." ), "document-save-as" ), // <- KMessageBox::Yes
KStandardGuiItem::cancel() );
switch (result)
{
case KMessageBox::Yes: // -> Save as Okular document archive
return slotSaveFileAs( true /* showOkularArchiveAsDefaultFormat */ );
default:
return false;
}
}
else
{
// Save as
const QString warningMessage = m_document->canSwapBackingFile() ?
i18n( "You are about to save changes, but the current file format does not support saving the following elements. Please use the <i>Okular document archive</i> format to preserve them. Click <i>Continue</i> to save the document and discard these elements." ) :
i18n( "You are about to save changes, but the current file format does not support saving the following elements. Please use the <i>Okular document archive</i> format to preserve them. Click <i>Continue</i> to save, but you will lose these elements as well as the undo/redo history." );
const QString continueMessage = m_document->canSwapBackingFile() ?
i18n( "Continue" ) :
i18n( "Continue losing changes" );
const int result = KMessageBox::warningYesNoCancelList( widget(),
warningMessage,
listOfwontSaves, i18n( "Warning" ),
KGuiItem( i18n( "Save as Okular document archive..." ), "document-save-as" ), // <- KMessageBox::Yes
KGuiItem( continueMessage, "arrow-right" ) ); // <- KMessageBox::NO
switch (result)
{
case KMessageBox::Yes: // -> Save as Okular document archive
return slotSaveFileAs( true /* showOkularArchiveAsDefaultFormat */ );
case KMessageBox::No: // -> Continue
setModifiedAfterSave = m_document->canSwapBackingFile();
break;
case KMessageBox::Cancel:
return false;
}
}
}

Loading…
Cancel
Save