1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-10 05:08:18 -05:00

ConversationActivity: Only show reconnect popup if automatic reconnect is disabled

This commit is contained in:
Sebastian Kaspari 2010-04-17 23:08:47 +02:00
parent 5dd6982314
commit 8766f785a0

View File

@ -386,28 +386,30 @@ public class ConversationActivity extends Activity implements ServiceConnection,
input.setEnabled(true); input.setEnabled(true);
} else { } else {
input.setEnabled(false); input.setEnabled(false);
AlertDialog.Builder builder = new AlertDialog.Builder(this); if (!binder.getService().getSettings().isReconnectEnabled()) {
builder.setMessage("You disconnected from " + server.getTitle() + ". Do you want to reconnect?") AlertDialog.Builder builder = new AlertDialog.Builder(this);
.setCancelable(false) builder.setMessage("You disconnected from " + server.getTitle() + ". Do you want to reconnect?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() { .setCancelable(false)
public void onClick(DialogInterface dialog, int id) { .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
binder.getService().getConnection(server.getId()).setAutojoinChannels( public void onClick(DialogInterface dialog, int id) {
server.getCurrentChannelNames() binder.getService().getConnection(server.getId()).setAutojoinChannels(
); server.getCurrentChannelNames()
server.clearConversations(); );
deckAdapter.clearConversations(); server.clearConversations();
deckAdapter.addItem(server.getConversation(ServerInfo.DEFAULT_NAME)); deckAdapter.clearConversations();
binder.connect(server); deckAdapter.addItem(server.getConversation(ServerInfo.DEFAULT_NAME));
} binder.connect(server);
}) }
.setNegativeButton("No", new DialogInterface.OnClickListener() { })
public void onClick(DialogInterface dialog, int id) { .setNegativeButton("No", new DialogInterface.OnClickListener() {
dialog.cancel(); public void onClick(DialogInterface dialog, int id) {
} dialog.cancel();
}); }
AlertDialog alert = builder.create(); });
alert.show(); AlertDialog alert = builder.create();
alert.show();
}
} }
} }