mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-09-18 11:56:35 +08:00
feat(cli): prompt scenes from gui
This commit is contained in:
@ -11,7 +11,7 @@ import numpy as np
|
|||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
from PySide6.QtCore import Qt, QThread, Signal, Slot
|
from PySide6.QtCore import Qt, QThread, Signal, Slot
|
||||||
from PySide6.QtGui import QCloseEvent, QIcon, QImage, QKeyEvent, QPixmap, QResizeEvent
|
from PySide6.QtGui import QCloseEvent, QIcon, QImage, QKeyEvent, QPixmap, QResizeEvent
|
||||||
from PySide6.QtWidgets import QApplication, QGridLayout, QLabel, QWidget
|
from PySide6.QtWidgets import QApplication, QFileDialog, QGridLayout, QLabel, QWidget
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
from .commons import config_path_option, verbosity_option
|
from .commons import config_path_option, verbosity_option
|
||||||
@ -817,6 +817,22 @@ def present(
|
|||||||
Use `manim-slide list-scenes` to list all available scenes in a given folder.
|
Use `manim-slide list-scenes` to list all available scenes in a given folder.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
app.setApplicationName("Manim Slides")
|
||||||
|
dialog = QFileDialog()
|
||||||
|
dialog.setDirectory(FOLDER_PATH if os.path.exists(FOLDER_PATH) else "")
|
||||||
|
dialog.setFileMode(QFileDialog.ExistingFiles)
|
||||||
|
dialog.setNameFilters(["JSON (*.json)", "* (*.*)"])
|
||||||
|
if dialog.exec():
|
||||||
|
filenames = dialog.selectedFiles()
|
||||||
|
print(filenames)
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# - get files in selected order
|
||||||
|
# - kill dialog
|
||||||
|
# - add cli option (+ envvar) to prompt gui instead of cli
|
||||||
|
# - use scenes selected from gui
|
||||||
|
|
||||||
if skip_all:
|
if skip_all:
|
||||||
exit_after_last_slide = True
|
exit_after_last_slide = True
|
||||||
|
|
||||||
@ -841,8 +857,6 @@ def present(
|
|||||||
"Recording only support '.avi' extension. For other video formats, please convert the resulting '.avi' file afterwards."
|
"Recording only support '.avi' extension. For other video formats, please convert the resulting '.avi' file afterwards."
|
||||||
)
|
)
|
||||||
|
|
||||||
app = QApplication(sys.argv)
|
|
||||||
app.setApplicationName("Manim Slides")
|
|
||||||
a = App(
|
a = App(
|
||||||
presentations,
|
presentations,
|
||||||
config=config,
|
config=config,
|
||||||
|
Reference in New Issue
Block a user