Kaydet (Commit) 209f95d9 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ProfileExportedDialog

Change-Id: Ie360699c167cbee0be6d890ad686d351d64707cd
Reviewed-on: https://gerrit.libreoffice.org/54315Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2bd48ad3
......@@ -332,21 +332,24 @@ IMPL_LINK(SafeModeDialog, DialogBtnHdl, Button*, pBtn, void)
}
namespace {
class ProfileExportedDialog : public ModalDialog
class ProfileExportedDialog : public weld::GenericDialogController
{
private:
DECL_LINK(OpenHdl, Button*, void);
std::unique_ptr<weld::Button> m_xButton;
DECL_LINK(OpenHdl, weld::Button&, void);
public:
explicit ProfileExportedDialog();
explicit ProfileExportedDialog(weld::Window* pParent);
};
ProfileExportedDialog::ProfileExportedDialog()
: ModalDialog(nullptr, "ProfileExportedDialog", "svx/ui/profileexporteddialog.ui")
ProfileExportedDialog::ProfileExportedDialog(weld::Window* pParent)
: GenericDialogController(pParent, "svx/ui/profileexporteddialog.ui", "GenericDialogController")
, m_xButton(m_xBuilder->weld_button("ok"))
{
get<Button>("openfolder")->SetClickHdl(LINK(this, ProfileExportedDialog, OpenHdl));
m_xButton->connect_clicked(LINK(this, ProfileExportedDialog, OpenHdl));
}
IMPL_LINK_NOARG(ProfileExportedDialog, OpenHdl, Button*, void)
IMPL_LINK_NOARG(ProfileExportedDialog, OpenHdl, weld::Button&, void)
{
const OUString uri(comphelper::BackupFileHelper::getUserProfileURL());
css::uno::Reference< css::system::XSystemShellExecute > exec(
......@@ -355,7 +358,7 @@ namespace {
exec->execute(uri, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY);
} catch (css::uno::Exception) {
}
EndDialog(RET_OK);
m_xDialog->response(RET_OK);
}
}
......@@ -379,8 +382,8 @@ IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, Button*, /*pBtn*/, void)
return;
}
ScopedVclPtrInstance< ProfileExportedDialog > aDialog;
aDialog->Execute();
ProfileExportedDialog aDialog(GetFrameWeld());
aDialog.run();
}
IMPL_LINK(SafeModeDialog, CheckBoxHdl, CheckBox&, /*pCheckBox*/, void)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="svx">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="ProfileExportedDialog">
......@@ -7,7 +7,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="profileexporteddialog|ProfileExportedDialog">Profile exported</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
......@@ -36,7 +42,7 @@
</packing>
</child>
<child>
<object class="GtkButton" id="openfolder">
<object class="GtkButton" id="ok">
<property name="label" translatable="yes" context="profileexporteddialog|openfolder">Open Containing _Folder</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -78,7 +84,7 @@
</child>
<action-widgets>
<action-widget response="-7">close</action-widget>
<action-widget response="0">openfolder</action-widget>
<action-widget response="-5">ok</action-widget>
</action-widgets>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment