LibreOffice Module sd (master) 1
RemoteDialog.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 */
9
10#include "RemoteDialog.hxx"
11#include <RemoteServer.hxx>
12
13using namespace ::sd;
14
15RemoteDialog::RemoteDialog(weld::Window* pWindow)
16 : GenericDialogController(pWindow, "modules/simpress/ui/remotedialog.ui", "RemoteDialog")
17 , m_xButtonConnect(m_xBuilder->weld_button("ok"))
18 , m_xClientBox(new sd::ClientBox(m_xBuilder->weld_scrolled_window("scroll"),
19 m_xBuilder->weld_container("tree")))
20{
21 m_xButtonConnect->connect_clicked(LINK(this, RemoteDialog, HandleConnectButton));
22}
23
25
26IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton, weld::Button&, void)
27{
29#if defined(ENABLE_SDREMOTE)
30 auto xEntry = m_xClientBox->GetActiveEntry();
31 if (!xEntry)
32 return;
33 OUString aPin = xEntry->m_xPinBox->get_text();
34 if (RemoteServer::connectClient(xEntry->m_xClientInfo, aPin))
35 m_xDialog->response(RET_OK);
36#endif
37}
38
40{
42#ifdef ENABLE_SDREMOTE
44#endif
45 return nRet;
46}
47
48/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Button > m_xButtonConnect
virtual ~RemoteDialog() override
virtual short run() override
static SD_DLLPUBLIC bool connectClient(const std::shared_ptr< ClientInfo > &pClient, std::u16string_view aPin)
Definition: Server.cxx:259
static SD_DLLPUBLIC void restoreDiscoverable()
restore the state of discoverability from before ensureDiscoverable
Definition: Server.cxx:368
virtual short run()
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
RET_OK