Merge branch 'fixed_video_playback_on_rotations' into release-1.5.6
authormasensio <masensio@solidgear.es>
Tue, 27 May 2014 11:20:01 +0000 (13:20 +0200)
committermasensio <masensio@solidgear.es>
Tue, 27 May 2014 11:20:01 +0000 (13:20 +0200)
1  2 
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@@ -90,7 -90,6 +90,7 @@@ import com.owncloud.android.ui.preview.
  import com.owncloud.android.ui.preview.PreviewMediaFragment;
  import com.owncloud.android.ui.preview.PreviewVideoActivity;
  import com.owncloud.android.utils.DisplayUtils;
 +import com.owncloud.android.utils.ErrorMessageAdapter;
  import com.owncloud.android.utils.Log_OC;
  
  
@@@ -181,11 -180,6 +181,6 @@@ FileFragment.ContainerActivity, OnNavig
          mRightFragmentContainer = findViewById(R.id.right_fragment_container);
          if (savedInstanceState == null) {
              createMinFragments();
-         } else {
-             Log_OC.d(TAG, "Init the secondFragment again");
-             if (mDualPane) {
-                 initFragmentsWithFile();                
-             }
          }
  
          // Action bar setup
       */
      private void onRemoveFileOperationFinish(RemoveFileOperation operation, RemoteOperationResult result) {
          dismissLoadingDialog();
 +        
 +        Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), 
 +                Toast.LENGTH_LONG); 
 +        msg.show();
 +        
          if (result.isSuccess()) {
 -            Toast msg = Toast.makeText(this, R.string.remove_success_msg, Toast.LENGTH_LONG);
 -            msg.show();
              OCFile removedFile = operation.getFile();
              FileFragment second = getSecondFragment();
              if (second != null && removedFile.equals(second.getFile())) {
              }
              invalidateOptionsMenu();
          } else {
 -            Toast msg = Toast.makeText(this, R.string.remove_fail_msg, Toast.LENGTH_LONG); 
 -            msg.show();
              if (result.isSslRecoverableException()) {
                  mLastSslUntrustedServerResult = result;
                  showUntrustedCertDialog(mLastSslUntrustedServerResult);
              refreshListOfFilesFragment();
          } else {
              dismissLoadingDialog();
 -            if (result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME) {
 -                Toast.makeText(FileDisplayActivity.this, R.string.filename_forbidden_characters, Toast.LENGTH_LONG).show();
 -            } else {
              try {
 -                Toast msg = Toast.makeText(FileDisplayActivity.this, R.string.create_dir_fail_msg, Toast.LENGTH_LONG); 
 +                Toast msg = Toast.makeText(FileDisplayActivity.this, 
 +                        ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), 
 +                        Toast.LENGTH_LONG); 
                  msg.show();
  
              } catch (NotFoundException e) {
                  Log_OC.e(TAG, "Error while trying to show fail message " , e);
              }
 -            }
          }
      }
  
              }
  
          } else {
 -            if (result.getCode().equals(ResultCode.INVALID_LOCAL_FILE_NAME)) {
 -                Toast msg = Toast.makeText(this, R.string.rename_local_fail_msg, Toast.LENGTH_LONG); 
 -                msg.show();
 -                // TODO throw again the new rename dialog
 -            } if (result.getCode().equals(ResultCode.INVALID_CHARACTER_IN_NAME)) {
 -                Toast msg = Toast.makeText(this, R.string.filename_forbidden_characters, Toast.LENGTH_LONG); 
 -                msg.show();
 -            } else {
 -                Toast msg = Toast.makeText(this, R.string.rename_server_fail_msg, Toast.LENGTH_LONG); 
 -                msg.show();
 -                if (result.isSslRecoverableException()) {
 -                    mLastSslUntrustedServerResult = result;
 -                    showUntrustedCertDialog(mLastSslUntrustedServerResult);
 -                }
 +            Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), 
 +                    Toast.LENGTH_LONG); 
 +            msg.show();
 +            
 +            if (result.isSslRecoverableException()) {
 +                mLastSslUntrustedServerResult = result;
 +                showUntrustedCertDialog(mLastSslUntrustedServerResult);
              }
          }
      }
                  onTransferStateChanged(syncedFile, true, true);
                  
              } else {
 -                Toast msg = Toast.makeText(this, R.string.sync_file_nothing_to_do_msg, Toast.LENGTH_LONG); 
 +                Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), 
 +                        Toast.LENGTH_LONG); 
                  msg.show();
              }
          }