Commit 481676dc authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid

Do not show "Continue" while on Save format warning

It makes no sense, only on Save As makes sense
parent f63aa211
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment