Skip to content

Commit

Permalink
add server form prepopulate control with currently selected server
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Jun 14, 2024
1 parent 9bd9e61 commit 4be6c03
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Server Add form prepopulate details of currently selected server
* Export as Excel
* Fixing timezone bug
* Adding server and query details into a separate tab
Expand Down
4 changes: 0 additions & 4 deletions src/studio/kdb/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import studio.core.AuthenticationManager;
import studio.core.Credentials;
import studio.core.DefaultAuthenticationMechanism;
import studio.kdb.config.AbstractConfig;
Expand Down Expand Up @@ -721,9 +720,6 @@ private void addServerInternal(Server server) {
if (name.contains("/")) {
throw new IllegalArgumentException("Server name can't contains /");
}
if (AuthenticationManager.getInstance().lookup(server.getAuthenticationMechanism()) == null) {
throw new IllegalArgumentException("Unknown Authentication Mechanism: " + server.getAuthenticationMechanism());
}

server.getFolderPath()
.stream()
Expand Down
4 changes: 2 additions & 2 deletions src/studio/ui/AddServerForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.awt.*;

public class AddServerForm extends ServerForm {
public AddServerForm(Window owner) {
super(owner, "Add a new server", Server.newServer());
public AddServerForm(Window owner, Server server) {
super(owner, "Add a new server", server);
}
}
2 changes: 1 addition & 1 deletion src/studio/ui/StudioWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ private void initActions() {

addServerAction = UserAction.create(I18n.getString("Add"), Util.ADD_SERVER_ICON, "Configure a new server",
KeyEvent.VK_A, null, e -> {
AddServerForm f = new AddServerForm(this);
AddServerForm f = new AddServerForm(this, editor.getServer());
f.alignAndShow();
if (f.getResult() == ACCEPTED) {
Server s = f.getServer();
Expand Down

0 comments on commit 4be6c03

Please sign in to comment.