* Client - After reconnect still active game or deck editor of build step gets topmost panel again (because tablesPanel is loaded automatically now after connect to server).

This commit is contained in:
LevelX2 2014-07-30 17:30:02 +02:00
parent 8bf5f01c2e
commit 865665767b
2 changed files with 8 additions and 4 deletions

View file

@ -712,7 +712,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
connection.setShowAbilityPickerForced(showAbilityPickerForced);
logger.debug("connecting (auto): " + proxyType + " " + proxyServer + " " + proxyPort + " " + proxyUsername);
if (MageFrame.connect(connection)) {
showGames();
showGames(false);
return true;
} else {
showMessage("Unable to connect to server");
@ -888,7 +888,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}//GEN-LAST:event_btnDeckEditorActionPerformed
private void btnGamesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGamesActionPerformed
this.showGames();
this.showGames(true);
}//GEN-LAST:event_btnGamesActionPerformed
private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
@ -970,10 +970,14 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
this.tablesPane.hideTables();
}
public void showGames() {
public void showGames(boolean setActive) {
MagePane topPane = getTopMost(tablesPane);
this.tablesPane.setVisible(true);
this.tablesPane.showTables();
setActive(tablesPane);
if (!setActive && topPane != null) {
setActive(topPane);
}
}
public void hideGames() {

View file

@ -337,7 +337,7 @@ public class ConnectDialog extends MageDialog {
if (result) {
lblStatus.setText("");
connected();
MageFrame.getInstance().showGames();
MageFrame.getInstance().showGames(false);
} else {
lblStatus.setText("Could not connect");
}