ListView {
id: studioListView
- x:0; y: 0; width: parent.width - (2 * x); height: parent.height - 36 * virtualstudio.uiScale
+ x:0;
+ y: 0;
+ width: parent.width
+ height: parent.height - (36 * virtualstudio.uiScale)
spacing: 16 * virtualstudio.uiScale
header: footer
footer: footer
clip: true
boundsBehavior: Flickable.StopAtBounds
delegate: Studio {
- x: 16 * virtualstudio.uiScale
- width: studioListView.width - (2 * x)
+ anchors.left: parent ? parent.left : undefined
+ anchors.leftMargin: 16 * virtualstudio.uiScale
+ width: studioListView.width - (32 * virtualstudio.uiScale)
serverLocation: virtualstudio.regions[modelData.location] ? "in " + virtualstudio.regions[modelData.location].label : ""
flagImage: modelData.bannerURL ? modelData.bannerURL : modelData.flag
studioName: modelData.name
m_studioSocketPtr->openSocket();
// Check if we have an address for our server
- if (m_currentStudio.status() != "Ready") {
+ if (m_currentStudio.status() != "Ready" || m_currentStudio.host().isEmpty()) {
m_connectionState = QStringLiteral("Waiting...");
emit connectionStateChanged();
} else {
if (!m_currentStudio.id().isEmpty()) {
emit openFeedbackSurveyModal(m_currentStudio.id());
- m_currentStudio.setId("");
+ m_currentStudio.clear();
emit currentStudioChanged();
}
QSharedPointer<VsServerInfo> serverInfo(new VsServerInfo(this));
serverInfo->setIsAdmin(servers.at(i)[QStringLiteral("admin")].toBool());
serverInfo->setName(servers.at(i)[QStringLiteral("name")].toString());
- serverInfo->setHost(servers.at(i)[QStringLiteral("serverHost")].toString());
+ // force these to be refreshed on connection
+ // they will only be set for the current studio
+ // serverInfo->setHost(servers.at(i)[QStringLiteral("serverHost")].toString());
+ // serverInfo->setPort(servers.at(i)[QStringLiteral("serverPort")].toInt());
+ // serverInfo->setSessionId(
+ // servers.at(i)[QStringLiteral("sessionId")].toString());
serverInfo->setIsManaged(servers.at(i)[QStringLiteral("managed")].toBool());
serverInfo->setStatus(servers.at(i)[QStringLiteral("status")].toString());
- serverInfo->setPort(servers.at(i)[QStringLiteral("serverPort")].toInt());
serverInfo->setIsPublic(servers.at(i)[QStringLiteral("public")].toBool());
serverInfo->setRegion(servers.at(i)[QStringLiteral("region")].toString());
serverInfo->setPeriod(servers.at(i)[QStringLiteral("period")].toInt());
serverInfo->setBannerURL(
servers.at(i)[QStringLiteral("bannerURL")].toString());
serverInfo->setId(servers.at(i)[QStringLiteral("id")].toString());
- serverInfo->setSessionId(
- servers.at(i)[QStringLiteral("sessionId")].toString());
serverInfo->setStreamId(servers.at(i)[QStringLiteral("streamId")].toString());
serverInfo->setInviteKey(
servers.at(i)[QStringLiteral("inviteKey")].toString());
QQuickStyle::setStyle("Basic");
+#if defined(Q_OS_MACOS) && (QT_VERSION > QT_VERSION_CHECK(6, 2, 6)) \
+ && (QT_VERSION < QT_VERSION_CHECK(6, 8, 0))
+ // work-around for screen sharing bugs in qtwebengine 6.2.7-6.7.x
+ qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-features=DesktopCaptureMacV2");
+#endif
+
// Initialize webengine
QtWebEngineQuick::initialize();
// TODO: Add support for QtWebView
bool VsServerInfo::canConnect() const
{
- return !m_host.isEmpty() && m_status == "Ready";
+ return m_status == "Ready";
}
bool VsServerInfo::canStart() const
void VsServerInfo::setHost(const QString& host)
{
m_host = host;
- emit canConnectChanged();
}
void VsServerInfo::setStatus(const QString& status)
{
m_status = status;
- emit canConnectChanged();
}
quint16 VsServerInfo::port() const
return name() < other.name();
}
+void VsServerInfo::clear()
+{
+ setId("");
+ setHost("");
+ setPort(0);
+ setSessionId("");
+}
+
VsServerInfo::~VsServerInfo() = default;