Skip to content

Commit

Permalink
Improved dconsole text coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
hyper-prog committed Feb 24, 2021
1 parent f948792 commit edff130
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 29 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.3.29
-Improved dconsole text coloring

1.3.28
-Moved gsafe pixmaps to resources

Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion datalib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
4 changes: 2 additions & 2 deletions datalib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down Expand Up @@ -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 //
Expand Down
37 changes: 32 additions & 5 deletions dconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2006-2020 Peter Deak ([email protected])
(C) 2006-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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));
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 19 additions & 1 deletion dconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2006-2020 Peter Deak ([email protected])
(C) 2006-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dialib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion dialib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion docgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion docgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion gstexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
gSAFE - LIB
general Sql dAtabase FrontEnd
(C) 2010-2020 Peter Deak ([email protected])
(C) 2010-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion guilib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion guilib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion hfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion hfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion printlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion printlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2005-2020 Peter Deak ([email protected])
(C) 2005-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion res_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2010-2020 Peter Deak ([email protected])
(C) 2010-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.28
1.3.29
2 changes: 1 addition & 1 deletion xbio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
gSAFE - LIB
general Sql dAtabase FrontEnd
(C) 2011-2020 Peter Deak ([email protected])
(C) 2011-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion xbio.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
gSAFE - LIB
general Sql dAtabase FrontEnd
(C) 2011-2020 Peter Deak ([email protected])
(C) 2011-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion xbioconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
gSAFE - LIB
general Sql dAtabase FrontEnd
(C) 2011-2020 Peter Deak ([email protected])
(C) 2011-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion xbioconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
gSAFE - LIB
general Sql dAtabase FrontEnd
(C) 2011-2020 Peter Deak ([email protected])
(C) 2011-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion xmlolib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2011-2020 Peter Deak ([email protected])
(C) 2011-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down
2 changes: 1 addition & 1 deletion xmlolib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
general Sql dAtabase FrontEnd
http://hyperprog.com/gsafe/
(C) 2011-2020 Peter Deak ([email protected])
(C) 2011-2021 Peter Deak ([email protected])
License: LGPLv2.1
Expand Down

0 comments on commit edff130

Please sign in to comment.