mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-27 08:49:19 +00:00
feat(MessagesCountNotifier): notify messages count on Windows with sys tray icon
This commit is contained in:
parent
f1d1577aa0
commit
ef1a3f8dd2
8 changed files with 25 additions and 86 deletions
|
|
@ -225,19 +225,12 @@ set(HEADERS
|
|||
|
||||
set(MAIN_FILE src/app/main.cpp)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierLinux.cpp)
|
||||
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierLinux.hpp)
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierWindows.cpp)
|
||||
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierWindows.hpp)
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierMacOs.m)
|
||||
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierMacOs.hpp)
|
||||
else ()
|
||||
list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierSystemTrayIcon.cpp)
|
||||
list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierSystemTrayIcon.hpp)
|
||||
endif ()
|
||||
|
||||
if (ENABLE_DBUS)
|
||||
|
|
|
|||
|
|
@ -35,13 +35,11 @@
|
|||
#include "components/sip-addresses/SipAddressesModel.hpp"
|
||||
#include "utils/Utils.hpp"
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include "messages-count-notifier/MessagesCountNotifierLinux.hpp"
|
||||
#elif defined(Q_OS_MACOS)
|
||||
#if defined(Q_OS_MACOS)
|
||||
#include "messages-count-notifier/MessagesCountNotifierMacOs.hpp"
|
||||
#elif defined(Q_OS_WIN)
|
||||
#include "messages-count-notifier/MessagesCountNotifierWindows.hpp"
|
||||
#endif // if defined(Q_OS_LINUX)
|
||||
#else
|
||||
#include "messages-count-notifier/MessagesCountNotifierSystemTrayIcon.hpp"
|
||||
#endif // if defined(Q_OS_MACOS)
|
||||
|
||||
#include "CoreHandlers.hpp"
|
||||
#include "CoreManager.hpp"
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
* Author: Ronan Abhamon
|
||||
*/
|
||||
|
||||
#ifndef ABSTRACT_MESSAGES_COUNT_NOTIFIER_H_
|
||||
#define ABSTRACT_MESSAGES_COUNT_NOTIFIER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
|
|
@ -51,3 +54,5 @@ private:
|
|||
|
||||
int mUnreadMessagesCount = 0;
|
||||
};
|
||||
|
||||
#endif // ABSTRACT_MESSAGES_COUNT_NOTIFIER_H_
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
* Author: Ghislain MARY
|
||||
*/
|
||||
|
||||
#ifndef MESSAGES_COUNT_NOTIFIER_MAC_OS_H_
|
||||
#define MESSAGES_COUNT_NOTIFIER_MAC_OS_H_
|
||||
|
||||
#include "AbstractMessagesCountNotifier.hpp"
|
||||
|
||||
extern "C" void notifyUnreadMessagesCountMacOS (int n);
|
||||
|
|
@ -34,3 +37,5 @@ public:
|
|||
notifyUnreadMessagesCountMacOS(n);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MESSAGES_COUNT_NOTIFIER_MAC_OS_H_
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* MessagesCountNotifierLinux.hpp
|
||||
* MessagesCountNotifierSystemTrayIcon.hpp
|
||||
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include "utils/LinphoneUtils.hpp"
|
||||
#include "utils/Utils.hpp"
|
||||
|
||||
#include "MessagesCountNotifierLinux.hpp"
|
||||
#include "MessagesCountNotifierSystemTrayIcon.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* MessagesCountNotifierLinux.hpp
|
||||
* MessagesCountNotifierSystemTrayIcon.hpp
|
||||
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
|
@ -20,6 +20,9 @@
|
|||
* Author: Ronan Abhamon
|
||||
*/
|
||||
|
||||
#ifndef MESSAGES_COUNT_NOTIFIER_SYSTEM_TRAY_ICON_H_
|
||||
#define MESSAGES_COUNT_NOTIFIER_SYSTEM_TRAY_ICON_H_
|
||||
|
||||
#include "AbstractMessagesCountNotifier.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -42,3 +45,5 @@ private:
|
|||
QTimer *mBlinkTimer = nullptr;
|
||||
bool mDisplayCounter = false;
|
||||
};
|
||||
|
||||
#endif // MESSAGES_COUNT_NOTIFIER_SYSTEM_TRAY_ICON_H_
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* MessagesCountNotifierWindows.cpp
|
||||
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Created on: August 7, 2017
|
||||
* Author: Ronan Abhamon
|
||||
*/
|
||||
|
||||
#include "MessagesCountNotifierWindows.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
MessagesCountNotifier::MessagesCountNotifier (QObject *parent) : AbstractMessagesCountNotifier(parent) {
|
||||
// TODO.
|
||||
}
|
||||
|
||||
void MessagesCountNotifier::notifyUnreadMessagesCount (int n) {
|
||||
// TODO.
|
||||
Q_UNUSED(n);
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* MessagesCountNotifierWindows.hpp
|
||||
* Copyright (C) 2017-2018 Belledonne Communications, Grenoble, France
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Created on: August 7, 2017
|
||||
* Author: Ronan Abhamon
|
||||
*/
|
||||
|
||||
#include "AbstractMessagesCountNotifier.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
class MessagesCountNotifier : public AbstractMessagesCountNotifier {
|
||||
public:
|
||||
MessagesCountNotifier (QObject *parent = Q_NULLPTR);
|
||||
|
||||
protected:
|
||||
void notifyUnreadMessagesCount (int n) override;
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue