disable the connect button if the host is offline
This commit is contained in:
parent
6b13eeeb38
commit
3baa1a18d4
|
@ -325,6 +325,7 @@ Copyright:
|
||||||
record.set('version', host[4])
|
record.set('version', host[4])
|
||||||
record.commit();
|
record.commit();
|
||||||
|
|
||||||
|
var button = this.buttons[1], status = record.get('status');
|
||||||
if (this.grid.getSelectionModel().getSelected() == record) {
|
if (this.grid.getSelectionModel().getSelected() == record) {
|
||||||
var status = record.get('status');
|
var status = record.get('status');
|
||||||
if (status == _('Offline')) {
|
if (status == _('Offline')) {
|
||||||
|
@ -401,15 +402,17 @@ Copyright:
|
||||||
|
|
||||||
var button = this.buttons[1], status = record.get('status');
|
var button = this.buttons[1], status = record.get('status');
|
||||||
if (status == _('Connected')) {
|
if (status == _('Connected')) {
|
||||||
|
button.enable();
|
||||||
button.setText(_('Disconnect'));
|
button.setText(_('Disconnect'));
|
||||||
} else if (status == _('Offline')) {
|
} else if (status == _('Offline')) {
|
||||||
|
button.disable();
|
||||||
if (record.get('host') == '127.0.0.1' || record.get('host') == 'localhost') {
|
if (record.get('host') == '127.0.0.1' || record.get('host') == 'localhost') {
|
||||||
this.stopHostButton.setText(_('Start Daemon'));
|
this.stopHostButton.setText(_('Start Daemon'));
|
||||||
} else {
|
} else {
|
||||||
this.stopHostButton.disable();
|
this.stopHostButton.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
button.enable();
|
||||||
button.setText(_('Connect'));
|
button.setText(_('Connect'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue