Device Emulation (contd.): Use two different TableViews for DeviceGroupList and DeviceList
This commit is contained in:
parent
0503c8acaf
commit
7c87e2130a
@ -55,6 +55,8 @@ PortsWindow::PortsWindow(PortGroupList *pgl, QWidget *parent)
|
|||||||
tvStreamList->verticalHeader()->minimumSectionSize());
|
tvStreamList->verticalHeader()->minimumSectionSize());
|
||||||
deviceGroupList->verticalHeader()->setDefaultSectionSize(
|
deviceGroupList->verticalHeader()->setDefaultSectionSize(
|
||||||
deviceGroupList->verticalHeader()->minimumSectionSize());
|
deviceGroupList->verticalHeader()->minimumSectionSize());
|
||||||
|
deviceList->verticalHeader()->setDefaultSectionSize(
|
||||||
|
deviceList->verticalHeader()->minimumSectionSize());
|
||||||
|
|
||||||
// Populate PortList Context Menu Actions
|
// Populate PortList Context Menu Actions
|
||||||
tvPortList->addAction(actionNew_Port_Group);
|
tvPortList->addAction(actionNew_Port_Group);
|
||||||
@ -97,6 +99,7 @@ PortsWindow::PortsWindow(PortGroupList *pgl, QWidget *parent)
|
|||||||
|
|
||||||
tvStreamList->setModel(plm->getStreamModel());
|
tvStreamList->setModel(plm->getStreamModel());
|
||||||
deviceGroupList->setModel(plm->getDeviceGroupModel());
|
deviceGroupList->setModel(plm->getDeviceGroupModel());
|
||||||
|
deviceList->setModel(plm->getDeviceModel());
|
||||||
|
|
||||||
// XXX: It would be ideal if we only needed to do the below to
|
// XXX: It would be ideal if we only needed to do the below to
|
||||||
// get the proxy model to do its magic. However, the QModelIndex
|
// get the proxy model to do its magic. However, the QModelIndex
|
||||||
@ -158,8 +161,11 @@ PortsWindow::PortsWindow(PortGroupList *pgl, QWidget *parent)
|
|||||||
SLOT(updateDeviceViewActions()));
|
SLOT(updateDeviceViewActions()));
|
||||||
|
|
||||||
// FIXME: hardcoding
|
// FIXME: hardcoding
|
||||||
deviceGroupList->resizeColumnToContents(1);
|
deviceGroupList->resizeColumnToContents(1); // Vlan Count
|
||||||
deviceGroupList->resizeColumnToContents(2);
|
deviceGroupList->resizeColumnToContents(2); // Device Count
|
||||||
|
|
||||||
|
// FIXME: hardcoding
|
||||||
|
deviceList->resizeColumnToContents(1); // Vlan Id(s)
|
||||||
|
|
||||||
// Initially we don't have any ports/streams/devices
|
// Initially we don't have any ports/streams/devices
|
||||||
// - so send signal triggers
|
// - so send signal triggers
|
||||||
@ -896,11 +902,7 @@ _exit:
|
|||||||
void PortsWindow::on_deviceInfo_toggled(bool checked)
|
void PortsWindow::on_deviceInfo_toggled(bool checked)
|
||||||
{
|
{
|
||||||
refresh->setVisible(checked);
|
refresh->setVisible(checked);
|
||||||
|
devicesWidget->setCurrentIndex(checked ? 1 : 0);
|
||||||
if (checked)
|
|
||||||
deviceGroupList->setModel(plm->getDeviceModel());
|
|
||||||
else
|
|
||||||
deviceGroupList->setModel(plm->getDeviceGroupModel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PortsWindow::on_actionNewDeviceGroup_triggered()
|
void PortsWindow::on_actionNewDeviceGroup_triggered()
|
||||||
|
@ -218,6 +218,28 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QStackedWidget" name="devicesWidget" >
|
||||||
|
<property name="currentIndex" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="deviceConfigPage" >
|
||||||
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="deviceGroupList" >
|
<widget class="QTableView" name="deviceGroupList" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
@ -245,6 +267,32 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="deviceInfoPage" >
|
||||||
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="deviceList" />
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user