mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
added multilevel logging support
This commit is contained in:
parent
1306844e52
commit
a0b2a7bdaa
@ -23,6 +23,9 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.5 2006/01/02 18:54:52 glvertex
|
||||
added multilevel logging support
|
||||
|
||||
Revision 1.4 2006/01/02 17:39:18 glvertex
|
||||
Added info types in a combobox
|
||||
|
||||
@ -50,20 +53,8 @@ CustomDialog::CustomDialog(QWidget * parent)
|
||||
connect(ui.pushButtonBottomBg,SIGNAL(clicked()),this,SLOT(setBkgBottomColor()));
|
||||
connect(ui.pushButtonTopBg,SIGNAL(clicked()),this,SLOT(setBkgTopColor()));
|
||||
connect(ui.pushButtonLogArea,SIGNAL(clicked()),this,SLOT(setLogAreaColor()));
|
||||
connect(ui.comboBoxInfoType,SIGNAL(editTextChanged()),this,SLOT(setLogLevel()));
|
||||
setFixedSize(260,155);
|
||||
}
|
||||
|
||||
|
||||
void CustomDialog::loadCurrentSetting(const Color4b& bb,const Color4b& bt,const Color4b& l)
|
||||
{
|
||||
bkgBottomColor=bb;
|
||||
bkgTopColor=bt;
|
||||
logAreaColor=l;
|
||||
|
||||
// Changes the palette in the labels
|
||||
QPalette pbb(QColor(bb.V(0),bb.V(1),bb.V(2)));
|
||||
QPalette pbt(QColor(bt.V(0),bt.V(1),bt.V(2)));
|
||||
QPalette pl(QColor(l.V(0),l.V(1),l.V(2)));
|
||||
|
||||
//Error=0, Warning=1, Info=2, Debug=3, Direct=4, OnlyFileLog=5, OnlyConsole=6
|
||||
ui.comboBoxInfoType->addItem("Any");
|
||||
@ -75,13 +66,26 @@ void CustomDialog::loadCurrentSetting(const Color4b& bb,const Color4b& bt,const
|
||||
//ui.comboBoxInfoType->addItem("Only file");
|
||||
//ui.comboBoxInfoType->addItem("Only Console");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CustomDialog::loadCurrentSetting(const Color4b& bb,const Color4b& bt,const Color4b& l,short logLevel)
|
||||
{
|
||||
bkgBottomColor=bb;
|
||||
bkgTopColor=bt;
|
||||
logAreaColor=l;
|
||||
|
||||
// Changes the palette in the labels
|
||||
QPalette pbb(QColor(bb.V(0),bb.V(1),bb.V(2)));
|
||||
QPalette pbt(QColor(bt.V(0),bt.V(1),bt.V(2)));
|
||||
QPalette pl(QColor(l.V(0),l.V(1),l.V(2)));
|
||||
|
||||
ui.comboBoxInfoType->setCurrentIndex(logLevel+1);
|
||||
ui.labelBottmBg->setPalette(pbb);
|
||||
ui.labelTopBg->setPalette(pbt);
|
||||
ui.labelLogArea->setPalette(pl);
|
||||
}
|
||||
|
||||
|
||||
void CustomDialog::setBkgBottomColor()
|
||||
{
|
||||
QColor bb=QColorDialog::getColor(QColor(255,255,255,255),this);
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.60 2006/01/02 18:54:52 glvertex
|
||||
added multilevel logging support
|
||||
|
||||
Revision 1.59 2005/12/22 20:01:23 glvertex
|
||||
- Added support for more than one shader
|
||||
- Some methods renamed
|
||||
@ -262,6 +265,8 @@ GLArea::GLArea(QWidget *parent)
|
||||
trackBallVisible = true;
|
||||
currentSharder = NULL;
|
||||
time.start();
|
||||
|
||||
currLogLevel = -1;
|
||||
}
|
||||
|
||||
|
||||
@ -277,14 +282,8 @@ void GLArea::displayModelInfo()
|
||||
renderText(currentWidth-currentWidth*0.15,currentHeight-30,strTriangle);
|
||||
}
|
||||
|
||||
|
||||
QSize GLArea::minimumSizeHint() const {
|
||||
return QSize(400,300);
|
||||
}
|
||||
|
||||
QSize GLArea::sizeHint() const {
|
||||
return QSize(400,300);
|
||||
}
|
||||
QSize GLArea::minimumSizeHint() const {return QSize(400,300);}
|
||||
QSize GLArea::sizeHint() const {return QSize(400,300);}
|
||||
|
||||
|
||||
void GLArea::initializeGL()
|
||||
@ -509,7 +508,7 @@ void GLArea::paintGL()
|
||||
// Now print out the infos
|
||||
glColor4f(1,1,1,1);
|
||||
if(logVisible)
|
||||
log.glDraw(this,0,3);
|
||||
log.glDraw(this,currLogLevel,3);
|
||||
|
||||
displayModelInfo();
|
||||
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.41 2006/01/02 18:54:52 glvertex
|
||||
added multilevel logging support
|
||||
|
||||
Revision 1.40 2006/01/02 16:14:07 glvertex
|
||||
Added setFileName and getFileName methods
|
||||
|
||||
@ -262,6 +265,7 @@ public:
|
||||
MeshModel *mm;
|
||||
vcg::Trackball trackball;
|
||||
GLLogStream log;
|
||||
short currLogLevel;
|
||||
|
||||
int currentWidth;
|
||||
int currentHeight;
|
||||
@ -270,6 +274,9 @@ public:
|
||||
|
||||
QString getFileName() {return fileName;}
|
||||
void setFileName(QString name) {fileName = name;}
|
||||
|
||||
short getLogLevel() {return currLogLevel;}
|
||||
void setLogLevel(short lvl) {currLogLevel = lvl;}
|
||||
|
||||
RenderMode & getCurrentRenderMode() {return rm;}
|
||||
const ColorSetting& getCustomSetting() const {return cs;}
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.62 2006/01/02 18:54:52 glvertex
|
||||
added multilevel logging support
|
||||
|
||||
Revision 1.61 2006/01/02 17:19:19 glvertex
|
||||
Changed include directive to new .ui filenames
|
||||
|
||||
@ -844,14 +847,15 @@ void MainWindow::setCustomize()
|
||||
{
|
||||
CustomDialog dialog(this);
|
||||
ColorSetting cs=GLA()->getCustomSetting();
|
||||
dialog.loadCurrentSetting(cs.bColorBottom,cs.bColorTop,cs.lColor);
|
||||
dialog.loadCurrentSetting(cs.bColorBottom,cs.bColorTop,cs.lColor,GLA()->getLogLevel());
|
||||
if (dialog.exec()==QDialog::Accepted)
|
||||
{
|
||||
// If press Ok set the selected colors in glArea
|
||||
cs.bColorBottom=dialog.getBkgBottomColor();
|
||||
cs.bColorTop=dialog.getBkgTopColor();
|
||||
cs.lColor=dialog.getLogAreaColor();
|
||||
GLA()->setCustomSetting(cs);
|
||||
GLA()->setCustomSetting(cs);
|
||||
GLA()->setLogLevel(dialog.getLogLevel());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user