Add View menu with a toggle to hide/show the ffmpeg log panel
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||
import main as app_main
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
OUT_DIR = ROOT / "test_media" / "seek_validation"
|
||||
|
||||
|
||||
def main():
|
||||
OUT_DIR.mkdir(exist_ok=True)
|
||||
qapp = QApplication(sys.argv)
|
||||
win = app_main.MainWindow()
|
||||
win.show()
|
||||
qapp.processEvents()
|
||||
|
||||
assert win.log_view.isVisible(), "log panel should be visible by default"
|
||||
assert win.toggle_log_action.isChecked()
|
||||
win.grab().save(str(OUT_DIR / "view_menu_log_visible.png"))
|
||||
|
||||
win.toggle_log_action.setChecked(False)
|
||||
qapp.processEvents()
|
||||
assert not win.log_view.isVisible(), "toggling the menu action should hide the log panel"
|
||||
win.grab().save(str(OUT_DIR / "view_menu_log_hidden.png"))
|
||||
|
||||
win.toggle_log_action.setChecked(True)
|
||||
qapp.processEvents()
|
||||
assert win.log_view.isVisible()
|
||||
|
||||
win.player.shutdown()
|
||||
print("PASS: View > Show ffmpeg Log toggles the log panel correctly")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user