-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logview highlighting #831
Add logview highlighting #831
Conversation
cuegui/cuegui/DarkPalette.py
Outdated
LOG_ERROR = QtGui.QColor(224, 52, 52) | ||
LOG_WARNING = QtGui.QColor(255, 201, 25) | ||
LOG_INFO = QtGui.QColor(111, 140, 255) | ||
LOG_COMPLETE = QtGui.QColor(132, 201, 12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: There should be a newline at the end of every code file. There should be an IDE setting you can use to do this automatically.
@@ -362,6 +362,9 @@ def __init__(self, parent=None): | |||
self._content_box.moveCursor(QtGui.QTextCursor.End) | |||
self._content_box.ensureCursorVisible() | |||
|
|||
self.highlighter = Highlighter(self._content_box.document()) | |||
print("highlight turned on") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop this print
, or turn it into a logger message if it's important.
@@ -600,7 +605,7 @@ def _move_to_match(self, pos, length): | |||
|
|||
def _move_to_search_box(self): | |||
""" | |||
Case-sensitive checkbox state has changed. Trigger a new search | |||
Case-sensetive checkbox state has changed. Trigger a new search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can revert this line -- "sensitive" is the correct spelling.
@@ -376,6 +379,8 @@ def __init__(self, parent=None): | |||
self._case_stv_checkbox.stateChanged.connect(self._move_to_search_box) | |||
|
|||
self._search_box = QtWidgets.QLineEdit('', self) | |||
self._search_box.setClearButtonEnabled(True) | |||
self._search_box.setPlaceholderText("Search log...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The string here can use single quotes.
line = text.lower() | ||
done = False | ||
|
||
for error in ['error','aborted','fatal', 'failed', 'killed', 'command not found']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should move this list, and the lists of things which are detected as warnings and progress lines, to Constants.py
instead of hardcoding them here. That should make it easier to customize.
Eventually we will need to figure out a better way to allow customization of these things, via config files or something like that, but I think having them as constants is good enough for now.
Show coloured output in the logview. Make it easier to users to catch important info. Closes AcademySoftwareFoundation#830
d159014
to
044312e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@larsbijl Ready to merge here, but looks like there's a merge conflict, probably from one of your other PRs. |
Thanks! |
Show coloured output in the logview. Make it easier for users
to catch important info.
Closes #830