22 general Sql dAtabase FrontEnd
33 http://hyperprog.com/gsafe/
44
5- (C) 2006-2020 Peter Deak (hyper80@gmail.com)
5+ (C) 2006-2021 Peter Deak (hyper80@gmail.com)
66
77 License: LGPLv2.1
88
@@ -56,6 +56,18 @@ void sdebug(QString s)
5656#endif // GSAFE_DISABLE_DEBUG
5757}
5858
59+ void ssdebug (QString s,char type)
60+ {
61+ #ifndef GSAFE_DISABLE_DEBUG
62+ if (HDebugConsole::myself == NULL )
63+ return ;
64+ HDebugConsole::debug_typedtxt (s,type);
65+ #else
66+ Q_UNUSED (s);
67+ Q_UNUSED (type);
68+ #endif // GSAFE_DISABLE_DEBUG
69+ }
70+
5971void dconsole (void )
6072{
6173#ifndef GSAFE_DISABLE_DEBUG
@@ -210,8 +222,6 @@ HDebugConsole::HDebugConsole(QWidget *parent)
210222 connect (p->pushClear ,SIGNAL (clicked ()),p->cf ,SLOT (clearText ()));
211223 connect (p->cf ,SIGNAL (commandEntered (QString)),this ,SLOT (execCommand (QString)));
212224 connect (p->cf ,SIGNAL (tabPressed (QString)),this ,SLOT (tabPressed (QString)));
213- p->cf ->setTextTypeColor (1 ,QColor (255 ,150 ,150 ));
214- p->cf ->setTextTypeColor (2 ,QColor (200 ,200 ,200 ));
215225
216226 p->cf ->setColor (" cursor" ,Qt::white);
217227 p->cf ->setColor (" cmdtext" ,QColor (0 ,255 ,0 ));
@@ -221,6 +231,11 @@ HDebugConsole::HDebugConsole(QWidget *parent)
221231 p->cf ->setTextTypeColor (DCONSOLE_TYPE_RESULT ,QColor (100 ,100 ,255 ));
222232 p->cf ->setTextTypeColor (DCONSOLE_TYPE_CMD ,QColor (0 ,230 ,0 ));
223233 p->cf ->setTextTypeColor (DCONSOLE_TYPE_QTDEBUG ,QColor (255 ,127 ,30 ));
234+ p->cf ->setTextTypeColor (DCONSOLE_TYPE_TXTALT_A,QColor (0 ,250 ,250 ));
235+ p->cf ->setTextTypeColor (DCONSOLE_TYPE_TXTALT_B,QColor (240 ,120 ,1 ));
236+ p->cf ->setTextTypeColor (DCONSOLE_TYPE_TXTALT_C,QColor (60 ,120 ,120 ));
237+ p->cf ->setTextTypeColor (DCONSOLE_TYPE_TXTALT_D,QColor (188 ,18 ,107 ));
238+ p->cf ->setTextTypeColor (DCONSOLE_TYPE_TXTALT_E,QColor (255 ,45 ,45 ));
224239
225240 p->cf ->addText (" START" ,DCONSOLE_TYPE_MESSAGE);
226241
@@ -356,8 +371,14 @@ void HDebugConsole::add_text(QString s,int type)
356371
357372#endif // DCONSOLE_NO_SQL
358373
359- if (p->pushText ->isChecked () && type == DCONSOLE_TYPE_TEXT)
360- p->cf ->addText (s,DCONSOLE_TYPE_TEXT);
374+ if (p->pushText ->isChecked () && (
375+ type == DCONSOLE_TYPE_TEXT ||
376+ type == DCONSOLE_TYPE_TXTALT_A ||
377+ type == DCONSOLE_TYPE_TXTALT_B ||
378+ type == DCONSOLE_TYPE_TXTALT_C ||
379+ type == DCONSOLE_TYPE_TXTALT_D ||
380+ type == DCONSOLE_TYPE_TXTALT_E))
381+ p->cf ->addText (s,type);
361382
362383 if (type == DCONSOLE_TYPE_QTDEBUG)
363384 p->cf ->addText (s,DCONSOLE_TYPE_QTDEBUG);
@@ -385,6 +406,12 @@ void HDebugConsole::debug_txt(QString s)
385406 myself->add_text (s,DCONSOLE_TYPE_TEXT);
386407}
387408
409+ void HDebugConsole::debug_typedtxt (QString s,char type)
410+ {
411+ if (myself != NULL )
412+ myself->add_text (s,type);
413+ }
414+
388415int HDebugConsole::execCommand (QString query)
389416{
390417 if (p->disabled )
0 commit comments