Qt: only "Comment" column should be editable in Local Interfaces management tab

Bug: 12146
Change-Id: Ife481b7c0b201a54749e212416571aa3dcaf7542
Reviewed-on: https://code.wireshark.org/review/14017
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Pascal Quantin 2016-02-19 19:47:16 +01:00 committed by Alexis La Goutte
parent 5eafa903f6
commit a795a3033a
2 changed files with 12 additions and 1 deletions

View File

@ -102,6 +102,7 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
#ifndef Q_OS_WIN
ui->localList->setColumnHidden(col_l_friendly_name_, true);
#endif
ui->localList->setEditTriggers(QAbstractItemView::NoEditTriggers);
ui->pipeList->setItemDelegateForColumn(col_p_pipe_, &new_pipe_item_delegate_);
new_pipe_item_delegate_.setTree(ui->pipeList);
@ -122,6 +123,7 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateWidgets()));
connect(this, SIGNAL(ifsChanged()), parent, SIGNAL(ifsChanged()));
connect(ui->localList, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(localListItemDoubleClicked(QTreeWidgetItem *, int)));
#ifdef HAVE_PCAP_REMOTE
connect(this, SIGNAL(remoteAdded(GList*, remote_options*)), this, SLOT(addRemoteInterfaces(GList*, remote_options*)));
@ -455,7 +457,7 @@ void ManageInterfacesDialog::localAccepted()
/* write new description string to preferences */
if (prefs.capture_devices_descr)
g_free(prefs.capture_devices_descr);
prefs.capture_devices_descr = qstring_strdup(comment_list.join(","));;
prefs.capture_devices_descr = qstring_strdup(comment_list.join(","));
}
}
@ -464,6 +466,13 @@ void ManageInterfacesDialog::on_buttonBox_helpRequested()
wsApp->helpTopicAction(HELP_CAPTURE_MANAGE_INTERFACES_DIALOG);
}
void ManageInterfacesDialog::localListItemDoubleClicked(QTreeWidgetItem * item, int column)
{
if (column == col_l_comment_) {
ui->localList->editItem(item, column);
}
}
#ifdef HAVE_PCAP_REMOTE
void ManageInterfacesDialog::remoteSelectionChanged(QTreeWidgetItem*, int)
{

View File

@ -106,6 +106,8 @@ private slots:
void on_pipeList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void localAccepted();
void localListItemDoubleClicked(QTreeWidgetItem * item, int column);
#ifdef HAVE_PCAP_REMOTE
void on_addRemote_clicked();
void on_delRemote_clicked();