summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/se/leap/leapclient/Dashboard.java33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index 7bb71c1e..a7e84eef 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -36,21 +36,12 @@ 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
@@ -99,6 +90,20 @@ public class Dashboard extends Activity {
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() {
// FIXME Provider service (eip/openvpn)