Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion po/sugar.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ msgstr ""
msgid "Invite to %s"
msgstr ""

#: src/jarabe/view/launcher.py:158
#: src/jarabe/view/launcher.py:162
#, python-format
msgid "<b>%s</b> failed to start."
msgstr ""
Expand Down Expand Up @@ -2005,3 +2005,8 @@ msgstr ""
#: src/jarabe/view/viewsource.py:814
msgid "Please select a file in the left panel."
msgstr ""

#: ../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.

21 changes: 15 additions & 6 deletions src/jarabe/model/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,23 +723,32 @@ def notify_launch(self, activity_id, service_name):
GLib.source_remove(self._launch_timers[activity_id])
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?

activity_id)
self._launch_timers[activity_id] = timer

def notify_launch_failed(self, activity_id):
home_activity = self.get_activity_by_id(activity_id)

if home_activity:
logging.debug('Activity %s (%s) launch failed', activity_id,
home_activity.get_type())
home_activity.get_type())

is_python2 = hasattr(self, '_python2_activity_check') and activity_id in self._python2_activity_check

if is_python2:
home_activity.is_python2_activity = True

if hasattr(self, '_python2_activity_check'):
self._python2_activity_check.discard(activity_id)

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?

else:
# activity sent failure notification after closing launcher
self._remove_activity(home_activity)
else:
logging.error('Model for activity id %s does not exist.',
activity_id)
activity_id)

def _check_activity_launched(self, activity_id):
del self._launch_timers[activity_id]
Expand Down Expand Up @@ -769,4 +778,4 @@ def get_model():
global _model
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.

12 changes: 8 additions & 4 deletions src/jarabe/view/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,20 @@ def __launch_failed_cb(home_model, home_activity):
if launcher is None:
logging.error('Launcher for %s is missing', activity_id)
else:
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.

home_activity.get_activity_name()
else:
launcher.error_text.props.label = _('<b>%s</b> failed to start.') % \
home_activity.get_activity_name()

launcher.error_text.show()

launcher.cancel_button.connect('clicked',
__cancel_button_clicked_cb,
home_activity)
launcher.cancel_button.show()


def __cancel_button_clicked_cb(button, home_activity):
_destroy_launcher(home_activity)

Expand All @@ -183,4 +187,4 @@ def _destroy_launcher(home_activity):
return

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.