Add Stream and Device menus to main window menu bar

Stream and Device related actions from the File menu has been moved
under these new menus
This commit is contained in:
Srivats P 2022-02-11 18:09:30 +05:30
parent 22b8c405f7
commit 2ee19da15c
4 changed files with 37 additions and 1 deletions

View File

@ -119,8 +119,11 @@ MainWindow::MainWindow(QWidget *parent)
setupUi(this); setupUi(this);
menuFile->insertActions(menuFile->actions().at(3), portsWindow->actions()); menuFile->insertActions(menuFile->actions().at(3),
portsWindow->portActions());
menuEdit->addActions(clipboardHelper->actions()); menuEdit->addActions(clipboardHelper->actions());
menuStreams->addActions(portsWindow->streamActions());
menuDevices->addActions(portsWindow->deviceActions());
statsDock->setWidget(statsWindow); statsDock->setWidget(statsWindow);
addDockWidget(Qt::BottomDockWidgetArea, statsDock); addDockWidget(Qt::BottomDockWidgetArea, statsDock);

View File

@ -25,6 +25,7 @@
<addaction name="actionOpenSession" /> <addaction name="actionOpenSession" />
<addaction name="actionSaveSession" /> <addaction name="actionSaveSession" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="separator" />
<addaction name="actionPreferences" /> <addaction name="actionPreferences" />
<addaction name="actionFileExit" /> <addaction name="actionFileExit" />
</widget> </widget>
@ -45,6 +46,17 @@
<string>&amp;Edit</string> <string>&amp;Edit</string>
</property> </property>
</widget> </widget>
<widget class="QMenu" name="menuStreams" >
<property name="title" >
<string>&amp;Streams</string>
</property>
<addaction name="actionTest" />
</widget>
<widget class="QMenu" name="menuDevices" >
<property name="title" >
<string>&amp;Devices</string>
</property>
</widget>
<widget class="QMenu" name="menuView" > <widget class="QMenu" name="menuView" >
<property name="title" > <property name="title" >
<string>&amp;View</string> <string>&amp;View</string>
@ -54,6 +66,8 @@
</widget> </widget>
<addaction name="menuFile" /> <addaction name="menuFile" />
<addaction name="menuEdit" /> <addaction name="menuEdit" />
<addaction name="menuStreams" />
<addaction name="menuDevices" />
<addaction name="menuView" /> <addaction name="menuView" />
<addaction name="menuHelp" /> <addaction name="menuHelp" />
</widget> </widget>

View File

@ -233,6 +233,21 @@ bool PortsWindow::saveSession(
return true; return true;
} }
QList<QAction*> PortsWindow::portActions()
{
return tvPortList->actions();
}
QList<QAction*> PortsWindow::streamActions()
{
return streamsWidget->actions();
}
QList<QAction*> PortsWindow::deviceActions()
{
return devicesWidget->actions();
}
void PortsWindow::clearCurrentSelection() void PortsWindow::clearCurrentSelection()
{ {
tvPortList->selectionModel()->clearCurrentIndex(); tvPortList->selectionModel()->clearCurrentIndex();

View File

@ -50,6 +50,10 @@ public:
QString &error, QString &error,
QProgressDialog *progress = NULL); QProgressDialog *progress = NULL);
QList<QAction*> portActions();
QList<QAction*> streamActions();
QList<QAction*> deviceActions();
signals: signals:
void currentPortChanged(const QModelIndex &current, void currentPortChanged(const QModelIndex &current,
const QModelIndex &previous); const QModelIndex &previous);