Skip to content

Commit

Permalink
FIX(client): Experimental notifications on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartmnt committed Jun 23, 2024
1 parent a1e8ad1 commit 4c5ef7e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 140 deletions.
4 changes: 0 additions & 4 deletions src/mumble/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ if(WIN32)
target_sources(mumble_client_object_lib PRIVATE
"GlobalShortcut_win.cpp"
"GlobalShortcut_win.h"
"Log_generic.cpp"
"SharedMemory_win.cpp"
"TaskList.cpp"
"UserLockFile_win.cpp"
Expand Down Expand Up @@ -658,7 +657,6 @@ else()
PRIVATE
"GlobalShortcut_unix.cpp"
"GlobalShortcut_unix.h"
"Log_generic.cpp"
"os_unix.cpp"
)

Expand All @@ -682,7 +680,6 @@ else()
"AppNap.mm"
"GlobalShortcut_macx.h"
"GlobalShortcut_macx.mm"
"Log_macx.mm"
"os_macx.mm"
)

Expand Down Expand Up @@ -1102,7 +1099,6 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
set_source_files_properties(
"AppNap.mm"
"GlobalShortcut_macx.mm"
"Log_macx.mm"
"os_macx.mm"
"TextToSpeech_macx.mm"
"Overlay_macx.mm"
Expand Down
21 changes: 20 additions & 1 deletion src/mumble/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,26 @@ void Log::log(MsgType mt, const QString &console, const QString &terse, bool own
// Message notification with balloon tooltips
if (flags & Settings::LogBalloon) {
// Replace any instances of a "Object Replacement Character" from QTextDocumentFragment::toPlainText
postNotification(mt, plain.replace("\xEF\xBF\xBC", tr("[embedded content]")));
plain = plain.replace("\xEF\xBF\xBC", tr("[embedded content]"));

QSystemTrayIcon::MessageIcon msgIcon;
switch (mt) {
case DebugInfo:
case CriticalError:
msgIcon = QSystemTrayIcon::Critical;
break;
case Warning:
msgIcon = QSystemTrayIcon::Warning;
break;
case TextMessage:
case PrivateTextMessage:
msgIcon = QSystemTrayIcon::NoIcon;
break;
default:
msgIcon = QSystemTrayIcon::Information;
break;
}
Global::get().trayIcon->showMessage(msgName(mt), plain, msgIcon);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/mumble/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ class Log : public QObject {
unsigned int uiLastId;
QDate qdDate;
static const QStringList allowedSchemes();
void postNotification(MsgType mt, const QString &plain);

public:
Log(QObject *p = nullptr);
Expand Down
29 changes: 0 additions & 29 deletions src/mumble/Log_generic.cpp

This file was deleted.

105 changes: 0 additions & 105 deletions src/mumble/Log_macx.mm

This file was deleted.

0 comments on commit 4c5ef7e

Please sign in to comment.