some more buttons in the GUI and fixed the project list logic when the list was cleared.
This commit is contained in:
parent
eb35156313
commit
120dded24f
9 changed files with 63 additions and 17 deletions
|
|
@ -26,6 +26,7 @@ import com.coder.server.message.ProjectRspMsg;
|
|||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class CoderClient extends Application{
|
||||
|
|
@ -106,7 +107,7 @@ public class CoderClient extends Application{
|
|||
selectServerDialog.setServerPort(serverPort);
|
||||
}
|
||||
@Override
|
||||
public void cancel() {
|
||||
public void exit() {
|
||||
logger.info("terminating");
|
||||
System.exit(0);
|
||||
}
|
||||
|
|
@ -162,11 +163,16 @@ public class CoderClient extends Application{
|
|||
private void setupSessionListener(){
|
||||
session.addCoderMessageReceivedListener(new CoderMessageReceivedListener() {
|
||||
@Override
|
||||
public void projectListRspReceived(Map<String, ProjectListData> projectListRsp) {
|
||||
for(String projectName : projectListRsp.keySet()){
|
||||
ProjectListData projectData = projectListRsp.get(projectName);
|
||||
selectProjectDialog.addProjectToList(projectName, projectData);
|
||||
}
|
||||
public void projectListRspReceived(final Map<String, ProjectListData> projectListRsp) {
|
||||
Platform.runLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for(String projectName : projectListRsp.keySet()){
|
||||
ProjectListData projectData = projectListRsp.get(projectName);
|
||||
selectProjectDialog.addProjectToList(projectName, projectData);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void projectRspReceived(ProjectRspMsg projectRspMsg) {
|
||||
|
|
@ -243,6 +249,7 @@ public class CoderClient extends Application{
|
|||
|
||||
private void closeCurrentSession(){
|
||||
if(this.session != null){
|
||||
logger.info("disconnecting from server");
|
||||
session.close();
|
||||
session = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue