1818#include " gui/components/maininfoareacomponent.h"
1919#include " gui/components/settingscomponent.h"
2020#include " gui/copyxswiftbusdialog.h"
21- #include " gui/foreignwindows.h"
2221#include " gui/guiactionbind.h"
2322#include " gui/guiapplication.h"
2423#include " misc/aviation/altitude.h"
@@ -86,26 +85,6 @@ void SwiftGuiStd::onMenuClicked()
8685 }
8786}
8887
89- void SwiftGuiStd::attachSimulatorWindow ()
90- {
91- this ->activateWindow (); // attaching requires active window
92- QWindow *w = CForeignWindows::getFirstFoundSimulatorWindow ();
93- if (!w)
94- {
95- CLogMessage (this ).warning (u" No simulator window found" );
96- return ;
97- }
98- const bool a = CForeignWindows::setSimulatorAsParent (w, this );
99- if (a) { CLogMessage (this ).info (u" Attached to simulator" ); }
100- else { CLogMessage (this ).warning (u" No simulator window found" ); }
101- }
102-
103- void SwiftGuiStd::detachSimulatorWindow ()
104- {
105- if (CForeignWindows::unsetSimulatorAsParent (this )) { CLogMessage (this ).info (u" Detached simulator window" ); }
106- else { CLogMessage (this ).info (u" No simulator window to detach" ); }
107- }
108-
10988void SwiftGuiStd::initMenus ()
11089{
11190 Q_ASSERT_X (ui->menu_InfoAreas , Q_FUNC_INFO, " No menu" );
@@ -114,13 +93,6 @@ void SwiftGuiStd::initMenus()
11493 sGui ->addMenuFile (*ui->menu_File );
11594 sGui ->addMenuInternals (*ui->menu_Internals );
11695 sGui ->addMenuWindow (*ui->menu_Window );
117- ui->menu_Window ->addSeparator ();
118- QAction *a = ui->menu_Window ->addAction (" Attach simulator window" );
119- bool c = connect (a, &QAction::triggered, this , &SwiftGuiStd::attachSimulatorWindow);
120- Q_ASSERT_X (c, Q_FUNC_INFO, " connect failed" );
121- a = ui->menu_Window ->addAction (" Detach simulator window" );
122- c = connect (a, &QAction::triggered, this , &SwiftGuiStd::detachSimulatorWindow);
123- Q_ASSERT_X (c, Q_FUNC_INFO, " connect failed" );
12496
12597 sGui ->addMenuHelp (*ui->menu_Help );
12698 ui->menu_InfoAreas ->addActions (ui->comp_MainInfoArea ->getInfoAreaSelectActions (true , ui->menu_InfoAreas ));
@@ -130,7 +102,7 @@ void SwiftGuiStd::initMenus()
130102 QAction *act = new QAction (CIcons::swift16 (), " Copy xswiftbus dialog" );
131103 ui->menu_File ->insertAction (ui->menu_File ->actions ().at (5 ), act);
132104 // clang-format off
133- c = connect (act, &QAction::triggered, this ,
105+ bool c = connect (act, &QAction::triggered, this ,
134106 [=] { this ->copyXSwiftBusDialog (false ); }, Qt::QueuedConnection);
135107 // clang-format on
136108 Q_ASSERT_X (c, Q_FUNC_INFO, " connect failed" );
0 commit comments