File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed
Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -1022,12 +1022,24 @@ void mbServerUi::contextMenuDevice(mbServerDeviceUi * deviceUi)
10221022 mn.exec (QCursor::pos ());
10231023}
10241024
1025- void mbServerUi::contextMenuDeviceRef (mbServerDeviceRef *device)
1026- {
1027- mbServerPort *port = nullptr ;
1028- if (device)
1029- port = device->port ();
1030- contextMenuPort (port);
1025+ void mbServerUi::contextMenuDeviceRef (mbServerDeviceRef */* device*/ )
1026+ {
1027+ // mbServerPort *port = nullptr;
1028+ // if (device)
1029+ // port = device->port();
1030+ // contextMenuPort(port);
1031+ QMenu mn (m_projectUi); // Note: be careful to delete deviceUi while his child 'QMenu' in stack
1032+ // User can choose 'actionDeleteDevice' and program can crash
1033+ // Solution: don't use direct 'delete deviceUi', use 'deviceUi->deleteLater'
1034+ Q_FOREACH (QAction *a, ui->menuDevice ->actions ())
1035+ mn.addAction (a);
1036+ mn.addSeparator ();
1037+ mn.addAction (ui->actionPortDeviceNew );
1038+ mn.addAction (ui->actionPortDeviceAdd );
1039+ mn.addAction (ui->actionPortDeviceEdit );
1040+ mn.addAction (ui->actionPortDeviceDelete );
1041+ mn.exec (QCursor::pos ());
1042+
10311043}
10321044
10331045void mbServerUi::contextMenuAction (mbServerSimAction * /* action*/ )
Original file line number Diff line number Diff line change 602602 </action >
603603 <action name =" actionPortDeviceNew" >
604604 <property name =" text" >
605- <string >New Device...</string >
605+ <string >New Device Ref ...</string >
606606 </property >
607607 </action >
608608 <action name =" actionPortDeviceEdit" >
609609 <property name =" text" >
610- <string >Edit Device...</string >
610+ <string >Edit Device Ref ...</string >
611611 </property >
612612 </action >
613613 <action name =" actionPortDeviceDelete" >
614614 <property name =" text" >
615- <string >Delete Device</string >
615+ <string >Delete Device Ref </string >
616616 </property >
617617 </action >
618618 <action name =" actionPortDeviceAdd" >
619619 <property name =" text" >
620- <string >Add Existing...</string >
620+ <string >Add Existing Ref ...</string >
621621 </property >
622622 </action >
623623 <action name =" actionDataViewInsert" >
You can’t perform that action at this time.
0 commit comments