requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);\r
setSupportProgressBarIndeterminateVisibility(false);\r
\r
- Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(getApplicationContext()));\r
+// Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(getApplicationContext()));\r
\r
if(savedInstanceState != null) {\r
mDirs = savedInstanceState.getStringArray(KEY_DIR_ARRAY);\r
break;\r
}\r
case R.id.startSync: {\r
+ // This could be interesting\r
+ //ContentResolver.cancelSync(null, "org.owncloud"); // cancel the current synchronizations of any other ownCloud account\r
Bundle bundle = new Bundle();\r
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\r
ContentResolver.requestSync(\r
Log.d("FileDisplay", "sync of account " + account_name\r
+ " is in_progress: " + inProgress);\r
\r
- //if (account_name.equals(AccountUtils.getCurrentOwnCloudAccount(context).name)) { // TODO - probably this check should be added, but won't push it until really tests are done; no time now\r
+ if (account_name.equals(AccountUtils.getCurrentOwnCloudAccount(context).name)) { \r
\r
- /// try to refresh the view with every message received from the FileSyncAdapter; brute, but more user friendly when there are a lot of files in the server\r
- OCFile currentDir;\r
+ String synchFolderRemotePath = intent.getStringExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH); \r
+ \r
if (mCurrentDir == null)\r
- currentDir = mStorageManager.getFileByPath("/");\r
- else\r
- currentDir = mStorageManager.getFileByPath(mCurrentDir.getRemotePath());\r
- \r
- if (currentDir != null) {\r
- mCurrentDir = currentDir;\r
+ mCurrentDir = mStorageManager.getFileByPath("/");\r
+\r
+ if (synchFolderRemotePath != null && mCurrentDir != null && mCurrentDir.getRemotePath().equals(synchFolderRemotePath) ) {\r
FileListFragment fileListFragment = (FileListFragment) getSupportFragmentManager()\r
.findFragmentById(R.id.fileList);\r
+ mCurrentDir = getStorageManager().getFileByPath(synchFolderRemotePath);\r
if (fileListFragment != null) {\r
- if (!mCurrentDir.equals(fileListFragment.getCurrentFile())) {\r
- fileListFragment.listDirectory(mCurrentDir); // only set the directory in the fragment first time\r
- } else\r
- fileListFragment.listDirectory(); // enough to show new files in the current directory if they are added after \r
+ fileListFragment.listDirectory(mCurrentDir); \r
}\r
}\r
\r
setSupportProgressBarIndeterminateVisibility(inProgress);\r
- //}\r
+ \r
+ }\r
}\r
}\r
\r
\r
// If we are on a large device -> update fragment\r
if (mDualPane) {\r
- FileDetailFragment fileDetails = (FileDetailFragment) getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG);\r
- if (fileDetails == null) {\r
- // first selected file since the current directory was listed\r
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r
- transaction.replace(R.id.file_details_container, new FileDetailFragment(file, AccountUtils.getCurrentOwnCloudAccount(this)), FileDetailFragment.FTAG);\r
- transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);\r
- transaction.commit();\r
- } else {\r
- // another select file\r
- fileDetails.updateFileDetails(file, AccountUtils.getCurrentOwnCloudAccount(this));\r
- } \r
+ // buttons in the details view are problematic when trying to reuse an existing fragment; create always a new one solves some of them, BUT no all; downloads are 'dangerous'\r
+ FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r
+ transaction.replace(R.id.file_details_container, new FileDetailFragment(file, AccountUtils.getCurrentOwnCloudAccount(this)), FileDetailFragment.FTAG);\r
+ transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);\r
+ transaction.commit();\r
\r
} else { // small or medium screen device -> new Activity\r
Intent showDetailsIntent = new Intent(this, FileDetailActivity.class);\r