summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-14 12:33:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-14 16:05:35 +0200
commit209f95d9148969f578196a76e0981cf6161f11dc (patch)
tree8e68e86a4af5914939f329202901f348e0bdd8a3
parentloplugin:redundantfcast (diff)
downloadcore-209f95d9148969f578196a76e0981cf6161f11dc.tar.gz
core-209f95d9148969f578196a76e0981cf6161f11dc.zip
weld ProfileExportedDialog
Change-Id: Ie360699c167cbee0be6d890ad686d351d64707cd Reviewed-on: https://gerrit.libreoffice.org/54315 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/dialog/SafeModeDialog.cxx23
-rw-r--r--svx/uiconfig/ui/profileexporteddialog.ui12
2 files changed, 22 insertions, 13 deletions
diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx
index af99ec1bd172..33e8912bebc5 100644
--- a/svx/source/dialog/SafeModeDialog.cxx
+++ b/svx/source/dialog/SafeModeDialog.cxx
@@ -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)
diff --git a/svx/uiconfig/ui/profileexporteddialog.ui b/svx/uiconfig/ui/profileexporteddialog.ui
index 485d4cfcdbfa..c69be1444f29 100644
--- a/svx/uiconfig/ui/profileexporteddialog.ui
+++ b/svx/uiconfig/ui/profileexporteddialog.ui
@@ -1,5 +1,5 @@
<?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>