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:
parent
7174eb356e
commit
6d8cbb6ff4
@ -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
|
||||
*
|
||||
|
@ -355,6 +355,11 @@ public class ServerActivity extends Activity implements ServiceConnection, Chann
|
||||
} else {
|
||||
onNothingSelected(deck);
|
||||
}
|
||||
|
||||
// Remember selection
|
||||
if (conversation != null) {
|
||||
server.setSelectedConversation(conversation.getName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user