parent
1d6db2a86f
commit
9d97fefad3
@ -32,7 +32,7 @@ DevicesWidget::DevicesWidget(QWidget *parent)
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
deviceGroupList->setVisible(deviceConfig->isChecked());
|
deviceGroupList->setVisible(deviceConfig->isChecked());
|
||||||
deviceList->setVisible(deviceInfo->isChecked());
|
deviceList->setVisible(deviceInfo->isChecked());
|
||||||
refresh->setVisible(deviceInfo->isChecked());
|
setDeviceInfoButtonsVisible(deviceInfo->isChecked());
|
||||||
deviceDetail->hide();
|
deviceDetail->hide();
|
||||||
|
|
||||||
deviceGroupList->verticalHeader()->setDefaultSectionSize(
|
deviceGroupList->verticalHeader()->setDefaultSectionSize(
|
||||||
@ -162,7 +162,7 @@ void DevicesWidget::updateDeviceViewActions()
|
|||||||
|
|
||||||
void DevicesWidget::on_deviceInfo_toggled(bool checked)
|
void DevicesWidget::on_deviceInfo_toggled(bool checked)
|
||||||
{
|
{
|
||||||
refresh->setVisible(checked);
|
setDeviceInfoButtonsVisible(checked);
|
||||||
deviceGroupList->setHidden(checked);
|
deviceGroupList->setHidden(checked);
|
||||||
deviceList->setVisible(checked);
|
deviceList->setVisible(checked);
|
||||||
deviceDetail->hide();
|
deviceDetail->hide();
|
||||||
@ -236,6 +236,40 @@ void DevicesWidget::on_refresh_clicked()
|
|||||||
.getDeviceInfo(portGroups_->port(currentPortIndex_).id());
|
.getDeviceInfo(portGroups_->port(currentPortIndex_).id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DevicesWidget::on_resolveNeighbors_clicked()
|
||||||
|
{
|
||||||
|
if (!portGroups_)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Q_ASSERT(portGroups_->isPort(currentPortIndex_));
|
||||||
|
QModelIndex curPortGroup = portGroups_->getPortModel()
|
||||||
|
->parent(currentPortIndex_);
|
||||||
|
Q_ASSERT(curPortGroup.isValid());
|
||||||
|
Q_ASSERT(portGroups_->isPortGroup(curPortGroup));
|
||||||
|
|
||||||
|
deviceDetail->hide();
|
||||||
|
QList<uint> portList({portGroups_->port(currentPortIndex_).id()});
|
||||||
|
portGroups_->portGroup(curPortGroup).resolveDeviceNeighbors(&portList);
|
||||||
|
portGroups_->portGroup(curPortGroup).getDeviceInfo(portList.at(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void DevicesWidget::on_clearNeighbors_clicked()
|
||||||
|
{
|
||||||
|
if (!portGroups_)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Q_ASSERT(portGroups_->isPort(currentPortIndex_));
|
||||||
|
QModelIndex curPortGroup = portGroups_->getPortModel()
|
||||||
|
->parent(currentPortIndex_);
|
||||||
|
Q_ASSERT(curPortGroup.isValid());
|
||||||
|
Q_ASSERT(portGroups_->isPortGroup(curPortGroup));
|
||||||
|
|
||||||
|
deviceDetail->hide();
|
||||||
|
QList<uint> portList({portGroups_->port(currentPortIndex_).id()});
|
||||||
|
portGroups_->portGroup(curPortGroup).clearDeviceNeighbors(&portList);
|
||||||
|
portGroups_->portGroup(curPortGroup).getDeviceInfo(portList.at(0));
|
||||||
|
}
|
||||||
|
|
||||||
void DevicesWidget::when_deviceList_currentChanged(const QModelIndex &index)
|
void DevicesWidget::when_deviceList_currentChanged(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!index.isValid() || !portGroups_)
|
if (!index.isValid() || !portGroups_)
|
||||||
@ -247,3 +281,11 @@ void DevicesWidget::when_deviceList_currentChanged(const QModelIndex &index)
|
|||||||
deviceDetail->setModel(detailModel);
|
deviceDetail->setModel(detailModel);
|
||||||
deviceDetail->setVisible(detailModel != NULL);
|
deviceDetail->setVisible(detailModel != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DevicesWidget::setDeviceInfoButtonsVisible(bool show)
|
||||||
|
{
|
||||||
|
refresh->setVisible(show);
|
||||||
|
arpNdpLabel->setVisible(show);
|
||||||
|
resolveNeighbors->setVisible(show);
|
||||||
|
clearNeighbors->setVisible(show);
|
||||||
|
}
|
||||||
|
@ -49,10 +49,14 @@ private slots:
|
|||||||
void on_deviceGroupList_activated(const QModelIndex &index);
|
void on_deviceGroupList_activated(const QModelIndex &index);
|
||||||
|
|
||||||
void on_refresh_clicked();
|
void on_refresh_clicked();
|
||||||
|
void on_resolveNeighbors_clicked();
|
||||||
|
void on_clearNeighbors_clicked();
|
||||||
|
|
||||||
void when_deviceList_currentChanged(const QModelIndex &index);
|
void when_deviceList_currentChanged(const QModelIndex &index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setDeviceInfoButtonsVisible(bool show);
|
||||||
|
|
||||||
PortGroupList *portGroups_;
|
PortGroupList *portGroups_;
|
||||||
QModelIndex currentPortIndex_;
|
QModelIndex currentPortIndex_;
|
||||||
};
|
};
|
||||||
|
@ -36,19 +36,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>131</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="refresh">
|
<widget class="QPushButton" name="refresh">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -66,6 +53,60 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>131</width>
|
||||||
|
<height>23</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="arpNdpLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>ARP/ND</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="resolveNeighbors">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Resolve Neighbors</string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string>Resolve Device Neighbors on selected port(s)</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="ostinato.qrc">
|
||||||
|
<normaloff>:/icons/neighbor_resolve.png</normaloff>:/icons/neighbor_resolve.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="clearNeighbors">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Clear Neighbors</string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string>Clear Device Neighbors on selected port(s)</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="ostinato.qrc">
|
||||||
|
<normaloff>:/icons/neighbor_clear.png</normaloff>:/icons/neighbor_clear.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
Reference in New Issue
Block a user