Merge branch 'master' of danga.com:camlistore

This commit is contained in:
Brad Fitzpatrick 2010-08-01 17:25:19 -07:00
commit 8c65f36662
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,7 @@ public class CamliActivity extends Activity {
private static final String TAG = "CamliActivity";
private static final int MENU_SETTINGS = 1;
private static final int MENU_STOP = 2;
private static final int MENU_UPLOAD_ALL = 3;
private IUploadService mServiceStub = null;
private IStatusCallback mCallback = null;
@ -181,6 +182,7 @@ public class CamliActivity extends Activity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(Menu.NONE, MENU_UPLOAD_ALL, 0, "Upload All");
menu.add(Menu.NONE, MENU_STOP, 0, "Stop");
menu.add(Menu.NONE, MENU_SETTINGS, 0, "Settings");
return true;
@ -201,6 +203,13 @@ public class CamliActivity extends Activity {
case MENU_SETTINGS:
SettingsActivity.show(this);
break;
case MENU_UPLOAD_ALL:
Intent uploadAll = new Intent(UploadService.INTENT_UPLOAD_ALL);
uploadAll.setClass(this, UploadService.class);
Log.d(TAG, "Starting upload all...");
startService(uploadAll);
Log.d(TAG, "Back from upload all...");
break;
}
return true;
}

View File

@ -36,6 +36,7 @@ public class UploadService extends Service {
public static final String INTENT_POWER_CONNECTED = "POWER_CONNECTED";
public static final String INTENT_POWER_DISCONNECTED = "POWER_DISCONNECTED";
public static final String INTENT_UPLOAD_ALL = "UPLOAD_ALL";
// Everything in this block guarded by 'this':
private boolean mUploading = false; // user's desired state (notified