Skip to content

Commit

Permalink
Merge pull request #290 from OZI-Project:patch/input-dialog
Browse files Browse the repository at this point in the history
fix: only use multiline input_dialog for copyright header
  • Loading branch information
rjdbcm authored Oct 28, 2024
2 parents a08c8fb + df89a10 commit 3ab0728
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ozi_core/new/interactive/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def input_dialog(
validator: Validator | None = None,
password: FilterOrBool = False,
style: BaseStyle | None = None,
multiline: bool = False,
default: str = '',
) -> Application[str]:
"""
Expand All @@ -217,7 +218,7 @@ def ok_handler() -> None: # noqa: DC102
longest_line = len(max(lines, key=len)) if len(lines) > 0 else 40
textfield = TextArea(
text=default,
multiline=True,
multiline=multiline,
password=password,
completer=completer,
validator=validator,
Expand Down
2 changes: 1 addition & 1 deletion ozi_core/new/interactive/dialog.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def admonition_dialog(title: str = ..., text: str = ..., heading_label: str = ..
"""
...

def input_dialog(title: AnyFormattedText = ..., text: AnyFormattedText = ..., ok_text: str | None = ..., cancel_text: str | None = ..., completer: Completer | None = ..., validator: Validator | None = ..., password: FilterOrBool = ..., style: BaseStyle | None = ..., default: str = ...) -> Application[str]:
def input_dialog(title: AnyFormattedText = ..., text: AnyFormattedText = ..., ok_text: str | None = ..., cancel_text: str | None = ..., completer: Completer | None = ..., validator: Validator | None = ..., password: FilterOrBool = ..., style: BaseStyle | None = ..., multiline: bool = ..., default: str = ...) -> Application[str]:
"""
Display a text input box.
Return the given text, or None when cancelled.
Expand Down
1 change: 1 addition & 0 deletions ozi_core/new/interactive/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def options_menu( # pragma: no cover
cancel_text=TRANSLATION('btn-back'),
ok_text=TRANSLATION('btn-ok'),
default=_default[0],
multiline=True,
).run()
if result in _default:
project.copyright_head = result
Expand Down

0 comments on commit 3ab0728

Please sign in to comment.