Skip to content

Commit edff130

Browse files
committed
Improved dconsole text coloring
1 parent f948792 commit edff130

25 files changed

+77
-29
lines changed

ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.3.29
2+
-Improved dconsole text coloring
3+
14
1.3.28
25
-Moved gsafe pixmaps to resources
36

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PROJECT_NAME = gSAFE
3131
# This could be handy for archiving the generated documentation or
3232
# if some version control system is used.
3333

34-
PROJECT_NUMBER = 1.3.11
34+
PROJECT_NUMBER = 1.3.29
3535

3636
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
3737
# base path where the generated documentation will be put.

datalib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
general Sql dAtabase FrontEnd
33
http://hyperprog.com/gsafe/
44
5-
(C) 2005-2020 Peter Deak (hyper80@gmail.com)
5+
(C) 2005-2021 Peter Deak (hyper80@gmail.com)
66
77
License: LGPLv2.1
88

datalib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
general Sql dAtabase FrontEnd
33
http://hyperprog.com/gsafe/
44
5-
(C) 2005-2020 Peter Deak (hyper80@gmail.com)
5+
(C) 2005-2021 Peter Deak (hyper80@gmail.com)
66
77
License: LGPLv2.1
88
@@ -36,7 +36,7 @@
3636
#include "gstexts.h"
3737

3838
/** The version of gsafe */
39-
#define GSAFE_VERSION "1.3.28"
39+
#define GSAFE_VERSION "1.3.29"
4040

4141
// ///////////////////////////////////
4242
// BEGIN - CONFIG/MODIFIERS/MODULES //

dconsole.cpp

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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+
5971
void 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+
388415
int HDebugConsole::execCommand(QString query)
389416
{
390417
if(p->disabled)

dconsole.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
@@ -53,6 +53,11 @@ void sqldebug(QString s);
5353
* @see HDebugConsole*/
5454
void sdebug(QString s);
5555

56+
/** Puts a debug/info text as special text.
57+
* If there is no started HDebugConsole this function does nothing.
58+
* @see HDebugConsole*/
59+
void ssdebug(QString s,char type);
60+
5661
/** Starts/Popup the HDebugConsole.
5762
* If the console already run this function does nothing.
5863
* @see HDebugConsole */
@@ -93,6 +98,17 @@ void clear_dconsole_commands();
9398
#define DCONSOLE_TYPE_RESULT 3
9499
#define DCONSOLE_TYPE_CMD 4
95100
#define DCONSOLE_TYPE_QTDEBUG 5
101+
#define DCONSOLE_TYPE_TXTALT_A 6
102+
#define DCONSOLE_TYPE_TXTALT_B 7
103+
#define DCONSOLE_TYPE_TXTALT_C 8
104+
#define DCONSOLE_TYPE_TXTALT_D 9
105+
#define DCONSOLE_TYPE_TXTALT_E 10
106+
107+
#define DCONSOLE_TYPE_TXTALT_CYAN DCONSOLE_TYPE_TXTALT_A
108+
#define DCONSOLE_TYPE_TXTALT_CORAL DCONSOLE_TYPE_TXTALT_B
109+
#define DCONSOLE_TYPE_TXTALT_TEAL DCONSOLE_TYPE_TXTALT_C
110+
#define DCONSOLE_TYPE_TXTALT_PURPLE DCONSOLE_TYPE_TXTALT_D
111+
#define DCONSOLE_TYPE_TXTALT_RED DCONSOLE_TYPE_TXTALT_E
96112

97113
#ifndef COMPILED_WITH_QT4X
98114
void dconsoleMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
@@ -209,6 +225,8 @@ class HDebugConsole : public QWidget
209225
#endif // DCONSOLE_NO_SQL
210226
/** Write a normal text to the console */
211227
static void debug_txt(QString s);
228+
/** Write a special typed text to the console */
229+
static void debug_typedtxt(QString s,char type);
212230
/** Popups a warning text */
213231
static void popup(QString title,QString str);
214232
/** You can disable the command excution if this function called with FALSE.

dialib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
general Sql dAtabase FrontEnd
33
http://hyperprog.com/gsafe/
44
5-
(C) 2005-2020 Peter Deak (hyper80@gmail.com)
5+
(C) 2005-2021 Peter Deak (hyper80@gmail.com)
66
77
License: LGPLv2.1
88

dialib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
general Sql dAtabase FrontEnd
33
http://hyperprog.com/gsafe/
44
5-
(C) 2005-2020 Peter Deak (hyper80@gmail.com)
5+
(C) 2005-2021 Peter Deak (hyper80@gmail.com)
66
77
License: LGPLv2.1
88

docgen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
general Sql dAtabase FrontEnd
33
http://hyperprog.com/gsafe/
44
5-
(C) 2005-2020 Peter Deak (hyper80@gmail.com)
5+
(C) 2005-2021 Peter Deak (hyper80@gmail.com)
66
77
License: LGPLv2.1
88

docgen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
general Sql dAtabase FrontEnd
33
http://hyperprog.com/gsafe/
44
5-
(C) 2005-2020 Peter Deak (hyper80@gmail.com)
5+
(C) 2005-2021 Peter Deak (hyper80@gmail.com)
66
77
License: LGPLv2.1
88

0 commit comments

Comments
 (0)