summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/se/leap/leapclient/Dashboard.java78
1 files changed, 18 insertions, 60 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index 02bc704c..3f32bde3 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -36,69 +36,27 @@ public class Dashboard extends Activity {
preferences = getPreferences(MODE_PRIVATE);
- // FIXME We need to StartActivityForResult and move the rest to buildDashboard (called in "else" and onActivityResult)
- if ( !preferences.contains("provider") ) {
+ // Check if we have preferences, run configuration wizard if not
+ // TODO We should do a better check for config that this!
+ if (!preferences.contains("provider") )
startActivity(new Intent(this, ProviderListActivity.class));
- }
-
- // Get our provider
- provider = Provider.getInstance(preferences);
-
- // Set provider name in textview
- providerNameTV = (TextView) findViewById(R.id.providerName);
- providerNameTV.setText(provider.getName());
- providerNameTV.setTextSize(28); // TODO maybe to some calculating, or a marquee?
-
- // TODO Inflate layout fragments for provider's services
- if ( provider.hasEIP() )
- serviceItemEIP();
+ else
+ buildDashboard();
}
- // FIXME!! We don't want you around here once we have something /real/ going on
- private void fixmePrefsFaker(SharedPreferences fakeit) {
- SharedPreferences.Editor fakes = fakeit.edit();
-
- AssetManager am = getAssets();
- BufferedReader prov = null;
- try {
- prov = new BufferedReader(new InputStreamReader(am.open("providers/bitmask.net_provider.json")));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- BufferedReader serv = null;
- try {
- serv = new BufferedReader(new InputStreamReader(am.open("providers/bitmask.net_eip-service.json")));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- StringBuilder provider = new StringBuilder();
- StringBuilder eip = new StringBuilder();
-
- String line;
- try {
- while ((line = prov.readLine()) != null){
- provider.append(line);
- }
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- String providerjson = provider.toString();
- try {
- while ((line = serv.readLine()) != null){
- eip.append(line);
- }
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- String eipjson = eip.toString();
-
- fakes.putString("provider", providerjson);
- fakes.putString("eip", eipjson);
- fakes.commit();
+
+ private void buildDashboard() {
+ // Get our provider
+ provider = Provider.getInstance(preferences);
+
+ // Set provider name in textview
+ providerNameTV = (TextView) findViewById(R.id.providerName);
+ providerNameTV.setText(provider.getName());
+ providerNameTV.setTextSize(28); // TODO maybe to some calculating, or a marquee?
+
+ // TODO Inflate layout fragments for provider's services
+ if ( provider.hasEIP() )
+ serviceItemEIP();
}
private void serviceItemEIP() {