diff options
author | Gerald Combs <gerald@wireshark.org> | 2014-08-06 14:50:48 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-08-08 05:57:01 +0000 |
commit | 4da7570809f7ea303ca15368d2c818fafc1a70f5 (patch) | |
tree | a3864c351c5349af1c22e35a593aa472093d49de /ui/qt/manage_interfaces_dialog.cpp | |
parent | 40d5c503a7b184c09105d37db33d4ec324416185 (diff) |
Use a QTreeWidget instead of QTableWidget.
Even though Qt's widget naming suggests otherwise, a QTreeWidget is
usually a better choice for tables than QTableWidget. The former gives
you a nice, clean Plain Old Table while the latter gives you something
that looks and acts like a spreadsheet.
In this particular instance using QTreeWidget also gives us the option
of adding sub-items with detailed information. Do so for attached
addresses.
Allow sorting by traffic while we're here. Simplify the column hiding
logic. Make sure the sparkline delegate isn't editable.
Change-Id: Ia36ba2e12c1c0cb86ae5b2154e6afcf6549ae049
Reviewed-on: https://code.wireshark.org/review/3466
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/manage_interfaces_dialog.cpp')
-rw-r--r-- | ui/qt/manage_interfaces_dialog.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp index 7ebdf85462..d5f8038c51 100644 --- a/ui/qt/manage_interfaces_dialog.cpp +++ b/ui/qt/manage_interfaces_dialog.cpp @@ -43,6 +43,10 @@ #include <QMessageBox> #include <QCheckBox> +enum { + col_p_pipe_ +}; + ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ManageInterfacesDialog) @@ -97,7 +101,7 @@ void ManageInterfacesDialog::showPipes() } ui->pipeList->setRowCount(ui->pipeList->rowCount()+1); QString output = QString(device.display_name); - ui->pipeList->setItem(ui->pipeList->rowCount()-1, INTERFACE, new QTableWidgetItem(output)); + ui->pipeList->setItem(ui->pipeList->rowCount()-1, col_p_pipe_, new QTableWidgetItem(output)); } } } @@ -228,7 +232,7 @@ void ManageInterfacesDialog::showLocalInterfaces() output = QString(device.name); ui->localList->setItem(ui->localList->rowCount()-1, LOCAL_NAME, new QTableWidgetItem(output)); output = QString(""); - eFlags = ui->localList->item(ui->localList->rowCount()-1, FRIENDLY)->flags(); + eFlags = ui->localList->item(ui->localList->rowCount()-1, LOCAL_NAME)->flags(); eFlags &= Qt::NoItemFlags; eFlags |= Qt::ItemIsSelectable | Qt::ItemIsEnabled; ui->localList->item(ui->localList->rowCount()-1, LOCAL_NAME)->setFlags(eFlags); |