mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
* changed init of main window to CRuntimeConfig, btw. makes 8 in https://dev.vatsim-germany.org/issues/199 redundant * coreMode in main window gone * mode for external / local audio
74 lines
1.8 KiB
C++
74 lines
1.8 KiB
C++
#include "introwindow.h"
|
|
#include "ui_introwindow.h"
|
|
#include "blackcore/dbus_server.h"
|
|
#include "blackmisc/networkutils.h"
|
|
#include <QDesktopServices>
|
|
#include <QUrl>
|
|
|
|
/*
|
|
* Constructor
|
|
*/
|
|
CIntroWindow::CIntroWindow(QWidget *parent) :
|
|
QDialog(parent, Qt::Tool),
|
|
ui(new Ui::CIntroWindow)
|
|
{
|
|
ui->setupUi(this);
|
|
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
|
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::sessionDBusServer());
|
|
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::systemDBusServer());
|
|
this->ui->cb_DBusServer->addItems(BlackMisc::CNetworkUtils::getKnownIpAddresses());
|
|
this->ui->cb_DBusServer->setCurrentIndex(0);
|
|
}
|
|
|
|
/*
|
|
* Destructor
|
|
*/
|
|
CIntroWindow::~CIntroWindow() { }
|
|
|
|
/*
|
|
* Window mode
|
|
*/
|
|
GuiModes::WindowMode CIntroWindow::getWindowMode() const
|
|
{
|
|
if (this->ui->rb_WindowFrameless->isChecked())
|
|
return GuiModes::WindowFrameless;
|
|
else
|
|
return GuiModes::WindowNormal;
|
|
}
|
|
|
|
/*
|
|
* Core mode
|
|
*/
|
|
GuiModes::CoreMode CIntroWindow::getCoreMode() const
|
|
{
|
|
if (this->ui->rb_CoreExternalVoiceLocal->isChecked())
|
|
return GuiModes::CoreExternalAudioLocal;
|
|
else if (this->ui->rb_CoreInGuiProcess->isChecked())
|
|
return GuiModes::CoreInGuiProcess;
|
|
else
|
|
return GuiModes::CoreExternal;
|
|
}
|
|
/*
|
|
* DBus server address
|
|
*/
|
|
QString CIntroWindow::getDBusAddress() const
|
|
{
|
|
return this->ui->cb_DBusServer->currentText();
|
|
}
|
|
|
|
/*
|
|
* Button clicked
|
|
*/
|
|
void CIntroWindow::buttonClicked() const
|
|
{
|
|
QObject *sender = QObject::sender();
|
|
if (sender == this->ui->pb_ModelDb)
|
|
{
|
|
QDesktopServices::openUrl(QUrl("http://vatrep.vatsim-germany.org/page/index.php", QUrl::TolerantMode));
|
|
}
|
|
else if (sender == this->ui->pb_WebSite)
|
|
{
|
|
QDesktopServices::openUrl(QUrl("https://dev.vatsim-germany.org/", QUrl::TolerantMode));
|
|
}
|
|
}
|