mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-06 17:53:23 +08:00
refs #205, added selection for DBus server to intro window
* 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
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "introwindow.h"
|
||||
#include "mainwindow.h"
|
||||
#include "guimodeenums.h"
|
||||
#include "blackcore/context_runtime_config.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include <QtGlobal>
|
||||
#include <QApplication>
|
||||
@@ -39,6 +40,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Dialog to decide external or internal core
|
||||
CIntroWindow intro;
|
||||
BlackCore::CRuntimeConfig runtimeConfig;
|
||||
if (intro.exec() == QDialog::Rejected)
|
||||
{
|
||||
return 0;
|
||||
@@ -47,13 +49,26 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
coreMode = intro.getCoreMode();
|
||||
windowMode = intro.getWindowMode();
|
||||
QString dbusAddress = BlackCore::CDBusServer::fixAddressToDBusAddress(intro.getDBusAddress());
|
||||
switch (windowMode)
|
||||
{
|
||||
case GuiModes::CoreExternal:
|
||||
runtimeConfig = BlackCore::CRuntimeConfig::remote(dbusAddress);
|
||||
break;
|
||||
case GuiModes::CoreInGuiProcess:
|
||||
runtimeConfig = BlackCore::CRuntimeConfig::local(dbusAddress);
|
||||
break;
|
||||
case GuiModes::CoreExternalAudioLocal:
|
||||
runtimeConfig = BlackCore::CRuntimeConfig::remoteLocalAudio(dbusAddress);
|
||||
break;
|
||||
}
|
||||
}
|
||||
intro.close();
|
||||
|
||||
// show window
|
||||
MainWindow w(windowMode);
|
||||
w.show();
|
||||
w.init(coreMode); // object is complete by now
|
||||
w.init(runtimeConfig); // object is complete by now
|
||||
int r = a.exec();
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user