Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent setting non-positive media duration #245

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tilia/ui/dialogs/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ def ask_for_color(

def ask_for_int(title: str, prompt: str, **kwargs) -> tuple[bool, int]:
number, accepted = QInputDialog().getInt(None, title, prompt, **kwargs)
return accepted, number
return bool(accepted) & True, number
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't get this one. Why do we need this?



def ask_for_string(title: str, prompt: str, **kwargs) -> tuple[bool, str]:
string, accepted = QInputDialog().getText(None, title, prompt, **kwargs)
return accepted, string
return bool(accepted) & True, string


def ask_for_float(title: str, prompt: str, **kwargs) -> tuple[bool, float]:
number, accepted = QInputDialog().getDouble(None, title, prompt, **kwargs)
return accepted, number
return bool(accepted) & True, number


def ask_yes_no_or_cancel(title: str, prompt: str) -> tuple[bool, bool]:
Expand Down