Added new dialogs

This commit is contained in:
Valentino Orlandi 2024-04-30 21:11:04 +02:00
parent 7d110ccabd
commit cd9d48b664
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
3 changed files with 39 additions and 3 deletions

View File

@ -423,6 +423,30 @@ void DialogSec::errLogFormatNoSeparators( QWidget* parent )
std::ignore = dialog.exec();
}
bool DialogSec::choiceLogFormatMissingField( const QString& field, QWidget* parent )
{
DialogBool dialog{
DialogSec::tr("Missing field in log format"),
QStringLiteral("%1:\n%2\n\n%3\n%4").arg(
DialogSec::tr("An important field is missing from the provided format:"),
field,
DialogSec::tr("The quality of the statistics may be seriously affected"),
DialogSec::tr("Proceed anyway?") ),
parent };
return dialog.exec();
}
bool DialogSec::choiceLogFormatWithCarriageReturn( QWidget* parent )
{
DialogBool dialog{
DialogSec::tr("Carriage Return in log format"),
QStringLiteral("%1\n\n%2").arg(
DialogSec::tr("The provided format contains the Carriage Return.\nThis may lead to data losses or crashes if not used with caution"),
DialogSec::tr("Proceed anyway?") ),
parent };
return dialog.exec();
}
void DialogSec::errFailedParsingLogs( const QString& message, QWidget* parent )
{
DialogMsg dialog{

View File

@ -186,7 +186,7 @@ public:
//! Failed to process a logs format string
static void errInvalidLogFormatString( const QString& msg, QWidget* parent=nullptr );
//! The logs format has not been set for the web server in use
//! The log format has not been set for the web server in use
static void errLogFormatNotSet( QWidget* parent=nullptr );
//! The log format in use has no log fields
@ -195,6 +195,12 @@ public:
//! The log format in use has no log separators
static void errLogFormatNoSeparators( QWidget* parent=nullptr );
//! The provided log format is missing an important field
static bool choiceLogFormatMissingField( const QString& field, QWidget* parent=nullptr );
//! The provided log format contains the CR control character
static bool choiceLogFormatWithCarriageReturn( QWidget* parent=nullptr );
/////////////////////
//// LOGS PARSER ////

View File

@ -20,8 +20,14 @@ public:
const std::string BOOLS__FALSE { TR::tr("FALSE").toStdString() };
const std::string BOOLS__TRUE { TR::tr("TRUE").toStdString() };
const std::string WORDS__DATE { TR::tr("Date").toStdString() };
const std::string WORDS__TIME { TR::tr("Time").toStdString() };
const std::string WORDS__DATE { TR::tr("Date").toStdString() };
const std::string WORDS__YEAR { TR::tr("Year").toStdString() };
const std::string WORDS__MONTH { TR::tr("Month").toStdString() };
const std::string WORDS__DAY { TR::tr("Day").toStdString() };
const std::string WORDS__TIME { TR::tr("Time").toStdString() };
const std::string WORDS__HOUR { TR::tr("Hour").toStdString() };
const std::string WORDS__MINUTE { TR::tr("Minute").toStdString() };
const std::string WORDS__SECOND { TR::tr("Second").toStdString() };
const std::string FIELDS__WARNING { TR::tr("Warning").toStdString() };
const std::string FIELDS__PROTOCOL { TR::tr("Protocol").toStdString() };