Skip to content

Commit 1e805ef

Browse files
authored
Merge pull request #4 from INSIGNEO/fix/Log_window_freeze
Fix for crash issue that results in freezing of the GUI when the log exceeds 1000 lines
2 parents 99ba630 + 3fdce33 commit 1e805ef

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ If it fixes a bug or resolves a feature request, be sure to link to that issue.
55

66
## Types of changes
77

8-
What types of changes does your code introduce to Appium?
8+
What types of changes does your code introduce to PyPeCT2S?
99
_Put an `x` in the boxes that apply_
1010

1111
- [ ] Bugfix (non-breaking change which fixes an issue)

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ keywords:
3030
- bone
3131
- python
3232
license: GPL-3.0-or-later
33-
version: 1.0.2
34-
date-released: '2024-08-19'
33+
version: 1.0.3
34+
date-released: '2024-08-20'

core_libs/texteditredirector.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def update_text_edit(self):
6565
# Remove lines at the beginning if we have too many lines
6666
while self.log_text_edit.document().blockCount() > self.max_lines:
6767
cursor.movePosition(QTextCursor.MoveOperation.Start) # Move the cursor to the start of the text edit
68-
cursor.select(QTextCursor.SelectionType.LineUnderCursor) # Select the line under the cursor
68+
cursor.select(QTextCursor.SelectionType.BlockUnderCursor) # Select the line under the cursor
6969
cursor.removeSelectedText() # Remove the selected text
70+
cursor.deleteChar() # Ensure the block is completely removed
7071

72+
cursor.movePosition(QTextCursor.MoveOperation.End)
7173
self.log_text_edit.setTextCursor(cursor) # Set the text
7274
self.log_text_edit.ensureCursorVisible() # Ensure the cursor is visible
7375

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog:
22

3+
## 1.0.3
4+
5+
- Fixed issue with log window; where if the window exceeded 1000 lines it would freeze the program until it was
6+
restarted. Now it will remove lines from the top of the log window if it exceeds 1000 lines.
7+
38
## 1.0.2
49

510
- Fixed issue in meshing script where it would look for a temporary file that it did not need to unless certain

0 commit comments

Comments
 (0)