aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-08-11 18:55:01 -0700
committerGuy Harris <guy@alum.mit.edu>2018-08-12 01:56:23 +0000
commit991f5a6e858ea116cb938c9acacee415ee075bab (patch)
tree5ee455e8a39729e13a3be940a19b5d0291753afc /ui/qt/models
parent713651d9c398ee5ccf652298cdffe30d5accdb07 (diff)
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>
Diffstat (limited to 'ui/qt/models')
-rw-r--r--ui/qt/models/interface_tree_cache_model.cpp6
-rw-r--r--ui/qt/models/interface_tree_model.cpp20
-rw-r--r--ui/qt/models/interface_tree_model.h5
3 files changed, 20 insertions, 11 deletions
diff --git a/ui/qt/models/interface_tree_cache_model.cpp b/ui/qt/models/interface_tree_cache_model.cpp
index baa650d93c..7112414c8c 100644
--- a/ui/qt/models/interface_tree_cache_model.cpp
+++ b/ui/qt/models/interface_tree_cache_model.cpp
@@ -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;
diff --git a/ui/qt/models/interface_tree_model.cpp b/ui/qt/models/interface_tree_model.cpp
index 8462b1be0b..ae44e131b2 100644
--- a/ui/qt/models/interface_tree_model.cpp
+++ b/ui/qt/models/interface_tree_model.cpp
@@ -115,11 +115,15 @@ 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 )
@@ -256,17 +260,21 @@ QVariant InterfaceTreeModel::headerData(int section, Qt::Orientation orientation
}
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");
}
diff --git a/ui/qt/models/interface_tree_model.h b/ui/qt/models/interface_tree_model.h
index e430128ade..f916e24bb9 100644
--- a/ui/qt/models/interface_tree_model.h
+++ b/ui/qt/models/interface_tree_model.h
@@ -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,