connect device management actions
This commit is contained in:
parent
f19f572daf
commit
9b4e9eda03
|
@ -24,6 +24,18 @@ DeviceWindow::DeviceWindow(QWidget *parent)
|
|||
// model connections
|
||||
connect(ui->widgetView->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||
this, &DeviceWindow::selectionChanged);
|
||||
connect(ui->actionOpen, &QAction::triggered,
|
||||
this, [this]() {
|
||||
auto selected = ui->widgetView->currentIndex();
|
||||
if (selected.isValid())
|
||||
selected.data(Qt::EditRole).value<DmxWidget*>()->open();
|
||||
});
|
||||
connect(ui->actionClose, &QAction::triggered,
|
||||
this, [this]() {
|
||||
auto selected = ui->widgetView->currentIndex();
|
||||
if (selected.isValid())
|
||||
selected.data(Qt::EditRole).value<DmxWidget*>()->close();
|
||||
});
|
||||
connect(ui->actionParameter, &QAction::triggered,
|
||||
this, [this]() {
|
||||
auto selected = ui->widgetView->currentIndex();
|
||||
|
@ -33,6 +45,7 @@ DeviceWindow::DeviceWindow(QWidget *parent)
|
|||
dlg.exec();
|
||||
});
|
||||
// action connections
|
||||
connect(ui->actionRefreshList, &QAction::triggered, model, &WidgetModel::rescanPorts);
|
||||
connect(ui->actionAbout, &QAction::triggered,
|
||||
this, [this](){
|
||||
QString title = tr("About") % " " % qAppName();
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionClose"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionRefresh_List"/>
|
||||
<addaction name="actionRefreshList"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuWidget">
|
||||
<property name="title">
|
||||
|
@ -96,7 +96,7 @@
|
|||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionRefresh_List"/>
|
||||
<addaction name="actionRefreshList"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionClose"/>
|
||||
<addaction name="separator"/>
|
||||
|
@ -131,7 +131,7 @@
|
|||
<string>About Qt</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRefresh_List">
|
||||
<action name="actionRefreshList">
|
||||
<property name="icon">
|
||||
<iconset theme="view-refresh">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
|
|
Loading…
Reference in New Issue