Added new dialogs

This commit is contained in:
Valentino Orlandi 2024-02-03 17:54:20 +01:00
parent 833f3da5db
commit 6182a61420
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
2 changed files with 163 additions and 97 deletions

View File

@ -13,22 +13,22 @@ void DialogSec::errLangLocaleInvalid( const QString& locale, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Invalid locale"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("Unexpected locale format"),
locale,
DialogSec::tr("If you haven't manually edited the configuration file,\nplease report this issue") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
void DialogSec::errLangNotAccepted( const QString& locale, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Invalid locale"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The given locale is not an accepted language"),
locale,
DialogSec::tr("If you'd like to have this locale in LogDoctor,\nplease follow the instruction on the repository page") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -41,11 +41,11 @@ void DialogSec::warnConfFileNotFound( const QString& file, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Configuration file not found"),
QString("%1%2\n\n%3").arg(
QStringLiteral("%1%2\n\n%3").arg(
DialogSec::tr("Unable to retrieve the configuration file"),
(file.isEmpty()) ? file : ":\n"+file,
DialogSec::tr("Skipping") ),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}
@ -53,7 +53,7 @@ void DialogSec::errConfFailedWriting( const QString& msg, const QString& err, QW
{
DialogMsg dialog{
DialogSec::tr("Failed to write the configuration file"),
QString("%1%2\n\n%3").arg(
QStringLiteral("%1%2\n\n%3").arg(
DialogSec::tr("An error occured while handling the configuration file"),
(msg.isEmpty()) ? msg : ":\n"+msg,
DialogSec::tr("Current configuration not saved") ),
@ -65,7 +65,7 @@ void DialogSec::errConfFileNotReadable( const QString& file, const QString& err,
{
DialogMsg dialog{
DialogSec::tr("File not readable"),
QString("%1\n\n%2%3").arg(
QStringLiteral("%1\n\n%2%3").arg(
DialogSec::tr("An error occured while handling the configuration file"),
DialogSec::tr("The file is not readable"),
(file.isEmpty()) ? file : ":\n"+file ),
@ -76,7 +76,7 @@ void DialogSec::errConfFileNotWritable( const QString& file, const QString& err,
{
DialogMsg dialog{
DialogSec::tr("File not writable"),
QString("%1\n\n%2%3").arg(
QStringLiteral("%1\n\n%2%3").arg(
DialogSec::tr("An error occured while handling the configuration file"),
DialogSec::tr("The file is not writable"),
(file.isEmpty()) ? file : ":\n"+file ),
@ -89,7 +89,7 @@ void DialogSec::errConfDirNotWritable( const QString& dir, const QString& err, Q
{
DialogMsg dialog{
DialogSec::tr("Directory not writable"),
QString("%1\n\n%2%3").arg(
QStringLiteral("%1\n\n%2%3").arg(
DialogSec::tr("An error occured while handling the configuration file"),
DialogSec::tr("The directory is not writable"),
(dir.isEmpty()) ? dir : ":\n"+dir ),
@ -102,10 +102,10 @@ void DialogSec::errFailedApplyingConfigsItem( const QString& msg, QWidget* paren
{
DialogMsg dialog{
DialogSec::tr("Failed applying configuration"),
QString("%1\n%2").arg(
QStringLiteral("%1\n%2").arg(
(msg.isEmpty()) ? msg : QString("%1\n").arg(msg),
DialogSec::tr("Skipping") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -114,7 +114,7 @@ void DialogSec::warnInvalidConfigsList( const QStringList& list, QWidget* parent
{
DialogMsg dialog{
DialogSec::tr("Invalid configuration lines"),
QString("%1\n%2").arg(
QStringLiteral("%1\n%2").arg(
DialogSec::tr("Has not been possible to apply some of the configurations"),
DialogSec::tr("If you haven't manually edited the configuration file,\nplease report this issue") ),
list.join('\n'),
@ -127,7 +127,7 @@ bool DialogSec::choiceFailedApplyingConfigs( const QString& msg, QWidget* parent
{
DialogBool dialog{
DialogSec::tr("Failed applying configuration"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
msg,
DialogSec::tr("If you choose to proceed, all of the unapplied configurations will be lost\nContinue?") ),
parent };
@ -143,12 +143,12 @@ void DialogSec::errHelpFailed( const QString& link, const QString& msg, QWidget*
{
DialogMsg dialog{
DialogSec::tr("Failed to retrieve the help file"),
QString("%1%2\n\n%3%4").arg(
QStringLiteral("%1%2\n\n%3%4").arg(
DialogSec::tr("An error occured while getting the help file"),
(msg.isEmpty()) ? msg : ":\n"+msg,
DialogSec::tr("Additional resources can be downloaded from the git repo"),
(link.isEmpty()) ? link : ":\n"+link ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -178,7 +178,7 @@ void DialogSec::warnInvalidItemBW( QWidget* parent )
DialogMsg dialog{
DialogSec::tr("Invalid string"),
DialogSec::tr("The given string is invalid and cannot be added to the list\n\nPlease correct it and retry"),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}
@ -191,11 +191,11 @@ void DialogSec::errSqlDriverNotFound( const QString& driver, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("QSql driver not found"),
QString("%1:\n%2\n\n%3").arg(
DialogSec::tr("Failed to retrieve the driver neede to handle the database"),
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("Failed to retrieve the driver needed to handle the database"),
driver,
DialogSec::tr("Aborting") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -203,7 +203,7 @@ bool DialogSec::choiceDatabaseNotFound( const QString& db_name, QWidget* parent
{
DialogBool dialog{
DialogSec::tr("File not found"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("Failed to retrieve the database file"),
db_name,
DialogSec::tr("Create a new database?") ),
@ -213,7 +213,7 @@ bool DialogSec::choiceDatabaseNotFound( const QString& db_name, QWidget* parent
bool DialogSec::choiceDatabaseWrongTable(const QString& db_name, const QString& table_name, QWidget* parent )
{
QString msg{ QString("%1:\n%2 -> %3").arg(
const QString msg{ QStringLiteral("%1:\n%2 -> %3").arg(
DialogSec::tr("The database contains an unexpected table"),
db_name, table_name ) };
return choiceDatabaseRenew(
@ -223,7 +223,7 @@ bool DialogSec::choiceDatabaseWrongTable(const QString& db_name, const QString&
}
bool DialogSec::choiceDatabaseMissingTable( const QString& db_name, const QString& table_name, QWidget* parent )
{
QString msg{ QString("%1:\n%2 -> %3").arg(
QString msg{ QStringLiteral("%1:\n%2 -> %3").arg(
DialogSec::tr("It seems that the database is missing a table"),
db_name, table_name ) };
return choiceDatabaseRenew(
@ -233,7 +233,7 @@ bool DialogSec::choiceDatabaseMissingTable( const QString& db_name, const QStrin
}
bool DialogSec::choiceDatabaseWrongColumn( const QString& db_name, const QString& table_name, const QString& column_name, QWidget* parent )
{
QString msg{ QString("%1:\n%2 -> %3 -> %4").arg(
QString msg{ QStringLiteral("%1:\n%2 -> %3 -> %4").arg(
DialogSec::tr("The database contains an unexpected column"),
db_name, table_name, column_name ) };
return choiceDatabaseRenew(
@ -243,7 +243,7 @@ bool DialogSec::choiceDatabaseWrongColumn( const QString& db_name, const QString
}
bool DialogSec::choiceDatabaseMissingColumn( const QString& db_name, const QString& table_name, const QString& column_name, QWidget* parent )
{
QString msg{ QString("%1:\n%2 -> %3 -> %4").arg(
QString msg{ QStringLiteral("%1:\n%2 -> %3 -> %4").arg(
DialogSec::tr("It seems that the table is missing a column"),
db_name, table_name, column_name ) };
return choiceDatabaseRenew(
@ -253,7 +253,7 @@ bool DialogSec::choiceDatabaseMissingColumn( const QString& db_name, const QStri
}
bool DialogSec::choiceDatabaseWrongDataType( const QString& db_name, const QString& table_name, const QString& column_name, const QString& data_type, QWidget* parent )
{
QString msg{ QString("%1:\n%2 -> %3 -> %4 -> %5").arg(
QString msg{ QStringLiteral("%1:\n%2 -> %3 -> %4 -> %5").arg(
DialogSec::tr("A column has an unexpected data-type"),
db_name, table_name, column_name, data_type ) };
return choiceDatabaseRenew(
@ -265,7 +265,7 @@ bool DialogSec::choiceDatabaseRenew( const QString& title, const QString& msg, Q
{
DialogBool dialog{
title,
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
msg,
DialogSec::tr("This database will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ),
parent };
@ -275,10 +275,10 @@ void DialogSec::msgDatabaseCreated( const QString& db_name, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Database created"),
QString("%1:\n%2").arg(
QStringLiteral("%1:\n%2").arg(
DialogSec::tr("Successfully created a new database"),
db_name ),
"", MsgType::Info, parent };
QString(), MsgType::Info, parent };
std::ignore = dialog.exec();
}
@ -286,10 +286,10 @@ void DialogSec::errDatabaseNotFound( const QString& db_name, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("File not found"),
QString("%1:\n%2").arg(
QStringLiteral("%1:\n%2").arg(
DialogSec::tr("Failed to retrieve the database file"),
db_name ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -297,12 +297,12 @@ void DialogSec::errDatabaseNotFile( const QString& db_name, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Not a file"),
QString("%1\n\n%2:\n%3\n\n%4").arg(
QStringLiteral("%1\n\n%2:\n%3\n\n%4").arg(
DialogSec::tr("Failed to retrieve the database file"),
DialogSec::tr("The path was supposed to point to a file, but it doesn't"),
db_name,
DialogSec::tr("Please remove the conflict and retry") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -310,11 +310,11 @@ void DialogSec::errDatabaseNotReadable( const QString& db_name, QWidget* parent
{
DialogMsg dialog{
DialogSec::tr("File not readable"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The database file is not readable"),
db_name,
DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -322,11 +322,11 @@ void DialogSec::errDatabaseNotWritable( const QString& db_name, QWidget* parent
{
DialogMsg dialog{
DialogSec::tr("File not writable"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The database file is not writable"),
db_name,
DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -334,11 +334,11 @@ void DialogSec::errDatabaseFailedCreating( const QString& db_name, QWidget* pare
{
DialogMsg dialog{
DialogSec::tr("Failed creating database"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("An error occured while creating the database"),
db_name,
DialogSec::tr("Aborting") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -346,7 +346,7 @@ void DialogSec::errDatabaseFailedOpening( const QString& db_name, const QString&
{
DialogMsg dialog{
DialogSec::tr("Failed opening database"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("An error occured while opening the database"),
db_name,
DialogSec::tr("Aborting") ),
@ -358,10 +358,10 @@ void DialogSec::errDatabaseFailedExecuting( const QString& db_name, const QStrin
{
DialogMsg dialog{
DialogSec::tr("Failed executing on database"),
QString("%1:\n%2%3\n\n%4").arg(
QStringLiteral("%1:\n%2%3\n\n%4").arg(
DialogSec::tr("An error occured while executing a statement on the database"),
db_name,
(statement.size()>0) ? "\n"+statement : "",
!statement.isEmpty() ? "\n"+statement : QString(),
DialogSec::tr("Aborting") ),
err, MsgType::Error, parent };
std::ignore = dialog.exec();
@ -371,7 +371,7 @@ void DialogSec::errDatabaseFailedBackup( const QString& msg, const QString& err,
{
DialogMsg dialog{
DialogSec::tr("Failed to backup database"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
msg,
DialogSec::tr("Please report this issue") ),
err, MsgType::Error, parent };
@ -396,9 +396,8 @@ void DialogSec::errLogFormatNotSet( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Log format error"),
QString("%1").arg(
DialogSec::tr("The log format has not been set, or is invalid\nPlease add a valid one in the configurations") ),
"", MsgType::Error, parent };
DialogSec::tr("The log format has not been set, or is invalid\nPlease add a valid one in the configurations"),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -406,10 +405,10 @@ void DialogSec::errLogFormatNoFields( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Misconfigured log format"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("No log field has been set in the current logs format,\nmaking it useless to parse logs"),
DialogSec::tr("Please set up a format which contains at least one field") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -417,10 +416,10 @@ void DialogSec::errLogFormatNoSeparators( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Misconfigured log format"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("A separator is missing between one or more fields,\nmaking it hard to establish net bounds,\nand possibly leading to store incorrect data"),
DialogSec::tr("Please set up a format which contains separators between fields") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -429,7 +428,7 @@ void DialogSec::errFailedParsingLogs( const QString& message, QWidget* parent )
DialogMsg dialog{
DialogSec::tr("An error occured while parsing logs"),
message,
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -442,10 +441,10 @@ void DialogSec::errFailedDefiningLogType( const QString& file, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Failed defining type"),
QString("%1:\n%2").arg(
QStringLiteral("%1:\n%2").arg(
DialogSec::tr("Failed to determine the log type"),
file ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -454,7 +453,7 @@ int DialogSec::choiceFileAlreadyUsed( const QString& msg, QWidget* parent )
{
DialogIda dialog{
DialogSec::tr("File already used"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The file has probably been used already"),
msg,
DialogSec::tr("Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process?") ),
@ -467,7 +466,7 @@ int DialogSec::choiceDuplicateFile( const QString& msg, QWidget* parent )
{
DialogIda dialog{
DialogSec::tr("Duplicate file"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The file appears twice in the list of selections"),
msg,
DialogSec::tr("Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process?") ),
@ -475,12 +474,23 @@ int DialogSec::choiceDuplicateFile( const QString& msg, QWidget* parent )
return dialog.exec();
}
void DialogSec::errFailedInsertUsedHashes( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Failed updating hashes"),
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("An error occured while inserting the parsed files hashes into the database"),
DialogSec::tr("Aborting") ),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
int DialogSec::choiceFileSizeWarning( const QString& msg, QWidget* parent )
{
DialogIda dialog{
DialogSec::tr("File exceeds warning size"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The file's size exceeds the warning size"),
msg,
DialogSec::tr("Ignore the warning and use it anyway, Discard it and continue, or Abort the entire process?") ),
@ -491,7 +501,7 @@ bool DialogSec::choiceFileSizeWarning2( const QString& msg, QWidget* parent )
{
DialogBool dialog{
DialogSec::tr("File exceeds warning size"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The file's size exceeds the warning size"),
msg,
DialogSec::tr("Proceed anyway?") ),
@ -503,11 +513,11 @@ void DialogSec::msgNotEnoughMemory( const QString& msg, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Not enough memory"),
QString("%1%2\n\n%3").arg(
QStringLiteral("%1%2\n\n%3").arg(
DialogSec::tr("The total size of the selected files exceeds the available memory"),
msg,
DialogSec::tr("Please free some resources, parse the files in different steps or split them into smaller units") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -516,10 +526,11 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW
{
DialogMsg dialog{
DialogSec::tr("Failed reading"),
QString("%1:\n%2").arg(
QStringLiteral("%1:\n%2%3").arg(
DialogSec::tr("An error occured while reading the file"),
file + ((skipping) ? DialogSec::tr("Skipping") : "") ),
"", MsgType::Error, parent };
file,
skipping ? DialogSec::tr("Skipping").prepend("\n\n") : QString() ),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -527,11 +538,11 @@ void DialogSec::errFailedReadFile( const QString& file , const bool skipping, QW
{
DialogMsg dialog{
DialogSec::tr("Failed writing"),
QString("%1:\n%2%3").arg(
QStringLiteral("%1:\n%2%3").arg(
DialogSec::tr("An error occured while writing the file"),
file,
(skipping) ? QString("\n\n%1").arg(DialogSec::tr("Skipping")) : "" ),
"", MsgType::Error, parent };
(skipping) ? QString("\n\n%1").arg(DialogSec::tr("Skipping")) : QString() ),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}*/
@ -540,11 +551,11 @@ void DialogSec::warnEmptyFile( const QString& file, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("File is empty"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The file is blank"),
file,
DialogSec::tr("Skipping") ),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}
@ -552,11 +563,11 @@ void DialogSec::errFileNotFound( const QString& file , const bool report, QWidge
{
DialogMsg dialog{
DialogSec::tr("File not found"),
QString("%1:\n%2%3").arg(
QStringLiteral("%1:\n%2%3").arg(
DialogSec::tr("Unable to retrieve the file"),
file,
( report ) ? QString("\n\n%1").arg(DialogSec::tr("Please report this issue")) : "" ),
"", MsgType::Error, parent };
report ? DialogSec::tr("Please report this issue").prepend("\n\n") : QString() ),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -564,11 +575,11 @@ void DialogSec::warnFileNotReadable( const QString& file, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("File not readable"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The file is not readable"),
file,
DialogSec::tr("Skipping") ),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}
@ -578,7 +589,7 @@ int DialogSec::choiceSelectedFileNotFound( const QString& file, QWidget* parent
{
DialogIda dialog{
DialogSec::tr("File not found"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("Failed to retrieve the selected file"),
file,
DialogSec::tr("Discard it and continue, or Abort all and exit?") ),
@ -590,10 +601,10 @@ void DialogSec::msgNoFileToParse( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("No file to parse"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("The list of files to parse is empty"),
DialogSec::tr("Aborting") ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -606,10 +617,10 @@ void DialogSec::errDirNotExists( const QString& dir, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Directory not found"),
QString("%1:\n%2").arg(
QStringLiteral("%1:\n%2").arg(
DialogSec::tr("The directory does not exists"),
dir ),
"", MsgType::Error, parent };
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -617,7 +628,7 @@ void DialogSec::errDirNotExists( const QString& dir, QWidget* parent )
{
DialogDia dialog{
DialogSec::tr("Directory not found"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The directory does not exists"),
dir,
DialogSec::tr("Discard it and continue, or Abort all and exit?") ),
@ -630,7 +641,7 @@ void DialogSec::errDirNotReadable( const QString& dir, const QString& err, QWidg
{
DialogMsg dialog{
DialogSec::tr("Directory not readable"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The directory is not readable"),
dir,
DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ),
@ -641,10 +652,10 @@ void DialogSec::warnDirNotReadable( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Directory not readable"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("The directory is not readable"),
DialogSec::tr("Please set the proper permissions before to start") ),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}
@ -652,7 +663,7 @@ void DialogSec::errDirNotWritable( const QString& dir, const QString& err, QWidg
{
DialogMsg dialog{
DialogSec::tr("Directory not writable"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The directory is not writable"),
dir,
DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ),
@ -663,10 +674,10 @@ void DialogSec::warnDirNotWritable( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Directory not writable"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("The directory is not writable"),
DialogSec::tr("Please set the proper permissions before to start") ),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}
@ -674,7 +685,7 @@ void DialogSec::errFailedMakeDir( const QString& msg, const QString& err, QWidge
{
DialogMsg dialog{
DialogSec::tr("Failed creating directory"),
QString("%1\n\n%2").arg(
QStringLiteral("%1\n\n%2").arg(
msg,
DialogSec::tr("Please set the proper permissions and retry\nIf this error persists, please report this issue") ),
err, MsgType::Error, parent };
@ -682,6 +693,44 @@ void DialogSec::errFailedMakeDir( const QString& msg, const QString& err, QWidge
}
//////////////
//// DATA ////
//////////////
void DialogSec::errConvertingData( const QString& fromType, const QString& intoType, const QString& value, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Data conversion failed"),
QStringLiteral("%1:\n%2").arg(
DialogSec::tr("Failed to convert from '%1' to '%2'").arg(
fromType, intoType ),
value ),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
////////////////////
//// STATISTICS ////
////////////////////
void DialogSec::errProcessingStatsData( const QString& err, QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Failed to create statistics"),
DialogSec::tr("An error occured while processing"),
err, MsgType::Error, parent };
std::ignore = dialog.exec();
}
void DialogSec::msgNoDataForStats( QWidget* parent )
{
DialogMsg dialog{
DialogSec::tr("Cannot create statistics"),
DialogSec::tr("No data has been found that matches with the currently set parameters"),
QString(), MsgType::Info, parent };
std::ignore = dialog.exec();
}
//////////////////
//// GENERICS ////
//////////////////
@ -689,7 +738,7 @@ bool DialogSec::choiceDirNotDir( const QString& path, QWidget* parent )
{
DialogBool dialog{
DialogSec::tr("Not a folder"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The path was supposed to point to a folder, but it doesn't"),
path,
DialogSec::tr("The entry will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ),
@ -700,7 +749,7 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent )
{
DialogBool dialog{
DialogSec::tr("Not a file"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("The path was supposed to point to a file, but it doesn't"),
path,
DialogSec::tr("The entry will be renamed with a trailing '.copy' and a new one will be created.\nContinue?") ),
@ -718,9 +767,9 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent )
}
DialogMsg dialog{
DialogSec::tr("An error occured"),
QString("%1%2").arg(
QStringLiteral("%1%2").arg(
msg, footer ),
"", MsgType::Warning, parent };
QString(), MsgType::Warning, parent };
std::ignore = dialog.exec();
}*/
@ -728,15 +777,12 @@ bool DialogSec::choiceFileNotFile( const QString& path, QWidget* parent )
void DialogSec::errGeneric( const QString& msg, const bool report_msg, QWidget* parent )
{
QString footer;
if ( report_msg ) {
footer += "\n\n" + DialogSec::tr("Please report this issue");
}
DialogMsg dialog{
DialogSec::tr("An error occured"),
QString("%1%2").arg(
msg, footer ),
"", MsgType::Error, parent };
QStringLiteral("%1%2").arg(
msg,
report_msg ? DialogSec::tr("Please report this issue").prepend("\n\n") : QString() ),
QString(), MsgType::Error, parent };
std::ignore = dialog.exec();
}
@ -746,7 +792,7 @@ void DialogSec::errRenaming( const QString& path, const QString& err, QWidget* p
{
DialogMsg dialog{
DialogSec::tr("Failed renaming"),
QString("%1:\n%2\n\n%3").arg(
QStringLiteral("%1:\n%2\n\n%3").arg(
DialogSec::tr("An error occured while renaming"),
path,
DialogSec::tr("Aborting") ),

View File

@ -164,6 +164,9 @@ public:
//! A selected log file appears twice in the selection
static int choiceDuplicateFile( const QString& msg, QWidget* parent=nullptr );
//! An error occured while inserting the new files' hashes into the daabase
static void errFailedInsertUsedHashes( QWidget* parent=nullptr );
///////////////////
//// LOGS SIZE ////
@ -200,6 +203,16 @@ public:
static void errFailedParsingLogs( const QString& message, QWidget* parent=nullptr );
////////////////////
//// STATISTICS ////
//! An error occured while processing data
static void errProcessingStatsData( const QString& err, QWidget* parent=nullptr );
//! No data, cannot draw the chart
static void msgNoDataForStats( QWidget* parent=nullptr );
///////////////
//// FILES ////
@ -241,6 +254,13 @@ public:
//! Failed to create a directory
static void errFailedMakeDir( const QString& msg, const QString& err, QWidget* parent=nullptr );
//////////////
//// DATA ////
//! Failed to convert some data from one type into another
static void errConvertingData( const QString& fromType, const QString& intoType, const QString& value, QWidget* parent=nullptr );
/////////////////
//// CHOICES ////