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

Conversation

FelipeDefensor
Copy link
Collaborator

Min is necessary as non-positive values may lead to crashes and default is nice when the user (or the developer) just wants to create a timeline and does not care about the specific media duration.

I also generalized some ask_for_ functions to make this change easier.

Using `**kwargs` allows us to use any keyword argument in the future. Also, the name `initial` was a remnant from the tkinter era.
Min is necessary as non-positive values may lead to crashes and default is nice when the user (or the developer) just wants to create a timeline and does not care about the specific media duration.
@FelipeDefensor FelipeDefensor requested a review from azfoo December 17, 2024 17:00
@FelipeDefensor FelipeDefensor changed the base branch from main to dev December 17, 2024 17:00
@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants