Skip to content

Commit

Permalink
[TOOLS-4471] Sub Info is not changed in 'Edit Host' or 'Edit Connecti…
Browse files Browse the repository at this point in the history
…on'. (#213)

http://jira.cubrid.org/browse/TOOLS-4471

- input 'unique name' in Edit Host or Edit connection
- when change host address in edit host, delete preference for database
  • Loading branch information
hwany7seo authored May 23, 2023
1 parent 8b1b91b commit 87765e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void doRun(CubridServer[] servers, boolean actionIsConnect) {
LOGGER.error("newServerInfo is null.");
continue;
}

if (!newServerInfo.getServerName().equals(server.getLabel())) {
QueryOptions.removePref(server.getServerInfo());
brokerManager.removeAllBrokerIntervalSettingInServer(server.getLabel());
Expand All @@ -227,6 +227,7 @@ public void doRun(CubridServer[] servers, boolean actionIsConnect) {

server.setId(newServerInfo.getServerName());
server.setLabel(newServerInfo.getServerName());
server.setUniqueName(newServerInfo.getServerName());
CMHostNodePersistManager.getInstance().addServer(
newServerInfo.getHostAddress(),
newServerInfo.getHostMonPort(),
Expand Down Expand Up @@ -302,8 +303,13 @@ public void doRun(CubridServer[] servers, boolean actionIsConnect) {
HostUtils.processHostDisconnected(server);
}

if (!serverInfo.getHostAddress().equals(server.getServerInfo().getHostAddress())) {
CMHostNodePersistManager.getInstance().removeServer(server);
}

server.setId(serverInfo.getServerName());
server.setLabel(serverInfo.getServerName());
server.setUniqueName(serverInfo.getServerName());
server.setServerInfo(serverInfo);
server.setAutoSavePassword(dialog.isSavePassword());
CMHostNodePersistManager.getInstance().addServer(serverInfo.getHostAddress(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private void doRun(CubridServer server) {
int ret = dlg.open();
if (ret == IDialogConstants.OK_ID) {
server.setLabel(dlg.getNewName());
server.setUniqueName(dlg.getNewName());
server.getServerInfo().setServerName(dlg.getNewName());
CubridNavigatorView navigatorView = CubridNavigatorView.getNavigatorView(CubridHostNavigatorView.ID);
TreeViewer treeViewer = navigatorView == null ? null : navigatorView.getViewer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ protected void buttonPressed(int buttonId) {
CommonUITool.openInformationBox(Messages.msgSaveAndClose);

server.setLabel(serverInfo.getServerName());
server.setUniqueName(serverInfo.getServerName());
/*Save operate at the action*/
QueryOptions.setAutoCommit(serverInfo,
btnAutoCommit.getSelection());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ private void doRun(CubridDatabase database) {
}

database.setLabel(dlg.getNewName());
database.setUniqueName(dlg.getNewName());
database.setLogined(false);

CubridNavigatorView navigatorView = CubridNavigatorView.getNavigatorView(CubridQueryNavigatorView.ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ protected void buttonPressed(int buttonId) {
} else {
database.setId(dbId);
database.setLabel(name);
database.setUniqueName(name);
}
database.setDatabaseInfo(dbInfo);
database.setServer(server);
Expand Down

0 comments on commit 87765e3

Please sign in to comment.