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/.
10 #include "RemoteDialog.hxx"
11 #include <RemoteServer.hxx>
15 RemoteDialog::RemoteDialog(weld::Window
* pWindow
)
16 : GenericDialogController(pWindow
, u
"modules/simpress/ui/remotedialog.ui"_ustr
,
18 , m_xButtonConnect(m_xBuilder
->weld_button(u
"ok"_ustr
))
19 , m_xClientBox(new sd::ClientBox(m_xBuilder
->weld_scrolled_window(u
"scroll"_ustr
),
20 m_xBuilder
->weld_container(u
"tree"_ustr
)))
22 m_xButtonConnect
->connect_clicked(LINK(this, RemoteDialog
, HandleConnectButton
));
25 RemoteDialog::~RemoteDialog() {}
27 IMPL_LINK_NOARG(RemoteDialog
, HandleConnectButton
, weld::Button
&, void)
29 weld::WaitObject(m_xDialog
.get());
30 #if defined(ENABLE_SDREMOTE)
31 auto xEntry
= m_xClientBox
->GetActiveEntry();
34 OUString aPin
= xEntry
->m_xPinBox
->get_text();
35 if (IPRemoteServer::connectClient(xEntry
->m_xClientInfo
, aPin
))
36 m_xDialog
->response(RET_OK
);
40 short RemoteDialog::run()
42 short nRet
= weld::GenericDialogController::run();
43 #ifdef ENABLE_SDREMOTE
44 RemoteServer::restoreDiscoverable();
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */