diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results')
2 files changed, 67 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java new file mode 100644 index 000000000..1dce8f89e --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de> + * Copyright (C) 2014 Vincent Breitmoser <v.breitmoser@mugenguild.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.sufficientlysecure.keychain.operations.results; + +import android.os.Parcel; + +public class DeleteResult extends OperationResult { + + final public int mOk, mFail; + + public DeleteResult(int result, OperationLog log, int ok, int fail) { + super(result, log); + mOk = ok; + mFail = fail; + } + + /** Construct from a parcel - trivial because we have no extra data. */ + public DeleteResult(Parcel source) { + super(source); + mOk = source.readInt(); + mFail = source.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + dest.writeInt(mOk); + dest.writeInt(mFail); + } + + public static Creator<DeleteResult> CREATOR = new Creator<DeleteResult>() { + public DeleteResult createFromParcel(final Parcel source) { + return new DeleteResult(source); + } + + public DeleteResult[] newArray(final int size) { + return new DeleteResult[size]; + } + }; + +} diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java index 45470ef20..dc47942fc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java @@ -593,7 +593,16 @@ public abstract class OperationResult implements Parcelable { MSG_GET_QUERY_TOO_SHORT(LogLevel.ERROR, R.string.msg_download_query_too_short), MSG_GET_TOO_MANY_RESPONSES(LogLevel.ERROR, R.string.msg_download_too_many_responses), MSG_GET_QUERY_TOO_SHORT_OR_TOO_MANY_RESPONSES(LogLevel.ERROR, R.string.msg_download_query_too_short_or_too_many_responses), - MSG_GET_QUERY_FAILED(LogLevel.ERROR, R.string.msg_download_query_failed) + MSG_GET_QUERY_FAILED(LogLevel.ERROR, R.string.msg_download_query_failed), + + MSG_DEL_ERROR_EMPTY (LogLevel.ERROR, R.string.msg_del_error_empty), + MSG_DEL_ERROR_MULTI_SECRET (LogLevel.DEBUG, R.string.msg_del_error_multi_secret), + MSG_DEL (LogLevel.START, R.plurals.msg_del), + MSG_DEL_KEY (LogLevel.DEBUG, R.string.msg_del_key), + MSG_DEL_KEY_FAIL (LogLevel.WARN, R.string.msg_del_key_fail), + MSG_DEL_CONSOLIDATE (LogLevel.DEBUG, R.string.msg_del_consolidate), + MSG_DEL_OK (LogLevel.OK, R.plurals.msg_del_ok), + MSG_DEL_FAIL (LogLevel.WARN, R.plurals.msg_del_fail), ; public final int mMsgId; |