|
@@ -2,7 +2,9 @@ package de.tudarmstadt.informatik.hostage.ui2.fragment;
|
|
|
|
|
|
import android.app.ActionBar;
|
|
|
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.database.Cursor;
|
|
@@ -95,6 +97,16 @@ public class ProfileEditFragment extends PreferenceFragment implements
|
|
|
profile.mGhostActive = prefs.getBoolean("pref_profile_protocols_ghost_active", profile.mGhostActive);
|
|
|
profile.mGhostPorts = prefs.getString("pref_profile_protocols_ghost_text", "");
|
|
|
|
|
|
+ if(profile.mLabel == null || profile.mLabel.isEmpty()){
|
|
|
+ new AlertDialog.Builder(getActivity()).setTitle(R.string.information).setMessage(R.string.profile_needs_name)
|
|
|
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }).setIcon(android.R.drawable.ic_dialog_info).show();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if(profile.mGhostPorts.isEmpty()){
|
|
|
profile.mGhostActive = false;
|
|
|
}
|