aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThialfihar <thialfihar@gmail.com>2010-06-01 21:28:30 +0000
committerThialfihar <thialfihar@gmail.com>2010-06-01 21:28:30 +0000
commitca5416532f6ead3acce5f5240c57454b12f36079 (patch)
treebb3aa05aaa2bf91d62de0a29b534aee0bc2b7901
parent5547f61e4f40a8e9e755c51fadc3b5e4ec8a7590 (diff)
downloadopen-keychain-ca5416532f6ead3acce5f5240c57454b12f36079.tar.gz
open-keychain-ca5416532f6ead3acce5f5240c57454b12f36079.tar.bz2
open-keychain-ca5416532f6ead3acce5f5240c57454b12f36079.zip
support ASTRO and others for the file selection
-rw-r--r--res/values-de/strings.xml2
-rw-r--r--res/values-ko/strings.xml2
-rw-r--r--res/values-ru/strings.xml2
-rw-r--r--res/values-sl/strings.xml2
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/org/openintents/intents/FileManager.java78
-rw-r--r--src/org/thialfihar/android/apg/DecryptActivity.java11
-rw-r--r--src/org/thialfihar/android/apg/EncryptActivity.java10
-rw-r--r--src/org/thialfihar/android/apg/FileDialog.java13
9 files changed, 19 insertions, 103 deletions
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 839afa4e5..118bba8d1 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -145,7 +145,7 @@
<string name="usingClipboardContent">Using clipboard content.</string>
<string name="keySaved">Key saved.</string>
<string name="setAPassPhrase">Set a pass phrase via the option menu first.</string>
- <string name="oiFilemanagerNotInstalled">OI File Manager not installed.</string>
+ <string name="noFilemanagerInstalled">No file manager installed.</string>
<string name="passPhrasesDoNotMatch">The pass phrases didn't match.</string>
<string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string>
<string name="passPhraseForSymmetricEncryption">Pass phrase for symmetric encryption:</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 839afa4e5..118bba8d1 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -145,7 +145,7 @@
<string name="usingClipboardContent">Using clipboard content.</string>
<string name="keySaved">Key saved.</string>
<string name="setAPassPhrase">Set a pass phrase via the option menu first.</string>
- <string name="oiFilemanagerNotInstalled">OI File Manager not installed.</string>
+ <string name="noFilemanagerInstalled">No file manager installed.</string>
<string name="passPhrasesDoNotMatch">The pass phrases didn't match.</string>
<string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string>
<string name="passPhraseForSymmetricEncryption">Pass phrase for symmetric encryption:</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 839afa4e5..118bba8d1 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -145,7 +145,7 @@
<string name="usingClipboardContent">Using clipboard content.</string>
<string name="keySaved">Key saved.</string>
<string name="setAPassPhrase">Set a pass phrase via the option menu first.</string>
- <string name="oiFilemanagerNotInstalled">OI File Manager not installed.</string>
+ <string name="noFilemanagerInstalled">No file manager installed.</string>
<string name="passPhrasesDoNotMatch">The pass phrases didn't match.</string>
<string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string>
<string name="passPhraseForSymmetricEncryption">Pass phrase for symmetric encryption:</string>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index e48f87cea..193a8e893 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -145,7 +145,7 @@
<string name="usingClipboardContent">Uporabljam vsebino odložišča.</string>
<string name="keySaved">Ključ shranjen.</string>
<string name="setAPassPhrase">Najprej preko menija možnosti določite geslo.</string>
- <string name="oiFilemanagerNotInstalled">"OI File Manager" ni nameščen.</string>
+ <string name="noFilemanagerInstalled">No file manager installed.</string>
<string name="passPhrasesDoNotMatch">Gesli se ne ujemata.</string>
<string name="passPhraseMustNotBeEmpty">Prazna gesla niso dovoljena.</string>
<string name="passPhraseForSymmetricEncryption">Geslo za simetrično enkripcijo:</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ee1fc02e8..c1c696bf0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -145,7 +145,7 @@
<string name="usingClipboardContent">Using clipboard content.</string>
<string name="keySaved">Key saved.</string>
<string name="setAPassPhrase">Set a pass phrase via the option menu first.</string>
- <string name="oiFilemanagerNotInstalled">OI File Manager not installed.</string>
+ <string name="noFilemanagerInstalled">No file manager installed.</string>
<string name="passPhrasesDoNotMatch">The pass phrases didn't match.</string>
<string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string>
<string name="passPhraseForSymmetricEncryption">Pass phrase for symmetric encryption:</string>
diff --git a/src/org/openintents/intents/FileManager.java b/src/org/openintents/intents/FileManager.java
deleted file mode 100644
index 3a5cc0d86..000000000
--- a/src/org/openintents/intents/FileManager.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2008 OpenIntents.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openintents.intents;
-
-// Version Dec 9, 2008
-
-/**
- * Provides OpenIntents actions, extras, and categories used by providers.
- * <p>
- * These specifiers extend the standard Android specifiers.
- * </p>
- */
-public final class FileManager {
-
- /**
- * Activity Action: Pick a file through the file manager, or let user
- * specify a custom file name. Data is the current file name or file name
- * suggestion. Returns a new file name as file URI in data.
- *
- * <p>
- * Constant Value: "org.openintents.action.PICK_FILE"
- * </p>
- */
- public static final String ACTION_PICK_FILE = "org.openintents.action.PICK_FILE";
-
- /**
- * Activity Action: Pick a directory through the file manager, or let user
- * specify a custom file name. Data is the current directory name or
- * directory name suggestion. Returns a new directory name as file URI in
- * data.
- *
- * <p>
- * Constant Value: "org.openintents.action.PICK_DIRECTORY"
- * </p>
- */
- public static final String ACTION_PICK_DIRECTORY = "org.openintents.action.PICK_DIRECTORY";
-
- /**
- * The title to display.
- *
- * <p>
- * This is shown in the title bar of the file manager.
- * </p>
- *
- * <p>
- * Constant Value: "org.openintents.extra.TITLE"
- * </p>
- */
- public static final String EXTRA_TITLE = "org.openintents.extra.TITLE";
-
- /**
- * The text on the button to display.
- *
- * <p>
- * Depending on the use, it makes sense to set this to "Open" or "Save".
- * </p>
- *
- * <p>
- * Constant Value: "org.openintents.extra.BUTTON_TEXT"
- * </p>
- */
- public static final String EXTRA_BUTTON_TEXT = "org.openintents.extra.BUTTON_TEXT";
-
-}
diff --git a/src/org/thialfihar/android/apg/DecryptActivity.java b/src/org/thialfihar/android/apg/DecryptActivity.java
index ab5ec08af..66679884a 100644
--- a/src/org/thialfihar/android/apg/DecryptActivity.java
+++ b/src/org/thialfihar/android/apg/DecryptActivity.java
@@ -32,9 +32,7 @@ import java.util.regex.Matcher;
import org.bouncycastle2.jce.provider.BouncyCastleProvider;
import org.bouncycastle2.openpgp.PGPException;
import org.bouncycastle2.util.Strings;
-import org.openintents.intents.FileManager;
-import android.app.Activity;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
@@ -296,18 +294,17 @@ public class DecryptActivity extends BaseActivity {
private void openFile() {
String filename = mFilename.getText().toString();
- Intent intent = new Intent(FileManager.ACTION_PICK_FILE);
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setData(Uri.parse("file://" + filename));
-
- intent.putExtra(FileManager.EXTRA_TITLE, getString(R.string.filemanager_titleDecrypt));
- intent.putExtra(FileManager.EXTRA_BUTTON_TEXT, R.string.filemanager_btnOpen);
+ intent.setType("*/*");
try {
startActivityForResult(intent, Id.request.filename);
} catch (ActivityNotFoundException e) {
// No compatible file manager was found.
- Toast.makeText(this, R.string.oiFilemanagerNotInstalled, Toast.LENGTH_SHORT).show();
+ Toast.makeText(this, R.string.noFilemanagerInstalled, Toast.LENGTH_SHORT).show();
}
}
diff --git a/src/org/thialfihar/android/apg/EncryptActivity.java b/src/org/thialfihar/android/apg/EncryptActivity.java
index 39a321f03..aaed4f8cd 100644
--- a/src/org/thialfihar/android/apg/EncryptActivity.java
+++ b/src/org/thialfihar/android/apg/EncryptActivity.java
@@ -35,7 +35,6 @@ import org.bouncycastle2.openpgp.PGPPublicKeyRing;
import org.bouncycastle2.openpgp.PGPSecretKey;
import org.bouncycastle2.openpgp.PGPSecretKeyRing;
import org.bouncycastle2.util.Strings;
-import org.openintents.intents.FileManager;
import org.thialfihar.android.apg.Apg.GeneralException;
import org.thialfihar.android.apg.utils.Choice;
@@ -354,18 +353,17 @@ public class EncryptActivity extends BaseActivity {
private void openFile() {
String filename = mFilename.getText().toString();
- Intent intent = new Intent(FileManager.ACTION_PICK_FILE);
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setData(Uri.parse("file://" + filename));
-
- intent.putExtra(FileManager.EXTRA_TITLE, R.string.filemanager_titleEncrypt);
- intent.putExtra(FileManager.EXTRA_BUTTON_TEXT, R.string.filemanager_btnOpen);
+ intent.setType("*/*");
try {
startActivityForResult(intent, Id.request.filename);
} catch (ActivityNotFoundException e) {
// No compatible file manager was found.
- Toast.makeText(this, R.string.oiFilemanagerNotInstalled, Toast.LENGTH_SHORT).show();
+ Toast.makeText(this, R.string.noFilemanagerInstalled, Toast.LENGTH_SHORT).show();
}
}
diff --git a/src/org/thialfihar/android/apg/FileDialog.java b/src/org/thialfihar/android/apg/FileDialog.java
index 22d64fc84..b6bbbf3f1 100644
--- a/src/org/thialfihar/android/apg/FileDialog.java
+++ b/src/org/thialfihar/android/apg/FileDialog.java
@@ -16,8 +16,6 @@
package org.thialfihar.android.apg;
-import org.openintents.intents.FileManager;
-
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
@@ -48,6 +46,8 @@ public class FileDialog {
String defaultFile, OnClickListener onClickListener,
String fileManagerTitle, String fileManagerButton,
int requestCode) {
+ // TODO: fileManagerTitle and fileManagerButton are deprecated, no use for them right now,
+ // but maybe the Intent now used will someday support them again, so leaving them in
LayoutInflater inflater =
(LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
@@ -102,18 +102,17 @@ public class FileDialog {
private static void openFile() {
String filename = mFilename.getText().toString();
- Intent intent = new Intent(FileManager.ACTION_PICK_FILE);
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setData(Uri.parse("file://" + filename));
-
- intent.putExtra(FileManager.EXTRA_TITLE, mFileManagerTitle);
- intent.putExtra(FileManager.EXTRA_BUTTON_TEXT, mFileManagerButton);
+ intent.setType("*/*");
try {
mActivity.startActivityForResult(intent, mRequestCode);
} catch (ActivityNotFoundException e) {
// No compatible file manager was found.
- Toast.makeText(mActivity, R.string.oiFilemanagerNotInstalled, Toast.LENGTH_SHORT).show();
+ Toast.makeText(mActivity, R.string.noFilemanagerInstalled, Toast.LENGTH_SHORT).show();
}
}
}