[Libreoffice-commits] .: Branch 'feature/tubes2' - 3 commits - sc/source tubes/inc tubes/source
Matus Kukan
mkukan at kemper.freedesktop.org
Sun Jul 1 14:50:03 PDT 2012
sc/source/ui/collab/contacts.cxx | 25 +++++++++++++++++++++----
sc/source/ui/inc/docsh.hxx | 1 +
tubes/inc/tubes/manager.hxx | 8 +++++---
tubes/source/manager.cxx | 26 ++++++++++++--------------
4 files changed, 39 insertions(+), 21 deletions(-)
New commits:
commit c2412e1f2a6c78f491b55c097b3f8a70fd6343ed
Author: Matúš Kukan <matus.kukan at gmail.com>
Date: Sun Jul 1 23:43:33 2012 +0200
tubes: correctly set pDocFunc
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx
index bfc7710..078bcdd 100644
--- a/sc/source/ui/collab/contacts.cxx
+++ b/sc/source/ui/collab/contacts.cxx
@@ -74,7 +74,7 @@ class TubeContacts : public ModelessDialog
boost::shared_ptr<ScDocFuncDirect> pDirect( new ScDocFuncDirect( *pScDocShell ) );
boost::shared_ptr<ScDocFuncRecv> pReceiver( new ScDocFuncRecv( pDirect ) );
pSender = new ScDocFuncSend( *pScDocShell, pReceiver );
- pDocFunc = pSender;
+ pScDocShell->SetDocFunc( pSender );
}
// This is a hack to work around:
// `error registering client handler: Name
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index a00e98e..827a3e9 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -241,6 +241,7 @@ public:
ScDocument* GetDocument() { return &aDocument; }
ScDocFunc& GetDocFunc() { return *pDocFunc; }
+ void SetDocFunc( ScDocFunc *pDF ) { pDocFunc = pDF; }
SfxPrinter* GetPrinter( sal_Bool bCreateIfNotExist = sal_True );
sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL );
commit da2da6094b879157efb1f501c440e49917855971
Author: Matúš Kukan <matus.kukan at gmail.com>
Date: Sat Jun 30 12:52:57 2012 +0200
tubes: make TeleManager::startGroupSession work and use it
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx
index d1f27ec..bfc7710 100644
--- a/sc/source/ui/collab/contacts.cxx
+++ b/sc/source/ui/collab/contacts.cxx
@@ -107,6 +107,21 @@ class TubeContacts : public ModelessDialog
}
}
+ void StartGroupSession()
+ {
+ AccountContact *pAC = NULL;
+ if (maList.FirstSelected())
+ pAC = static_cast<AccountContact*> (maList.FirstSelected()->GetUserData());
+ if (pAC)
+ {
+ TpAccount* pAccount = pAC->mpAccount;
+ fprintf( stderr, "picked %s\n", tp_account_get_display_name( pAccount ) );
+ TeleManager *pManager = TeleManager::get();
+ if (!pManager->startGroupSession( pAccount, rtl::OUString("liboroom"), rtl::OUString("conference.jabber.org") ))
+ fprintf( stderr, "could not start group session\n" );
+ }
+ }
+
public:
TubeContacts() :
ModelessDialog( NULL, ScResId( RID_SCDLG_CONTACTS ) ),
@@ -188,7 +203,11 @@ public:
IMPL_LINK_NOARG( TubeContacts, BtnConnectHdl )
{
+#if 0
StartBuddySession();
+#else
+ StartGroupSession();
+#endif
Close();
return 0;
}
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index c780fd2..326cc51 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -101,9 +101,11 @@ public:
*/
ContactList* getContactList() const;
-#if 0
/** Start a group session in a MUC.
+ @param pAccount
+ The account to use. This must be a valid Jabber account.
+
@param rConferenceRoom
The MUC to be created/joined, e.g. "LibreOffice". If empty, the
conference's UUID is used.
@@ -113,9 +115,9 @@ public:
empty, only the conference's UUID is used and rConferenceRoom is
ignored, hopefully resulting in a local DBus tube.
*/
- bool startGroupSession( const rtl::OUString& rConferenceRoom,
+ bool startGroupSession( TpAccount *pAccount,
+ const rtl::OUString& rConferenceRoom,
const rtl::OUString& rConferenceServer );
-#endif
/** Start a session with a buddy.
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index 2e0cd3e..06b1533 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -442,8 +442,6 @@ bool TeleManager::connect()
/* TODO: setup filters for LibreOfficeCalc, LibreOfficeWriter, ... */
-/* FIXME: once we can handle MUCs, this is additional to buddy channels! */
-#if 0
// Setup client handler for MUC channels with our service.
tp_base_client_take_handler_filter( pImpl->mpClient,
tp_asv_new(
@@ -451,7 +449,6 @@ bool TeleManager::connect()
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_ROOM,
TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, getFullServiceName().getStr(),
NULL));
-#endif
if (!tp_base_client_register( pImpl->mpClient, &pError))
{
@@ -497,18 +494,16 @@ bool TeleManager::connect()
}
-#if 0
/* TODO: factor out common code with startBuddySession() */
-bool TeleManager::startGroupSession( const rtl::OUString& rUConferenceRoom, const rtl::OUString& rUConferenceServer )
+bool TeleManager::startGroupSession( TpAccount *pAccount,
+ const rtl::OUString& rUConferenceRoom,
+ const rtl::OUString& rUConferenceServer )
{
INFO_LOGGER( "TeleManager::startGroupSession");
- if (!getMyAccount())
- return false;
-
OString aSessionId( TeleManager::createUuid());
- TeleConferencePtr pConference( new TeleConference( this, NULL, aSessionId));
+ TeleConferencePtr pConference( new TeleConference( this, NULL, NULL, aSessionId));
maConferences.push_back( pConference);
/* TODO: associate the document with this session and conference */
@@ -528,10 +523,9 @@ bool TeleManager::startGroupSession( const rtl::OUString& rUConferenceRoom, cons
/* FIXME: else? bail out? we have only a session ID without server then */
}
OString aTarget( aBuf.makeStringAndClear());
- pConference->setTarget( aTarget);
SAL_INFO( "tubes", "TeleManager::startGroupSession: creating channel request from "
- << maAccountID.getStr() << " to " << aTarget.getStr());
+ << tp_account_get_path_suffix( pAccount ) << " to " << aTarget.getStr() );
// MUC request
GHashTable* pRequest = tp_asv_new(
@@ -542,11 +536,13 @@ bool TeleManager::startGroupSession( const rtl::OUString& rUConferenceRoom, cons
NULL);
TpAccountChannelRequest * pChannelRequest = tp_account_channel_request_new(
- mpAccount, pRequest, TP_USER_ACTION_TIME_NOT_USER_ACTION);
- g_hash_table_unref( pRequest);
+ pAccount, pRequest, TP_USER_ACTION_TIME_NOT_USER_ACTION);
SAL_WARN_IF( !pChannelRequest, "tubes", "TeleManager::startGroupSession: no channel");
if (!pChannelRequest)
+ {
+ g_hash_table_unref( pRequest);
return false;
+ }
setChannelReadyHandlerInvoked( false);
@@ -555,9 +551,11 @@ bool TeleManager::startGroupSession( const rtl::OUString& rUConferenceRoom, cons
iterateLoop( &TeleManager::isChannelReadyHandlerInvoked);
+ g_object_unref( pChannelRequest);
+ g_hash_table_unref( pRequest);
+
return pConference->getChannel() != NULL && pConference->isTubeOpen();
}
-#endif
void TeleManager::ensureLegacyChannel( TpAccount* pAccount, TpContact* pBuddy )
commit ccb249ad2d1765f7e76cc687bcfd2c16319c11f3
Author: Matúš Kukan <matus.kukan at gmail.com>
Date: Sat Jun 30 11:48:22 2012 +0200
tubes: use TeleManager::get() also here
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx
index 0c70585..d1f27ec 100644
--- a/sc/source/ui/collab/contacts.cxx
+++ b/sc/source/ui/collab/contacts.cxx
@@ -100,12 +100,10 @@ class TubeContacts : public ModelessDialog
TpAccount* pAccount = pAC->mpAccount;
TpContact* pContact = pAC->mpContact;
fprintf( stderr, "picked %s\n", tp_contact_get_identifier( pContact ) );
- // TeleManager has to exist already, false will be ignored:
- TeleManager *pManager = TeleManager::get( false );
+ TeleManager *pManager = TeleManager::get();
if (!pManager->startBuddySession( pAccount, pContact ))
fprintf( stderr, "could not start session with %s\n",
tp_contact_get_identifier( pContact ) );
- pManager->unref();
}
}
More information about the Libreoffice-commits
mailing list