From edff130b7080aa0cf448f2dc90a3761d303c4c36 Mon Sep 17 00:00:00 2001 From: Peter Deak Date: Wed, 24 Feb 2021 20:17:50 +0100 Subject: [PATCH] Improved dconsole text coloring --- ChangeLog.txt | 3 +++ Doxyfile | 2 +- datalib.cpp | 2 +- datalib.h | 4 ++-- dconsole.cpp | 37 ++++++++++++++++++++++++++++++++----- dconsole.h | 20 +++++++++++++++++++- dialib.cpp | 2 +- dialib.h | 2 +- docgen.cpp | 2 +- docgen.h | 2 +- gstexts.h | 2 +- guilib.cpp | 2 +- guilib.h | 2 +- hfactory.cpp | 2 +- hfactory.h | 2 +- printlib.cpp | 2 +- printlib.h | 2 +- res_p.h | 2 +- version.txt | 2 +- xbio.cpp | 2 +- xbio.h | 2 +- xbioconn.cpp | 2 +- xbioconn.h | 2 +- xmlolib.cpp | 2 +- xmlolib.h | 2 +- 25 files changed, 77 insertions(+), 29 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ba21e8b..e06f72c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,6 @@ +1.3.29 + -Improved dconsole text coloring + 1.3.28 -Moved gsafe pixmaps to resources diff --git a/Doxyfile b/Doxyfile index 2fcfcc7..32fd99e 100644 --- a/Doxyfile +++ b/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = gSAFE # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.3.11 +PROJECT_NUMBER = 1.3.29 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/datalib.cpp b/datalib.cpp index 50befa7..c8626f1 100644 --- a/datalib.cpp +++ b/datalib.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/datalib.h b/datalib.h index 4102ab1..8adbb36 100644 --- a/datalib.h +++ b/datalib.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 @@ -36,7 +36,7 @@ #include "gstexts.h" /** The version of gsafe */ -#define GSAFE_VERSION "1.3.28" +#define GSAFE_VERSION "1.3.29" // /////////////////////////////////// // BEGIN - CONFIG/MODIFIERS/MODULES // diff --git a/dconsole.cpp b/dconsole.cpp index 8a1112a..517975c 100644 --- a/dconsole.cpp +++ b/dconsole.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2006-2020 Peter Deak (hyper80@gmail.com) + (C) 2006-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 @@ -56,6 +56,18 @@ void sdebug(QString s) #endif //GSAFE_DISABLE_DEBUG } +void ssdebug(QString s,char type) +{ +#ifndef GSAFE_DISABLE_DEBUG + if(HDebugConsole::myself == NULL) + return; + HDebugConsole::debug_typedtxt(s,type); +#else + Q_UNUSED(s); + Q_UNUSED(type); +#endif //GSAFE_DISABLE_DEBUG +} + void dconsole(void) { #ifndef GSAFE_DISABLE_DEBUG @@ -210,8 +222,6 @@ HDebugConsole::HDebugConsole(QWidget *parent) connect(p->pushClear,SIGNAL(clicked()),p->cf,SLOT(clearText())); connect(p->cf,SIGNAL(commandEntered(QString)),this,SLOT(execCommand(QString))); connect(p->cf,SIGNAL(tabPressed(QString)),this,SLOT(tabPressed(QString))); - p->cf->setTextTypeColor(1,QColor(255,150,150)); - p->cf->setTextTypeColor(2,QColor(200,200,200)); p->cf->setColor("cursor",Qt::white); p->cf->setColor("cmdtext",QColor(0,255,0)); @@ -221,6 +231,11 @@ HDebugConsole::HDebugConsole(QWidget *parent) p->cf->setTextTypeColor(DCONSOLE_TYPE_RESULT ,QColor(100,100,255)); p->cf->setTextTypeColor(DCONSOLE_TYPE_CMD ,QColor(0,230,0)); p->cf->setTextTypeColor(DCONSOLE_TYPE_QTDEBUG ,QColor(255,127,30)); + p->cf->setTextTypeColor(DCONSOLE_TYPE_TXTALT_A,QColor(0,250,250)); + p->cf->setTextTypeColor(DCONSOLE_TYPE_TXTALT_B,QColor(240,120,1)); + p->cf->setTextTypeColor(DCONSOLE_TYPE_TXTALT_C,QColor(60,120,120)); + p->cf->setTextTypeColor(DCONSOLE_TYPE_TXTALT_D,QColor(188,18,107)); + p->cf->setTextTypeColor(DCONSOLE_TYPE_TXTALT_E,QColor(255,45,45)); p->cf->addText("START",DCONSOLE_TYPE_MESSAGE); @@ -356,8 +371,14 @@ void HDebugConsole::add_text(QString s,int type) #endif // DCONSOLE_NO_SQL - if(p->pushText->isChecked() && type == DCONSOLE_TYPE_TEXT) - p->cf->addText(s,DCONSOLE_TYPE_TEXT); + if(p->pushText->isChecked() && ( + type == DCONSOLE_TYPE_TEXT || + type == DCONSOLE_TYPE_TXTALT_A || + type == DCONSOLE_TYPE_TXTALT_B || + type == DCONSOLE_TYPE_TXTALT_C || + type == DCONSOLE_TYPE_TXTALT_D || + type == DCONSOLE_TYPE_TXTALT_E)) + p->cf->addText(s,type); if(type == DCONSOLE_TYPE_QTDEBUG) p->cf->addText(s,DCONSOLE_TYPE_QTDEBUG); @@ -385,6 +406,12 @@ void HDebugConsole::debug_txt(QString s) myself->add_text(s,DCONSOLE_TYPE_TEXT); } +void HDebugConsole::debug_typedtxt(QString s,char type) +{ + if(myself != NULL) + myself->add_text(s,type); +} + int HDebugConsole::execCommand(QString query) { if(p->disabled) diff --git a/dconsole.h b/dconsole.h index ed07274..c39bf51 100644 --- a/dconsole.h +++ b/dconsole.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2006-2020 Peter Deak (hyper80@gmail.com) + (C) 2006-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 @@ -53,6 +53,11 @@ void sqldebug(QString s); * @see HDebugConsole*/ void sdebug(QString s); +/** Puts a debug/info text as special text. + * If there is no started HDebugConsole this function does nothing. + * @see HDebugConsole*/ +void ssdebug(QString s,char type); + /** Starts/Popup the HDebugConsole. * If the console already run this function does nothing. * @see HDebugConsole */ @@ -93,6 +98,17 @@ void clear_dconsole_commands(); #define DCONSOLE_TYPE_RESULT 3 #define DCONSOLE_TYPE_CMD 4 #define DCONSOLE_TYPE_QTDEBUG 5 +#define DCONSOLE_TYPE_TXTALT_A 6 +#define DCONSOLE_TYPE_TXTALT_B 7 +#define DCONSOLE_TYPE_TXTALT_C 8 +#define DCONSOLE_TYPE_TXTALT_D 9 +#define DCONSOLE_TYPE_TXTALT_E 10 + +#define DCONSOLE_TYPE_TXTALT_CYAN DCONSOLE_TYPE_TXTALT_A +#define DCONSOLE_TYPE_TXTALT_CORAL DCONSOLE_TYPE_TXTALT_B +#define DCONSOLE_TYPE_TXTALT_TEAL DCONSOLE_TYPE_TXTALT_C +#define DCONSOLE_TYPE_TXTALT_PURPLE DCONSOLE_TYPE_TXTALT_D +#define DCONSOLE_TYPE_TXTALT_RED DCONSOLE_TYPE_TXTALT_E #ifndef COMPILED_WITH_QT4X void dconsoleMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); @@ -209,6 +225,8 @@ class HDebugConsole : public QWidget #endif // DCONSOLE_NO_SQL /** Write a normal text to the console */ static void debug_txt(QString s); + /** Write a special typed text to the console */ + static void debug_typedtxt(QString s,char type); /** Popups a warning text */ static void popup(QString title,QString str); /** You can disable the command excution if this function called with FALSE. diff --git a/dialib.cpp b/dialib.cpp index 0d58fd2..0a687e3 100644 --- a/dialib.cpp +++ b/dialib.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/dialib.h b/dialib.h index 2c988fd..2d34e78 100644 --- a/dialib.h +++ b/dialib.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/docgen.cpp b/docgen.cpp index 58dabf5..29c15d8 100644 --- a/docgen.cpp +++ b/docgen.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/docgen.h b/docgen.h index 4558257..d283146 100644 --- a/docgen.h +++ b/docgen.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/gstexts.h b/gstexts.h index 2fc91e5..cbb9da5 100644 --- a/gstexts.h +++ b/gstexts.h @@ -2,7 +2,7 @@ gSAFE - LIB general Sql dAtabase FrontEnd - (C) 2010-2020 Peter Deak (hyper80@gmail.com) + (C) 2010-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/guilib.cpp b/guilib.cpp index 8de2b90..1a32a23 100644 --- a/guilib.cpp +++ b/guilib.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/guilib.h b/guilib.h index 774892a..a16cfd5 100644 --- a/guilib.h +++ b/guilib.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/hfactory.cpp b/hfactory.cpp index c98509c..5efad82 100644 --- a/hfactory.cpp +++ b/hfactory.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/hfactory.h b/hfactory.h index de380c3..0eda217 100644 --- a/hfactory.h +++ b/hfactory.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/printlib.cpp b/printlib.cpp index d76537d..7293908 100644 --- a/printlib.cpp +++ b/printlib.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/printlib.h b/printlib.h index 57d570e..17057b9 100644 --- a/printlib.h +++ b/printlib.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2005-2020 Peter Deak (hyper80@gmail.com) + (C) 2005-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/res_p.h b/res_p.h index 7d2169a..5579bfb 100644 --- a/res_p.h +++ b/res_p.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2010-2020 Peter Deak (hyper80@gmail.com) + (C) 2010-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/version.txt b/version.txt index 5574de9..a76ee30 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.3.28 +1.3.29 diff --git a/xbio.cpp b/xbio.cpp index 7479583..f4560e5 100644 --- a/xbio.cpp +++ b/xbio.cpp @@ -2,7 +2,7 @@ gSAFE - LIB general Sql dAtabase FrontEnd - (C) 2011-2020 Peter Deak (hyper80@gmail.com) + (C) 2011-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/xbio.h b/xbio.h index 42d9553..22f13f1 100644 --- a/xbio.h +++ b/xbio.h @@ -2,7 +2,7 @@ gSAFE - LIB general Sql dAtabase FrontEnd - (C) 2011-2020 Peter Deak (hyper80@gmail.com) + (C) 2011-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/xbioconn.cpp b/xbioconn.cpp index 29bfb06..5f49343 100644 --- a/xbioconn.cpp +++ b/xbioconn.cpp @@ -2,7 +2,7 @@ gSAFE - LIB general Sql dAtabase FrontEnd - (C) 2011-2020 Peter Deak (hyper80@gmail.com) + (C) 2011-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/xbioconn.h b/xbioconn.h index 62594dc..f430185 100644 --- a/xbioconn.h +++ b/xbioconn.h @@ -2,7 +2,7 @@ gSAFE - LIB general Sql dAtabase FrontEnd - (C) 2011-2020 Peter Deak (hyper80@gmail.com) + (C) 2011-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/xmlolib.cpp b/xmlolib.cpp index 3309c1d..b152c3d 100644 --- a/xmlolib.cpp +++ b/xmlolib.cpp @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2011-2020 Peter Deak (hyper80@gmail.com) + (C) 2011-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1 diff --git a/xmlolib.h b/xmlolib.h index 8ad7041..11825f1 100644 --- a/xmlolib.h +++ b/xmlolib.h @@ -2,7 +2,7 @@ general Sql dAtabase FrontEnd http://hyperprog.com/gsafe/ - (C) 2011-2020 Peter Deak (hyper80@gmail.com) + (C) 2011-2021 Peter Deak (hyper80@gmail.com) License: LGPLv2.1