Merge branch 'idn_hosts' of https://github.com/ogasser/android into idn_hosts
authorjabarros <jabarros@solidgear.es>
Wed, 15 Oct 2014 10:20:49 +0000 (12:20 +0200)
committerjabarros <jabarros@solidgear.es>
Wed, 15 Oct 2014 10:20:49 +0000 (12:20 +0200)
Conflicts:
src/com/owncloud/android/authentication/AuthenticatorActivity.java

1  2 
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/ui/activity/Preferences.java

@@@ -71,7 -71,6 +71,7 @@@ import com.owncloud.android.lib.common.
  import com.owncloud.android.lib.common.operations.RemoteOperation;\r
  import com.owncloud.android.lib.common.operations.RemoteOperationResult;\r
  import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;\r
 +import com.owncloud.android.lib.common.utils.Log_OC;\r
  import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;\r
  import com.owncloud.android.lib.resources.status.OwnCloudVersion;\r
  import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;\r
@@@ -85,6 -84,8 +85,7 @@@ import com.owncloud.android.ui.dialog.I
  import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
  import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
  import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
 -import com.owncloud.android.utils.Log_OC;\r
+ import com.owncloud.android.utils.DisplayUtils;\r
  \r
  /**\r
   * This Activity is used to add an ownCloud account to the App\r
@@@ -351,7 -352,8 +352,8 @@@ SsoWebViewClientListener, OnSslUntruste
          \r
          /// step 2 - set properties of UI elements (text, visibility, enabled...)\r
          mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput);\r
-         mHostUrlInput.setText(mServerInfo.mBaseUrl);\r
+         // Convert IDN to Unicode\r
+         mHostUrlInput.setText(DisplayUtils.convertIdn(mServerInfo.mBaseUrl, false));\r
          if (mAction != ACTION_CREATE) {\r
              /// lock things that should not change\r
              mHostUrlInput.setEnabled(false);\r
          showRefreshButton(false);\r
          \r
          if (uri.length() != 0) {\r
+             // Handle internationalized domain names\r
+             uri = DisplayUtils.convertIdn(uri, true);\r
              mServerStatusText = R.string.auth_testing_connection;\r
              mServerStatusIcon = R.drawable.progress_small;\r
              showServerStatus();\r
@@@ -51,9 -51,9 +51,9 @@@ import com.owncloud.android.R
  import com.owncloud.android.authentication.AccountUtils;
  import com.owncloud.android.authentication.AuthenticatorActivity;
  import com.owncloud.android.db.DbHandler;
 +import com.owncloud.android.lib.common.utils.Log_OC;
  import com.owncloud.android.ui.LongClickableCheckBoxPreference;
  import com.owncloud.android.utils.DisplayUtils;
 -import com.owncloud.android.utils.Log_OC;
  
  
  /**
@@@ -68,6 -68,8 +68,6 @@@ public class Preferences extends Sherlo
  
      private DbHandler mDbHandler;
      private CheckBoxPreference pCode;
 -    //private CheckBoxPreference pLogging;
 -    //private Preference pLoggingHistory;
      private Preference pAboutApp;
  
      private PreferenceCategory mAccountsPrefCategory = null;
  
                  if (obj != null && obj instanceof LongClickableCheckBoxPreference) {
                      mShowContextMenu = true;
-                     mAccountName = obj.toString();
+                     mAccountName = ((LongClickableCheckBoxPreference) obj).getKey();
  
                      Preferences.this.openContextMenu(listView);
  
                     Log_OC.e(TAG, "Error while showing about dialog", e);
                 }
         }
 -       
 -       /* DISABLED FOR RELEASE UNTIL FIXED 
 -       pLogging = (CheckBoxPreference) findPreference("log_to_file");
 -       if (pLogging != null) {
 -           pLogging.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
 -               @Override
 -               public boolean onPreferenceChange(Preference preference, Object newValue) {
 -                   
 -                   String logpath = Environment.getExternalStorageDirectory()+File.separator+"owncloud"+File.separator+"log";
 -                
 -                   if(!pLogging.isChecked()) {
 -                       Log_OC.d("Debug", "start logging");
 -                       Log_OC.v("PATH", logpath);
 -                       Log_OC.startLogging(logpath);
 -                   }
 -                   else {
 -                       Log_OC.d("Debug", "stop logging");
 -                       Log_OC.stopLogging();
 -                   }
 -                   return true;
 -               }
 -           });
 -       }
 -       
 -       pLoggingHistory = (Preference) findPreference("log_history");
 -       if (pLoggingHistory != null) {
 -           pLoggingHistory.setOnPreferenceClickListener(new OnPreferenceClickListener() {
 -            
 -            @Override
 -            public boolean onPreferenceClick(Preference preference) {
 -                Intent intent = new Intent(getApplicationContext(),LogHistoryActivity.class);
 -                startActivity(intent);
 -                return true;
 -            }
 -        });
 -       }
 -       */
 -       
      }
  
      @Override
              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