More interface view cleanups.
Rename some of the columns - IFTREE_COL_NAME is the interface name, IFTREE_COL_DESCRIPTION is the description/friendly name, and a new IFTREE_COL_DISPLAY_NAME column is the display name (which may include both the description and the interface name). Rename IFTREE_COL_INTERFACE_COMMENT to just IFTREE_COL_COMMENT - there's no *other* type of comment, and "IF" is short for "interface". In the interface frame, use IFTREE_COL_DISPLAY_NAME, as that's the only column that shows both and thus has something for all interfaces. In the "Manage interfaces" dialog, put the description before the interface name, as it was in earlier versions. Change-Id: If0d959dcd4ca99913c941df00621da3c478233f6 Reviewed-on: https://code.wireshark.org/review/29090 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
713651d9c3
commit
991f5a6e85
@ -73,7 +73,7 @@ InterfaceFrame::InterfaceFrame(QWidget * parent)
|
||||
|
||||
QList<InterfaceTreeColumns> columns;
|
||||
columns.append(IFTREE_COL_EXTCAP);
|
||||
columns.append(IFTREE_COL_NAME);
|
||||
columns.append(IFTREE_COL_DISPLAY_NAME);
|
||||
columns.append(IFTREE_COL_STATS);
|
||||
proxyModel.setColumns(columns);
|
||||
proxyModel.setStoreOnChange(true);
|
||||
@ -257,7 +257,7 @@ void InterfaceFrame::resetInterfaceTreeDisplay()
|
||||
ui->interfaceTree->setHidden(false);
|
||||
ui->lblNoInterfaces->setHidden(true);
|
||||
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_EXTCAP));
|
||||
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_NAME));
|
||||
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_DISPLAY_NAME));
|
||||
ui->interfaceTree->resizeColumnToContents(proxyModel.mapSourceToColumn(IFTREE_COL_STATS));
|
||||
}
|
||||
}
|
||||
@ -301,7 +301,7 @@ void InterfaceFrame::on_interfaceTree_doubleClicked(const QModelIndex &index)
|
||||
|
||||
#ifdef HAVE_LIBPCAP
|
||||
|
||||
QString device_name = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_INTERFACE_NAME).toString();
|
||||
QString device_name = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_NAME).toString();
|
||||
QString extcap_string = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
|
||||
|
||||
/* We trust the string here. If this interface is really extcap, the string is
|
||||
@ -329,7 +329,7 @@ void InterfaceFrame::on_interfaceTree_clicked(const QModelIndex &index)
|
||||
if ( ! realIndex.isValid() )
|
||||
return;
|
||||
|
||||
QString device_name = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_INTERFACE_NAME).toString();
|
||||
QString device_name = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_NAME).toString();
|
||||
QString extcap_string = sourceModel.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
|
||||
|
||||
/* We trust the string here. If this interface is really extcap, the string is
|
||||
|
@ -142,9 +142,9 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
|
||||
proxyModel = new InterfaceSortFilterModel(this);
|
||||
QList<InterfaceTreeColumns> columns;
|
||||
columns.append(IFTREE_COL_HIDDEN);
|
||||
columns.append(IFTREE_COL_INTERFACE_NAME);
|
||||
columns.append(IFTREE_COL_DESCRIPTION);
|
||||
columns.append(IFTREE_COL_NAME);
|
||||
columns.append(IFTREE_COL_INTERFACE_COMMENT);
|
||||
columns.append(IFTREE_COL_COMMENT);
|
||||
proxyModel->setColumns(columns);
|
||||
proxyModel->setSourceModel(sourceModel);
|
||||
proxyModel->setFilterHidden(false);
|
||||
@ -152,7 +152,7 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
|
||||
|
||||
ui->localView->setModel(proxyModel);
|
||||
ui->localView->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_HIDDEN));
|
||||
ui->localView->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_INTERFACE_NAME));
|
||||
ui->localView->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_NAME));
|
||||
|
||||
pipeProxyModel = new InterfaceSortFilterModel(this);
|
||||
columns.clear();
|
||||
|
@ -41,7 +41,7 @@ InterfaceTreeCacheModel::InterfaceTreeCacheModel(QObject *parent) :
|
||||
checkableColumns << IFTREE_COL_MONITOR_MODE;
|
||||
#endif
|
||||
|
||||
editableColumns << IFTREE_COL_INTERFACE_COMMENT << IFTREE_COL_SNAPLEN << IFTREE_COL_PIPE_PATH;
|
||||
editableColumns << IFTREE_COL_COMMENT << IFTREE_COL_SNAPLEN << IFTREE_COL_PIPE_PATH;
|
||||
|
||||
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
|
||||
editableColumns << IFTREE_COL_BUFFERLEN;
|
||||
@ -218,7 +218,7 @@ void InterfaceTreeCacheModel::save()
|
||||
if ( content.isValid() && static_cast<Qt::CheckState>(content.toInt()) == Qt::Unchecked )
|
||||
prefStorage[&prefs.capture_devices_hide] << QString(device->name);
|
||||
|
||||
content = getColumnContent(idx, IFTREE_COL_INTERFACE_COMMENT);
|
||||
content = getColumnContent(idx, IFTREE_COL_COMMENT);
|
||||
if ( content.isValid() && content.toString().size() > 0 )
|
||||
prefStorage[&prefs.capture_devices_descr] << QString("%1(%2)").arg(device->name).arg(content.toString());
|
||||
|
||||
@ -484,7 +484,7 @@ QVariant InterfaceTreeCacheModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if ( col == IFTREE_COL_PIPE_PATH ||
|
||||
col == IFTREE_COL_NAME ||
|
||||
col == IFTREE_COL_INTERFACE_NAME )
|
||||
col == IFTREE_COL_DESCRIPTION )
|
||||
{
|
||||
|
||||
QMap<InterfaceTreeColumns, QVariant> * dataField = 0;
|
||||
|
@ -114,12 +114,16 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
/* Only the name is being displayed */
|
||||
if ( col == IFTREE_COL_NAME )
|
||||
{
|
||||
return QString(device->name);
|
||||
}
|
||||
else if ( col == IFTREE_COL_DESCRIPTION )
|
||||
{
|
||||
return QString(device->friendly_name);
|
||||
}
|
||||
else if ( col == IFTREE_COL_INTERFACE_NAME )
|
||||
else if ( col == IFTREE_COL_DISPLAY_NAME )
|
||||
{
|
||||
return QString(device->name);
|
||||
return QString(device->display_name);
|
||||
}
|
||||
else if ( col == IFTREE_COL_PIPE_PATH )
|
||||
{
|
||||
@ -148,7 +152,7 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
return QVariant::fromValue((int)device->if_info.type);
|
||||
}
|
||||
else if ( col == IFTREE_COL_INTERFACE_COMMENT )
|
||||
else if ( col == IFTREE_COL_COMMENT )
|
||||
{
|
||||
QString comment = gchar_free_to_qstring(capture_dev_user_descr_find(device->name));
|
||||
if ( comment.length() > 0 )
|
||||
@ -255,18 +259,22 @@ QVariant InterfaceTreeModel::headerData(int section, Qt::Orientation orientation
|
||||
return tr("Show");
|
||||
}
|
||||
else if ( section == IFTREE_COL_NAME )
|
||||
{
|
||||
return tr("Interface Name");
|
||||
}
|
||||
else if ( section == IFTREE_COL_DESCRIPTION )
|
||||
{
|
||||
return tr("Friendly Name");
|
||||
}
|
||||
else if ( section == IFTREE_COL_INTERFACE_NAME )
|
||||
else if ( section == IFTREE_COL_DISPLAY_NAME )
|
||||
{
|
||||
return tr("Interface Name");
|
||||
return tr("Friendly Name");
|
||||
}
|
||||
else if ( section == IFTREE_COL_PIPE_PATH )
|
||||
{
|
||||
return tr("Local Pipe Path");
|
||||
}
|
||||
else if ( section == IFTREE_COL_INTERFACE_COMMENT )
|
||||
else if ( section == IFTREE_COL_COMMENT )
|
||||
{
|
||||
return tr("Comment");
|
||||
}
|
||||
|
@ -32,8 +32,9 @@ enum InterfaceTreeColumns
|
||||
IFTREE_COL_EXTCAP,
|
||||
IFTREE_COL_EXTCAP_PATH,
|
||||
IFTREE_COL_NAME,
|
||||
IFTREE_COL_INTERFACE_NAME,
|
||||
IFTREE_COL_INTERFACE_COMMENT,
|
||||
IFTREE_COL_DESCRIPTION,
|
||||
IFTREE_COL_DISPLAY_NAME,
|
||||
IFTREE_COL_COMMENT,
|
||||
IFTREE_COL_HIDDEN,
|
||||
IFTREE_COL_DLT,
|
||||
IFTREE_COL_PROMISCUOUSMODE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user