move current 'KDE' gui to separate directory ui-kde
[makneto-zunavac1.git] / src / ui-kde / makneto.cpp
bloba7d2c465a0d0f7960bf7742eded2cba1dd902092
1 /*
2 * makneto.cpp
4 * Copyright (C) 2008 Jaroslav Reznik <rezzabuh@gmail.com>
5 */
7 #include "makneto.h"
9 #include <QObject>
11 //Vtheman
12 #include "../backend/telepathy-initializer.h"
13 #include "../backend/telepathy-client.h"
14 #include "../backend/session.h"
16 #include "sessiontabmanager.h"
17 #include "maknetoview.h"
20 Makneto* Makneto::m_instance = NULL;
22 Makneto* Makneto::Instance()
24 if(!m_instance)
25 m_instance = new Makneto;
27 return m_instance;
31 Makneto::Makneto(QObject *parent) : QObject(parent)
34 //vtheman
35 MaknetoBackend::TelepathyInitializer *tpInit = new MaknetoBackend::TelepathyInitializer();
37 connect(tpInit,
38 SIGNAL(finished(MaknetoBackend::TelepathyClient *)),
39 SLOT(onTelepathyInitializerFinished(MaknetoBackend::TelepathyClient *)));
41 tpInit->createClient("Makneto");
45 Makneto::~Makneto()
49 //vtheman
50 void Makneto::onTelepathyInitializerFinished(MaknetoBackend::TelepathyClient* client)
52 m_client = client;
54 //connect SessionTabManager with TelepathyClient for session creation
55 connect(m_mainwindow->getMaknetoView()->getSessionTabManager(),
56 SIGNAL(newSessionRequested(QModelIndex, MaknetoBackend::Session::SessionType)),
57 MaknetoBackend::TelepathyClient::Instance(),
58 SLOT(onSessionRequested(QModelIndex, MaknetoBackend::Session::SessionType)));
60 connect(MaknetoBackend::TelepathyClient::Instance(),
61 SIGNAL(sessionCreated(MaknetoBackend::Session *)),
62 m_mainwindow->getMaknetoView()->getSessionTabManager(),
63 SLOT(onNewSession(MaknetoBackend::Session *)));
65 qDebug() << "Makneto: Telepathy has been initialised";
66 emit clientInitialised(m_client);