mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 713922 - Don't allow empty password for master password. r=mfinkle
This commit is contained in:
parent
68c0d15133
commit
c25815880f
@ -58,6 +58,7 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
@ -187,7 +188,8 @@ public class GeckoPreferences
|
|||||||
|
|
||||||
String text1 = input1.getText().toString();
|
String text1 = input1.getText().toString();
|
||||||
String text2 = input2.getText().toString();
|
String text2 = input2.getText().toString();
|
||||||
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(text1.equals(text2));
|
boolean disabled = TextUtils.isEmpty(text1) || TextUtils.isEmpty(text2) || !text1.equals(text2);
|
||||||
|
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(!disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||||
@ -230,8 +232,8 @@ public class GeckoPreferences
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog = builder.create();
|
dialog = builder.create();
|
||||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
public void onDismiss(DialogInterface dialog) {
|
public void onShow(DialogInterface dialog) {
|
||||||
input1.setText("");
|
input1.setText("");
|
||||||
input2.setText("");
|
input2.setText("");
|
||||||
input1.requestFocus();
|
input1.requestFocus();
|
||||||
|
Loading…
Reference in New Issue
Block a user