Commit 791a4759 authored by Laurent Montel's avatar Laurent Montel
Browse files

KMessageBox::sorry is deprecated in kf5.97

parent df57c290
Pipeline #210935 passed with stage
in 4 minutes and 25 seconds
......@@ -66,7 +66,7 @@ void AsyExporter::run( const KigPart& doc, KigWidget& w )
QFile file( file_name );
if ( ! file.open( QIODevice::WriteOnly ) )
{
KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please "
KMessageBox::error( &w, i18n( "The file \"%1\" could not be opened. Please "
"check if the file permissions are set correctly." ,
file_name ) );
return;
......
......@@ -101,14 +101,14 @@ void ImageExporter::run( const KigPart& doc, KigWidget& w )
qDebug() << "mimetype: " << mimeType.name();
if ( !QImageWriter::supportedMimeTypes().contains( mimeType.name().toUtf8() ) )
{
KMessageBox::sorry( &w, i18n( "Sorry, this file format is not supported." ) );
KMessageBox::error( &w, i18n( "Sorry, this file format is not supported." ) );
return;
};
QFile file( filename );
if ( ! file.open( QIODevice::WriteOnly ) )
{
KMessageBox::sorry( &w,
KMessageBox::error( &w,
i18n( "The file \"%1\" could not be opened. Please check if the file permissions are set correctly." ,
filename ) );
return;
......
......@@ -62,7 +62,7 @@ bool KigFilter::supportMime( const QString& )
void KigFilter::fileNotFound( const QString& file ) const
{
KMessageBox::sorry( nullptr,
KMessageBox::error( nullptr,
i18n( "The file \"%1\" could not be opened. "
"This probably means that it does not "
"exist, or that it cannot be opened due to "
......@@ -77,7 +77,7 @@ void KigFilter::parseError( const QString& explanation ) const
const QString title = i18n( "Parse Error" );
if ( explanation.isEmpty() )
KMessageBox::sorry( nullptr, text, title );
KMessageBox::error( nullptr, text, title );
else
KMessageBox::detailedSorry( nullptr, text, explanation, title );
}
......
......@@ -560,7 +560,7 @@ void LatexExporter::run( const KigPart& doc, KigWidget& w )
QFile file( file_name );
if ( ! file.open( QIODevice::WriteOnly ) )
{
KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please "
KMessageBox::error( &w, i18n( "The file \"%1\" could not be opened. Please "
"check if the file permissions are set correctly." ,
file_name ) );
return;
......
......@@ -63,7 +63,7 @@ void SVGExporter::run( const KigPart& part, KigWidget& w )
QFile file( file_name );
if ( ! file.open( QIODevice::WriteOnly ) )
{
KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please "
KMessageBox::error( &w, i18n( "The file \"%1\" could not be opened. Please "
"check if the file permissions are set correctly." ,
file_name ) );
return;
......
......@@ -573,7 +573,7 @@ void XFigExporter::run( const KigPart& doc, KigWidget& w )
QFile file( file_name );
if ( ! file.open( QIODevice::WriteOnly ) )
{
KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please "
KMessageBox::error( &w, i18n( "The file \"%1\" could not be opened. Please "
"check if the file permissions are set correctly." ,
file_name ) );
return;
......
......@@ -390,7 +390,7 @@ bool KigPart::openFile()
QFileInfo fileinfo( localFilePath() );
if ( ! fileinfo.exists() )
{
KMessageBox::sorry( widget(),
KMessageBox::error( widget(),
i18n( "The file \"%1\" you tried to open does not exist. "
"Please verify that you entered the correct path.", localFilePath() ),
i18n( "File Not Found" ) );
......@@ -409,7 +409,7 @@ bool KigPart::openFile()
if ( !filter )
{
// we don't support this mime type...
KMessageBox::sorry
KMessageBox::error
(
widget(),
i18n( "You tried to open a document of type \"%1\"; unfortunately, Kig does not support this format. If you think the format in question would be worth implementing support for, you can open a feature request in <a href=\"https://bugs.kde.org/enter_bug.cgi?product=kig&bug_severity=wishlist\">KDE's bug tracking system</a>"
......
......@@ -287,13 +287,13 @@ bool MacroList::load( const QString& f, std::vector<Macro*>& ret, const KigPart&
QFile file( f );
if ( ! file.open( QIODevice::ReadOnly ) )
{
KMessageBox::sorry( nullptr, i18n( "Could not open macro file '%1'", f ) );
KMessageBox::error( nullptr, i18n( "Could not open macro file '%1'", f ) );
return false;
}
QDomDocument doc( QStringLiteral("KigMacroFile") );
if ( !doc.setContent( &file ) )
{
KMessageBox::sorry( nullptr, i18n( "Could not open macro file '%1'", f ) );
KMessageBox::error( nullptr, i18n( "Could not open macro file '%1'", f ) );
return false;
}
file.close();
......
......@@ -314,7 +314,7 @@ bool TextLabelModeBase::canFinish()
if ( ! finish )
{
KMessageBox::sorry( mdoc.widget(),
KMessageBox::error( mdoc.widget(),
i18n( "There are '%n' parts in the text that you have not selected a "
"value for. Please remove them or select enough arguments." ) );
};
......
......@@ -73,7 +73,7 @@ bool DefineMacroMode::validateObjects()
ObjectHierarchy hier( given, final );
if ( !mgiven.empty() && !hier.resultDependsOnGiven() )
{
KMessageBox::sorry( mwizard,
KMessageBox::error( mwizard,
i18n( "One of the result objects you selected "
"cannot be calculated from the given objects. "
"Kig cannot calculate this macro because of this. "
......@@ -83,7 +83,7 @@ bool DefineMacroMode::validateObjects()
}
else if( !hier.allGivenObjectsUsed() )
{
KMessageBox::sorry( mwizard,
KMessageBox::error( mwizard,
i18n( "One of the given objects is not used in the "
"calculation of the resultant objects. This "
"probably means you are expecting Kig to do "
......
......@@ -504,7 +504,7 @@ void TypesDialog::editType()
return;
if ( indexes.count() > 1 )
{
KMessageBox::sorry( this,
KMessageBox::error( this,
i18n( "There is more than one type selected. You can "
"only edit one type at a time. Please select "
"only the type you want to edit and try again." ),
......
......@@ -196,7 +196,7 @@ bool ScriptCreationMode::queryFinish()
}
else
{
KMessageBox::sorry(
KMessageBox::error(
mwizard, i18n( "There seems to be an error in your script. The Python interpreter "
"reported no errors, but the script does not generate "
"a valid object. Please fix the script, and click the Finish button "
......@@ -338,7 +338,7 @@ bool ScriptEditMode::queryFinish()
}
else
{
KMessageBox::sorry(
KMessageBox::error(
mwizard, i18n( "There seems to be an error in your script. The Python interpreter "
"reported no errors, but the script does not generate "
"a valid object. Please fix the script." ) );
......
Supports Markdown
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