Commit Graph

5 Commits (master)

Author SHA1 Message Date
Matt Gajownik c426622690 UI: Create Log Viewer window XML file, migrate code 2022-04-10 11:52:11 +10:00
Matt Gajownik 0e57a7beef UI: Fix performance issues with the Log Viewer
This commit includes two big changes, alongside other smaller tweaks.

1) Update the internal QTextDocument of the text component directly
2) Use QPlainTextEdit, which supports HTML & is designed for long text
3) Use QString's arg function for formatting strings

Fix 1 significantly improves realtime performance when adding lines
individually, to the point that the UI no longer freezes if the viewer
is open and the log is being spammed. It also improves initial launch
speed when there's a large amount of text already in the file.
Reference: https://stackoverflow.com/a/54501760/2763321

Fix 2 completely eliminates delay when opening the viewer, regardless
of how many lines are already in the log file. For a standard log
after OBS launch, this cuts opening time from about 2 seconds to half a
second. For anything longer than 1,000 lines, the UI no longer freezes,
and the viewer (& its contents) open within half a second.
Reference: https://stackoverflow.com/a/17466240/2763321
2022-02-26 15:03:35 -08:00
jp9000 c0f19b95d5 UI: Do not always have log viewer loaded
This object should not always be created on startup. Instead, only load
it specifically when the user wants to load it.

This fixes a freeze some users were experiencing due to the text widget.
Unfortunately, it is not yet known how that freeze occurred with the log
viewer, so for the time being do not load the log viewer object unless
explicitly created.
2020-09-15 20:29:40 -07:00
Matt Gajownik 3e5de93cf3 UI: Provide Open button in the Log Viewer 2020-08-15 15:20:38 +10:00
Clayton Groeneveld 040e445617 UI: Add log viewer window 2020-07-31 19:57:12 -07:00