-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Merged
+49
−1
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fb15fab
Throw toast when app is installed
meisenzahl 3d5437a
Update src/Application.vala
meisenzahl b48d1bb
Launch package on click
meisenzahl 3dfd0ff
Merge branch 'master' into throw-toast-when-app-is-installed
meisenzahl f75fc53
Update src/Application.vala
meisenzahl 6b2e2d5
Merge branch 'master' into throw-toast-when-app-is-installed
meisenzahl 3bace92
Launch last installed package
meisenzahl 67cb1ff
Hide the toast on the app's own app info view
meisenzahl fd1e8d8
Refactor
meisenzahl 4de415c
Refactor to use signal
meisenzahl 4afca66
Merge branch 'master' into throw-toast-when-app-is-installed
meisenzahl 3eabf46
Update src/MainWindow.vala
meisenzahl 28b9dc3
Create overlay in construct
meisenzahl 58da95b
Add comment to explain when to show a toast
meisenzahl ad1b739
Merge branch 'master' into throw-toast-when-app-is-installed
meisenzahl ccc92cb
Merge branch 'master' into throw-toast-when-app-is-installed
meisenzahl 6a3766f
MainWindow: concise comment
cassidyjames File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 👍