mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Make groups/blogs visible to all contacts by default.
This commit is contained in:
@@ -51,7 +51,7 @@ SelectContactsDialog.Listener {
|
|||||||
private final BriarServiceConnection serviceConnection =
|
private final BriarServiceConnection serviceConnection =
|
||||||
new BriarServiceConnection();
|
new BriarServiceConnection();
|
||||||
|
|
||||||
private boolean wasSubscribed = false;
|
private boolean subscribed = false;
|
||||||
private CheckBox subscribeCheckBox = null;
|
private CheckBox subscribeCheckBox = null;
|
||||||
private RadioGroup radioGroup = null;
|
private RadioGroup radioGroup = null;
|
||||||
private RadioButton visibleToAll = null, visibleToSome = null;
|
private RadioButton visibleToAll = null, visibleToSome = null;
|
||||||
@@ -78,7 +78,7 @@ SelectContactsDialog.Listener {
|
|||||||
byte[] publicKey = i.getByteArrayExtra("net.sf.briar.PUBLIC_KEY");
|
byte[] publicKey = i.getByteArrayExtra("net.sf.briar.PUBLIC_KEY");
|
||||||
if(publicKey == null) throw new IllegalStateException();
|
if(publicKey == null) throw new IllegalStateException();
|
||||||
group = new Group(id, name, publicKey);
|
group = new Group(id, name, publicKey);
|
||||||
wasSubscribed = i.getBooleanExtra("net.sf.briar.SUBSCRIBED", false);
|
subscribed = i.getBooleanExtra("net.sf.briar.SUBSCRIBED", false);
|
||||||
boolean all = i.getBooleanExtra("net.sf.briar.VISIBLE_TO_ALL", false);
|
boolean all = i.getBooleanExtra("net.sf.briar.VISIBLE_TO_ALL", false);
|
||||||
|
|
||||||
LinearLayout layout = new LinearLayout(this);
|
LinearLayout layout = new LinearLayout(this);
|
||||||
@@ -88,7 +88,7 @@ SelectContactsDialog.Listener {
|
|||||||
|
|
||||||
subscribeCheckBox = new CheckBox(this);
|
subscribeCheckBox = new CheckBox(this);
|
||||||
subscribeCheckBox.setText(R.string.subscribe_to_this_blog);
|
subscribeCheckBox.setText(R.string.subscribe_to_this_blog);
|
||||||
subscribeCheckBox.setChecked(wasSubscribed);
|
subscribeCheckBox.setChecked(subscribed);
|
||||||
subscribeCheckBox.setOnClickListener(this);
|
subscribeCheckBox.setOnClickListener(this);
|
||||||
layout.addView(subscribeCheckBox);
|
layout.addView(subscribeCheckBox);
|
||||||
|
|
||||||
@@ -98,18 +98,18 @@ SelectContactsDialog.Listener {
|
|||||||
visibleToAll = new RadioButton(this);
|
visibleToAll = new RadioButton(this);
|
||||||
visibleToAll.setId(1);
|
visibleToAll.setId(1);
|
||||||
visibleToAll.setText(R.string.blog_visible_to_all);
|
visibleToAll.setText(R.string.blog_visible_to_all);
|
||||||
visibleToAll.setEnabled(wasSubscribed);
|
visibleToAll.setEnabled(subscribed);
|
||||||
visibleToAll.setOnClickListener(this);
|
visibleToAll.setOnClickListener(this);
|
||||||
radioGroup.addView(visibleToAll);
|
radioGroup.addView(visibleToAll);
|
||||||
|
|
||||||
visibleToSome = new RadioButton(this);
|
visibleToSome = new RadioButton(this);
|
||||||
visibleToSome.setId(2);
|
visibleToSome.setId(2);
|
||||||
visibleToSome.setText(R.string.blog_visible_to_some);
|
visibleToSome.setText(R.string.blog_visible_to_some);
|
||||||
visibleToSome.setEnabled(wasSubscribed);
|
visibleToSome.setEnabled(subscribed);
|
||||||
visibleToSome.setOnClickListener(this);
|
visibleToSome.setOnClickListener(this);
|
||||||
radioGroup.addView(visibleToSome);
|
radioGroup.addView(visibleToSome);
|
||||||
|
|
||||||
if(all) radioGroup.check(1);
|
if(!subscribed || all) radioGroup.check(1);
|
||||||
else radioGroup.check(2);
|
else radioGroup.check(2);
|
||||||
layout.addView(radioGroup);
|
layout.addView(radioGroup);
|
||||||
|
|
||||||
@@ -154,8 +154,8 @@ SelectContactsDialog.Listener {
|
|||||||
doneButton.setVisibility(GONE);
|
doneButton.setVisibility(GONE);
|
||||||
progress.setVisibility(VISIBLE);
|
progress.setVisibility(VISIBLE);
|
||||||
// Update the blog in a background thread
|
// Update the blog in a background thread
|
||||||
if(subscribe || wasSubscribed)
|
if(subscribe || subscribed)
|
||||||
updateGroup(subscribe, wasSubscribed, all, visible);
|
updateGroup(subscribe, subscribed, all, visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ SelectContactsDialog.Listener {
|
|||||||
private final BriarServiceConnection serviceConnection =
|
private final BriarServiceConnection serviceConnection =
|
||||||
new BriarServiceConnection();
|
new BriarServiceConnection();
|
||||||
|
|
||||||
private boolean wasSubscribed = false;
|
private boolean subscribed = false;
|
||||||
private CheckBox subscribeCheckBox = null;
|
private CheckBox subscribeCheckBox = null;
|
||||||
private RadioGroup radioGroup = null;
|
private RadioGroup radioGroup = null;
|
||||||
private RadioButton visibleToAll = null, visibleToSome = null;
|
private RadioButton visibleToAll = null, visibleToSome = null;
|
||||||
@@ -76,7 +76,7 @@ SelectContactsDialog.Listener {
|
|||||||
if(name == null) throw new IllegalStateException();
|
if(name == null) throw new IllegalStateException();
|
||||||
setTitle(name);
|
setTitle(name);
|
||||||
group = new Group(id, name, null);
|
group = new Group(id, name, null);
|
||||||
wasSubscribed = i.getBooleanExtra("net.sf.briar.SUBSCRIBED", false);
|
subscribed = i.getBooleanExtra("net.sf.briar.SUBSCRIBED", false);
|
||||||
boolean all = i.getBooleanExtra("net.sf.briar.VISIBLE_TO_ALL", false);
|
boolean all = i.getBooleanExtra("net.sf.briar.VISIBLE_TO_ALL", false);
|
||||||
|
|
||||||
LinearLayout layout = new LinearLayout(this);
|
LinearLayout layout = new LinearLayout(this);
|
||||||
@@ -86,7 +86,7 @@ SelectContactsDialog.Listener {
|
|||||||
|
|
||||||
subscribeCheckBox = new CheckBox(this);
|
subscribeCheckBox = new CheckBox(this);
|
||||||
subscribeCheckBox.setText(R.string.subscribe_to_this_group);
|
subscribeCheckBox.setText(R.string.subscribe_to_this_group);
|
||||||
subscribeCheckBox.setChecked(wasSubscribed);
|
subscribeCheckBox.setChecked(subscribed);
|
||||||
subscribeCheckBox.setOnClickListener(this);
|
subscribeCheckBox.setOnClickListener(this);
|
||||||
layout.addView(subscribeCheckBox);
|
layout.addView(subscribeCheckBox);
|
||||||
|
|
||||||
@@ -96,18 +96,18 @@ SelectContactsDialog.Listener {
|
|||||||
visibleToAll = new RadioButton(this);
|
visibleToAll = new RadioButton(this);
|
||||||
visibleToAll.setId(1);
|
visibleToAll.setId(1);
|
||||||
visibleToAll.setText(R.string.group_visible_to_all);
|
visibleToAll.setText(R.string.group_visible_to_all);
|
||||||
visibleToAll.setEnabled(wasSubscribed);
|
visibleToAll.setEnabled(subscribed);
|
||||||
visibleToAll.setOnClickListener(this);
|
visibleToAll.setOnClickListener(this);
|
||||||
radioGroup.addView(visibleToAll);
|
radioGroup.addView(visibleToAll);
|
||||||
|
|
||||||
visibleToSome = new RadioButton(this);
|
visibleToSome = new RadioButton(this);
|
||||||
visibleToSome.setId(2);
|
visibleToSome.setId(2);
|
||||||
visibleToSome.setText(R.string.group_visible_to_some);
|
visibleToSome.setText(R.string.group_visible_to_some);
|
||||||
visibleToSome.setEnabled(wasSubscribed);
|
visibleToSome.setEnabled(subscribed);
|
||||||
visibleToSome.setOnClickListener(this);
|
visibleToSome.setOnClickListener(this);
|
||||||
radioGroup.addView(visibleToSome);
|
radioGroup.addView(visibleToSome);
|
||||||
|
|
||||||
if(all) radioGroup.check(1);
|
if(!subscribed || all) radioGroup.check(1);
|
||||||
else radioGroup.check(2);
|
else radioGroup.check(2);
|
||||||
layout.addView(radioGroup);
|
layout.addView(radioGroup);
|
||||||
|
|
||||||
@@ -152,8 +152,8 @@ SelectContactsDialog.Listener {
|
|||||||
doneButton.setVisibility(GONE);
|
doneButton.setVisibility(GONE);
|
||||||
progress.setVisibility(VISIBLE);
|
progress.setVisibility(VISIBLE);
|
||||||
// Update the blog in a background thread
|
// Update the blog in a background thread
|
||||||
if(subscribe || wasSubscribed)
|
if(subscribe || subscribed)
|
||||||
updateGroup(subscribe, wasSubscribed, all, visible);
|
updateGroup(subscribe, subscribed, all, visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user