Skip to content

Commit

Permalink
Renaming "Filters" to "Highlighters" nickbnf#71
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurspa committed May 21, 2018
1 parent 8b54586 commit 9892967
Show file tree
Hide file tree
Showing 14 changed files with 450 additions and 449 deletions.
10 changes: 5 additions & 5 deletions doc/documentation.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ In addition to the filtered window, the match overview on the right hand side
of the screen offers a view of the position of matches in the log file. Matches
are showed as small red lines.

## Using filters
## Using highlighters

_Filters_ can colorize some lines of the log being displayed, for example to
_Highlighters_ can colorize some lines of the log being displayed, for example to
draw attention to lines indicating an error, or to associate a color with each
sort of event. Any number of filter can be defined in the 'Filters'
sort of event. Any number of highlighter can be defined in the 'highlighters'
configuration dialog, each using a regexp against which lines will be matched.
For each line, all filters are tried in order and the fore and back colors of
the first successful filter are applied.
For each line, all highlighters are tried in order and the fore and back colors of
the first successful highlighter are applied.

## Marking lines in the log file

Expand Down
17 changes: 9 additions & 8 deletions glogg.pro
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ SOURCES += \
src/optionsdialog.cpp \
src/persistentinfo.cpp \
src/configuration.cpp \
src/filtersdialog.cpp \
src/filterset.cpp \
src/savedsearches.cpp \
src/infoline.cpp \
src/menuactiontooltipbehavior.cpp \
Expand All @@ -55,6 +53,8 @@ SOURCES += \
src/viewtools.cpp \
src/encodingspeculator.cpp \
src/gloggapp.cpp \
src/highlightersdialog.cpp \
src/highlighterset.cpp

INCLUDEPATH += src/

Expand All @@ -78,8 +78,6 @@ HEADERS += \
src/optionsdialog.h \
src/persistentinfo.h \
src/configuration.h \
src/filtersdialog.h \
src/filterset.h \
src/savedsearches.h \
src/infoline.h \
src/filewatcher.h \
Expand All @@ -103,6 +101,8 @@ HEADERS += \
src/viewtools.h \
src/encodingspeculator.h \
src/gloggapp.h \
src/highlighterset.h \
src/highlightersdialog.h

isEmpty(BOOST_PATH) {
message(Building using system dynamic Boost libraries)
Expand All @@ -118,14 +118,15 @@ isEmpty(BOOST_PATH) {
else {
message(Building using static Boost libraries at $$BOOST_PATH)

SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
$$BOOST_PATH/libs/smart_ptr/src/*.cpp
SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp #\
#$$BOOST_PATH/libs/smart_ptr/src/*.cpp

INCLUDEPATH += $$BOOST_PATH
}

FORMS += src/optionsdialog.ui
FORMS += src/filtersdialog.ui
FORMS += src/optionsdialog.ui \
src/highlightersdialog.ui
FORMS +=

macx {
# Icon for Mac
Expand Down
8 changes: 4 additions & 4 deletions src/abstractlogview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "log.h"

#include "persistentinfo.h"
#include "filterset.h"
#include "highlighterset.h"
#include "logmainview.h"
#include "quickfind.h"
#include "quickfindpattern.h"
Expand Down Expand Up @@ -1435,8 +1435,8 @@ void AbstractLogView::drawTextArea( QPaintDevice* paint_device, int32_t )
const int paintDeviceHeight = paint_device->height() / viewport()->devicePixelRatio();
const int paintDeviceWidth = paint_device->width() / viewport()->devicePixelRatio();
const QPalette& palette = viewport()->palette();
std::shared_ptr<const FilterSet> filterSet =
Persistent<FilterSet>( "filterSet" );
std::shared_ptr<const HighlighterSet> highlighterSet =
Persistent<HighlighterSet>( "highlighterSet" );
QColor foreColor, backColor;

static const QBrush normalBulletBrush = QBrush( Qt::white );
Expand Down Expand Up @@ -1536,7 +1536,7 @@ void AbstractLogView::drawTextArea( QPaintDevice* paint_device, int32_t )
backColor = palette.color( QPalette::Highlight );
painter.setPen(palette.color(QPalette::Text));
}
else if ( filterSet->matchLine( logData->getLineString( line_index ),
else if ( highlighterSet->matchLine( logData->getLineString( line_index ),
&foreColor, &backColor ) ) {
// Apply a filter to the line
}
Expand Down
Loading

0 comments on commit 9892967

Please sign in to comment.