Kaydet (Commit) 3117ee35 authored tarafından Matúš Kukan's avatar Matúš Kukan

tubes: add listen button to start TeleManager

No more need to run soffice with LIBO_TUBES set.
üst b5dbf32a
......@@ -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
......
......@@ -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
......@@ -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 ) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment