void InterfaceFrame::interfaceListChanged()
{
- if (sourceModel->rowCount() == 0)
+ if ( sourceModel->rowCount() == 0 )
{
ui->interfaceTree->setHidden(true);
ui->lblNoInterfaces->setHidden(false);
{
QAbstractButton * button = 0;
- if ( ! global_capture_opts.all_ifaces )
+ ui->wdgTypeSelector->setVisible( proxyModel->typesDisplayed().count() > 1 );
+
+ if ( sourceModel->rowCount() == 0 )
return;
foreach (QWidget * w, ui->wdgButtons->findChildren<QWidget *>())
void InterfaceFrame::updateSelectedInterfaces()
{
- if ( ! global_capture_opts.all_ifaces )
+ if ( sourceModel->rowCount() == 0 )
return;
QItemSelection mySelection;
- for(unsigned int idx = 0; idx < global_capture_opts.all_ifaces->len; idx++)
+ for( int idx = 0; idx < sourceModel->rowCount(); idx++ )
{
interface_t device = g_array_index(global_capture_opts.all_ifaces, interface_t, idx);
{
if (selected.count() == 0 && deselected.count() == 0)
return;
- if ( ! global_capture_opts.all_ifaces )
+ if ( sourceModel->rowCount() == 0 )
return;
QList<int> selectedIndices;
{
QModelIndex realIndex = proxyModel->mapToSource(index);
- if ( ! global_capture_opts.all_ifaces || global_capture_opts.all_ifaces->len <= (guint) realIndex.row() )
+ if ( ! realIndex.isValid() )
return;
#ifdef HAVE_EXTCAP
{
QModelIndex realIndex = proxyModel->mapToSource(index);
- if ( ! global_capture_opts.all_ifaces || global_capture_opts.all_ifaces->len <= (guint) realIndex.row() )
+ if ( ! realIndex.isValid() )
return;
interface_t device = g_array_index(global_capture_opts.all_ifaces, interface_t, realIndex.row());
void InterfaceFrame::updateStatistics(void)
{
- if ( ! global_capture_opts.all_ifaces )
+ if ( sourceModel->rowCount() == 0 )
return;
#ifdef HAVE_LIBPCAP
- for( unsigned int idx = 0; idx < global_capture_opts.all_ifaces->len; idx++ )
+ for( int idx = 0; idx < proxyModel->rowCount(); idx++ )
{
QModelIndex selectIndex = proxyModel->mapFromSource(sourceModel->index(idx, 0));
<rect>
<x>0</x>
<y>0</y>
- <width>550</width>
+ <width>555</width>
<height>350</height>
</rect>
</property>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Show Interfaces</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QWidget" name="wdgButtons" native="true"/>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
+ <widget class="QWidget" name="wdgTypeSelector" native="true">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <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="QLabel" name="label">
+ <property name="text">
+ <string>Show Interfaces</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QWidget" name="wdgButtons" native="true"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>429</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</item>
</layout>
</widget>