diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-06-16 22:52:18 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:40:16 +0200 |
commit | 3117ee358c614cc9905e22f8fcd2522b2c9eaca3 (patch) | |
tree | baa01cc75cf038da0d54494519ac02d886c4e17f | |
parent | tubes: create InitTeleManager method (diff) | |
download | core-3117ee358c614cc9905e22f8fcd2522b2c9eaca3.tar.gz core-3117ee358c614cc9905e22f8fcd2522b2c9eaca3.zip |
tubes: add listen button to start TeleManager
No more need to run soffice with LIBO_TUBES set.
-rw-r--r-- | sc/source/ui/collab/contacts.cxx | 29 | ||||
-rw-r--r-- | sc/source/ui/collab/contacts.hrc | 1 | ||||
-rw-r--r-- | sc/source/ui/collab/contacts.src | 8 |
3 files changed, 37 insertions, 1 deletions
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx index 44821a599e06..085237bc061e 100644 --- a/sc/source/ui/collab/contacts.cxx +++ b/sc/source/ui/collab/contacts.cxx @@ -30,6 +30,8 @@ #include <vector> #include "contacts.hrc" +#include "sendfunc.hxx" +#include "docsh.hxx" #include "scresid.hxx" #include <svtools/filter.hxx> #include <tubes/manager.hxx> @@ -45,10 +47,12 @@ class TubeContacts : public ModelessDialog { FixedLine maLabel; PushButton maBtnConnect; + PushButton maBtnListen; SvxSimpleTableContainer maListContainer; SvxSimpleTable maList; DECL_LINK( BtnConnectHdl, void * ); + DECL_LINK( BtnListenHdl, void * ); struct AccountContact { @@ -59,6 +63,22 @@ class TubeContacts : public ModelessDialog }; boost::ptr_vector<AccountContact> maACs; + void Listen() + { + ScDocShell *pScDocShell = reinterpret_cast<ScDocShell*> (SfxObjectShell::Current()); + ScDocFunc *pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL; + ScDocFuncSend *pSender = reinterpret_cast<ScDocFuncSend*> (pDocFunc); + if (!pSender) + { + delete pDocFunc; + boost::shared_ptr<ScDocFuncDirect> pDirect( new ScDocFuncDirect( *pScDocShell ) ); + boost::shared_ptr<ScDocFuncRecv> pReceiver( new ScDocFuncRecv( pDirect ) ); + pSender = new ScDocFuncSend( *pScDocShell, pReceiver ); + pDocFunc = pSender; + } + pSender->InitTeleManager( false ); + } + void StartBuddySession() { AccountContact *pAC = NULL; @@ -83,10 +103,12 @@ public: ModelessDialog( NULL, ScResId( RID_SCDLG_CONTACTS ) ), maLabel( this, ScResId( FL_LABEL ) ), maBtnConnect( this, ScResId( BTN_CONNECT ) ), + maBtnListen( this, ScResId( BTN_LISTEN ) ), maListContainer( this, ScResId( CTL_LIST ) ), maList( maListContainer ) { maBtnConnect.SetClickHdl( LINK( this, TubeContacts, BtnConnectHdl ) ); + maBtnListen.SetClickHdl( LINK( this, TubeContacts, BtnListenHdl ) ); static long aStaticTabs[]= { @@ -160,6 +182,13 @@ IMPL_LINK_NOARG( TubeContacts, BtnConnectHdl ) return 0; } +IMPL_LINK_NOARG( TubeContacts, BtnListenHdl ) +{ + Listen(); + Close(); + return 0; +} + } // anonymous namespace #endif diff --git a/sc/source/ui/collab/contacts.hrc b/sc/source/ui/collab/contacts.hrc index dd3fcc4af1af..cb6991663c80 100644 --- a/sc/source/ui/collab/contacts.hrc +++ b/sc/source/ui/collab/contacts.hrc @@ -3,6 +3,7 @@ #define FL_LABEL 1 #define CTL_LIST 2 #define BTN_CONNECT 3 +#define BTN_LISTEN 4 #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 1689823a9d0b..0de2849bfe6d 100644 --- a/sc/source/ui/collab/contacts.src +++ b/sc/source/ui/collab/contacts.src @@ -21,10 +21,16 @@ ModelessDialog RID_SCDLG_CONTACTS }; PushButton BTN_CONNECT { - Pos = MAP_APPFONT( 8 , 200 ); + Pos = MAP_APPFONT( 70 , 200 ); Size = MAP_APPFONT( 50 , 10 ); Text [ en-US ] = "Collaborate"; }; + PushButton BTN_LISTEN + { + Pos = MAP_APPFONT( 8 , 200 ); + Size = MAP_APPFONT( 50 , 10 ); + Text [ en-US ] = "Listen"; + }; Control CTL_LIST { Pos = MAP_APPFONT ( 8 , 10 ) ; |