LibreOffice Module svx (master) 1
FileExportedDialog.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
11
12#include <tools/diagnose_ex.h>
15#include <com/sun/star/system/XSystemShellExecute.hpp>
16#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
17#include <com/sun/star/system/SystemShellExecute.hpp>
18
20 : GenericDialogController(pParent, "svx/ui/fileexporteddialog.ui", "FileExportedDialog")
21 , m_xFileLabel(m_xBuilder->weld_label("Filelabel"))
22 , m_xButton(m_xBuilder->weld_button("ok"))
23{
24 m_xFileLabel->set_label(atitle);
25 m_xButton->connect_clicked(LINK(this, FileExportedDialog, OpenHdl));
26}
27
29{
31 css::uno::Reference<css::system::XSystemShellExecute> exec(
32 css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
33 try
34 {
35 exec->execute(uri, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY);
36 }
37 catch (const css::uno::Exception&)
38 {
39 TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri << "> failed:");
40 }
41 m_xDialog->response(RET_OK);
42}
IMPL_LINK_NOARG(FileExportedDialog, OpenHdl, weld::Button &, void)
Reference< XExecutableDialog > m_xDialog
FileExportedDialog(weld::Window *pParent, OUString atitle)
std::unique_ptr< weld::Button > m_xButton
std::unique_ptr< weld::Label > m_xFileLabel
static const OUString & getUserProfileURL()
#define TOOLS_WARN_EXCEPTION(area, stream)
Reference< XComponentContext > getProcessComponentContext()
RET_OK