mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
refs #507, adjustments for launcher
* renamed GUI enum to reflect where audio runs * removed assumpted position, this is no longer possible as launcher is independet application
This commit is contained in:
committed by
Mathew Sutcliffe
parent
30e6831bf8
commit
746985fa3c
@@ -217,23 +217,6 @@ namespace BlackGui
|
|||||||
return (mw) ? mw->getWidget()->pos() : QPoint();
|
return (mw) ? mw->getWidget()->pos() : QPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint CGuiUtility::introWindowPosition()
|
|
||||||
{
|
|
||||||
QWidgetList tlw = topLevelApplicationWidgetsWithName();
|
|
||||||
foreach(QWidget * w, tlw)
|
|
||||||
{
|
|
||||||
QString n = w->objectName().toLower();
|
|
||||||
if (n.contains("intro")) { return w->pos(); }
|
|
||||||
}
|
|
||||||
return QPoint(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
QPoint CGuiUtility::assumedMainWindowPosition()
|
|
||||||
{
|
|
||||||
QPoint p = mainWindowPosition();
|
|
||||||
return (p.isNull()) ? introWindowPosition() : p;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CGuiUtility::replaceTabCountValue(const QString &oldName, int count)
|
QString CGuiUtility::replaceTabCountValue(const QString &oldName, int count)
|
||||||
{
|
{
|
||||||
const QString v = QString(" (").append(QString::number(count)).append(")");
|
const QString v = QString(" (").append(QString::number(count)).append(")");
|
||||||
|
|||||||
@@ -41,12 +41,6 @@ namespace BlackGui
|
|||||||
//! Position of main window
|
//! Position of main window
|
||||||
static QPoint mainWindowPosition();
|
static QPoint mainWindowPosition();
|
||||||
|
|
||||||
//! Position of intro window
|
|
||||||
static QPoint introWindowPosition();
|
|
||||||
|
|
||||||
//! During initialization, when main window position might not be set set
|
|
||||||
static QPoint assumedMainWindowPosition();
|
|
||||||
|
|
||||||
//! Replace count in name such as "stations (4)"
|
//! Replace count in name such as "stations (4)"
|
||||||
static QString replaceTabCountValue(const QString &oldName, int count);
|
static QString replaceTabCountValue(const QString &oldName, int count);
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ public:
|
|||||||
enum CoreMode
|
enum CoreMode
|
||||||
{
|
{
|
||||||
CoreInGuiProcess,
|
CoreInGuiProcess,
|
||||||
CoreExternal,
|
CoreExternalCoreAudio,
|
||||||
CoreExternalAudioLocal
|
CoreExternalAudioGui
|
||||||
};
|
};
|
||||||
|
|
||||||
//! String to core mode
|
//! String to core mode
|
||||||
@@ -29,14 +29,14 @@ public:
|
|||||||
{
|
{
|
||||||
QString cm(m.toLower().trimmed());
|
QString cm(m.toLower().trimmed());
|
||||||
if (cm.isEmpty()) { return CoreInGuiProcess; }
|
if (cm.isEmpty()) { return CoreInGuiProcess; }
|
||||||
if (m == coreModeToString(CoreExternal)) { return CoreExternal; }
|
if (m == coreModeToString(CoreExternalCoreAudio)) { return CoreExternalCoreAudio; }
|
||||||
if (m == coreModeToString(CoreInGuiProcess)) { return CoreInGuiProcess; }
|
if (m == coreModeToString(CoreInGuiProcess)) { return CoreInGuiProcess; }
|
||||||
if (m == coreModeToString(CoreExternalAudioLocal)) { return CoreExternalAudioLocal; }
|
if (m == coreModeToString(CoreExternalAudioGui)) { return CoreExternalAudioGui; }
|
||||||
|
|
||||||
// some alternative names
|
// some alternative names
|
||||||
if (cm.contains("audiolocal")) { return CoreExternalAudioLocal; }
|
if (cm.contains("audiolocal")) { return CoreExternalAudioGui; }
|
||||||
if (cm.contains("localaudio")) { return CoreExternalAudioLocal; }
|
if (cm.contains("localaudio")) { return CoreExternalAudioGui; }
|
||||||
if (cm.contains("external")) { return CoreExternal; }
|
if (cm.contains("external")) { return CoreExternalCoreAudio; }
|
||||||
if (cm.contains("gui")) { return CoreInGuiProcess; }
|
if (cm.contains("gui")) { return CoreInGuiProcess; }
|
||||||
return CoreInGuiProcess;
|
return CoreInGuiProcess;
|
||||||
}
|
}
|
||||||
@@ -47,8 +47,8 @@ public:
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case CoreInGuiProcess: return "coreinguiprocess";
|
case CoreInGuiProcess: return "coreinguiprocess";
|
||||||
case CoreExternal: return "coreexternal";
|
case CoreExternalCoreAudio: return "coreexternal";
|
||||||
case CoreExternalAudioLocal: return "coreexternalaudiolocal";
|
case CoreExternalAudioGui: return "coreexternalaudiogui";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,13 +130,13 @@ int main(int argc, char *argv[])
|
|||||||
BlackCore::CRuntimeConfig runtimeConfig;
|
BlackCore::CRuntimeConfig runtimeConfig;
|
||||||
switch (coreMode)
|
switch (coreMode)
|
||||||
{
|
{
|
||||||
case GuiModes::CoreExternal:
|
case GuiModes::CoreExternalCoreAudio:
|
||||||
runtimeConfig = CRuntimeConfig::remote(dBusAddress);
|
runtimeConfig = CRuntimeConfig::remote(dBusAddress);
|
||||||
break;
|
break;
|
||||||
case GuiModes::CoreInGuiProcess:
|
case GuiModes::CoreInGuiProcess:
|
||||||
runtimeConfig = CRuntimeConfig::local(dBusAddress);
|
runtimeConfig = CRuntimeConfig::local(dBusAddress);
|
||||||
break;
|
break;
|
||||||
case GuiModes::CoreExternalAudioLocal:
|
case GuiModes::CoreExternalAudioGui:
|
||||||
runtimeConfig = CRuntimeConfig::remoteLocalAudio(dBusAddress);
|
runtimeConfig = CRuntimeConfig::remoteLocalAudio(dBusAddress);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ SwiftGuiStd::~SwiftGuiStd()
|
|||||||
|
|
||||||
void SwiftGuiStd::mouseMoveEvent(QMouseEvent *event)
|
void SwiftGuiStd::mouseMoveEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (!handleMousePressEvent(event)) { QMainWindow::mouseMoveEvent(event); }
|
if (!handleMouseMoveEvent(event)) { QMainWindow::mouseMoveEvent(event); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwiftGuiStd::mousePressEvent(QMouseEvent *event)
|
void SwiftGuiStd::mousePressEvent(QMouseEvent *event)
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
|||||||
this->setWindowTitle(CProject::versionStringDevBetaInfo());
|
this->setWindowTitle(CProject::versionStringDevBetaInfo());
|
||||||
this->setObjectName("SwiftGuiStd");
|
this->setObjectName("SwiftGuiStd");
|
||||||
this->initStyleSheet();
|
this->initStyleSheet();
|
||||||
QPoint pos = CGuiUtility::introWindowPosition();
|
|
||||||
this->move(pos);
|
|
||||||
|
|
||||||
// with frameless window, we shift menu and statusbar into central widget
|
// with frameless window, we shift menu and statusbar into central widget
|
||||||
// http://stackoverflow.com/questions/18316710/frameless-and-transparent-window-qt5
|
// http://stackoverflow.com/questions/18316710/frameless-and-transparent-window-qt5
|
||||||
|
|||||||
Reference in New Issue
Block a user