Skip to content

Commit 29869fb

Browse files
committed
Polish the Syphon server picker and status
- Picker shows a live status line that doubles as an empty state: "No Syphon servers found yet..." when none are advertised, otherwise "%n server(s) available" (the list already refreshes automatically every second). - Picker entries get a tooltip with the full identity (application, server name, UUID). - Property panel now distinguishes "No server selected" from "Waiting for server..." and "Connected".
1 parent e8a47b9 commit 29869fb

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

src/gui/SourceGui.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,16 @@ void SyphonGui::_rebuildServerEnum()
321321

322322
void SyphonGui::_updateStatus()
323323
{
324-
_statusItem->setValue(syphon->isConnected() ? tr("Connected")
325-
: tr("Waiting for server…"));
324+
QString status;
325+
if (syphon->isConnected())
326+
status = tr("Connected");
327+
else if (syphon->getServerUUID().isEmpty() &&
328+
syphon->getServerName().isEmpty() &&
329+
syphon->getAppName().isEmpty())
330+
status = tr("No server selected");
331+
else
332+
status = tr("Waiting for server…");
333+
_statusItem->setValue(status);
326334
}
327335

328336
void SyphonGui::refreshServers()

src/gui/SyphonServerDialog.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
#include <QTimer>
2929
#include <QIcon>
3030
#include <QPixmap>
31+
#include <QStringList>
3132

3233
namespace mmp {
3334

3435
SyphonServerDialog::SyphonServerDialog(QWidget* parent)
3536
: QDialog(parent),
3637
_list(nullptr),
38+
_statusLabel(nullptr),
3739
_timer(nullptr)
3840
{
3941
setWindowTitle(tr("Add Syphon Source"));
@@ -48,6 +50,12 @@ SyphonServerDialog::SyphonServerDialog(QWidget* parent)
4850
_list = new QListWidget(this);
4951
layout->addWidget(_list);
5052

53+
// Live status line (updated by refresh()); the list refreshes automatically.
54+
_statusLabel = new QLabel(this);
55+
_statusLabel->setWordWrap(true);
56+
_statusLabel->setEnabled(false); // muted look
57+
layout->addWidget(_statusLabel);
58+
5159
QDialogButtonBox* buttons =
5260
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
5361
layout->addWidget(buttons);
@@ -85,8 +93,24 @@ void SyphonServerDialog::refresh()
8593
QListWidgetItem* item = new QListWidgetItem(text, _list);
8694
if (!_servers[i].icon.isNull())
8795
item->setIcon(QIcon(QPixmap::fromImage(_servers[i].icon)));
96+
97+
// Tooltip with the full identity (app, server name, UUID).
98+
QStringList tip;
99+
if (!_servers[i].appName.isEmpty()) tip << tr("Application: %1").arg(_servers[i].appName);
100+
if (!_servers[i].name.isEmpty()) tip << tr("Server: %1").arg(_servers[i].name);
101+
if (!_servers[i].uuid.isEmpty()) tip << tr("ID: %1").arg(_servers[i].uuid);
102+
item->setToolTip(tip.join('\n'));
88103
}
89104

105+
// Update the live status line (also serves as the "no servers" empty state).
106+
if (_servers.isEmpty())
107+
_statusLabel->setText(tr("No Syphon servers found yet. Open a Syphon-enabled "
108+
"app (Resolume, VDMX, a Simple Server, …), or create "
109+
"the source now and connect it later."));
110+
else
111+
_statusLabel->setText(tr("%n Syphon server(s) available. The list updates "
112+
"automatically.", "", _servers.size()));
113+
90114
// Restore a sensible selection.
91115
int restore;
92116
if (prevRow < 0)

src/gui/SyphonServerDialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
class QListWidget;
3333
class QTimer;
34+
class QLabel;
3435

3536
namespace mmp {
3637

@@ -57,6 +58,7 @@ private slots:
5758

5859
private:
5960
QListWidget* _list;
61+
QLabel* _statusLabel;
6062
QTimer* _timer;
6163
QList<SyphonServerDescription> _servers;
6264
};

0 commit comments

Comments
 (0)