-
Notifications
You must be signed in to change notification settings - Fork 277
Detects Python 2 Activities_ fixes #991 #998
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] | ||
|
|
@@ -769,4 +778,4 @@ def get_model(): | |
| global _model | ||
| if _model is None: | ||
| _model = ShellModel() | ||
| return _model | ||
| return _model | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the No new line at EOF. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.') % \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
||
|
|
@@ -183,4 +187,4 @@ def _destroy_launcher(home_activity): | |
| return | ||
|
|
||
| shell.get_model().unregister_launcher(activity_id) | ||
| launcher.destroy() | ||
| launcher.destroy() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the No new line at EOF. |
||
There was a problem hiding this comment.
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.