Skip to content

Commit

Permalink
Added query for user before file upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Pitre committed Jul 8, 2010
1 parent ea69c2f commit 7e7c39b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .externalToolBuilders/NDK.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/home/ml/jpitre5/android/android-ndk-r4/ndk-build"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/home/ml/jpitre5/applications/android-ndk-r4/ndk-build"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-j4 V=1"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
Expand Down
25 changes: 24 additions & 1 deletion src/ca/mcgill/hs/HSAndroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import ca.mcgill.hs.serv.HSService;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
Expand Down Expand Up @@ -71,10 +74,30 @@ public void onClick(View v) {
}
});

//YES-NO DIALOG BOX FOR FILE UPLOAD
final Context c = this;
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which){
case DialogInterface.BUTTON_POSITIVE:
Toast.makeText(c, "Unimplemented feature!", Toast.LENGTH_SHORT).show();
break;

case DialogInterface.BUTTON_NEGATIVE:
break;
}
}
};

final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Upload data collected to online server?")
.setPositiveButton("Yes", dialogClickListener).setNegativeButton("No", dialogClickListener);

uploadButton = (Button) findViewById(R.id.uploadButton);
uploadButton.setOnClickListener( new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(uploadButton.getContext(), "UNIMPLEMENTED FEATURE!!! :(", Toast.LENGTH_SHORT).show();
builder.show();
}
});

Expand Down

0 comments on commit 7e7c39b

Please sign in to comment.