Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-11-05 19:35:51 +01:00
commit a9b3a1c222
2 changed files with 12 additions and 3 deletions

View file

@ -219,14 +219,17 @@ public class DownloadIndexesThread {
} }
if (currentDownloadingItem == null) { if (currentDownloadingItem == null) {
execute(new DownloadIndexesAsyncTask()); execute(new DownloadIndexesAsyncTask());
} else {
downloadInProgress();
} }
} }
public void cancelDownload(IndexItem item) { public void cancelDownload(IndexItem item) {
if(currentDownloadingItem == item) { if(currentDownloadingItem == item) {
downloadFileHelper.setInterruptDownloading(true);; downloadFileHelper.setInterruptDownloading(true);
} else { } else {
indexItemDownloading.remove(item); indexItemDownloading.remove(item);
downloadInProgress();
} }
} }

View file

@ -169,13 +169,19 @@ public class MapDataMenuController extends MenuController {
rightTitleButtonController.visible = indexItem != null && indexItem.isDownloaded(); rightTitleButtonController.visible = indexItem != null && indexItem.isDownloaded();
boolean hasIndexes = downloadThread.getIndexes().isDownloadedFromInternet; boolean hasIndexes = downloadThread.getIndexes().isDownloadedFromInternet;
boolean isDownloading = indexItem != null && downloadThread.getCurrentDownloadingItem() == indexItem; boolean isDownloading = indexItem != null && downloadThread.isDownloading(indexItem);
if (!hasIndexes) { if (!hasIndexes) {
titleProgressController.setIndexesDownloadMode(); titleProgressController.setIndexesDownloadMode();
titleProgressController.visible = true; titleProgressController.visible = true;
} else if (isDownloading) { } else if (isDownloading) {
titleProgressController.setMapDownloadMode(); titleProgressController.setMapDownloadMode();
titleProgressController.progress = downloadThread.getCurrentDownloadingItemProgress(); if (downloadThread.getCurrentDownloadingItem() == indexItem) {
titleProgressController.indeterminate = false;
titleProgressController.progress = downloadThread.getCurrentDownloadingItemProgress();
} else {
titleProgressController.indeterminate = true;
titleProgressController.progress = 0;
}
double mb = indexItem.getArchiveSizeMB(); double mb = indexItem.getArchiveSizeMB();
String v ; String v ;
if (titleProgressController.progress != -1) { if (titleProgressController.progress != -1) {