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 <svx/FileExportedDialog.hxx>
12 #include <comphelper/diagnose_ex.hxx>
13 #include <comphelper/backupfilehelper.hxx>
14 #include <comphelper/processfactory.hxx>
15 #include <com/sun/star/system/XSystemShellExecute.hpp>
16 #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
17 #include <com/sun/star/system/SystemShellExecute.hpp>
19 FileExportedDialog::FileExportedDialog(weld::Window
* pParent
, OUString atitle
)
20 : GenericDialogController(pParent
, "svx/ui/fileexporteddialog.ui", "FileExportedDialog")
21 , m_xFileLabel(m_xBuilder
->weld_label("Filelabel"))
22 , m_xButton(m_xBuilder
->weld_button("ok"))
24 m_xFileLabel
->set_label(atitle
);
25 m_xButton
->connect_clicked(LINK(this, FileExportedDialog
, OpenHdl
));
28 IMPL_LINK_NOARG(FileExportedDialog
, OpenHdl
, weld::Button
&, void)
30 const OUString
uri(comphelper::BackupFileHelper::getUserProfileURL());
31 css::uno::Reference
<css::system::XSystemShellExecute
> exec(
32 css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
35 exec
->execute(uri
, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY
);
37 catch (const css::uno::Exception
&)
39 TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri
<< "> failed:");
41 m_xDialog
->response(RET_OK
);