mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 21:45:34 +08:00
refs #883, added menus for core and assigned shortcuts to menu items
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a57b83f9de
commit
455d9c7b7d
@@ -54,6 +54,7 @@ CSwiftCore::CSwiftCore(QWidget *parent) :
|
||||
initSlots();
|
||||
initStyleSheet();
|
||||
initDBusMode();
|
||||
initMenus();
|
||||
|
||||
if (sGui->isParserOptionSet("start")) { startCore(sGui->getCmdDBusAddressValue()); }
|
||||
}
|
||||
@@ -144,6 +145,13 @@ void CSwiftCore::initLogDisplay()
|
||||
ui->comp_InfoArea->getLogComponent()->showFilterDialog(); // add a filter dialog
|
||||
}
|
||||
|
||||
void CSwiftCore::initMenus()
|
||||
{
|
||||
sGui->addMenuFile(*ui->menu_File);
|
||||
sGui->addMenuWindow(*ui->menu_Window);
|
||||
sGui->addMenuHelp(*ui->menu_Help);
|
||||
}
|
||||
|
||||
void CSwiftCore::startCore(const QString &dBusAdress)
|
||||
{
|
||||
if (dBusAdress.isEmpty()) { return; }
|
||||
|
||||
@@ -57,11 +57,12 @@ private slots:
|
||||
|
||||
private:
|
||||
//! \name Init
|
||||
//! @[
|
||||
//! @{
|
||||
void initSlots();
|
||||
void initLogDisplay();
|
||||
void initStyleSheet();
|
||||
void initDBusMode();
|
||||
void initMenus();
|
||||
//! @}
|
||||
|
||||
void startCore(const QString &dBusAdress);
|
||||
|
||||
@@ -132,6 +132,34 @@ QTextEdit {
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="mb_SwiftCore">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>460</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Help">
|
||||
<property name="title">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Window">
|
||||
<property name="title">
|
||||
<string>&Window</string>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
<addaction name="menu_Window"/>
|
||||
<addaction name="menu_Help"/>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
||||
@@ -77,13 +77,13 @@
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Window">
|
||||
<property name="title">
|
||||
<string>Window</string>
|
||||
<string>&Window</string>
|
||||
</property>
|
||||
<addaction name="menu_WindowFont"/>
|
||||
</widget>
|
||||
@@ -107,7 +107,7 @@
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Help">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
|
||||
@@ -258,12 +258,12 @@
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Help">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
@@ -274,7 +274,7 @@
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Window">
|
||||
<property name="title">
|
||||
<string>Window</string>
|
||||
<string>&Window</string>
|
||||
</property>
|
||||
<addaction name="menu_WindowFont"/>
|
||||
<addaction name="menu_WindowToggleNavigator"/>
|
||||
@@ -502,6 +502,12 @@
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CInfoBarStatusComponent</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>blackgui/components/infobarstatuscomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::COverlayMessagesFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
@@ -520,12 +526,6 @@
|
||||
<header>blackgui/dockwidgetinfobar.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CInfoBarStatusComponent</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>blackgui/components/infobarstatuscomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CMainKeypadAreaComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
|
||||
@@ -29,9 +29,6 @@ using namespace BlackMisc;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
/*
|
||||
* Menu clicked
|
||||
*/
|
||||
void SwiftGuiStd::ps_onMenuClicked()
|
||||
{
|
||||
QObject *sender = QObject::sender();
|
||||
@@ -78,7 +75,8 @@ void SwiftGuiStd::initMenus()
|
||||
|
||||
// for hotkeys
|
||||
const QString swift(CGuiActionBindHandler::pathSwiftPilotClient());
|
||||
static const CActionBind swiftRoot(swift, CIcons::swift16());
|
||||
static const CActionBind swiftRoot(swift, CIcons::swift16()); // inserts action for root folder
|
||||
Q_UNUSED(swiftRoot);
|
||||
m_menuHotkeyHandlers.append(CGuiActionBindHandler::bindMenu(ui->menu_InfoAreas, swift + "Info areas"));
|
||||
m_menuHotkeyHandlers.append(CGuiActionBindHandler::bindMenu(ui->menu_File, swift + "File"));
|
||||
m_menuHotkeyHandlers.append(CGuiActionBindHandler::bindMenu(ui->menu_Window, swift + "Window"));
|
||||
|
||||
Reference in New Issue
Block a user