mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T640, FSD details as UI component and dialog
This commit is contained in:
45
src/blackgui/components/networkdetailscomponent.cpp
Normal file
45
src/blackgui/components/networkdetailscomponent.cpp
Normal file
@@ -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
|
||||
53
src/blackgui/components/networkdetailscomponent.h
Normal file
53
src/blackgui/components/networkdetailscomponent.h
Normal file
@@ -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 <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#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::CNetworkDetailsComponent> ui;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
177
src/blackgui/components/networkdetailscomponent.ui
Normal file
177
src/blackgui/components/networkdetailscomponent.ui
Normal file
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CNetworkDetailsComponent</class>
|
||||
<widget class="QFrame" name="CNetworkDetailsComponent">
|
||||
<property name="windowTitle">
|
||||
<string>Network details</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_FsdDetailsComponent">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tw_Details">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tb_LoginMode">
|
||||
<attribute name="title">
|
||||
<string>Mode</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_LoginMode">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="BlackGui::CLoginModeButtons" name="frp_LoginMode"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_FsdDetails">
|
||||
<attribute name="title">
|
||||
<string>FSD details</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_FsdDetails">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="sa_FsdDetails">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="qw_FsdDetails">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>192</width>
|
||||
<height>55</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_ScrollAreaFsdDetails">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Editors::CFsdSetupForm" name="form_FsdDetails"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_Voice">
|
||||
<attribute name="title">
|
||||
<string>Voice</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_Voice">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="BlackGui::Editors::CVoiceSetupForm" name="form_Voice"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_MatchingLog">
|
||||
<attribute name="title">
|
||||
<string>Matching log</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_MatchingLog">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="BlackGui::Components::CModelMatcherLogEnable" name="comp_MatchingLogEnabled"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CFsdSetupForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/fsdsetupform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CVoiceSetupForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/voicesetupform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CModelMatcherLogEnable</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/modelmatcherlogenable.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::CLoginModeButtons</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/loginmodebuttons.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
45
src/blackgui/components/networkdetailsdialog.cpp
Normal file
45
src/blackgui/components/networkdetailsdialog.cpp
Normal file
@@ -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
|
||||
53
src/blackgui/components/networkdetailsdialog.h
Normal file
53
src/blackgui/components/networkdetailsdialog.h
Normal file
@@ -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 <QDialog>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#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::CNetworkDetailsDialog> ui;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
88
src/blackgui/components/networkdetailsdialog.ui
Normal file
88
src/blackgui/components/networkdetailsdialog.ui
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CNetworkDetailsDialog</class>
|
||||
<widget class="QDialog" name="CNetworkDetailsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>200</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Network details</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CNetworkDetailsComponent" name="comp_NetworkDetails">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="bb_NetworkDetailsDialog">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CNetworkDetailsComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/networkdetailscomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>bb_NetworkDetailsDialog</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>CNetworkDetailsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>bb_NetworkDetailsDialog</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>CNetworkDetailsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user