Ajout du support pour les fichiers CAN database .dbc
Ajout shortcut pour RDP vers le PC dans le champs
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#include "GeneralStatusPage.h"
|
||||
#include "ui_GeneralStatusPage.h"
|
||||
#include "QStringList"
|
||||
|
||||
CGeneralStatusPage::CGeneralStatusPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::CGeneralStatusPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
}
|
||||
|
||||
CGeneralStatusPage::~CGeneralStatusPage()
|
||||
@@ -13,8 +15,66 @@ CGeneralStatusPage::~CGeneralStatusPage()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
int CGeneralStatusPage::SetGeneralMsgText(QString Txt)
|
||||
int CGeneralStatusPage::SetGeneralMsgText(QStringList Txt)
|
||||
{
|
||||
ui->mGenMsgTextEdit->setText(Txt);
|
||||
/*if you're populating the text box programatically, is to use textEdit->setTextColor(QColor&).You can create the QColor object yourself, or use one of the predefined colours in the Qt namespace (Qt::black, Qt::red, etc). It will apply the specified colour to any text you add, until it is called again with a different one.*/
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CGeneralStatusPage::AddGeneralMsgBoxLineEntry(QString LineTxt)
|
||||
{
|
||||
|
||||
//Limit the number of lines in the MsgBox to avoid overruns...
|
||||
if(mGenMsgListBoxTextLines.size() >= GENERAL_MESSAGES_MAX_LOG_LINES)
|
||||
{
|
||||
mGenMsgListBoxTextLines.removeFirst();
|
||||
mGenMsgListBoxTextLines.append(LineTxt);
|
||||
|
||||
ui->mGenMsgTextEdit->clear();
|
||||
for(int i = 0; i < mGenMsgListBoxTextLines.size(); i++)
|
||||
{
|
||||
AddColoredLineToGenMsgBox(mGenMsgListBoxTextLines[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mGenMsgListBoxTextLines.append(LineTxt);
|
||||
AddColoredLineToGenMsgBox(LineTxt);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int CGeneralStatusPage::AddColoredLineToGenMsgBox(QString Line)
|
||||
{
|
||||
if(Line.isEmpty())
|
||||
{
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
if(Line.at(0) == QChar('%'))
|
||||
{
|
||||
if(Line.at(1) == QChar('E')) //The line is describing an error... write it red
|
||||
{
|
||||
ui->mGenMsgTextEdit->setTextColor(Qt::red);
|
||||
}
|
||||
else if(Line.at(1) == QChar('W')) //The line is describing a warning... write it yellow
|
||||
{
|
||||
ui->mGenMsgTextEdit->setTextColor(Qt::blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("GeneralStatusPage: Logic error in general message box line encoding... you should check into that");
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
Line.remove(0,2);
|
||||
}
|
||||
|
||||
ui->mGenMsgTextEdit->insertPlainText(Line);
|
||||
ui->mGenMsgTextEdit->setTextColor(Qt::black);
|
||||
|
||||
return RET_OK;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user