Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Throw toast when app is installed #1456
Throw toast when app is installed #1456
Changes from 4 commits
fb15fab
3d5437a
b48d1bb
3dfd0ff
f75fc53
6b2e2d5
3bace92
67cb1ff
fd1e8d8
4de415c
4afca66
3eabf46
28b9dc3
58da95b
ad1b739
ccc92cb
6a3766f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It would be better to handle sending the toast and saving the package reference inside MainWindow, instead of trying to expose
last_installed_package
in Application and then accessing it back in MainWindow.Simply declare a
private AppCenterCore.Package? last_installed_package
member and apublic void send_installed_toast (AppCenterCore.Package package)
method in MainWindow and manage sending the toast there instead.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.
I now also need
selected_package
inAppCenter.App
to check if aToast
should be sent.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.
I mean sure, but that didn't resolve my issue. The toast is still half managed in Application and MainWindow at the same time. And there's also no need to store
selected_package
globaly inside Application. Notice how MainWindow actually callsshow_package
andreturn_clicked
where this property could be set within MainWindow as well.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.
Thanks for your feedback. I have refactored that except for
selected_package
.The
show_package
call in MainWindow is not the same as in View.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.
I refactored it using a signal.
@donadigo thanks for being persistent 😃 The code looks much cleaner now 👍