X-Git-Url: http://git.joshuawise.com/dumload.git/blobdiff_plain/bb6544e9a004d0ab6849bec9036d24d452b824bf..113e5e9f0483796238df53b9d6a55ad63ca15f4a:/src/com/joshuawise/dumload/Dumload.java?ds=sidebyside diff --git a/src/com/joshuawise/dumload/Dumload.java b/src/com/joshuawise/dumload/Dumload.java index f0919b7..c625b3a 100644 --- a/src/com/joshuawise/dumload/Dumload.java +++ b/src/com/joshuawise/dumload/Dumload.java @@ -1,21 +1,37 @@ -package com.joshuawise.dumload; +/* Dumload.java + * Main front-end glue for Dumload. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 3, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ -import java.io.InputStream; +package com.joshuawise.dumload; import android.app.Activity; -import android.app.Service; import android.content.Intent; +import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; -import android.os.IBinder; +import android.preference.PreferenceManager; +import android.util.Log; +import android.view.View; +import android.widget.Button; import android.widget.TextView; import android.widget.Toast; -import android.widget.TextView; -import android.widget.Button; -import android.view.View; -import android.util.Log; public class Dumload extends Activity { + + private SharedPreferences prefs; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { @@ -33,12 +49,16 @@ public class Dumload extends Activity { super.onStart(); final Dumload thisact = this; + prefs = PreferenceManager.getDefaultSharedPreferences(this); + Intent i = getIntent(); /* i *am* not an intent! */ if (!i.getAction().equals(Intent.ACTION_SEND)) { - say("Unknown intent for dumload"); - this.finish(); +// say("Unknown intent for dumload"); +// this.finish(); + Intent pi = new Intent(this, Preferences.class); + startActivity(pi); return; } @@ -68,7 +88,7 @@ public class Dumload extends Activity { ((TextView) findViewById(R.id.suckit)).setText("Where to?"); - ((TextView) findViewById(R.id.entry)).setText("/var/www/" + uribase.substring(uribase.lastIndexOf("/") + 1) + ".jpg"); + ((TextView) findViewById(R.id.entry)).setText(prefs.getString("defaultUploadPath", "/var/www/") + uribase.substring(uribase.lastIndexOf("/") + 1) + ".jpg"); } } \ No newline at end of file