Commit c14fbe5e authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid

Remove SaveAsDontShowWarning

It was only used in tests as a way to "hide" warning dialogs, now we have a proper way to
close them, this way we make sure that dialogs are should when they should not not when they should not
parent 835c9c49
This diff is collapsed.
......@@ -2478,7 +2478,7 @@ bool Part::saveAs( const QUrl & saveUrl, SaveAsFlags flags )
// Does the user want a .okular archive?
if ( flags & SaveAsOkularArchive )
{
if ( !hasUserAcceptedReload && !m_document->canSwapBackingFile() && !( flags & SaveAsDontShowWarning ) )
if ( !hasUserAcceptedReload && !m_document->canSwapBackingFile() )
{
const int res = KMessageBox::warningYesNo( widget(),
i18n( "The current document format backend doesn't support internal reload on save so we will close and open the file again.<br />This means that the undo/redo stack will be lost.<br />Do you want to continue?" ),
......@@ -2511,7 +2511,7 @@ bool Part::saveAs( const QUrl & saveUrl, SaveAsFlags flags )
QStringList listOfwontSaves;
if ( wontSaveForms ) listOfwontSaves << i18n( "Filled form contents" );
if ( wontSaveAnnotations ) listOfwontSaves << i18n( "User annotations" );
if ( !listOfwontSaves.isEmpty() && !( flags & SaveAsDontShowWarning ) )
if ( !listOfwontSaves.isEmpty() )
{
const QString warningMessage = m_document->canSwapBackingFile() ?
i18n( "The following elements <b>cannot be saved</b> in this format.<br>If you want to preserve them, please use the <i>Okular document archive</i> format." ) :
......
......@@ -271,8 +271,7 @@ class OKULARPART_EXPORT Part : public KParts::ReadWritePart, public Okular::Docu
enum SaveAsFlag
{
NoSaveAsFlags = 0, ///< No options
SaveAsOkularArchive = 1, ///< Save as Okular Archive (.okular) instead of document's native format
SaveAsDontShowWarning = 2, ///< Don't show warning for unsupported save features
SaveAsOkularArchive = 1 ///< Save as Okular Archive (.okular) instead of document's native format
};
Q_DECLARE_FLAGS( SaveAsFlags, SaveAsFlag )
......
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