Skip to content
Permalink
Browse files

Add `UserRenamed` `MsgType`

Categorise rename logmessages for themselves allowing users to filter
them how they please. Closes #1728
  • Loading branch information...
s1gtrap authored and mkrautz committed Jun 27, 2015
1 parent b4d48ef commit 46cb8a371b1be08e013ed25e41cbf871c347f946
Showing with 7 additions and 4 deletions.
  1. +3 −1 src/mumble/Log.cpp
  2. +2 −2 src/mumble/Log.h
  3. +1 −1 src/mumble/Messages.cpp
  4. +1 −0 src/mumble/Settings.cpp
@@ -230,6 +230,7 @@ const Log::MsgType Log::msgOrder[] = {
UserJoin, UserLeave,
Recording,
YouKicked, UserKicked,
UserRenamed,
SelfMute, SelfUnmute, SelfDeaf, SelfUndeaf,
OtherSelfMute, YouMuted, YouMutedOther, OtherMutedOther,
ChannelJoin, ChannelLeave,
@@ -260,7 +261,8 @@ const char *Log::msgNames[] = {
QT_TRANSLATE_NOOP("Log", "Text Message"),
QT_TRANSLATE_NOOP("Log", "You self-unmuted"),
QT_TRANSLATE_NOOP("Log", "You self-deafened"),
QT_TRANSLATE_NOOP("Log", "You self-undeafened")
QT_TRANSLATE_NOOP("Log", "You self-undeafened"),
QT_TRANSLATE_NOOP("Log", "User renamed")
};

QString Log::msgName(MsgType t) const {
@@ -71,10 +71,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 };
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 };
enum LogColorType { Time, Server, Privilege, Source, Target };
static const MsgType firstMsgType = DebugInfo;
static const MsgType lastMsgType = SelfUndeaf;
static const MsgType lastMsgType = UserRenamed;

// Display order in settingsscreen, allows to insert new events without breaking config-compatibility with older versions.
static const MsgType msgOrder[];
@@ -522,7 +522,7 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) {
QString newName = u8(msg.name());
pmModel->renameUser(pDst, newName);
if (! oldName.isNull() && oldName != newName) {
g.l->log(Log::Information, tr("%1 renamed to %2.").arg(Log::formatClientUser(pDst, Log::Target, oldName),
g.l->log(Log::UserRenamed, tr("%1 renamed to %2.").arg(Log::formatClientUser(pDst, Log::Target, oldName),
Log::formatClientUser(pDst, Log::Target)));
}
}
@@ -442,6 +442,7 @@ Settings::Settings() {
qmMessages[Log::UserKicked] = Settings::LogConsole;
qmMessages[Log::OtherSelfMute] = Settings::LogConsole;
qmMessages[Log::OtherMutedOther] = Settings::LogConsole;
qmMessages[Log::UserRenamed] = Settings::LogConsole;
}

bool Settings::doEcho() const {

0 comments on commit 46cb8a3

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