Skip to content

Conversation

ahmadtariq1
Copy link

Issue: #991
Launcher animation running for 90 seconds minute before reporting "failed to start"
No meaningful error in the activity log.
A FileNotFoundError for sugar-activity in shell.log.

The requirements included:
Reduce the launcher animation timeout to 10 seconds.
Display custom message in launcher.
Ensure the activity log reflects the failure (handled in sugar-toolkit-gtk3).

Changes in This PR
Launcher Animation Timeout Reduction: Adjusted the launcher timeout from 90 seconds to 10.
Display of custom Error Message in Launcher due to Python2 activity.
Translation Support: Added the new error message to the translation catalog in sugar.pot. (Currently only in sugar.pot; additional language files pending.)

The following requirements are addressed in a separate PR in sugar-toolkit-gtk3:

Handling the FileNotFoundError exception in activityfactory.py.
Logging the error to the activity log when "sugar-activity" is detected in the exception.

Testing
Tested on Fedora 41 with Sugar 0.121.
Used the Calculate activity (version 44) to verify:
The launcher animation stops after 10 seconds.
The custom error message is displayed in the launcher when the activity fails due to a missing sugar-activity.

Notes
Please review the companion PR in the sugar-toolkit-gtk3 repo sugarlabs/sugar-toolkit-gtk3#487 .

Screenshot 2025-04-03 at 4 01 46 AM
Screenshot 2025-04-03 at 4 02 06 AM

@quozl, @chimosky, would really appreciate if you could review this.

Copy link
Member

@chimosky chimosky left a comment

Choose a reason for hiding this comment

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

Reviewed, not tested.

Please look at a diff of your changes before making them, some of the No new line at EOF could've been picked up that way.

If you use a tool like cat to view the file with No new line at EOF, you'll understand why you need to remove them.

#: ../src/jarabe/view/launcher.py:159
#, python-format
msgid "<b>%s</b> cannot start because it was made for an older version."
msgstr ""
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the No new line at EOF.

del self._launch_timers[activity_id]

timer = GLib.timeout_add_seconds(90, self._check_activity_launched,
timer = GLib.timeout_add_seconds(10, self._check_activity_launched,
Copy link
Member

Choose a reason for hiding this comment

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

The commit that introduced this is 6528ba5, did you check to confirm if the issue still exists after your change?


if self.get_launcher(activity_id) is not None:
self.emit('launch-failed', home_activity)
self.emit('launch-failed', home_activity)
Copy link
Member

@chimosky chimosky Apr 7, 2025

Choose a reason for hiding this comment

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

Why the extra spaces at the end?

if _model is None:
_model = ShellModel()
return _model
return _model
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the No new line at EOF.

launcher.error_text.props.label = _('<b>%s</b> failed to start.') % \
home_activity.get_activity_name()
if hasattr(home_activity, 'is_python2_activity') and home_activity.is_python2_activity:
launcher.error_text.props.label = _('<b>%s</b> cannot start because it was made for an older version.') % \
Copy link
Member

Choose a reason for hiding this comment

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

A better error message would be specifying that it was made for Python2 and that's old.


shell.get_model().unregister_launcher(activity_id)
launcher.destroy()
launcher.destroy()
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the No new line at EOF.

@ahmadtariq1
Copy link
Author

@chimosky I have my exams this week, I'll correct them by next week.

@quozl
Copy link
Contributor

quozl commented Apr 8, 2025

  • rewrite commit messages,
  • the transfer of information through an attribute of the class that may or may not exist is a bit odd; is that the best way to get the information?

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.

3 participants