diff --git a/client/portswindow.cpp b/client/portswindow.cpp index b23093b..ce145d4 100644 --- a/client/portswindow.cpp +++ b/client/portswindow.cpp @@ -97,7 +97,9 @@ PortsWindow::PortsWindow(PortGroupList *pgl, QWidget *parent) connect(plm->getPortModel(), SIGNAL(modelReset()), SLOT(when_portModel_reset())); - connect( tvPortList->selectionModel(), + connect(tvPortList, SIGNAL(activated(const QModelIndex&)), + SLOT(on_actionPort_Configuration_triggered(const QModelIndex&))); + connect(tvPortList->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this, SLOT(when_portView_currentChanged(const QModelIndex&, const QModelIndex&))); @@ -597,9 +599,11 @@ void PortsWindow::on_actionExclusive_Control_triggered(bool checked) } } -void PortsWindow::on_actionPort_Configuration_triggered() +void PortsWindow::on_actionPort_Configuration_triggered( + const QModelIndex &portIndex) { - QModelIndex current = tvPortList->selectionModel()->currentIndex(); + QModelIndex current = portIndex.isValid() ? + portIndex : tvPortList->selectionModel()->currentIndex(); if (proxyPortModel) current = proxyPortModel->mapToSource(current); diff --git a/client/portswindow.h b/client/portswindow.h index 6df8f5c..7c99f12 100644 --- a/client/portswindow.h +++ b/client/portswindow.h @@ -80,7 +80,8 @@ private slots: void on_actionDisconnect_Port_Group_triggered(); void on_actionExclusive_Control_triggered(bool checked); - void on_actionPort_Configuration_triggered(); + void on_actionPort_Configuration_triggered( + const QModelIndex &portIndex = QModelIndex()); private: PortGroupList *plm;