feat(cli): prompt scenes from gui

This commit is contained in:
Jérome Eertmans
2022-12-09 11:08:26 +01:00
parent 777ff444a3
commit 152050612e

View File

@ -11,7 +11,7 @@ import numpy as np
from pydantic import ValidationError
from PySide6.QtCore import Qt, QThread, Signal, Slot
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 .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.
"""
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:
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."
)
app = QApplication(sys.argv)
app.setApplicationName("Manim Slides")
a = App(
presentations,
config=config,