Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f882c60f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "System Profiles: Do not allow user to delete active profile"

parents 03094026 98f1dd77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
    <string name="profile_remove_dialog_message">Remove profile %1$s?</string>
    <string name="profile_populate_profile_from_state">Configure profile using current device settings?</string>
    <string name="profile_menu_fill_from_state">Import current device settings</string>
    <string name="profile_remove_current_profile">Cannot delete current profile!</string>

    <!-- Add Profile -->
    <string name="add_profile_dialog_title">Create new profile</string>
+14 −0
Original line number Diff line number Diff line
@@ -404,6 +404,20 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
    }

    private void requestRemoveProfileDialog() {
        Profile current = mProfileManager.getActiveProfile();
        if (mProfile.getUuid().equals(current.getUuid())) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setMessage(getString(R.string.profile_remove_current_profile));
            builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });
            builder.show();
            return;
        }

        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setMessage(getString(R.string.profile_remove_dialog_message, mProfile.getName()));
        builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {