mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Ref T417, SimBrief download dialog
This commit is contained in:
committed by
Mat Sutcliffe
parent
88373744f8
commit
179cdb1b6d
51
src/blackgui/components/simbriefdownloaddialog.cpp
Normal file
51
src/blackgui/components/simbriefdownloaddialog.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/* 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 "simbriefdownloaddialog.h"
|
||||
#include "ui_simbriefdownloaddialog.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
CSimBriefDownloadDialog::CSimBriefDownloadDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CSimBriefDownloadDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
CSimBriefDownloadDialog::~CSimBriefDownloadDialog()
|
||||
{ }
|
||||
|
||||
CSimBriefData CSimBriefDownloadDialog::getSimBriefData() const
|
||||
{
|
||||
return CSimBriefData(ui->le_SimBriefURL->text().trimmed(), ui->le_SimBriefUsername->text().trimmed());
|
||||
}
|
||||
|
||||
void CSimBriefDownloadDialog::setSimBriefData(const CSimBriefData &data)
|
||||
{
|
||||
ui->le_SimBriefURL->setText(data.getUrl());
|
||||
ui->le_SimBriefUsername->setText(data.getUsername());
|
||||
}
|
||||
|
||||
int CSimBriefDownloadDialog::exec()
|
||||
{
|
||||
this->setSimBriefData(m_simBrief.get());
|
||||
const int r = QDialog::exec();
|
||||
if (r == Accepted)
|
||||
{
|
||||
m_simBrief.set(this->getSimBriefData());
|
||||
}
|
||||
return r;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
Reference in New Issue
Block a user