diff options
-rw-r--r-- | sc/source/ui/collab/contacts.cxx | 66 | ||||
-rw-r--r-- | sc/source/ui/collab/contacts.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/collab/contacts.src | 9 | ||||
-rw-r--r-- | sc/source/ui/collab/sendfunc.cxx | 3 | ||||
-rw-r--r-- | tubes/inc/tubes/manager.hxx | 2 | ||||
-rw-r--r-- | tubes/source/manager.cxx | 2 |
6 files changed, 69 insertions, 16 deletions
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx index d517888cdd5b..00e0392604d4 100644 --- a/sc/source/ui/collab/contacts.cxx +++ b/sc/source/ui/collab/contacts.cxx @@ -30,15 +30,20 @@ #include <vector> #include "collab.hxx" +#include "contacts.hrc" +#include "scresid.hxx" +#include <tubes/manager.hxx> #include <tubes/conference.hxx> -#include <vcl/syswin.hxx> +#include <tubes/contact-list.hxx> +#include <vcl/fixed.hxx> +#include <vcl/dialog.hxx> #include <svx/simptabl.hxx> -// #define CONTACTS +#define CONTACTS_DLG #ifdef CONTACTS_DLG namespace { -class TubeContacts : ModelessDialog +class TubeContacts : public ModelessDialog { FixedLine maLabel; SvxSimpleTableContainer maListContainer; @@ -46,24 +51,69 @@ class TubeContacts : ModelessDialog public: TubeContacts() : - ModelessDialog( NULL, RID_SCDLG_CONTACTS ), + ModelessDialog( NULL, ScResId( RID_SCDLG_CONTACTS ) ), maLabel( this, ScResId( FL_LABEL ) ), maListContainer( this, ScResId( CTL_LIST ) ), - maList( maListContainer ), + maList( maListContainer ) { - SetMinOutputSizePixel( Size( 640, 480 ) ); + static long aStaticTabs[]= + { + 3 /* count */, 0, 20, 80, 150, 200 + }; + + maList.SvxSimpleTable::SetTabs( aStaticTabs ); + String sHeader( '\t' ); + sHeader += String( ScResId( STR_HEADER_ALIAS ) ); + sHeader += '\t'; + sHeader += String( ScResId( STR_HEADER_NAME ) ); + sHeader += '\t'; + maList.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT ); Show(); } virtual ~TubeContacts() {} + + static rtl::OUString fromUTF8( const char *pStr ) + { + return rtl::OStringToOUString( rtl::OString( pStr, strlen( pStr ) ), + RTL_TEXTENCODING_UTF8 ); + } + + void Populate( const TeleManager &rManager ) + { + ContactList *pContacts = rManager.getContactList(); + if ( pContacts ) + { + fprintf( stderr, "contacts !\n" ); + AccountContactPairV aPairs = pContacts->getContacts(); + AccountContactPairV::iterator it; + for( it = aPairs.begin(); it != aPairs.end(); it++ ) + { + fprintf( stderr, "'%s' => '%s' '%s'\n", + tp_account_get_display_name( it->first ), + tp_contact_get_alias( it->second ), + tp_contact_get_identifier( it->second ) ); + rtl::OUStringBuffer aEntry( 128 ); + aEntry.append( sal_Unicode( '\t' ) ); + aEntry.append( fromUTF8 ( tp_contact_get_alias( it->second ) ) ); + aEntry.append( sal_Unicode( '\t' ) ); + aEntry.append( fromUTF8 ( tp_contact_get_identifier( it->second ) ) ); + aEntry.append( sal_Unicode( '\t' ) ); + SvLBoxEntry* pEntry = maList.InsertEntry( aEntry.makeStringAndClear() ); + // FIXME: ref the TpContact ... + pEntry->SetUserData( it->second ); + } + } + } }; } // anonymous namespace #endif namespace tubes { -void createContacts() +void createContacts( const TeleManager &rManager ) { #ifdef CONTACTS_DLG - new TubeContacts(); + TubeContacts *pContacts = new TubeContacts(); + pContacts->Populate( rManager ); #endif } } diff --git a/sc/source/ui/collab/contacts.hxx b/sc/source/ui/collab/contacts.hxx index 657df23ff475..eba76a3a1206 100644 --- a/sc/source/ui/collab/contacts.hxx +++ b/sc/source/ui/collab/contacts.hxx @@ -32,8 +32,9 @@ #include "collab.hxx" #include <tubes/conference.hxx> +class TeleManager; namespace tubes { - void createContacts(); + void createContacts( const TeleManager &rContacts ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/collab/contacts.src b/sc/source/ui/collab/contacts.src index 09729201ee00..6a1081f91397 100644 --- a/sc/source/ui/collab/contacts.src +++ b/sc/source/ui/collab/contacts.src @@ -9,19 +9,20 @@ ModelessDialog RID_SCDLG_CONTACTS Hide = FALSE ; Moveable = TRUE ; Closeable = TRUE ; - Size = MAP_APPFONT ( 320 , 480 ) ; + Size = MAP_APPFONT ( 220 , 200 ) ; + OutputSize = TRUE ; Text [ en-US ] = "Contacts" ; FixedLine FL_LABEL { Pos = MAP_APPFONT ( 6 , 3 ) ; Size = MAP_APPFONT ( 400 , 8 ) ; - Text [ en-US ] = "Here are your contacts" ; + Text [ en-US ] = "Select a contact to collaborate with" ; }; Control CTL_LIST { - Pos = MAP_APPFONT ( 21 , 38 ) ; - Size = MAP_APPFONT ( 177 , 130 ) ; + Pos = MAP_APPFONT ( 8 , 10 ) ; + Size = MAP_APPFONT ( 200 , 190 ) ; Border = TRUE ; TabStop = TRUE ; }; diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index 66db1d2fdefa..0f742093a0fb 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -35,6 +35,7 @@ #include "docfunc.hxx" #include "collab.hxx" #include "contacts.hxx" +#include <tubes/manager.hxx> #include <tubes/conference.hxx> // new file send/recv fun ... @@ -451,7 +452,7 @@ public: SendFile( rText ); if ( rtl::OUString( rText ) == "contacts" ) - tubes::createContacts(); + tubes::createContacts( TeleManager::get() ); return true; // needs some code auditing action } diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx index 7c877f5fc786..ec85d9134506 100644 --- a/tubes/inc/tubes/manager.hxx +++ b/tubes/inc/tubes/manager.hxx @@ -96,7 +96,7 @@ public: /** Fetches the contact list. Returns 0 before connect() is called successfully. Is non-functional until prepareAccountManager(). */ - ContactList* getContactList(); + ContactList* getContactList() const; #if 0 /** Start a group session in a MUC. diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index 3128ea2898d6..b9f9744c2f0f 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -683,7 +683,7 @@ bool TeleManager::isAccountManagerReadyHandlerInvoked() const return pImpl->mbAccountManagerReadyHandlerInvoked; } -ContactList* TeleManager::getContactList() +ContactList* TeleManager::getContactList() const { return pImpl->mpContactList; } |