mirror of
https://github.com/wownero/wowlet.git
synced 2026-11-27 10:34:11 +01:00
Disable various tabs when websocket is disabled
This commit is contained in:
@@ -47,6 +47,8 @@ NodeWidget::NodeWidget(QWidget *parent)
|
||||
|
||||
connect(ui->customView, &QTreeView::doubleClicked, this, &NodeWidget::onContextConnect);
|
||||
connect(ui->wsView, &QTreeView::doubleClicked, this, &NodeWidget::onContextConnect);
|
||||
|
||||
this->onWebsocketStatusChanged();
|
||||
}
|
||||
|
||||
void NodeWidget::onShowWSContextMenu(const QPoint &pos) {
|
||||
@@ -65,6 +67,13 @@ void NodeWidget::onShowCustomContextMenu(const QPoint &pos) {
|
||||
this->showContextMenu(pos, node);
|
||||
}
|
||||
|
||||
void NodeWidget::onWebsocketStatusChanged() {
|
||||
bool disabled = config()->get(Config::disableWebsocket).toBool() || config()->get(Config::offlineMode).toBool();
|
||||
QString labelText = disabled ? "From cached list" : "From websocket (recommended)";
|
||||
ui->radioButton_websocket->setText(labelText);
|
||||
ui->wsView->setColumnHidden(1, disabled);
|
||||
}
|
||||
|
||||
void NodeWidget::showContextMenu(const QPoint &pos, const FeatherNode &node) {
|
||||
QMenu menu(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user