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

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

Merge "Settings: add delete confirmation dialog for profiles"

parents 28aefdf3 2a2ea7d4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
    <string name="profile_unknown_nfc_tag">Unknown profile</string>
    <string name="profile_add_nfc_text">This NFC tag refers to an unknown profile. Attaching this NFC tag to an existing profile will allow for selecting the profile in the future.</string>
    <string name="profile_select">Select profile</string>
    <string name="profile_remove_dialog_message">Remove profile %1$s?</string>

    <!-- Add Profile -->
    <string name="add_profile_dialog_title">Create new profile</string>
+16 −2
Original line number Diff line number Diff line
@@ -194,8 +194,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case MENU_REMOVE:
                mProfileManager.removeProfile(mProfile);
                finishFragment();
                requestRemoveProfileDialog();
                return true;

            case MENU_TRIGGERS:
@@ -257,6 +256,21 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
                : R.string.profile_setup_actions_title_config);
    }

    private void requestRemoveProfileDialog() {
        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() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                mProfileManager.removeProfile(mProfile);
                finishFragment();
            }
        });
        builder.setNegativeButton(R.string.no, null);
        builder.show();
    }

    private void requestLockscreenModeDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        final String[] lockEntries =