diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-14 10:56:14 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:40:27 +0200 |
commit | f5ee5d794f0c7500755df68b2b57d56e4566c9c1 (patch) | |
tree | 437ea861a5e2371dcab20bbc1296bb9ac35a41ff | |
parent | c8a6a1ff706600562bc08fe1dd490c149bbf8012 (diff) |
tubes: add possibility to invite contacts to MUC
Change-Id: Ia27c725aff1d16d21ee1f5abcfff9a107bd87a82
-rw-r--r-- | sc/source/ui/collab/contacts.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/collab/contacts.hrc | 3 | ||||
-rw-r--r-- | sc/source/ui/collab/contacts.src | 6 | ||||
-rw-r--r-- | sc/source/ui/collab/sendfunc.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/collab/sendfunc.hxx | 1 | ||||
-rw-r--r-- | tubes/inc/tubes/conference.hxx | 2 | ||||
-rw-r--r-- | tubes/source/conference.cxx | 9 |
7 files changed, 49 insertions, 1 deletions
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx index ac16c3947b5e..725b1f52fc6c 100644 --- a/sc/source/ui/collab/contacts.cxx +++ b/sc/source/ui/collab/contacts.cxx @@ -47,6 +47,7 @@ class TubeContacts : public ModelessDialog { FixedLine maLabel; PushButton maBtnConnect; + PushButton maBtnInvite; PushButton maBtnListen; SvxSimpleTableContainer maListContainer; SvxSimpleTable maList; @@ -54,6 +55,7 @@ class TubeContacts : public ModelessDialog ScDocFuncSend* mpSender; DECL_LINK( BtnConnectHdl, void * ); + DECL_LINK( BtnInviteHdl, void * ); DECL_LINK( BtnListenHdl, void * ); struct AccountContact @@ -65,6 +67,19 @@ class TubeContacts : public ModelessDialog }; boost::ptr_vector<AccountContact> maACs; + void Invite() + { + AccountContact *pAC = NULL; + if (maList.FirstSelected()) + pAC = static_cast<AccountContact*> (maList.FirstSelected()->GetUserData()); + if (pAC && mpSender->GetConference()) + { + TpContact* pContact = pAC->mpContact; + fprintf( stderr, "inviting %s\n", tp_contact_get_identifier( pContact ) ); + mpSender->GetConference()->invite( pContact ); + } + } + void Listen() { if (!mpManager->registerClients()) @@ -128,6 +143,7 @@ public: ModelessDialog( NULL, ScResId( RID_SCDLG_CONTACTS ) ), maLabel( this, ScResId( FL_LABEL ) ), maBtnConnect( this, ScResId( BTN_CONNECT ) ), + maBtnInvite( this, ScResId( BTN_INVITE ) ), maBtnListen( this, ScResId( BTN_LISTEN ) ), maListContainer( this, ScResId( CTL_LIST ) ), maList( maListContainer ), @@ -159,6 +175,7 @@ public: } } maBtnConnect.SetClickHdl( LINK( this, TubeContacts, BtnConnectHdl ) ); + maBtnInvite.SetClickHdl( LINK( this, TubeContacts, BtnInviteHdl ) ); maBtnListen.SetClickHdl( LINK( this, TubeContacts, BtnListenHdl ) ); static long aStaticTabs[]= @@ -242,6 +259,13 @@ IMPL_LINK_NOARG( TubeContacts, BtnConnectHdl ) return 0; } +IMPL_LINK_NOARG( TubeContacts, BtnInviteHdl ) +{ + Invite(); + Close(); + return 0; +} + IMPL_LINK_NOARG( TubeContacts, BtnListenHdl ) { Listen(); diff --git a/sc/source/ui/collab/contacts.hrc b/sc/source/ui/collab/contacts.hrc index cb6991663c80..59aeb678243a 100644 --- a/sc/source/ui/collab/contacts.hrc +++ b/sc/source/ui/collab/contacts.hrc @@ -3,7 +3,8 @@ #define FL_LABEL 1 #define CTL_LIST 2 #define BTN_CONNECT 3 -#define BTN_LISTEN 4 +#define BTN_INVITE 4 +#define BTN_LISTEN 5 #define STR_HEADER_ALIAS 20 #define STR_HEADER_NAME 21 diff --git a/sc/source/ui/collab/contacts.src b/sc/source/ui/collab/contacts.src index 0de2849bfe6d..27d1dcafc7cd 100644 --- a/sc/source/ui/collab/contacts.src +++ b/sc/source/ui/collab/contacts.src @@ -25,6 +25,12 @@ ModelessDialog RID_SCDLG_CONTACTS Size = MAP_APPFONT( 50 , 10 ); Text [ en-US ] = "Collaborate"; }; + PushButton BTN_INVITE + { + Pos = MAP_APPFONT( 130 , 200 ); + Size = MAP_APPFONT( 50 , 10 ); + Text [ en-US ] = "Invite"; + }; PushButton BTN_LISTEN { Pos = MAP_APPFONT( 8 , 200 ); diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index e5e6c54beb09..e70021bf9c73 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -286,6 +286,11 @@ void ScDocFuncSend::SetCollaboration( TeleConference* pConference ) &ScDocFuncRecv::packetReceived, mpDirect, _1 ) ); } +TeleConference* ScDocFuncSend::GetConference() +{ + return mpConference; +} + ScDocFuncRecv* ScDocFuncSend::GetReceiver() { return mpDirect; diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx index 1bcbe237c246..459be2afaa82 100644 --- a/sc/source/ui/collab/sendfunc.hxx +++ b/sc/source/ui/collab/sendfunc.hxx @@ -238,6 +238,7 @@ public: virtual ~ScDocFuncSend(); void SetCollaboration( TeleConference* pConference ); + TeleConference* GetConference(); ScDocFuncRecv* GetReceiver(); virtual void EnterListAction( sal_uInt16 nNameResId ); diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx index a43a6dc8bf68..b35fddc4c5bb 100644 --- a/tubes/inc/tubes/conference.hxx +++ b/tubes/inc/tubes/conference.hxx @@ -70,6 +70,8 @@ public: void queue( const char* pDBusSender, const char* pPacket, int nSize ); void queue( TelePacket &rPacket ); + TUBES_DLLPUBLIC void invite( TpContact *pContact ); + /** Emitted when a packet is received. */ boost::signals2::signal<void (TelePacket&)> sigPacketReceived; diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx index a04851e35132..97da5cfe0d80 100644 --- a/tubes/source/conference.cxx +++ b/tubes/source/conference.cxx @@ -418,6 +418,15 @@ void TeleConference::queue( const char* pDBusSender, const char* pPacketData, in queue( aPacket ); } +void TeleConference::invite( TpContact *pContact ) +{ + INFO_LOGGER( "TeleConference::invite" ); + TpHandle aHandle = tp_contact_get_handle( pContact ); + GArray handles = { reinterpret_cast<gchar *> (&aHandle), 1 }; + tp_cli_channel_interface_group_call_add_members( TP_CHANNEL( mpChannel ), + -1, &handles, NULL, NULL, NULL, NULL, NULL ); +} + class SendFileRequest { public: |