[Libreoffice-commits] core.git: 2 commits - svx/source svx/uiconfig sw/inc sw/source sw/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 17 12:08:48 UTC 2018


 svx/source/dialog/docrecovery.cxx            |   94 ++++++++++-----------------
 svx/source/inc/docrecovery.hxx               |   86 +++++++++++-------------
 svx/uiconfig/ui/docrecoverybrokendialog.ui   |   63 ++++++++++++++----
 sw/inc/swabstdlg.hxx                         |    2 
 sw/source/ui/dialog/swdlgfact.cxx            |   14 ++--
 sw/source/ui/dialog/swdlgfact.hxx            |   13 ++-
 sw/source/ui/envelp/mailmrge.cxx             |   14 ----
 sw/source/uibase/inc/mailmrge.hxx            |    9 +-
 sw/source/uibase/uiview/view2.cxx            |    2 
 sw/uiconfig/swriter/ui/mergeconnectdialog.ui |   18 ++---
 10 files changed, 161 insertions(+), 154 deletions(-)

New commits:
commit 6c8c47429936c30ebb760253fa4078c1e410eea5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 17 09:52:29 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 17 14:08:07 2018 +0200

    weld SwMailMergeFieldConnectionsDlg
    
    Change-Id: I15ee027db596c98eef878e2e174429c532789dad
    Reviewed-on: https://gerrit.libreoffice.org/61871
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 8478b77b990f..fdd6a431544f 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -460,7 +460,7 @@ public:
                                                 sal_Int32 nCommandType,
                                                 const css::uno::Reference< css::sdbc::XConnection>& xConnection ) = 0;
     virtual VclPtr<AbstractMailMergeCreateFromDlg>   CreateMailMergeCreateFromDlg(vcl::Window* pParent) = 0;
-    virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) = 0;
+    virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) = 0;
     virtual VclPtr<VclAbstractDialog>          CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) = 0;
     virtual VclPtr<SfxAbstractTabDialog>       CreateOutlineTabDialog(weld::Window* pParent,
                                                 const SfxItemSet* pSwItemSet,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index e8eb7119af93..6dca63b32f43 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -214,7 +214,12 @@ short AbstractJavaEditDialog_Impl::Execute()
 
 IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl);
+
+short AbstractMailMergeFieldConnectionsDlg_Impl::Execute()
+{
+    return m_xDlg->run();
+}
+
 IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl);
@@ -637,7 +642,7 @@ bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const
 
 bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const
 {
-    return pDlg->IsUseExistingConnections();
+    return m_xDlg->IsUseExistingConnections();
 }
 
 CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const
@@ -1040,10 +1045,9 @@ VclPtr<AbstractMailMergeCreateFromDlg> SwAbstractDialogFactory_Impl::CreateMailM
     return VclPtr<AbstractMailMergeCreateFromDlg_Impl>::Create(pDlg);
 }
 
-VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent)
+VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(weld::Window* pParent)
 {
-    VclPtr<SwMailMergeFieldConnectionsDlg> pDlg = VclPtr<SwMailMergeFieldConnectionsDlg>::Create( pParent );
-    return VclPtr<AbstractMailMergeFieldConnectionsDlg_Impl>::Create( pDlg );
+    return VclPtr<AbstractMailMergeFieldConnectionsDlg_Impl>::Create(o3tl::make_unique<SwMailMergeFieldConnectionsDlg>(pParent));
 }
 
 VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr)
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 6471d1864c4c..07953242d358 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -508,8 +508,15 @@ class AbstractMailMergeCreateFromDlg_Impl : public AbstractMailMergeCreateFromDl
 class SwMailMergeFieldConnectionsDlg;
 class AbstractMailMergeFieldConnectionsDlg_Impl : public AbstractMailMergeFieldConnectionsDlg
 {
-    DECL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl,SwMailMergeFieldConnectionsDlg)
-    virtual bool    IsUseExistingConnections() const override ;
+protected:
+    std::unique_ptr<SwMailMergeFieldConnectionsDlg> m_xDlg;
+public:
+    explicit AbstractMailMergeFieldConnectionsDlg_Impl(std::unique_ptr<SwMailMergeFieldConnectionsDlg> p)
+        : m_xDlg(std::move(p))
+    {
+    }
+    virtual short Execute() override;
+    virtual bool IsUseExistingConnections() const override ;
 };
 
 class SwMultiTOXTabDialog;
@@ -670,7 +677,7 @@ public:
                                                 sal_Int32 nCommandType,
                                                 const css::uno::Reference< css::sdbc::XConnection>& xConnection ) override;
     virtual VclPtr<AbstractMailMergeCreateFromDlg>     CreateMailMergeCreateFromDlg(vcl::Window* pParent) override;
-    virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) override;
+    virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) override;
     virtual VclPtr<VclAbstractDialog>          CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) override;
     virtual VclPtr<SfxAbstractTabDialog>       CreateOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet,
                                                 SwWrtShell &) override;
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 6230ad636d48..9bcd53d6c206 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -634,22 +634,14 @@ void SwMailMergeCreateFromDlg::dispose()
     ModalDialog::dispose();
 }
 
-SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pParent)
-    : ModalDialog(pParent, "MergeConnectDialog",
-                  "modules/swriter/ui/mergeconnectdialog.ui")
+SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(weld::Window* pParent)
+    : GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog")
+    , m_xUseExistingRB(m_xBuilder->weld_radio_button("existing"))
 {
-    get(m_pUseExistingRB, "existing");
 }
 
 SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg()
 {
-    disposeOnce();
-}
-
-void SwMailMergeFieldConnectionsDlg::dispose()
-{
-    m_pUseExistingRB.clear();
-    ModalDialog::dispose();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx
index 6a2b5bf53566..23f51e363d8d 100644
--- a/sw/source/uibase/inc/mailmrge.hxx
+++ b/sw/source/uibase/inc/mailmrge.hxx
@@ -152,17 +152,16 @@ public:
     }
 };
 
-class SwMailMergeFieldConnectionsDlg : public ModalDialog
+class SwMailMergeFieldConnectionsDlg : public weld::GenericDialogController
 {
-    VclPtr<RadioButton> m_pUseExistingRB;
+    std::unique_ptr<weld::RadioButton> m_xUseExistingRB;
 public:
-    SwMailMergeFieldConnectionsDlg(vcl::Window* pParent);
+    SwMailMergeFieldConnectionsDlg(weld::Window* pParent);
     virtual ~SwMailMergeFieldConnectionsDlg() override;
-    virtual void dispose() override;
 
     bool IsUseExistingConnections() const
     {
-        return m_pUseExistingRB->IsChecked();
+        return m_xUseExistingRB->get_active();
     }
 };
 
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 8d2b1e91eabc..93bc535e9b31 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -2308,7 +2308,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
             {
                 //take an existing data source or create a new one?
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg( pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow()) );
+                ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg(pFact->CreateMailMergeFieldConnectionsDlg(GetFrameWeld()));
                 if(RET_OK == pConnectionsDlg->Execute())
                     bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
                 else
diff --git a/sw/uiconfig/swriter/ui/mergeconnectdialog.ui b/sw/uiconfig/swriter/ui/mergeconnectdialog.ui
index 162196ad0cbf..dc2fa1f82e96 100644
--- a/sw/uiconfig/swriter/ui/mergeconnectdialog.ui
+++ b/sw/uiconfig/swriter/ui/mergeconnectdialog.ui
@@ -1,11 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="MergeConnectDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="mergeconnectdialog|MergeConnectDialog">Data Source Connection</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>
@@ -57,6 +61,7 @@
                 <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">2</property>
+                <property name="secondary">True</property>
               </packing>
             </child>
           </object>
@@ -98,13 +103,10 @@
                         <property name="xalign">0</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
-                        <property name="group">new</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -121,25 +123,21 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="yalign">0</property>
                         <property name="label" translatable="yes" context="mergeconnectdialog|label2">Fields are used to personalize form letters. The fields are placeholders for data from a data source, such as a database. The fields in the form letter must be connected to the data source.</property>
                         <property name="wrap">True</property>
                         <property name="max_width_chars">52</property>
+                        <property name="xalign">0</property>
+                        <property name="yalign">0</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">2</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>
commit 2410cce33e9bde53cecd8d2d5a73ab91121567e3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 17 09:40:13 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 17 14:07:54 2018 +0200

    weld BrokenRecoveryDialog
    
    Change-Id: I6bcc067eba0648f0f4c000d1fbb811d9235c8707
    Reviewed-on: https://gerrit.libreoffice.org/61870
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index d7265a42447d..899c7a9e9e59 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -449,6 +449,7 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a
     if (sURL.isEmpty())
         sURL = aNew.TemplateURL;
     INetURLObject aURL(sURL);
+    aNew.StandardImageId = SvFileInformationManager::GetFileImageId(aURL);
     aNew.StandardImage = SvFileInformationManager::GetFileImage(aURL);
 
     /* set the right UI state for this item to NOT_RECOVERED_YET... because nDocState shows the state of
@@ -959,14 +960,13 @@ short RecoveryDialog::Execute()
                  // failed recovery documents. They must be saved to
                  // a user selected directory.
                  short                 nRet                  = DLG_RET_UNKNOWN;
-                 ScopedVclPtrInstance< BrokenRecoveryDialog > pBrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted);
-                 OUString              sSaveDir              = pBrokenRecoveryDialog->getSaveDirURL(); // get the default dir
-                 if (pBrokenRecoveryDialog->isExecutionNeeded())
+                 BrokenRecoveryDialog aBrokenRecoveryDialog(GetFrameWeld(), m_pCore, !m_bWasRecoveryStarted);
+                 OUString sSaveDir = aBrokenRecoveryDialog.getSaveDirURL(); // get the default dir
+                 if (aBrokenRecoveryDialog.isExecutionNeeded())
                  {
-                     nRet = pBrokenRecoveryDialog->Execute();
-                     sSaveDir = pBrokenRecoveryDialog->getSaveDirURL();
+                     nRet = aBrokenRecoveryDialog.run();
+                     sSaveDir = aBrokenRecoveryDialog.getSaveDirURL();
                  }
-                 pBrokenRecoveryDialog.disposeAndClear();
 
                  switch(nRet)
                  {
@@ -1027,18 +1027,17 @@ short RecoveryDialog::Execute()
                  // They should be saved to a user defined location.
                  // If no temp files exists or user decided to ignore it ...
                  // we have to remove all recovery/session data anyway!
-                 short                 nRet                  = DLG_RET_UNKNOWN;
-                 ScopedVclPtrInstance< BrokenRecoveryDialog > pBrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted);
-                 OUString              sSaveDir              = pBrokenRecoveryDialog->getSaveDirURL(); // get the default save location
+                 short nRet = DLG_RET_UNKNOWN;
+                 BrokenRecoveryDialog aBrokenRecoveryDialog(GetFrameWeld(), m_pCore, !m_bWasRecoveryStarted);
+                 OUString sSaveDir = aBrokenRecoveryDialog.getSaveDirURL(); // get the default save location
 
                  // dialog itself checks if there is a need to copy files for this mode.
                  // It uses the information m_bWasRecoveryStarted doing so.
-                 if (pBrokenRecoveryDialog->isExecutionNeeded())
+                 if (aBrokenRecoveryDialog.isExecutionNeeded())
                  {
-                     nRet     = pBrokenRecoveryDialog->Execute();
-                     sSaveDir = pBrokenRecoveryDialog->getSaveDirURL();
+                     nRet     = aBrokenRecoveryDialog.run();
+                     sSaveDir = aBrokenRecoveryDialog.getSaveDirURL();
                  }
-                 pBrokenRecoveryDialog.disposeAndClear();
 
                  // Possible states:
                  // a) nRet == DLG_RET_UNKNOWN
@@ -1109,7 +1108,6 @@ void RecoveryDialog::updateItems()
     m_pFileListLB->Update();
 }
 
-
 void RecoveryDialog::stepNext(TURLInfo* pItem)
 {
     sal_uIntPtr c = m_pFileListLB->GetEntryCount();
@@ -1206,49 +1204,36 @@ OUString RecoveryDialog::impl_getStatusString( const TURLInfo& rInfo ) const
     return sStatus;
 }
 
-BrokenRecoveryDialog::BrokenRecoveryDialog(vcl::Window*       pParent        ,
-                                           RecoveryCore* pCore          ,
-                                           bool      bBeforeRecovery)
-    : ModalDialog   ( pParent, "DocRecoveryBrokenDialog", "svx/ui/docrecoverybrokendialog.ui" )
-    , m_pCore       ( pCore                                               )
-    , m_bBeforeRecovery (bBeforeRecovery)
+BrokenRecoveryDialog::BrokenRecoveryDialog(weld::Window* pParent,
+                                           RecoveryCore* pCore,
+                                           bool bBeforeRecovery)
+    : GenericDialogController(pParent, "svx/ui/docrecoverybrokendialog.ui", "DocRecoveryBrokenDialog")
+    , m_pCore(pCore)
+    , m_bBeforeRecovery(bBeforeRecovery)
     , m_bExecutionNeeded(false)
+    , m_xFileListLB(m_xBuilder->weld_tree_view("filelist"))
+    , m_xSaveDirED(m_xBuilder->weld_entry("savedir"))
+    , m_xSaveDirBtn(m_xBuilder->weld_button("change"))
+    , m_xOkBtn(m_xBuilder->weld_button("ok"))
+    , m_xCancelBtn(m_xBuilder->weld_button("cancel"))
 {
-    get(m_pFileListLB, "filelist");
-    get(m_pSaveDirED, "savedir");
-    get(m_pSaveDirBtn, "change");
-    get(m_pOkBtn, "save");
-    get(m_pCancelBtn, "cancel");
-
-    m_pSaveDirBtn->SetClickHdl( LINK( this, BrokenRecoveryDialog, SaveButtonHdl ) );
-    m_pOkBtn->SetClickHdl( LINK( this, BrokenRecoveryDialog, OkButtonHdl ) );
-    m_pCancelBtn->SetClickHdl( LINK( this, BrokenRecoveryDialog, CancelButtonHdl ) );
+    m_xSaveDirBtn->connect_clicked( LINK( this, BrokenRecoveryDialog, SaveButtonHdl ) );
+    m_xOkBtn->connect_clicked( LINK( this, BrokenRecoveryDialog, OkButtonHdl ) );
+    m_xCancelBtn->connect_clicked( LINK( this, BrokenRecoveryDialog, CancelButtonHdl ) );
 
     m_sSavePath = SvtPathOptions().GetWorkPath();
     INetURLObject aObj( m_sSavePath );
     OUString sPath;
     osl::FileBase::getSystemPathFromFileURL(aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), sPath);
-    m_pSaveDirED->SetText( sPath );
+    m_xSaveDirED->set_text(sPath);
 
     impl_refresh();
 }
 
 BrokenRecoveryDialog::~BrokenRecoveryDialog()
 {
-    disposeOnce();
-}
-
-void BrokenRecoveryDialog::dispose()
-{
-    m_pFileListLB.clear();
-    m_pSaveDirED.clear();
-    m_pSaveDirBtn.clear();
-    m_pOkBtn.clear();
-    m_pCancelBtn.clear();
-    ModalDialog::dispose();
 }
 
-
 void BrokenRecoveryDialog::impl_refresh()
 {
                              m_bExecutionNeeded = false;
@@ -1277,51 +1262,44 @@ void BrokenRecoveryDialog::impl_refresh()
 
         m_bExecutionNeeded = true;
 
-        const sal_Int32 nPos = m_pFileListLB->InsertEntry(rInfo.DisplayName, rInfo.StandardImage );
-        m_pFileListLB->SetEntryData( nPos, const_cast<TURLInfo *>(&rInfo) );
+        m_xFileListLB->append(OUString::number(reinterpret_cast<sal_IntPtr>(&rInfo)), rInfo.DisplayName, rInfo.StandardImageId);
     }
     m_sSavePath.clear();
-    m_pOkBtn->GrabFocus();
+    m_xOkBtn->grab_focus();
 }
 
-
 bool BrokenRecoveryDialog::isExecutionNeeded()
 {
     return m_bExecutionNeeded;
 }
 
-
 const OUString& BrokenRecoveryDialog::getSaveDirURL()
 {
     return m_sSavePath;
 }
 
-
-IMPL_LINK_NOARG(BrokenRecoveryDialog, OkButtonHdl, Button*, void)
+IMPL_LINK_NOARG(BrokenRecoveryDialog, OkButtonHdl, weld::Button&, void)
 {
-    OUString sPhysicalPath = comphelper::string::strip(m_pSaveDirED->GetText(), ' ');
+    OUString sPhysicalPath = comphelper::string::strip(m_xSaveDirED->get_text(), ' ');
     OUString sURL;
     osl::FileBase::getFileURLFromSystemPath( sPhysicalPath, sURL );
     m_sSavePath = sURL;
     while (m_sSavePath.isEmpty())
         impl_askForSavePath();
 
-    EndDialog(DLG_RET_OK);
+    m_xDialog->response(DLG_RET_OK);
 }
 
-
-IMPL_LINK_NOARG(BrokenRecoveryDialog, CancelButtonHdl, Button*, void)
+IMPL_LINK_NOARG(BrokenRecoveryDialog, CancelButtonHdl, weld::Button&, void)
 {
-    EndDialog();
+    m_xDialog->response(RET_CANCEL);
 }
 
-
-IMPL_LINK_NOARG(BrokenRecoveryDialog, SaveButtonHdl, Button*, void)
+IMPL_LINK_NOARG(BrokenRecoveryDialog, SaveButtonHdl, weld::Button&, void)
 {
     impl_askForSavePath();
 }
 
-
 void BrokenRecoveryDialog::impl_askForSavePath()
 {
     css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker =
@@ -1335,7 +1313,7 @@ void BrokenRecoveryDialog::impl_askForSavePath()
         m_sSavePath = xFolderPicker->getDirectory();
         OUString sPath;
         osl::FileBase::getSystemPathFromFileURL(m_sSavePath, sPath);
-        m_pSaveDirED->SetText( sPath );
+        m_xSaveDirED->set_text(sPath);
     }
 }
 
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index c0fc7eda5cb6..d87afdb6ee27 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -70,8 +70,8 @@
 #define RECOVERY_OPERATIONSTATE_UPDATE              "update"
 
 #define DLG_RET_UNKNOWN                                  -1
-#define DLG_RET_OK                                        1
-#define DLG_RET_CANCEL                                    0
+#define DLG_RET_OK                                      RET_OK
+#define DLG_RET_CANCEL                                  RET_CANCEL
 #define DLG_RET_OK_AUTOLUNCH                            101
 
 
@@ -146,6 +146,7 @@ struct TURLInfo
 
     /// standard icon
     Image StandardImage;
+    OUString StandardImageId;
 
     public:
 
@@ -535,65 +536,58 @@ class RecoveryDialog : public Dialog
 };
 
 
-class BrokenRecoveryDialog : public ModalDialog
+class BrokenRecoveryDialog : public weld::GenericDialogController
 {
+// member
+private:
+    OUString m_sSavePath;
+    RecoveryCore*   m_pCore;
+    bool const        m_bBeforeRecovery;
+    bool        m_bExecutionNeeded;
+
+    std::unique_ptr<weld::TreeView> m_xFileListLB;
+    std::unique_ptr<weld::Entry> m_xSaveDirED;
+    std::unique_ptr<weld::Button> m_xSaveDirBtn;
+    std::unique_ptr<weld::Button> m_xOkBtn;
+    std::unique_ptr<weld::Button> m_xCancelBtn;
+
+// interface
+public:
 
-    // member
-    private:
-        VclPtr<ListBox>         m_pFileListLB;
-        VclPtr<Edit>            m_pSaveDirED;
-        VclPtr<PushButton>      m_pSaveDirBtn;
-        VclPtr<PushButton>      m_pOkBtn;
-        VclPtr<CancelButton>    m_pCancelBtn;
-
-        OUString m_sSavePath;
-        RecoveryCore*   m_pCore;
-        bool const        m_bBeforeRecovery;
-        bool        m_bExecutionNeeded;
-
-
-    // interface
-    public:
-
-
-        /** @short TODO */
-        BrokenRecoveryDialog(vcl::Window*       pParent        ,
-                             RecoveryCore* pCore          ,
-                             bool      bBeforeRecovery);
-        virtual ~BrokenRecoveryDialog() override;
-        virtual void dispose() override;
-
-
-        /** @short TODO */
-        bool isExecutionNeeded();
-
+    /** @short TODO */
+    BrokenRecoveryDialog(weld::Window* pParent,
+                         RecoveryCore* pCore,
+                         bool bBeforeRecovery);
+    virtual ~BrokenRecoveryDialog() override;
 
-        /** @short TODO */
-        const OUString& getSaveDirURL();
+    /** @short TODO */
+    bool isExecutionNeeded();
 
 
-    // helper
-    private:
+    /** @short TODO */
+    const OUString& getSaveDirURL();
 
 
-        /** @short TODO */
-        void impl_refresh();
+// helper
+private:
+    /** @short TODO */
+    void impl_refresh();
 
 
-        /** @short TODO */
-        DECL_LINK(SaveButtonHdl, Button*, void);
+    /** @short TODO */
+    DECL_LINK(SaveButtonHdl, weld::Button&, void);
 
 
-        /** @short TODO */
-        DECL_LINK(OkButtonHdl, Button*, void);
+    /** @short TODO */
+    DECL_LINK(OkButtonHdl, weld::Button&, void);
 
 
-        /** @short TODO */
-        DECL_LINK(CancelButtonHdl, Button*, void);
+    /** @short TODO */
+    DECL_LINK(CancelButtonHdl, weld::Button&, void);
 
 
-        /** @short TODO */
-        void impl_askForSavePath();
+    /** @short TODO */
+    void impl_askForSavePath();
 };
     }
 }
diff --git a/svx/uiconfig/ui/docrecoverybrokendialog.ui b/svx/uiconfig/ui/docrecoverybrokendialog.ui
index 798ea7f94953..a1626b1ea3a1 100644
--- a/svx/uiconfig/ui/docrecoverybrokendialog.ui
+++ b/svx/uiconfig/ui/docrecoverybrokendialog.ui
@@ -1,12 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="svx">
   <requires lib="gtk+" version="3.18"/>
+  <object class="GtkListStore" id="liststore1">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkDialog" id="DocRecoveryBrokenDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="docrecoverybrokendialog|DocRecoveryBrokenDialog">%PRODUCTNAME Document Recovery</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>
@@ -17,9 +31,8 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="save">
+              <object class="GtkButton" id="ok">
                 <property name="label" translatable="yes" context="docrecoverybrokendialog|save">_Save</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
@@ -36,7 +49,6 @@
             <child>
               <object class="GtkButton" id="cancel">
                 <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -70,12 +82,12 @@
                 <property name="can_focus">False</property>
                 <property name="halign">start</property>
                 <property name="hexpand">True</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="docrecoverybrokendialog|label1">The automatic recovery process was interrupted.
 
 The documents listed below will be saved in the folder noted below if you click 'Save'. Click 'Cancel' to close the wizard without saving the documents.</property>
                 <property name="wrap">True</property>
                 <property name="max_width_chars">100</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -90,7 +102,7 @@ The documents listed below will be saved in the folder noted below if you click
                 <property name="halign">start</property>
                 <property name="label" translatable="yes" context="docrecoverybrokendialog|label3">Documents:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">filelist:border</property>
+                <property name="mnemonic_widget">filelist</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -99,14 +111,38 @@ The documents listed below will be saved in the folder noted below if you click
               </packing>
             </child>
             <child>
-              <object class="GtkTreeView" id="filelist:border">
-                <property name="height_request">100</property>
+              <object class="GtkScrolledWindow">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <child internal-child="selection">
-                  <object class="GtkTreeSelection" id="treeview-selection1"/>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkTreeView" id="filelist">
+                    <property name="height_request">100</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="model">liststore1</property>
+                    <property name="headers_visible">False</property>
+                    <property name="headers_clickable">False</property>
+                    <property name="search_column">0</property>
+                    <property name="show_expanders">False</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="treeview-selection2"/>
+                    </child>
+                    <child>
+                      <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                        <child>
+                          <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
                 </child>
               </object>
               <packing>
@@ -120,10 +156,10 @@ The documents listed below will be saved in the folder noted below if you click
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="halign">start</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="docrecoverybrokendialog|label4">_Save to:</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">savedir</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -152,7 +188,6 @@ The documents listed below will be saved in the folder noted below if you click
                 <child>
                   <object class="GtkButton" id="change">
                     <property name="label" translatable="yes" context="docrecoverybrokendialog|change">Chan_ge...</property>
-                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
@@ -181,7 +216,7 @@ The documents listed below will be saved in the folder noted below if you click
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">save</action-widget>
+      <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
     </action-widgets>
   </object>


More information about the Libreoffice-commits mailing list