mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +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();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
const QString v = QString(" (").append(QString::number(count)).append(")");
|
||||
|
||||
@@ -41,12 +41,6 @@ namespace BlackGui
|
||||
//! Position of main window
|
||||
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)"
|
||||
static QString replaceTabCountValue(const QString &oldName, int count);
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ public:
|
||||
enum CoreMode
|
||||
{
|
||||
CoreInGuiProcess,
|
||||
CoreExternal,
|
||||
CoreExternalAudioLocal
|
||||
CoreExternalCoreAudio,
|
||||
CoreExternalAudioGui
|
||||
};
|
||||
|
||||
//! String to core mode
|
||||
@@ -29,14 +29,14 @@ public:
|
||||
{
|
||||
QString cm(m.toLower().trimmed());
|
||||
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(CoreExternalAudioLocal)) { return CoreExternalAudioLocal; }
|
||||
if (m == coreModeToString(CoreExternalAudioGui)) { return CoreExternalAudioGui; }
|
||||
|
||||
// some alternative names
|
||||
if (cm.contains("audiolocal")) { return CoreExternalAudioLocal; }
|
||||
if (cm.contains("localaudio")) { return CoreExternalAudioLocal; }
|
||||
if (cm.contains("external")) { return CoreExternal; }
|
||||
if (cm.contains("audiolocal")) { return CoreExternalAudioGui; }
|
||||
if (cm.contains("localaudio")) { return CoreExternalAudioGui; }
|
||||
if (cm.contains("external")) { return CoreExternalCoreAudio; }
|
||||
if (cm.contains("gui")) { return CoreInGuiProcess; }
|
||||
return CoreInGuiProcess;
|
||||
}
|
||||
@@ -47,8 +47,8 @@ public:
|
||||
switch (mode)
|
||||
{
|
||||
case CoreInGuiProcess: return "coreinguiprocess";
|
||||
case CoreExternal: return "coreexternal";
|
||||
case CoreExternalAudioLocal: return "coreexternalaudiolocal";
|
||||
case CoreExternalCoreAudio: return "coreexternal";
|
||||
case CoreExternalAudioGui: return "coreexternalaudiogui";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -130,13 +130,13 @@ int main(int argc, char *argv[])
|
||||
BlackCore::CRuntimeConfig runtimeConfig;
|
||||
switch (coreMode)
|
||||
{
|
||||
case GuiModes::CoreExternal:
|
||||
case GuiModes::CoreExternalCoreAudio:
|
||||
runtimeConfig = CRuntimeConfig::remote(dBusAddress);
|
||||
break;
|
||||
case GuiModes::CoreInGuiProcess:
|
||||
runtimeConfig = CRuntimeConfig::local(dBusAddress);
|
||||
break;
|
||||
case GuiModes::CoreExternalAudioLocal:
|
||||
case GuiModes::CoreExternalAudioGui:
|
||||
runtimeConfig = CRuntimeConfig::remoteLocalAudio(dBusAddress);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ SwiftGuiStd::~SwiftGuiStd()
|
||||
|
||||
void SwiftGuiStd::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
if (!handleMousePressEvent(event)) { QMainWindow::mouseMoveEvent(event); }
|
||||
if (!handleMouseMoveEvent(event)) { QMainWindow::mouseMoveEvent(event); }
|
||||
}
|
||||
|
||||
void SwiftGuiStd::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
@@ -41,8 +41,6 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
||||
this->setWindowTitle(CProject::versionStringDevBetaInfo());
|
||||
this->setObjectName("SwiftGuiStd");
|
||||
this->initStyleSheet();
|
||||
QPoint pos = CGuiUtility::introWindowPosition();
|
||||
this->move(pos);
|
||||
|
||||
// with frameless window, we shift menu and statusbar into central widget
|
||||
// http://stackoverflow.com/questions/18316710/frameless-and-transparent-window-qt5
|
||||
|
||||
Reference in New Issue
Block a user