Avoid UI clash between changed repos and empty update

This commit is contained in:
Ciaran Gultnieks 2012-09-12 16:55:43 +01:00
parent 64c8ed5507
commit 951bf603fd

View File

@ -128,19 +128,19 @@ public class FDroid extends TabActivity implements OnItemClickListener,
Intent call = new Intent(this, ManageRepo.class); Intent call = new Intent(this, ManageRepo.class);
call.putExtra("uri", i.getStringExtra("uri")); call.putExtra("uri", i.getStringExtra("uri"));
startActivityForResult(call, REQUEST_MANAGEREPOS); startActivityForResult(call, REQUEST_MANAGEREPOS);
} else if(i.hasExtra(EXTRA_TAB_UPDATE)) { } else if (i.hasExtra(EXTRA_TAB_UPDATE)) {
boolean updateTab = i.getBooleanExtra(EXTRA_TAB_UPDATE, false); boolean updateTab = i.getBooleanExtra(EXTRA_TAB_UPDATE, false);
if(updateTab) { if (updateTab) {
tabHost.setCurrentTab(2); tabHost.setCurrentTab(2);
} }
} }
triedEmptyUpdate = false;
} }
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
triedEmptyUpdate = false;
populateLists(true); populateLists(true);
} }
@ -231,6 +231,7 @@ public class FDroid extends TabActivity implements OnItemClickListener,
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
triedEmptyUpdate = true;
switch (requestCode) { switch (requestCode) {
case REQUEST_APPDETAILS: case REQUEST_APPDETAILS:
break; break;
@ -260,10 +261,8 @@ public class FDroid extends TabActivity implements OnItemClickListener,
break; break;
case REQUEST_PREFS: case REQUEST_PREFS:
// The automatic update settings may have changed, so reschedule (or // The automatic update settings may have changed, so reschedule (or
// unschedule) the // unschedule) the service accordingly. It's cheap, so no need to
// service accordingly. It's cheap, so no need to check if the // check if the particular setting has actually been changed.
// particular setting has
// actually been changed.
UpdateService.schedule(getBaseContext()); UpdateService.schedule(getBaseContext());
break; break;