Skip to content
Permalink
Browse files

Merge PR #3442: Add configurable "User connected and entered channel"…

… and "User left channel and disconnected" messages
  • Loading branch information...
davidebeatrici committed Jul 7, 2018
2 parents e54f60f + a3c2242 commit 07c8e00e295b44ffacf9407d56b110f188ae1a4b
Showing with 21 additions and 6 deletions.
  1. +3 −0 src/mumble/Log.cpp
  2. +2 −2 src/mumble/Log.h
  3. +2 −2 src/mumble/Messages.cpp
  4. +2 −0 src/mumble/Settings.cpp
  5. +12 −2 src/mumble/mumble_en.ts
@@ -213,6 +213,7 @@ const Log::MsgType Log::msgOrder[] = {
OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther,
SelfChannelJoin, SelfChannelJoinOther,
ChannelJoin, ChannelLeave,
ChannelJoinConnect, ChannelLeaveDisconnect,
PermissionDenied,
TextMessage
};
@@ -244,6 +245,8 @@ const char *Log::msgNames[] = {
QT_TRANSLATE_NOOP("Log", "User renamed"),
QT_TRANSLATE_NOOP("Log", "You Joined Channel"),
QT_TRANSLATE_NOOP("Log", "You Joined Channel (moved)"),
QT_TRANSLATE_NOOP("Log", "User connected and entered channel"),
QT_TRANSLATE_NOOP("Log", "User left channel and disconnected")
};

QString Log::msgName(MsgType t) const {
@@ -44,10 +44,10 @@ class Log : public QObject {
Q_OBJECT
Q_DISABLE_COPY(Log)
public:
enum MsgType { DebugInfo, CriticalError, Warning, Information, ServerConnected, ServerDisconnected, UserJoin, UserLeave, Recording, YouKicked, UserKicked, SelfMute, OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther, ChannelJoin, ChannelLeave, PermissionDenied, TextMessage, SelfUnmute, SelfDeaf, SelfUndeaf, UserRenamed, SelfChannelJoin, SelfChannelJoinOther };
enum MsgType { DebugInfo, CriticalError, Warning, Information, ServerConnected, ServerDisconnected, UserJoin, UserLeave, Recording, YouKicked, UserKicked, SelfMute, OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther, ChannelJoin, ChannelLeave, PermissionDenied, TextMessage, SelfUnmute, SelfDeaf, SelfUndeaf, UserRenamed, SelfChannelJoin, SelfChannelJoinOther, ChannelJoinConnect, ChannelLeaveDisconnect };
enum LogColorType { Time, Server, Privilege, Source, Target };
static const MsgType firstMsgType = DebugInfo;
static const MsgType lastMsgType = SelfChannelJoinOther;
static const MsgType lastMsgType = ChannelLeaveDisconnect;

// Display order in settingsscreen, allows to insert new events without breaking config-compatibility with older versions.
static const MsgType msgOrder[];
@@ -282,7 +282,7 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) {
}

if (pSelf && pDst->cChannel == pSelf->cChannel) {
g.l->log(Log::ChannelJoin, tr("%1 connected and entered channel.").arg(Log::formatClientUser(pDst, Log::Source)));
g.l->log(Log::ChannelJoinConnect, tr("%1 connected and entered channel.").arg(Log::formatClientUser(pDst, Log::Source)));
} else {
g.l->log(Log::UserJoin, tr("%1 connected.").arg(Log::formatClientUser(pDst, Log::Source)));
}
@@ -581,7 +581,7 @@ void MainWindow::msgUserRemove(const MumbleProto::UserRemove &msg) {
g.l->log((pSrc == pSelf) ? Log::YouKicked : Log::UserKicked, tr("%3 was kicked from the server by %1: %2.").arg(Log::formatClientUser(pSrc, Log::Source)).arg(reason).arg(Log::formatClientUser(pDst, Log::Target)));
} else {
if (pDst->cChannel == pSelf->cChannel || pDst->cChannel->allLinks().contains(pSelf->cChannel)) {
g.l->log(Log::UserLeave, tr("%1 left channel and disconnected.").arg(Log::formatClientUser(pDst, Log::Source)));
g.l->log(Log::ChannelLeaveDisconnect, tr("%1 left channel and disconnected.").arg(Log::formatClientUser(pDst, Log::Source)));
} else {
g.l->log(Log::UserLeave, tr("%1 disconnected.").arg(Log::formatClientUser(pDst, Log::Source)));
}
@@ -425,6 +425,8 @@ Settings::Settings() {
qmMessageSounds[Log::TextMessage] = QLatin1String(":/TextMessage.ogg");
qmMessageSounds[Log::ChannelJoin] = QLatin1String(":/UserJoinedChannel.ogg");
qmMessageSounds[Log::ChannelLeave] = QLatin1String(":/UserLeftChannel.ogg");
qmMessageSounds[Log::ChannelJoinConnect] = qmMessageSounds[Log::ChannelJoin];
qmMessageSounds[Log::ChannelLeaveDisconnect] = qmMessageSounds[Log::UserLeave];
qmMessageSounds[Log::YouMutedOther] = QLatin1String(":/UserMutedYouOrByYou.ogg");
qmMessageSounds[Log::YouMuted] = QLatin1String(":/UserMutedYouOrByYou.ogg");
qmMessageSounds[Log::YouKicked] = QLatin1String(":/UserKickedYouOrByYou.ogg");
@@ -3960,7 +3960,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<context>
<name>Log</name>
<message>
<location filename="Log.cpp" line="+221"/>
<location filename="Log.cpp" line="+222"/>
<source>Debug</source>
<translation type="unfinished"></translation>
</message>
@@ -4089,6 +4089,16 @@ This field describes the size of an LCD device. The size is given either in pixe
<source>You Joined Channel (moved)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>User connected and entered channel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>User left channel and disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+59"/>
<source>the server</source>
@@ -4139,7 +4149,7 @@ This field describes the size of an LCD device. The size is given either in pixe
<context>
<name>LogConfig</name>
<message>
<location line="-495"/>
<location line="-498"/>
<source>Toggle console for %1 events</source>
<translation type="unfinished"></translation>
</message>

0 comments on commit 07c8e00

Please sign in to comment.
You can’t perform that action at this time.