Skip to content

Commit

Permalink
Fix setting default output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Inzarcon committed Feb 29, 2024
1 parent bb03087 commit ad3cec2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main_window.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Module containing the main application window where all subcomponents are used.
"""
from pathlib import Path

import version
from common_utils import enable_widgets
from compose import ComposeRunner, ComposeSignalType, connect_compose_signal
Expand Down Expand Up @@ -249,7 +251,6 @@ def on_output_input_click(self):
"""
selection = QFileDialog.getExistingDirectory(caption="Open directory")
self.out_input.setText(selection)
self.status_label.setText("Ready for composing.")

def update_tileset_info(self):
self.tileset_info.read_tileset_info(
Expand All @@ -260,6 +261,17 @@ def update_tileset_info(self):
if valid:
self.tilesheet_selector.set_entries(self.tileset_info.tilesheets)
self.status_label.setText("Ready for composing.")
if (
not self.out_input.text()
or "default_compose_output" in self.out_input.text()
):
self.out_input.setText(
str(
Path(self.src_input.text())
.joinpath("default_compose_output")
.as_posix()
)
)
else:
self.tilesheet_selector.clear_entries()
if self.tileset_info.tileset:
Expand Down

0 comments on commit ad3cec2

Please sign in to comment.