aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/org
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-01-18 20:40:41 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-01-18 20:40:41 +0100
commitb4b2a12a45d55af4c8340a221e80d17a644d2b40 (patch)
treeeb517e09eb9aa12de28cbdf69c0831aaa7a6759c /OpenPGP-Keychain/src/org
parentb6240f8927ea96ec69f4e88a4fb498535922e514 (diff)
downloadopen-keychain-b4b2a12a45d55af4c8340a221e80d17a644d2b40.tar.gz
open-keychain-b4b2a12a45d55af4c8340a221e80d17a644d2b40.tar.bz2
open-keychain-b4b2a12a45d55af4c8340a221e80d17a644d2b40.zip
prettify upload key
Diffstat (limited to 'OpenPGP-Keychain/src/org')
-rw-r--r--OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java53
1 files changed, 17 insertions, 36 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
index 2bf19ab92..9dca1094f 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Dominik Schürmann <dominik@dominikschuermann.de>
+ * Copyright (C) 2012-2014 Dominik Schürmann <dominik@dominikschuermann.de>
* Copyright (C) 2011 Senecaso
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,13 +18,10 @@
package org.sufficientlysecure.keychain.ui;
import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
-import org.sufficientlysecure.keychain.R;
-
-import com.actionbarsherlock.app.SherlockFragmentActivity;
-import com.actionbarsherlock.view.MenuItem;
import android.app.ProgressDialog;
import android.content.Intent;
@@ -34,10 +31,12 @@ import android.os.Messenger;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
-import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
+import com.actionbarsherlock.app.SherlockFragmentActivity;
+import com.beardedhen.androidbootstrap.BootstrapButton;
+
/**
* gpg --send-key activity
*
@@ -49,28 +48,10 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
public static final String ACTION_EXPORT_KEY_TO_SERVER = Constants.INTENT_PREFIX
+ "EXPORT_KEY_TO_SERVER";
- public static final String EXTRA_KEYRING_ROW_ID = "key_id";
-
- private Button export;
- private Spinner keyServer;
+ public static final String EXTRA_KEYRING_ROW_ID = "key_row_id";
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
-
- case android.R.id.home:
- // app icon in Action Bar clicked; go home
- Intent intent = new Intent(this, KeyListPublicActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- return true;
-
- default:
- break;
-
- }
- return false;
- }
+ private BootstrapButton mUploadButton;
+ private Spinner mKeyServerSpinner;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -78,21 +59,21 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
setContentView(R.layout.key_server_export);
- export = (Button) findViewById(R.id.btn_export_to_server);
- keyServer = (Spinner) findViewById(R.id.sign_key_keyserver);
+ mUploadButton = (BootstrapButton) findViewById(R.id.btn_export_to_server);
+ mKeyServerSpinner = (Spinner) findViewById(R.id.sign_key_keyserver);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, Preferences.getPreferences(this)
.getKeyServers());
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- keyServer.setAdapter(adapter);
+ mKeyServerSpinner.setAdapter(adapter);
if (adapter.getCount() > 0) {
- keyServer.setSelection(0);
+ mKeyServerSpinner.setSelection(0);
} else {
- export.setEnabled(false);
+ mUploadButton.setEnabled(false);
}
- export.setOnClickListener(new OnClickListener() {
+ mUploadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
uploadKey();
@@ -112,14 +93,14 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
int keyRingId = getIntent().getIntExtra(EXTRA_KEYRING_ROW_ID, -1);
data.putInt(KeychainIntentService.UPLOAD_KEY_KEYRING_ROW_ID, keyRingId);
- String server = (String) keyServer.getSelectedItem();
+ String server = (String) mKeyServerSpinner.getSelectedItem();
data.putString(KeychainIntentService.UPLOAD_KEY_SERVER, server);
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
// Message is received after uploading is done in ApgService
- KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, R.string.progress_exporting,
- ProgressDialog.STYLE_HORIZONTAL) {
+ KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this,
+ R.string.progress_exporting, ProgressDialog.STYLE_HORIZONTAL) {
public void handleMessage(Message message) {
// handle messages by standard ApgHandler first
super.handleMessage(message);