mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
included the error message source to debug errors because of too many slots and signals
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@215 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
#include <QMessageBox>
|
||||
#include <QAbstractButton>
|
||||
using namespace std;
|
||||
|
||||
class qDefs:public QWidget{
|
||||
@ -144,28 +145,27 @@ static const int64_t GUI_VERSION=0x20121213;
|
||||
static int Message(MessageIndex index, string message,string source)
|
||||
{
|
||||
static QMessageBox* msgBox;
|
||||
|
||||
message.append(string("<p style=\"font-size:10px;color:grey;\">Source: ") + source + string("</p>"));
|
||||
|
||||
switch(index){
|
||||
case WARNING:
|
||||
source.insert(0,"WARNING: #<b>");
|
||||
msgBox= new QMessageBox(QMessageBox::Warning,source.c_str(),tr(message.c_str()),QMessageBox::Ok, msgBox);
|
||||
msgBox= new QMessageBox(QMessageBox::Warning,"WARNING",tr(message.c_str()),QMessageBox::Ok, msgBox);
|
||||
break;
|
||||
case CRITICAL:
|
||||
source.insert(0,"CRITICAL: #<b>");
|
||||
msgBox= new QMessageBox(QMessageBox::Critical,source.c_str(),tr(message.c_str()),QMessageBox::Ok, msgBox);
|
||||
msgBox= new QMessageBox(QMessageBox::Critical,"CRITICAL",tr(message.c_str()),QMessageBox::Ok, msgBox);
|
||||
break;
|
||||
case INFORMATION:
|
||||
source.insert(0,"INFORMATION: #<b>");
|
||||
msgBox= new QMessageBox(QMessageBox::Information,source.c_str(),tr(message.c_str()),QMessageBox::Ok, msgBox);
|
||||
msgBox= new QMessageBox(QMessageBox::Information,"INFORMATION",tr(message.c_str()),QMessageBox::Ok, msgBox);
|
||||
break;
|
||||
default:
|
||||
source.insert(0,"QUESTION: #<b>");
|
||||
msgBox= new QMessageBox(QMessageBox::Question,source.c_str(),tr(message.c_str()),QMessageBox::Ok| QMessageBox::Cancel, msgBox);
|
||||
msgBox= new QMessageBox(QMessageBox::Question,"QUESTION",tr(message.c_str()),QMessageBox::Ok| QMessageBox::Cancel, msgBox);
|
||||
break;
|
||||
}
|
||||
//msgBox->setDetailedText(QString(source.c_str())); //close button doesnt work with this static function and this
|
||||
if(msgBox->exec()==QMessageBox::Ok) return OK; else return FAIL;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/** range of x and y axes
|
||||
@ -194,7 +194,6 @@ static const int64_t GUI_VERSION=0x20121213;
|
||||
retval = myDet->getErrorMessage(errorLevel);
|
||||
|
||||
if(!retval.empty()){
|
||||
|
||||
//replace all \n with <br>
|
||||
pos = 0;
|
||||
while((pos = retval.find("\n", pos)) != string::npos){
|
||||
@ -202,6 +201,10 @@ static const int64_t GUI_VERSION=0x20121213;
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
//get rid of the last \n
|
||||
if(retval.find_last_of("<br>")==retval.length()-1)
|
||||
retval.erase((int)retval.find_last_of("<br>")-3,4);
|
||||
|
||||
retval.insert(0,"<font color=\"darkBlue\">");
|
||||
retval.append("</font></nobr>");
|
||||
|
||||
@ -233,7 +236,6 @@ static const int64_t GUI_VERSION=0x20121213;
|
||||
retval = myDet->getErrorMessage(emask);
|
||||
|
||||
if(!retval.empty()){
|
||||
|
||||
//replace all \n with <br>
|
||||
pos = 0;
|
||||
while((pos = retval.find("\n", pos)) != string::npos){
|
||||
@ -241,6 +243,10 @@ static const int64_t GUI_VERSION=0x20121213;
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
//get rid of the last \n
|
||||
if(retval.find_last_of("<br>")==retval.length()-1)
|
||||
retval.erase((int)retval.find_last_of("<br>")-3,4);
|
||||
|
||||
retval.insert(0,"<font color=\"darkBlue\">");
|
||||
retval.append("</font></nobr>");
|
||||
|
||||
|
Reference in New Issue
Block a user