From: jabarros Date: Thu, 30 Oct 2014 13:33:58 +0000 (+0100) Subject: Merge pull request #697 from owncloud/fix_https_access_via_proxy X-Git-Tag: oc-android-1.7.0_signed~124 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/0a394622102758bc666ba3189bfe9410ca72dd27?hp=c71b0de0512f90360005d5fbebb88e0b9886c478 Merge pull request #697 from owncloud/fix_https_access_via_proxy Update reference to library with bugfix --- diff --git a/res/menu/file_select_all.xml b/res/menu/file_select_all.xml new file mode 100644 index 00000000..a8097aae --- /dev/null +++ b/res/menu/file_select_all.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml index e3d598ec..78d39f1c 100644 --- a/res/values-eu/strings.xml +++ b/res/values-eu/strings.xml @@ -11,6 +11,11 @@ Ezarpenak Xehetasunak Bidali + Ordenatu + + A-Z + Berrienak - Zaharrenak + Orokorra @@ -238,6 +243,7 @@ Mesedez, baimendu berriz Irudi aurreikuspena Ezin da irudi hau erakutsi %1$s ezin da %2$s karpeta lokalera kopiatu + Igotzetarako Bidea Sentitzen dut, partekatzea ez dago zure zerbitzarian gaituta. Mesedez jarri harremanetan zure administratzailearekin. Errore bat egon da fitxategaia edo karpeta partekatzerakoan Errore bat egon da fitxategaia edo karpeta partekatzeari uzterakoan @@ -260,8 +266,12 @@ Mesedez, baimendu berriz Fitxategia jadanik ez dago eskuragarri zerbitzarian Kontuak Gehitu kontua + ownCloud Android programaren egunerokoak + Datuak kargatzen... Autentikazioa beharrezkoa Pasahitz okerra + Mugitu Aukeratu + Berehalako Igoerak Segurtasuna diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index 97dcfde8..0f7892ee 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -85,6 +85,7 @@ import com.owncloud.android.ui.dialog.IndeterminateProgressDialog; import com.owncloud.android.ui.dialog.SamlWebViewDialog; import com.owncloud.android.ui.dialog.SslUntrustedCertDialog; import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener; +import com.owncloud.android.utils.DisplayUtils; /** * This Activity is used to add an ownCloud account to the App @@ -356,7 +357,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { /// step 2 - set properties of UI elements (text, visibility, enabled...) mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput); - mHostUrlInput.setText(mServerInfo.mBaseUrl); + // Convert IDN to Unicode + mHostUrlInput.setText(DisplayUtils.convertIdn(mServerInfo.mBaseUrl, false)); if (mAction != ACTION_CREATE) { /// lock things that should not change mHostUrlInput.setEnabled(false); @@ -737,6 +739,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { showRefreshButton(false); if (uri.length() != 0) { + // Handle internationalized domain names + uri = DisplayUtils.convertIdn(uri, true); mServerStatusText = R.string.auth_testing_connection; mServerStatusIcon = R.drawable.progress_small; showServerStatus(); diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index d078b1e2..20330931 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -104,7 +104,7 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa if (obj != null && obj instanceof LongClickableCheckBoxPreference) { mShowContextMenu = true; - mAccountName = obj.toString(); + mAccountName = ((LongClickableCheckBoxPreference) obj).getKey(); Preferences.this.openContextMenu(listView); @@ -406,7 +406,8 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa for (Account a : accounts) { LongClickableCheckBoxPreference accountPreference = new LongClickableCheckBoxPreference(this); accountPreference.setKey(a.name); - accountPreference.setTitle(a.name); + // Handle internationalized domain names + accountPreference.setTitle(DisplayUtils.convertIdn(a.name, false)); mAccountsPrefCategory.addPreference(accountPreference); // Check the current account that is being used diff --git a/src/com/owncloud/android/ui/activity/UploadFilesActivity.java b/src/com/owncloud/android/ui/activity/UploadFilesActivity.java index 09185726..83e7bc07 100644 --- a/src/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/src/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -34,6 +34,9 @@ import android.widget.TextView; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar.OnNavigationListener; +import com.actionbarsherlock.internal.view.menu.ActionMenuItemView; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; import com.owncloud.android.R; import com.owncloud.android.lib.common.utils.Log_OC; @@ -73,6 +76,8 @@ public class UploadFilesActivity extends FileActivity implements private static final String WAIT_DIALOG_TAG = "WAIT"; private static final String QUERY_TO_MOVE_DIALOG_TAG = "QUERY_TO_MOVE"; + private boolean selectAllToggled = false; + private Menu menu; @Override public void onCreate(Bundle savedInstanceState) { @@ -119,6 +124,7 @@ public class UploadFilesActivity extends FileActivity implements actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(mDirectories, this); + // wait dialog if (mCurrentDialog != null) { mCurrentDialog.dismiss(); @@ -127,8 +133,15 @@ public class UploadFilesActivity extends FileActivity implements Log_OC.d(TAG, "onCreate() end"); } - - + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu items for use in the action bar + MenuInflater inflater = getSherlock().getMenuInflater(); + inflater.inflate(R.menu.file_select_all, menu); + this.menu = menu; + return true; + } + @Override public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; @@ -139,12 +152,33 @@ public class UploadFilesActivity extends FileActivity implements } break; } + case R.id.actionbar_select_all:{ + if(selectAllToggled){ + toggleOffSelectAll(); + }else{ + toggleOnSelectAll(item); + } + break; + } default: retval = super.onOptionsItemSelected(item); } return retval; } - + public void toggleOffSelectAll(MenuItem item){ + selectAllToggled = false; + item.setIcon(android.R.drawable.checkbox_off_background); + mFileListFragment.deselectAll(); + } + public void toggleOffSelectAll(){ + MenuItem item = menu.findItem(R.id.actionbar_select_all); + toggleOffSelectAll(item); + } + public void toggleOnSelectAll(MenuItem item){ + selectAllToggled = true; + item.setIcon(android.R.drawable.checkbox_on_background); + mFileListFragment.selectAll(); + } @Override public boolean onNavigationItemSelected(int itemPosition, long itemId) { @@ -175,6 +209,7 @@ public class UploadFilesActivity extends FileActivity implements ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(false); } + toggleOffSelectAll(); } @@ -242,10 +277,11 @@ public class UploadFilesActivity extends FileActivity implements * {@inheritDoc} */ @Override - public void onDirectoryClick(File directory) { + public void onDirectoryClick(File directory) { pushDirname(directory); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); + toggleOffSelectAll(); } diff --git a/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java b/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java index a9b6ad2c..62b41a3e 100644 --- a/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java @@ -18,6 +18,7 @@ package com.owncloud.android.ui.fragment; import java.io.File; +import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; @@ -97,13 +98,33 @@ public class LocalFileListFragment extends ExtendedListFragment { Log_OC.i(TAG, "onActivityCreated() stop"); } + public void selectAll(){ + int numberOfFiles = mAdapter.getCount(); + for(int i = 0; i < numberOfFiles; i++){ + File file = (File) mAdapter.getItem(i); + if (file != null) { + if (!file.isDirectory()) { + /// Click on a file + getListView().setItemChecked(i, true); + // notify the change to the container Activity + mContainerActivity.onFileClick(file); + } + } + } + } + + public void deselectAll(){ + mAdapter = new LocalFileListAdapter(mContainerActivity.getInitialDirectory(), getActivity()); + setListAdapter(mAdapter); + } /** * Checks the file clicked over. Browses inside if it is a directory. Notifies the container activity in any case. */ @Override public void onItemClick(AdapterView l, View v, int position, long id) { - File file = (File) mAdapter.getItem(position); + File file = (File) mAdapter.getItem(position); + if (file != null) { /// Click on a directory if (file.isDirectory()) { @@ -209,16 +230,18 @@ public class LocalFileListFragment extends ExtendedListFragment { * @return File paths to the files checked by the user. */ public String[] getCheckedFilePaths() { - String [] result = null; + ArrayList result = new ArrayList(); SparseBooleanArray positions = mList.getCheckedItemPositions(); if (positions.size() > 0) { - Log_OC.d(TAG, "Returning " + positions.size() + " selected files"); - result = new String[positions.size()]; - for (int i=0; i= Build.VERSION_CODES.GINGERBREAD) { + // Find host name after '//' or '@' + int hostStart = 0; + if (url.indexOf("//") != -1) { + hostStart = url.indexOf("//") + "//".length(); + } else if (url.indexOf("@") != -1) { + hostStart = url.indexOf("@") + "@".length(); + } + + int hostEnd = url.substring(hostStart).indexOf("/"); + // Handle URL which doesn't have a path (path is implicitly '/') + hostEnd = (hostEnd == -1 ? url.length() : hostStart + hostEnd); + + String host = url.substring(hostStart, hostEnd); + host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host)); + + return url.substring(0, hostStart) + host + url.substring(hostEnd); + } else { + return url; + } + } } diff --git a/tests/.classpath b/tests/.classpath index 9b141f6f..26d8fe48 100644 --- a/tests/.classpath +++ b/tests/.classpath @@ -1,10 +1,10 @@ - - + +