1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #include "sdresid.hxx"
12 #include "cusshow.hxx"
14 #include "RemoteDialog.hxx"
15 #include "RemoteDialog.hrc"
16 #include "RemoteServer.hxx"
19 using namespace ::std
;
21 RemoteDialog::RemoteDialog( Window
*pWindow
) :
22 ModalDialog( pWindow
, SdResId( DLG_PAIR_REMOTE
) ),
23 mButtonConnect( this, SdResId( BTN_CONNECT
) ),
24 mButtonCancel( this, SdResId( BTN_CANCEL
) ),
25 mClientBox( this, NULL
, SdResId( LB_SERVERS
) )
29 #ifdef ENABLE_SDREMOTE
30 RemoteServer::ensureDiscoverable();
32 vector
<ClientInfo
*> aClients( RemoteServer::getClients() );
34 const vector
<ClientInfo
*>::const_iterator
aEnd( aClients
.end() );
36 for ( vector
<ClientInfo
*>::const_iterator
aIt( aClients
.begin() );
39 mClientBox
.addEntry( *aIt
);
43 mButtonConnect
.SetClickHdl( LINK( this, RemoteDialog
, HandleConnectButton
) );
44 SetCloseHdl( LINK( this, RemoteDialog
, CloseHdl
) );
45 mButtonCancel
.SetClickHdl( LINK( this, RemoteDialog
, CloseHdl
) );
48 RemoteDialog::~RemoteDialog()
52 // -----------------------------------------------------------------------
53 IMPL_LINK_NOARG(RemoteDialog
, HandleConnectButton
)
56 // Fixme: Try and connect
57 #if defined(ENABLE_SDREMOTE) && defined(ENABLE_SDREMOTE_BLUETOOTH)
58 long aSelected
= mClientBox
.GetActiveEntryIndex();
61 TClientBoxEntry aEntry
= mClientBox
.GetEntryData(aSelected
);
62 OUString
aPin ( mClientBox
.getPin() );
63 if ( RemoteServer::connectClient( aEntry
->m_pClientInfo
, aPin
) )
76 IMPL_LINK_NOARG( RemoteDialog
, CloseHdl
)
78 #ifdef ENABLE_SDREMOTE
79 RemoteServer::restoreDiscoverable();
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */