From baecb0ff93fc98b44b1cae3b17fcb9517f99e58b Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 11 May 2019 02:29:55 +0200 Subject: [PATCH] Ref T640, FSD details as UI component and dialog --- .../components/networkdetailscomponent.cpp | 45 +++++ .../components/networkdetailscomponent.h | 53 ++++++ .../components/networkdetailscomponent.ui | 177 ++++++++++++++++++ .../components/networkdetailsdialog.cpp | 45 +++++ .../components/networkdetailsdialog.h | 53 ++++++ .../components/networkdetailsdialog.ui | 88 +++++++++ 6 files changed, 461 insertions(+) create mode 100644 src/blackgui/components/networkdetailscomponent.cpp create mode 100644 src/blackgui/components/networkdetailscomponent.h create mode 100644 src/blackgui/components/networkdetailscomponent.ui create mode 100644 src/blackgui/components/networkdetailsdialog.cpp create mode 100644 src/blackgui/components/networkdetailsdialog.h create mode 100644 src/blackgui/components/networkdetailsdialog.ui diff --git a/src/blackgui/components/networkdetailscomponent.cpp b/src/blackgui/components/networkdetailscomponent.cpp new file mode 100644 index 000000000..0a8d2a94f --- /dev/null +++ b/src/blackgui/components/networkdetailscomponent.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2019 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated, + * or distributed except according to the terms contained in the LICENSE file. + */ + +#include "networkdetailscomponent.h" +#include "ui_networkdetailscomponent.h" + +using namespace BlackMisc::Network; +using namespace BlackMisc::Audio; +using namespace BlackCore; + +namespace BlackGui +{ + namespace Components + { + CNetworkDetailsComponent::CNetworkDetailsComponent(QWidget *parent) : + QFrame(parent), + ui(new Ui::CNetworkDetailsComponent) + { + ui->setupUi(this); + } + + CNetworkDetailsComponent::~CNetworkDetailsComponent() + { } + + INetwork::LoginMode CNetworkDetailsComponent::getLoginMode() const + { + return ui->frp_LoginMode->getLoginMode(); + } + + CVoiceSetup CNetworkDetailsComponent::getVoiceSetup() const + { + return ui->form_Voice->getValue(); + } + + CFsdSetup CNetworkDetailsComponent::getFsdSetup() const + { + return ui->form_FsdDetails->getValue(); + } + } // ns +} // ns diff --git a/src/blackgui/components/networkdetailscomponent.h b/src/blackgui/components/networkdetailscomponent.h new file mode 100644 index 000000000..30c311ee5 --- /dev/null +++ b/src/blackgui/components/networkdetailscomponent.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2019 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated, + * or distributed except according to the terms contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_COMPONENTS_NETWORKDETAILSCOMPONENT_H +#define BLACKGUI_COMPONENTS_NETWORKDETAILSCOMPONENT_H + +#include +#include + +#include "blackmisc/network/fsdsetup.h" +#include "blackmisc/audio/voicesetup.h" +#include "blackcore/network.h" + +namespace Ui { class CNetworkDetailsComponent; } +namespace BlackGui +{ + namespace Components + { + //! FSD details + class CNetworkDetailsComponent : public QFrame + { + Q_OBJECT + + public: + //! Ctor + explicit CNetworkDetailsComponent(QWidget *parent = nullptr); + + //! Dtor + virtual ~CNetworkDetailsComponent() override; + + //! FSD setup + BlackMisc::Network::CFsdSetup getFsdSetup() const; + + //! Voice setup + BlackMisc::Audio::CVoiceSetup getVoiceSetup() const; + + //! Login mode + BlackCore::INetwork::LoginMode getLoginMode() const; + + private: + QScopedPointer ui; + }; + } // ns +} // ns + +#endif // guard diff --git a/src/blackgui/components/networkdetailscomponent.ui b/src/blackgui/components/networkdetailscomponent.ui new file mode 100644 index 000000000..ab56c08f2 --- /dev/null +++ b/src/blackgui/components/networkdetailscomponent.ui @@ -0,0 +1,177 @@ + + + CNetworkDetailsComponent + + + Network details + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Mode + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + + + + FSD details + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + true + + + + + 0 + 0 + 192 + 55 + + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + + + + + + + Voice + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + + + + Matching log + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + + + + + + + + + BlackGui::Editors::CFsdSetupForm + QFrame +
blackgui/editors/fsdsetupform.h
+ 1 +
+ + BlackGui::Editors::CVoiceSetupForm + QFrame +
blackgui/editors/voicesetupform.h
+ 1 +
+ + BlackGui::Components::CModelMatcherLogEnable + QFrame +
blackgui/components/modelmatcherlogenable.h
+ 1 +
+ + BlackGui::CLoginModeButtons + QFrame +
blackgui/loginmodebuttons.h
+ 1 +
+
+ + +
diff --git a/src/blackgui/components/networkdetailsdialog.cpp b/src/blackgui/components/networkdetailsdialog.cpp new file mode 100644 index 000000000..68cf27c61 --- /dev/null +++ b/src/blackgui/components/networkdetailsdialog.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2019 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated, + * or distributed except according to the terms contained in the LICENSE file. + */ + +#include "networkdetailsdialog.h" +#include "ui_networkdetailsdialog.h" + +using namespace BlackMisc::Network; +using namespace BlackMisc::Audio; +using namespace BlackCore; + +namespace BlackGui +{ + namespace Components + { + CNetworkDetailsDialog::CNetworkDetailsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::CNetworkDetailsDialog) + { + ui->setupUi(this); + } + + CNetworkDetailsDialog::~CNetworkDetailsDialog() + { } + + CFsdSetup CNetworkDetailsDialog::getFsdSetup() const + { + return ui->comp_NetworkDetails->getFsdSetup(); + } + + CVoiceSetup CNetworkDetailsDialog::getVoiceSetup() const + { + return ui->comp_NetworkDetails->getVoiceSetup(); + } + + INetwork::LoginMode CNetworkDetailsDialog::getLoginMode() const + { + return ui->comp_NetworkDetails->getLoginMode(); + } + } // ns +} // ns diff --git a/src/blackgui/components/networkdetailsdialog.h b/src/blackgui/components/networkdetailsdialog.h new file mode 100644 index 000000000..3dc7aa41d --- /dev/null +++ b/src/blackgui/components/networkdetailsdialog.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2019 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated, + * or distributed except according to the terms contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_COMPONENTS_NETWORKDETAILSDIALOG_H +#define BLACKGUI_COMPONENTS_NETWORKDETAILSDIALOG_H + +#include +#include + +#include "blackmisc/network/fsdsetup.h" +#include "blackmisc/audio/voicesetup.h" +#include "blackcore/network.h" + +namespace Ui { class CNetworkDetailsDialog; } +namespace BlackGui +{ + namespace Components + { + //! Network details as dialog + class CNetworkDetailsDialog : public QDialog + { + Q_OBJECT + + public: + //! Ctor + explicit CNetworkDetailsDialog(QWidget *parent = nullptr); + + //! Dtor + virtual ~CNetworkDetailsDialog() override; + + //! FSD setup + BlackMisc::Network::CFsdSetup getFsdSetup() const; + + //! Voice setup + BlackMisc::Audio::CVoiceSetup getVoiceSetup() const; + + //! Login mode + BlackCore::INetwork::LoginMode getLoginMode() const; + + private: + QScopedPointer ui; + }; + } // ns +} // ns + +#endif // guard diff --git a/src/blackgui/components/networkdetailsdialog.ui b/src/blackgui/components/networkdetailsdialog.ui new file mode 100644 index 000000000..3d4654156 --- /dev/null +++ b/src/blackgui/components/networkdetailsdialog.ui @@ -0,0 +1,88 @@ + + + CNetworkDetailsDialog + + + + 0 + 0 + 300 + 200 + + + + + 300 + 200 + + + + Network details + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + BlackGui::Components::CNetworkDetailsComponent + QFrame +
blackgui/components/networkdetailscomponent.h
+ 1 +
+
+ + + + bb_NetworkDetailsDialog + accepted() + CNetworkDetailsDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + bb_NetworkDetailsDialog + rejected() + CNetworkDetailsDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +