Commit 6a338c41 authored by Carsten Fuhrmann's avatar Carsten Fuhrmann

using different icons for mute states

parent 23825383
#include "ChannelListWidget.h"
#include <QMouseEvent>
#include <Windows.h>
#include <qboxlayout.h>
#include <QBoxLayout>
#include <QFile>
#include <QApplication>
......@@ -119,7 +119,6 @@ ChannelListWidget::ChannelListWidget(QWidget *parent)
m_maxIcon.addPixmap(QPixmap::fromImage(std::move(tempImage)));
}
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::SplashScreen);
move(320, 200);
......
......@@ -78,7 +78,6 @@ protected:
virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
public:
QTreeWidget* getTree();
signals:
......
Resources/channel.png

2.98 KB | W: | H:

Resources/channel.png

403 Bytes | W: | H:

Resources/channel.png
Resources/channel.png
Resources/channel.png
Resources/channel.png
  • 2-up
  • Swipe
  • Onion skin
Resources/client.png

3.22 KB | W: | H:

Resources/client.png

647 Bytes | W: | H:

Resources/client.png
Resources/client.png
Resources/client.png
Resources/client.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -28,7 +28,10 @@ OverlayController::OverlayController(const struct TS3Functions funcs, quint64 se
m_treeState = full;
m_channelIcon.addFile("plugins\\qtTsOverlay\\channel.png");
m_clientIcon.addFile("plugins\\qtTsOverlay\\client.png");
m_clientIcon.normal.addFile("plugins\\qtTsOverlay\\client.png");
m_clientIcon.microMute.addFile("plugins\\qtTsOverlay\\microMute.png");
m_clientIcon.speakerMute.addFile("plugins\\qtTsOverlay\\speakerMute.png");
m_clientIcon.doubleMute.addFile("plugins\\qtTsOverlay\\doubleMute.png");
QFile styleSheet("plugins\\qtTsOverlay\\label.styl");
styleSheet.open(QIODevice::ReadOnly);
......@@ -366,7 +369,30 @@ void OverlayController::updateClientList()
{
QTreeWidgetItem* tmp = new QTreeWidgetItem;
tmp->setData(0, Qt::DisplayRole, clientID2Name(m_SCHID, clientIDList[i]));
tmp->setIcon(0, m_clientIcon);
int value[3];
if (m_ts3.getClientVariableAsInt(m_SCHID, clientIDList[i], CLIENT_INPUT_MUTED, &value[0]) != ERROR_ok)
value[0] = -1;
if (m_ts3.getClientVariableAsInt(m_SCHID, clientIDList[i], CLIENT_OUTPUT_MUTED, &value[1]) != ERROR_ok)
value[1] = -1;
if (m_ts3.getClientVariableAsInt(m_SCHID, clientIDList[i], CLIENT_INPUT_HARDWARE, &value[2]) != ERROR_ok)
value[2] = -1;
// missing information
if(value[0] == -1 || value[1] == -1 || value[2] == -1)
tmp->setIcon(0, m_clientIcon.normal);
// double muted
else if((value[0] || !value[2]) && value[1])
tmp->setIcon(0, m_clientIcon.doubleMute);
// micro muted
else if(value[0] || !value[2])
tmp->setIcon(0, m_clientIcon.microMute);
// speaker muted
else if(value[1])
tmp->setIcon(0, m_clientIcon.speakerMute);
// nothing muted
else
tmp->setIcon(0, m_clientIcon.normal);
tmp->setData(1, Qt::UserRole, clientIDList[i]);
tmp->setData(2, Qt::UserRole, client);
m_clientList.push_back(tmp);
......
......@@ -45,7 +45,12 @@ private:
int m_speakerOffset;
QIcon m_channelIcon;
QIcon m_clientIcon;
struct {
QIcon normal;
QIcon microMute;
QIcon speakerMute;
QIcon doubleMute;
} m_clientIcon;
QString m_stylesheet;
QLabel* m_debugWindow;
......
......@@ -438,27 +438,6 @@ void ts3plugin_onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, a
void ts3plugin_onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* timeoutMessage) {
getController(serverConnectionHandlerID)->updateClientList();
QString ClientName = clientID2Name(serverConnectionHandlerID, clientID);
QString oldChannel = channelID2Name(serverConnectionHandlerID, oldChannelID);
QString newChannel = channelID2Name(serverConnectionHandlerID, newChannelID);
anyID myID;
ts3Functions.getClientID(serverConnectionHandlerID, &myID);
if (!ClientName.isEmpty() && !oldChannel.isEmpty() && !newChannel.isEmpty())
{
// joined my channel
if (newChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">timeout from</font> %2</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel));
// quit my channel
else if (oldChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">timeout to</font> %2</font>").arg(ClientName.toHtmlEscaped()).arg(newChannel));
// somewhere else
else
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 timeout from %2 to %3</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel).arg(newChannel));
}
}
void ts3plugin_onClientMoveMovedEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID moverID, const char* moverName, const char* moverUniqueIdentifier, const char* moveMessage) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment