4 * Copyright (C) 2008 Jaroslav Reznik <rezzabuh@gmail.com>
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()
25 m_instance
= new Makneto
;
31 Makneto::Makneto(QObject
*parent
) : QObject(parent
)
35 MaknetoBackend::TelepathyInitializer
*tpInit
= new MaknetoBackend::TelepathyInitializer();
38 SIGNAL(finished(MaknetoBackend::TelepathyClient
*)),
39 SLOT(onTelepathyInitializerFinished(MaknetoBackend::TelepathyClient
*)));
41 tpInit
->createClient("Makneto");
50 void Makneto::onTelepathyInitializerFinished(MaknetoBackend::TelepathyClient
* 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
);