2
* Copyright (C) 2012-2013 Canonical, Ltd.
5
* Tiago Salem Herrmann <tiago.herrmann@canonical.com>
6
* Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
8
* This file is part of telephony-service.
10
* telephony-service is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; version 3.
14
* telephony-service is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
#include <libnotify/notify.h>
25
#include "applicationutils.h"
26
#include "callchannelobserver.h"
27
#include "telepathyhelper.h"
28
#include "textchannelobserver.h"
29
#include "voicemailindicator.h"
30
#include <QCoreApplication>
31
#include <TelepathyQt/ClientRegistrar>
32
#include <TelepathyQt/AbstractClient>
33
#include <TelepathyQt/AccountManager>
34
#include <TelepathyQt/Contact>
40
int main(int argc, char **argv)
42
QCoreApplication app(argc, argv);
44
C::bindtextdomain( "telephony-service", "/usr/share/locale" );
45
C::textdomain("telephony-service");
47
notify_init(C::gettext("Telephony Service Indicator"));
51
// check if there is already an instance of the approver running
52
if (ApplicationUtils::checkApplicationRunning(TP_QT_IFACE_CLIENT + ".TelephonyServiceIndicator")) {
53
qDebug() << "Found another instance of the indicator. Quitting.";
57
// register the observer
58
TelepathyHelper::instance()->registerChannelObserver("TelephonyServiceIndicator");
60
// Connect the textObserver and the callObserver to the channel observer in TelepathyHelper
61
CallChannelObserver *callObserver = new CallChannelObserver();
62
TextChannelObserver *textObserver = new TextChannelObserver();
63
QObject::connect(TelepathyHelper::instance()->channelObserver(), SIGNAL(textChannelAvailable(Tp::TextChannelPtr)),
64
textObserver, SLOT(onTextChannelAvailable(Tp::TextChannelPtr)));
65
QObject::connect(TelepathyHelper::instance()->channelObserver(), SIGNAL(callChannelAvailable(Tp::CallChannelPtr)),
66
callObserver, SLOT(onCallChannelAvailable(Tp::CallChannelPtr)));
68
// we don't need to call anything on the indicator, it will work by itself
69
VoiceMailIndicator voiceMailIndicator;
70
Q_UNUSED(voiceMailIndicator);