1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-29 12:22:21 -05:00

Remember selected conversation in server object

This commit is contained in:
Sebastian Kaspari 2010-03-10 22:56:44 +01:00
parent 7174eb356e
commit 6d8cbb6ff4
2 changed files with 27 additions and 0 deletions

View File

@ -40,6 +40,7 @@ public class Server
private HashMap<String, Conversation> conversations = new HashMap<String, Conversation>();
private int status = Status.DISCONNECTED;
private String selected = "";
/**
* Create a new server object
@ -47,6 +48,7 @@ public class Server
public Server()
{
conversations.put(ServerInfo.DEFAULT_NAME, new ServerInfo());
this.selected = ServerInfo.DEFAULT_NAME;
}
/**
@ -216,6 +218,26 @@ public class Server
conversations.clear();
}
/**
* Set name of currently selected conversation
*
* @param selected The name of the selected conversation
*/
public void setSelectedConversation(String selected)
{
this.selected = selected;
}
/**
* Get name of currently selected conversation
*
* @return The name of the selected conversation
*/
public String getSelectedConversation()
{
return selected;
}
/**
* Get icon for current server status
*

View File

@ -355,6 +355,11 @@ public class ServerActivity extends Activity implements ServiceConnection, Chann
} else {
onNothingSelected(deck);
}
// Remember selection
if (conversation != null) {
server.setSelectedConversation(conversation.getName());
}
}
/**