Skip to content
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

AbstractAppContainer: Remove curated warning dialog #1841

Merged
merged 5 commits into from
May 9, 2022
Merged
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
5 changes: 0 additions & 5 deletions data/io.elementary.appcenter.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<summary>List of package names of drivers that may be required</summary>
<description>Speeds up loading of updates view by remembering which drivers may be required</description>
</key>
<key type="b" name="non-curated-warning">
<default>true</default>
<summary>Display warning for non-curated apps</summary>
<description>Whether to display a warning dialog when attempting to install apps are not from a curated source</description>
</key>
<key type="x" name="last-refresh-time">
<default>0</default>
<summary>Unix UTC time of last cache refresh</summary>
Expand Down
1 change: 0 additions & 1 deletion po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ src/Core/Task.vala
src/Core/UbuntuDriversBackend.vala
src/Core/UpdateManager.vala
src/Dialogs/InstallFailDialog.vala
src/Dialogs/NonCuratedWarningDialog.vala
src/Dialogs/StripeDialog.vala
src/Dialogs/UninstallConfirmDialog.vala
src/Dialogs/UninstallFailDialog.vala
Expand Down
89 changes: 0 additions & 89 deletions src/Dialogs/NonCuratedWarningDialog.vala

This file was deleted.

52 changes: 2 additions & 50 deletions src/Widgets/AppContainers/AbstractAppContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ namespace AppCenter {
action_button_revealer.add (action_button);

action_button.download_requested.connect (() => {
if (install_approved ()) {
action_clicked.begin ();
}
action_clicked.begin ();
});

action_button.payment_requested.connect ((amount) => {
if (install_approved ()) {
show_stripe_dialog (amount);
}
show_stripe_dialog (amount);
});

uninstall_button = new Gtk.Button.with_label (_("Uninstall")) {
Expand Down Expand Up @@ -347,49 +343,5 @@ namespace AppCenter {
}
});
}

private bool install_approved () {
bool approved = true;
#if CURATED
var curated_dialog_allowed = App.settings.get_boolean ("non-curated-warning");
var app_installed = package.state != AppCenterCore.Package.State.NOT_INSTALLED;
var app_curated = package.is_native || package.is_os_updates;

// Only show the curated dialog if the user has left them enabled, the app isn't installed
// and it isn't a curated app
if (curated_dialog_allowed && !app_installed && !app_curated) {
approved = false;

var non_curated_warning = new Widgets.NonCuratedWarningDialog (package.get_name ());
non_curated_warning.transient_for = (Gtk.Window) get_toplevel ();

non_curated_warning.response.connect ((response_id) => {
switch (response_id) {
case Gtk.ResponseType.OK:
approved = true;
break;
case Gtk.ResponseType.CANCEL:
case Gtk.ResponseType.CLOSE:
case Gtk.ResponseType.DELETE_EVENT:
approved = false;
break;
default:
assert_not_reached ();
}

non_curated_warning.close ();
});

non_curated_warning.run ();
non_curated_warning.destroy ();

// If the install has been rejected at this stage, return early
if (!approved) {
return false;
}
}
#endif
return approved;
}
}
}
1 change: 0 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ appcenter_files = files(
'Core/UbuntuDriversBackend.vala',
'Core/UpdateManager.vala',
'Dialogs/InstallFailDialog.vala',
'Dialogs/NonCuratedWarningDialog.vala',
'Dialogs/StripeDialog.vala',
'Dialogs/UninstallConfirmDialog.vala',
'Dialogs/UninstallFailDialog.vala',
Expand Down