mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 11:33:25 +00:00
- Implemented ConvertConfirmScreen for confirming AVI to MKV conversions with audio and subtitle options. - Added DeleteConfirmScreen for confirming file deletions with detailed file information. - Enhanced MediaPanelView to include additional MediaInfo properties such as video, audio, and subtitle tracks. - Updated MediaPanelProperties to extract and display raw MediaInfo track data. - Introduced HelpScreen for user guidance on application features and navigation. - Created OpenScreen for directory path input with validation. - Developed RenameConfirmScreen for renaming files with user confirmation and editing capabilities. - Added SettingsScreen for configuring application settings, including cache TTL and HEVC encoding options. - Updated imports and module exports in views to accommodate new screens.
31 lines
991 B
Python
31 lines
991 B
Python
from textual.screen import Screen
|
|
from textual.widgets import Input, Button
|
|
from pathlib import Path
|
|
|
|
|
|
class OpenScreen(Screen):
|
|
def compose(self):
|
|
yield Input(placeholder="Enter directory path", value=".", id="dir_input")
|
|
yield Button("OK", id="ok")
|
|
|
|
def on_button_pressed(self, event):
|
|
if event.button.id == "ok":
|
|
self.submit_path()
|
|
|
|
def on_input_submitted(self, event):
|
|
self.submit_path()
|
|
|
|
def submit_path(self):
|
|
path_str = self.query_one("#dir_input", Input).value
|
|
path = Path(path_str)
|
|
if not path.exists():
|
|
# Show error
|
|
self.query_one("#dir_input", Input).value = f"Path does not exist: {path_str}"
|
|
return
|
|
if not path.is_dir():
|
|
self.query_one("#dir_input", Input).value = f"Not a directory: {path_str}"
|
|
return
|
|
self.app.scan_dir = path # type: ignore
|
|
self.app.scan_files() # type: ignore
|
|
self.app.pop_screen()
|