11 #include <QMessageBox>
12 #include <QPushButton>
13 #include <QRadioButton>
14 #include <QVBoxLayout>
17 #include "ui_swiftcore.h"
55 connect(ui->pb_Restart, &QPushButton::clicked,
this, &CSwiftCore::restart);
56 connect(ui->pb_Audio, &QPushButton::clicked,
this, &CSwiftCore::audioDialog, Qt::QueuedConnection);
57 connect(ui->pb_AudioAdvanced, &QPushButton::clicked,
this, &CSwiftCore::audioAdvancedDialog, Qt::QueuedConnection);
58 connect(ui->pb_DisconnectNetwork, &QPushButton::clicked,
this, &CSwiftCore::disconnectFromNetwork,
59 Qt::QueuedConnection);
62 this->initLogDisplay();
63 this->initStyleSheet();
67 CLogMessage(
this).
info(u
"Cmd: %1") << CGuiApplication::arguments().join(
" ");
70 ui->lep_CommandLineInput->setIdentifier(this->
identifier());
71 connect(ui->lep_CommandLineInput, &CCommandInput::commandEntered,
sGui->
getCoreFacade(),
72 &CCoreFacade::parseCommandLine);
77 void CSwiftCore::initStyleSheet()
81 CStyleSheetUtility::fileNameStandardWidget(),
82 CStyleSheetUtility::fileNameSwiftCore() });
83 this->setStyleSheet(
"");
84 this->setStyleSheet(s);
87 void CSwiftCore::showSettingsDialog()
90 m_settingsDialog->show();
93 void CSwiftCore::showRawFsdMessageDialog()
96 m_rawFsdMessageDialog->show();
101 void CSwiftCore::initLogDisplay()
104 CLogHandler::instance()->install(
true);
105 CLogHandler::instance()->enableConsoleOutput(
false);
106 ui->comp_InfoArea->getLogComponent()->showFilterDialog();
109 void CSwiftCore::initMenus()
114 connect(ui->menu_SettingsDialog, &QAction::triggered,
this, &CSwiftCore::showSettingsDialog);
115 connect(ui->menu_RawFsdMessageDialog, &QAction::triggered,
this, &CSwiftCore::showRawFsdMessageDialog);
118 void CSwiftCore::restart()
121 ui->pb_Restart->setEnabled(
false);
122 const QStringList args = this->getRestartCmdArgs();
126 void CSwiftCore::disconnectFromNetwork()
132 const QMessageBox::StandardButton reply =
133 QMessageBox::question(
this,
"Disconnect",
"Disconnect from network?", QMessageBox::Yes | QMessageBox::No);
134 if (reply != QMessageBox::Yes) {
return; }
138 void CSwiftCore::audioDialog()
141 m_audioDialog->setModal(
false);
142 m_audioDialog->show();
145 void CSwiftCore::audioAdvancedDialog()
148 m_audioAdvDialog->setModal(
false);
149 m_audioAdvDialog->show();
152 QStringList CSwiftCore::getRestartCmdArgs()
const
154 const QStringList cmds = ui->comp_DBusSelector->getDBusCmdLineArgs();
virtual void onStyleSheetsChanged()
Style sheet has changed.
virtual ~CSwiftCore()
Destructor.
CSwiftCore(QWidget *parent=nullptr)
Constructor.
void restartApplication(const QStringList &newArguments={}, const QStringList &removeArguments={})
Stop and restart application.
CCoreFacade * getCoreFacade()
Get the facade.
const context::IContextNetwork * getIContextNetwork() const
Direct access to contexts if a CCoreFacade has been initialized.
bool isShuttingDown() const
Is application shutting down?
const QString & getApplicationNameAndVersion() const
Application name and version.
virtual swift::misc::CStatusMessage disconnectFromNetwork()=0
Disconnect from network.
virtual bool isConnected() const =0
Network connected?
void addMenuHelp(QMenu &menu)
Help operations.
void addMenuFile(QMenu &menu)
File menu.
const CStyleSheetUtility & getStyleSheetUtility() const
Style sheet handling.
void addMenuWindow(QMenu &menu)
Window operations.
void initMainApplicationWidget(QWidget *mainWidget)
Init the main application window based on information in this application.
QString styles(const QStringList &fileNames) const
Multiple styles concatenated.
QDialog which can minimize to system tray.
void setSystemTrayMode(SystemTrayMode mode)
System tray mode.
void setSystemTrayToolTip(const QString &tooltip)
Set tool tip.
CManagedStatusBar * m_mwaStatusBar
status bar if any
components::CLogComponent * m_mwaLogComponent
the log component if any
COverlayMessagesFrame * m_mwaOverlayFrame
overlay messages if any
Audio advanced setup as dialog.
Cockpit COM component as dialog.
Core / swift pilot client settings as Dialog.
void showDetails(bool details)
Show log details.
CRawFsdMessageComponent as dialog.
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
const CIdentifier & identifier() const
Get identifier.
Class for emitting a log message.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Free functions in swift::misc.