Added support for native KDE notifier icon.
This commit is contained in:
10
qcma.pro
10
qcma.pro
@@ -122,6 +122,16 @@ unix {
|
|||||||
|
|
||||||
unix:!macx:DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE
|
unix:!macx:DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE
|
||||||
|
|
||||||
|
unix:!macx:ENABLE_KDE {
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
|
error("ENABLE_KDE can only be used with Qt4")
|
||||||
|
}
|
||||||
|
LIBS += -lkdeui
|
||||||
|
DEFINES += "ENABLE_KDE_NOTIFIER=1"
|
||||||
|
SOURCES += src/kdenotifier.cpp
|
||||||
|
HEADERS += src/kdenotifier.h
|
||||||
|
}
|
||||||
|
|
||||||
win32:RC_FILE = qcma.rc
|
win32:RC_FILE = qcma.rc
|
||||||
win32:QMAKE_CXXFLAGS += -mno-ms-bitfields
|
win32:QMAKE_CXXFLAGS += -mno-ms-bitfields
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1" language="es_ES">
|
<TS version="2.0" language="es_ES">
|
||||||
<context>
|
<context>
|
||||||
<name>BackupItem</name>
|
<name>BackupItem</name>
|
||||||
<message>
|
<message>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
<name>CmaClient</name>
|
<name>CmaClient</name>
|
||||||
<message>
|
<message>
|
||||||
<source>Connected to </source>
|
<source>Connected to </source>
|
||||||
<translation type="vanished">Conectado a </translation>
|
<translation type="obsolete">Conectado a </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/cmaclient.cpp" line="127"/>
|
<location filename="../../src/cmaclient.cpp" line="127"/>
|
||||||
@@ -316,8 +316,8 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>FilterLineEdit</name>
|
<name>FilterLineEdit</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/filterlineedit.cpp" line="40"/>
|
<location filename="../../src/filterlineedit.cpp" line="50"/>
|
||||||
<location filename="../../src/filterlineedit.cpp" line="61"/>
|
<location filename="../../src/filterlineedit.cpp" line="71"/>
|
||||||
<source>Filter</source>
|
<source>Filter</source>
|
||||||
<translation>Filtro</translation>
|
<translation>Filtro</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -325,37 +325,38 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="75"/>
|
<location filename="../../src/mainwidget.cpp" line="79"/>
|
||||||
<source>Shutting down...</source>
|
<source>Shutting down...</source>
|
||||||
<translation>Cerrando...</translation>
|
<translation>Cerrando...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="76"/>
|
<location filename="../../src/mainwidget.cpp" line="80"/>
|
||||||
<source>Stopping QCMA...</source>
|
<source>Stopping QCMA...</source>
|
||||||
<translation>Deteniendo QCMA...</translation>
|
<translation>Deteniendo QCMA...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="88"/>
|
<location filename="../../src/mainwidget.cpp" line="96"/>
|
||||||
|
<location filename="../../src/mainwidget.cpp" line="227"/>
|
||||||
<source>Disconnected</source>
|
<source>Disconnected</source>
|
||||||
<translation>Desconectado</translation>
|
<translation>Desconectado</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="89"/>
|
<location filename="../../src/mainwidget.cpp" line="97"/>
|
||||||
<source>The device has been disconnected</source>
|
<source>The device has been disconnected</source>
|
||||||
<translation>El dispositivo se ha desconectado</translation>
|
<translation>El dispositivo se ha desconectado</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="138"/>
|
<location filename="../../src/mainwidget.cpp" line="154"/>
|
||||||
<source>About QCMA</source>
|
<source>About QCMA</source>
|
||||||
<translation>Acerca de QCMA</translation>
|
<translation>Acerca de QCMA</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="140"/>
|
<location filename="../../src/mainwidget.cpp" line="156"/>
|
||||||
<source>Copyright (C) 2013 Codestation</source>
|
<source>Copyright (C) 2013 Codestation</source>
|
||||||
<translation>Copyright (C) 2013 Codestation</translation>
|
<translation>Copyright (C) 2013 Codestation</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="142"/>
|
<location filename="../../src/mainwidget.cpp" line="158"/>
|
||||||
<source>Copyright (C) 2013 Codestation
|
<source>Copyright (C) 2013 Codestation
|
||||||
|
|
||||||
build hash: %1
|
build hash: %1
|
||||||
@@ -366,17 +367,22 @@ Hash de compilación: %1
|
|||||||
Rama de compilación: %2</translation>
|
Rama de compilación: %2</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="167"/>
|
<location filename="../../src/mainwidget.cpp" line="183"/>
|
||||||
<source>&About QCMA</source>
|
<source>&About QCMA</source>
|
||||||
<translation>&Acerca de QCMA</translation>
|
<translation>&Acerca de QCMA</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../src/mainwidget.cpp" line="246"/>
|
||||||
|
<source>Qcma - Information</source>
|
||||||
|
<translation>Qcma - Información</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Copyright (C) 2013 Codestation
|
<source>Copyright (C) 2013 Codestation
|
||||||
</source>
|
</source>
|
||||||
<translation type="obsolete">Copyright (C) 2013 Codestation\n</translation>
|
<translation type="obsolete">Copyright (C) 2013 Codestation\n</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="166"/>
|
<location filename="../../src/mainwidget.cpp" line="182"/>
|
||||||
<source>&Backup Manager</source>
|
<source>&Backup Manager</source>
|
||||||
<translation>&Gestor de Respaldos</translation>
|
<translation>&Gestor de Respaldos</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -385,7 +391,7 @@ Rama de compilación: %2</translation>
|
|||||||
<translation type="obsolete">&Acerca de</translation>
|
<translation type="obsolete">&Acerca de</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="168"/>
|
<location filename="../../src/mainwidget.cpp" line="184"/>
|
||||||
<source>Abou&t Qt</source>
|
<source>Abou&t Qt</source>
|
||||||
<translation>A&cerca de Qt</translation>
|
<translation>A&cerca de Qt</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -394,12 +400,12 @@ Rama de compilación: %2</translation>
|
|||||||
<translation type="obsolete">PIN recibido: %1</translation>
|
<translation type="obsolete">PIN recibido: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="164"/>
|
<location filename="../../src/mainwidget.cpp" line="180"/>
|
||||||
<source>&Settings</source>
|
<source>&Settings</source>
|
||||||
<translation>&Ajustes</translation>
|
<translation>&Ajustes</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="165"/>
|
<location filename="../../src/mainwidget.cpp" line="181"/>
|
||||||
<source>&Refresh database</source>
|
<source>&Refresh database</source>
|
||||||
<translation>&Refrescar base de datos</translation>
|
<translation>&Refrescar base de datos</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -408,12 +414,17 @@ Rama de compilación: %2</translation>
|
|||||||
<translation type="obsolete">Gestor de Respaldos</translation>
|
<translation type="obsolete">Gestor de Respaldos</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="169"/>
|
<location filename="../../src/mainwidget.cpp" line="185"/>
|
||||||
<source>&Quit</source>
|
<source>&Quit</source>
|
||||||
<translation>&Salir</translation>
|
<translation>&Salir</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="210"/>
|
<location filename="../../src/mainwidget.cpp" line="225"/>
|
||||||
|
<source>Qcma status</source>
|
||||||
|
<translation>Estado de Qcma</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../src/mainwidget.cpp" line="243"/>
|
||||||
<source>Information</source>
|
<source>Information</source>
|
||||||
<translation>Información</translation>
|
<translation>Información</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1" language="ja_JP">
|
<TS version="2.0" language="ja_JP">
|
||||||
<context>
|
<context>
|
||||||
<name>BackupItem</name>
|
<name>BackupItem</name>
|
||||||
<message>
|
<message>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
<name>CmaClient</name>
|
<name>CmaClient</name>
|
||||||
<message>
|
<message>
|
||||||
<source>Connected to </source>
|
<source>Connected to </source>
|
||||||
<translation type="vanished">次のデバイスに接続しました </translation>
|
<translation type="obsolete">次のデバイスに接続しました </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/cmaclient.cpp" line="127"/>
|
<location filename="../../src/cmaclient.cpp" line="127"/>
|
||||||
@@ -317,8 +317,8 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>FilterLineEdit</name>
|
<name>FilterLineEdit</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/filterlineedit.cpp" line="40"/>
|
<location filename="../../src/filterlineedit.cpp" line="50"/>
|
||||||
<location filename="../../src/filterlineedit.cpp" line="61"/>
|
<location filename="../../src/filterlineedit.cpp" line="71"/>
|
||||||
<source>Filter</source>
|
<source>Filter</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -326,37 +326,38 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="75"/>
|
<location filename="../../src/mainwidget.cpp" line="79"/>
|
||||||
<source>Shutting down...</source>
|
<source>Shutting down...</source>
|
||||||
<translation>終了しています...</translation>
|
<translation>終了しています...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="76"/>
|
<location filename="../../src/mainwidget.cpp" line="80"/>
|
||||||
<source>Stopping QCMA...</source>
|
<source>Stopping QCMA...</source>
|
||||||
<translation>QCMAを停止しています...</translation>
|
<translation>QCMAを停止しています...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="88"/>
|
<location filename="../../src/mainwidget.cpp" line="96"/>
|
||||||
|
<location filename="../../src/mainwidget.cpp" line="227"/>
|
||||||
<source>Disconnected</source>
|
<source>Disconnected</source>
|
||||||
<translation>切断されました</translation>
|
<translation>切断されました</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="89"/>
|
<location filename="../../src/mainwidget.cpp" line="97"/>
|
||||||
<source>The device has been disconnected</source>
|
<source>The device has been disconnected</source>
|
||||||
<translation>デバイスが切断されました</translation>
|
<translation>デバイスが切断されました</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="138"/>
|
<location filename="../../src/mainwidget.cpp" line="154"/>
|
||||||
<source>About QCMA</source>
|
<source>About QCMA</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="140"/>
|
<location filename="../../src/mainwidget.cpp" line="156"/>
|
||||||
<source>Copyright (C) 2013 Codestation</source>
|
<source>Copyright (C) 2013 Codestation</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="142"/>
|
<location filename="../../src/mainwidget.cpp" line="158"/>
|
||||||
<source>Copyright (C) 2013 Codestation
|
<source>Copyright (C) 2013 Codestation
|
||||||
|
|
||||||
build hash: %1
|
build hash: %1
|
||||||
@@ -364,31 +365,36 @@ build branch: %2</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="166"/>
|
<location filename="../../src/mainwidget.cpp" line="182"/>
|
||||||
<source>&Backup Manager</source>
|
<source>&Backup Manager</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="167"/>
|
<location filename="../../src/mainwidget.cpp" line="183"/>
|
||||||
<source>&About QCMA</source>
|
<source>&About QCMA</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="168"/>
|
<location filename="../../src/mainwidget.cpp" line="184"/>
|
||||||
<source>Abou&t Qt</source>
|
<source>Abou&t Qt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../src/mainwidget.cpp" line="246"/>
|
||||||
|
<source>Qcma - Information</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Received PIN: %1</source>
|
<source>Received PIN: %1</source>
|
||||||
<translation type="obsolete">受信したPIN: %1</translation>
|
<translation type="obsolete">受信したPIN: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="164"/>
|
<location filename="../../src/mainwidget.cpp" line="180"/>
|
||||||
<source>&Settings</source>
|
<source>&Settings</source>
|
||||||
<translation>&設定</translation>
|
<translation>&設定</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="165"/>
|
<location filename="../../src/mainwidget.cpp" line="181"/>
|
||||||
<source>&Refresh database</source>
|
<source>&Refresh database</source>
|
||||||
<translation>&データベースを更新する</translation>
|
<translation>&データベースを更新する</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -397,12 +403,17 @@ build branch: %2</source>
|
|||||||
<translation type="obsolete">バックアップマネージャー</translation>
|
<translation type="obsolete">バックアップマネージャー</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="169"/>
|
<location filename="../../src/mainwidget.cpp" line="185"/>
|
||||||
<source>&Quit</source>
|
<source>&Quit</source>
|
||||||
<translation>&終了</translation>
|
<translation>&終了</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/mainwidget.cpp" line="210"/>
|
<location filename="../../src/mainwidget.cpp" line="225"/>
|
||||||
|
<source>Qcma status</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../src/mainwidget.cpp" line="243"/>
|
||||||
<source>Information</source>
|
<source>Information</source>
|
||||||
<translation>情報</translation>
|
<translation>情報</translation>
|
||||||
</message>
|
</message>
|
||||||
|
25
src/kdenotifier.cpp
Normal file
25
src/kdenotifier.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* QCMA: Cross-platform content manager assistant for the PS Vita
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Codestation
|
||||||
|
*
|
||||||
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "kdenotifier.h"
|
||||||
|
|
||||||
|
KDENotifier::KDENotifier(const QString &id, QObject *parent) :
|
||||||
|
KStatusNotifierItem(id, parent)
|
||||||
|
{
|
||||||
|
}
|
41
src/kdenotifier.h
Normal file
41
src/kdenotifier.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* QCMA: Cross-platform content manager assistant for the PS Vita
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Codestation
|
||||||
|
*
|
||||||
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef KDENOTIFIER_H
|
||||||
|
#define KDENOTIFIER_H
|
||||||
|
|
||||||
|
#include <kstatusnotifieritem.h>
|
||||||
|
#include <kmenu.h>
|
||||||
|
|
||||||
|
class KDENotifier : public KStatusNotifierItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit KDENotifier(const QString &id, QObject *parent = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
// block left click because it shows the default widget
|
||||||
|
virtual void activate (const QPoint &pos=QPoint()) {
|
||||||
|
Q_UNUSED(pos);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // KDENOTIFIER_H
|
@@ -34,6 +34,10 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QSpacerItem>
|
#include <QSpacerItem>
|
||||||
|
|
||||||
|
#ifdef ENABLE_KDE_NOTIFIER
|
||||||
|
#include <kmenu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
const QStringList MainWidget::path_list = QStringList() << "photoPath" << "musicPath" << "videoPath" << "appsPath" << "urlPath";
|
const QStringList MainWidget::path_list = QStringList() << "photoPath" << "musicPath" << "videoPath" << "appsPath" << "urlPath";
|
||||||
|
|
||||||
bool sleptOnce = false;
|
bool sleptOnce = false;
|
||||||
@@ -79,10 +83,14 @@ void MainWidget::stopServer()
|
|||||||
|
|
||||||
void MainWidget::deviceDisconnect()
|
void MainWidget::deviceDisconnect()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
#ifndef Q_OS_WIN32
|
#ifndef Q_OS_WIN32
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_dc.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_dc.png"));
|
||||||
#else
|
#else
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16_dc.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16_dc.png"));
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
notifierItem->setIconByPixmap(QIcon(":/main/resources/images/psv_icon_dc.png"));
|
||||||
#endif
|
#endif
|
||||||
qDebug("Icon changed - disconnected");
|
qDebug("Icon changed - disconnected");
|
||||||
setTrayTooltip(tr("Disconnected"));
|
setTrayTooltip(tr("Disconnected"));
|
||||||
@@ -91,10 +99,14 @@ void MainWidget::deviceDisconnect()
|
|||||||
|
|
||||||
void MainWidget::deviceConnected(QString message)
|
void MainWidget::deviceConnected(QString message)
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
#ifndef Q_OS_WIN32
|
#ifndef Q_OS_WIN32
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon.png"));
|
||||||
#else
|
#else
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16.png"));
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
notifierItem->setIconByPixmap(QIcon(":/main/resources/images/psv_icon.png"));
|
||||||
#endif
|
#endif
|
||||||
qDebug("Icon changed - connected");
|
qDebug("Icon changed - connected");
|
||||||
setTrayTooltip(message);
|
setTrayTooltip(message);
|
||||||
@@ -121,7 +133,11 @@ void MainWidget::connectSignals()
|
|||||||
|
|
||||||
void MainWidget::setTrayTooltip(QString message)
|
void MainWidget::setTrayTooltip(QString message)
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
trayIcon->setToolTip(message);
|
trayIcon->setToolTip(message);
|
||||||
|
#else
|
||||||
|
notifierItem->setToolTipSubTitle(message);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::openManager()
|
void MainWidget::openManager()
|
||||||
@@ -175,7 +191,12 @@ void MainWidget::createTrayIcon()
|
|||||||
connect(about_qt, SIGNAL(triggered()), this, SLOT(showAboutQt()));
|
connect(about_qt, SIGNAL(triggered()), this, SLOT(showAboutQt()));
|
||||||
connect(quit, SIGNAL(triggered()), this, SLOT(stopServer()));
|
connect(quit, SIGNAL(triggered()), this, SLOT(stopServer()));
|
||||||
|
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
QMenu *trayIconMenu = new QMenu(this);
|
QMenu *trayIconMenu = new QMenu(this);
|
||||||
|
#else
|
||||||
|
KMenu *trayIconMenu = new KMenu(this);
|
||||||
|
#endif
|
||||||
|
|
||||||
trayIconMenu->addAction(options);
|
trayIconMenu->addAction(options);
|
||||||
trayIconMenu->addAction(reload);
|
trayIconMenu->addAction(reload);
|
||||||
trayIconMenu->addAction(backup);
|
trayIconMenu->addAction(backup);
|
||||||
@@ -185,6 +206,7 @@ void MainWidget::createTrayIcon()
|
|||||||
trayIconMenu->addSeparator();
|
trayIconMenu->addSeparator();
|
||||||
trayIconMenu->addAction(quit);
|
trayIconMenu->addAction(quit);
|
||||||
|
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
trayIcon = new QSystemTrayIcon(this);
|
trayIcon = new QSystemTrayIcon(this);
|
||||||
trayIcon->setContextMenu(trayIconMenu);
|
trayIcon->setContextMenu(trayIconMenu);
|
||||||
#ifndef Q_OS_WIN32
|
#ifndef Q_OS_WIN32
|
||||||
@@ -193,8 +215,18 @@ void MainWidget::createTrayIcon()
|
|||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16_dc.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16_dc.png"));
|
||||||
#endif
|
#endif
|
||||||
trayIcon->show();
|
trayIcon->show();
|
||||||
// try to avoid the iconTray Qt bug
|
#else
|
||||||
//Sleeper::sleep(1);
|
notifierItem = new KDENotifier("QcmaNotifier", this);
|
||||||
|
notifierItem->setContextMenu(trayIconMenu);
|
||||||
|
notifierItem->setTitle("Qcma");
|
||||||
|
notifierItem->setCategory(KStatusNotifierItem::ApplicationStatus);
|
||||||
|
notifierItem->setIconByPixmap(QIcon(":/main/resources/images/psv_icon_dc.png"));
|
||||||
|
notifierItem->setStatus(KStatusNotifierItem::Active);
|
||||||
|
notifierItem->setToolTipTitle(tr("Qcma status"));
|
||||||
|
notifierItem->setToolTipIconByPixmap(QIcon(":/main/resources/images/qcma.png"));
|
||||||
|
notifierItem->setToolTipSubTitle(tr("Disconnected"));
|
||||||
|
notifierItem->setStandardActionsEnabled(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::receiveMessage(QString message)
|
void MainWidget::receiveMessage(QString message)
|
||||||
@@ -206,12 +238,19 @@ void MainWidget::receiveMessage(QString message)
|
|||||||
sleptOnce = true;
|
sleptOnce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
if(trayIcon->isVisible()) {
|
if(trayIcon->isVisible()) {
|
||||||
trayIcon->showMessage(tr("Information"), message);
|
trayIcon->showMessage(tr("Information"), message);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
notifierItem->showMessage(tr("Qcma - Information"), message, "dialog-information", 3000);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWidget::~MainWidget()
|
MainWidget::~MainWidget()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
trayIcon->hide();
|
trayIcon->hide();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,11 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
|
#ifdef ENABLE_KDE_NOTIFIER
|
||||||
|
#include "kdenotifier.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <vitamtp.h>
|
#include <vitamtp.h>
|
||||||
|
|
||||||
@@ -60,7 +64,12 @@ private:
|
|||||||
QAction *backup;
|
QAction *backup;
|
||||||
QAction *about;
|
QAction *about;
|
||||||
QAction *about_qt;
|
QAction *about_qt;
|
||||||
|
|
||||||
|
#ifndef ENABLE_KDE_NOTIFIER
|
||||||
QSystemTrayIcon *trayIcon;
|
QSystemTrayIcon *trayIcon;
|
||||||
|
#else
|
||||||
|
KDENotifier *notifierItem;
|
||||||
|
#endif
|
||||||
|
|
||||||
const static QStringList path_list;
|
const static QStringList path_list;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user