Skip to content

Commit

Permalink
REFAC(client): Remove old tray icon code
Browse files Browse the repository at this point in the history
The existing code for the tray icon was ancient,
buggy and possibly entirely broken in more than one place.

This commit removes all tray related code, such that it can
be completely written from scratch.
  • Loading branch information
Hartmnt committed Sep 14, 2024
1 parent 5a63f67 commit 00f35bd
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 405 deletions.
4 changes: 0 additions & 4 deletions src/mumble/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ if(WIN32)
target_sources(mumble_client_object_lib PRIVATE
"GlobalShortcut_win.cpp"
"GlobalShortcut_win.h"
"Log_win.cpp"
"SharedMemory_win.cpp"
"TaskList.cpp"
"UserLockFile_win.cpp"
Expand Down Expand Up @@ -657,7 +656,6 @@ else()
PRIVATE
"GlobalShortcut_unix.cpp"
"GlobalShortcut_unix.h"
"Log_unix.cpp"
"os_unix.cpp"
)

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

Expand Down Expand Up @@ -1101,7 +1098,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
22 changes: 1 addition & 21 deletions src/mumble/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ 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]")));
// FIXME
}
}

Expand Down Expand Up @@ -910,26 +910,6 @@ void Log::processDeferredLogs() {
}
}

// Post a notification using the MainWindow's QSystemTrayIcon.
void Log::postQtNotification(MsgType mt, const QString &plain) {
if (Global::get().mw->qstiIcon->isSystemTrayAvailable() && Global::get().mw->qstiIcon->supportsMessages()) {
QSystemTrayIcon::MessageIcon msgIcon;
switch (mt) {
case DebugInfo:
case CriticalError:
msgIcon = QSystemTrayIcon::Critical;
break;
case Warning:
msgIcon = QSystemTrayIcon::Warning;
break;
default:
msgIcon = QSystemTrayIcon::Information;
break;
}
Global::get().mw->qstiIcon->showMessage(msgName(mt), plain, msgIcon);
}
}

LogMessage::LogMessage(Log::MsgType mt, const QString &console, const QString &terse, bool ownMessage,
const QString &overrideTTS, bool ignoreTTS)
: mt(mt), console(console), terse(terse), ownMessage(ownMessage), overrideTTS(overrideTTS), ignoreTTS(ignoreTTS) {
Expand Down
2 changes: 0 additions & 2 deletions src/mumble/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ class Log : public QObject {
unsigned int uiLastId;
QDate qdDate;
static const QStringList allowedSchemes();
void postNotification(MsgType mt, const QString &plain);
void postQtNotification(MsgType mt, const QString &plain);

public:
Log(QObject *p = nullptr);
Expand Down
105 changes: 0 additions & 105 deletions src/mumble/Log_macx.mm

This file was deleted.

68 changes: 0 additions & 68 deletions src/mumble/Log_unix.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions src/mumble/Log_win.cpp

This file was deleted.

5 changes: 0 additions & 5 deletions src/mumble/LookConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ static ConfigRegistrar registrar(1100, LookConfigNew);
LookConfig::LookConfig(Settings &st) : ConfigWidget(st) {
setupUi(this);

#ifndef Q_OS_MAC
if (!QSystemTrayIcon::isSystemTrayAvailable())
#endif
qgbTray->hide();

qcbLanguage->addItem(tr("System default"));
QDir d(QLatin1String(":"), QLatin1String("mumble_*.qm"), QDir::Name, QDir::Files);
foreach (const QString &key, d.entryList()) {
Expand Down
Loading

0 comments on commit 00f35bd

Please sign in to comment.