mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #288, login mode buttons as GUI element
This commit is contained in:
committed by
Roland Winklmeier
parent
dae22f5a3f
commit
c6d14c31fd
42
src/blackgui/loginmodebuttons.cpp
Normal file
42
src/blackgui/loginmodebuttons.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/* Copyright (C) 2014
|
||||
* 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 and at http://www.swift-project.org/license.html. 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 "loginmodebuttons.h"
|
||||
#include "ui_loginmodebuttons.h"
|
||||
|
||||
using namespace BlackCore;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
|
||||
CLoginModeButtons::CLoginModeButtons(QWidget *parent) :
|
||||
QGroupBox(parent),
|
||||
ui(new Ui::CLoginModeButtons)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
CLoginModeButtons::~CLoginModeButtons()
|
||||
{ }
|
||||
|
||||
|
||||
BlackCore::INetwork::LoginMode BlackGui::CLoginModeButtons::getLoginMode() const
|
||||
{
|
||||
INetwork::LoginMode mode = INetwork::LoginNormal;
|
||||
if (this->ui->rb_LoginStealth->isChecked())
|
||||
{
|
||||
mode = INetwork::LoginStealth;
|
||||
}
|
||||
else if (this->ui->rb_LoginObserver->isChecked())
|
||||
{
|
||||
mode = INetwork::LoginAsObserver;
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
45
src/blackgui/loginmodebuttons.h
Normal file
45
src/blackgui/loginmodebuttons.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 2014
|
||||
* 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 and at http://www.swift-project.org/license.html. 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 BLACKMISC_LOGINMODEBUTTONS_H
|
||||
#define BLACKMISC_LOGINMODEBUTTONS_H
|
||||
|
||||
#include "blackcore/network.h"
|
||||
#include <QGroupBox>
|
||||
#include <QScopedPointer>
|
||||
|
||||
|
||||
namespace Ui { class CLoginModeButtons; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
|
||||
class CLoginModeButtons : public QGroupBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CLoginModeButtons(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CLoginModeButtons();
|
||||
|
||||
//! Get login mode, \sa BlackCore::INetwork::LoginMode
|
||||
BlackCore::INetwork::LoginMode getLoginMode() const;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CLoginModeButtons> ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
73
src/blackgui/loginmodebuttons.ui
Normal file
73
src/blackgui/loginmodebuttons.ui
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CLoginModeButtons</class>
|
||||
<widget class="QGroupBox" name="CLoginModeButtons">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>271</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Login mode </string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_LoginMode">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<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="QLabel" name="lbl_LognMode">
|
||||
<property name="text">
|
||||
<string>Login mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rb_LoginNormal">
|
||||
<property name="text">
|
||||
<string>Normal</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rb_LoginStealth">
|
||||
<property name="text">
|
||||
<string>Stealth</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rb_LoginObserver">
|
||||
<property name="text">
|
||||
<string>Observer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user