[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 27 10:43:18 UTC 2020


 include/vcl/toolkit/dialog.hxx   |    2 ++
 vcl/jsdialog/executor.cxx        |   12 ++++++++++++
 vcl/jsdialog/jsdialogbuilder.cxx |    3 +++
 vcl/source/window/dialog.cxx     |    7 +++++++
 4 files changed, 24 insertions(+)

New commits:
commit 60ec1659924be692de2985d2b1a5363976db6ca1
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 19 13:50:30 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Nov 27 11:42:54 2020 +0100

    jsdialog: dump dialog title
    
    Change-Id: Id4c9f336039f8a0b8d1d43fdff4852f32e2c7ae6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106707
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx
index 3c519d0a5004..1d3064784bd4 100644
--- a/include/vcl/toolkit/dialog.hxx
+++ b/include/vcl/toolkit/dialog.hxx
@@ -154,6 +154,8 @@ public:
     void            set_default_response(int nResponse);
     int             get_default_response() const;
     vcl::Window*    get_widget_for_response(int nResponse);
+
+    void            DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
 };
 
 #endif // INCLUDED_VCL_DIALOG_HXX
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 5618af225d4c..c6aed4909b87 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -60,6 +60,7 @@
 #include <vcl/IDialogRenderable.hxx>
 #include <messagedialog.hxx>
 #include <salframe.hxx>
+#include <tools/json_writer.hxx>
 
 #include <iostream>
 #include <utility>
@@ -1614,4 +1615,10 @@ void TopLevelWindowLocker::decBusy()
     m_aBusyStack.pop();
 }
 
+void Dialog::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+    SystemWindow::DumpAsPropertyTree(rJsonWriter);
+    rJsonWriter.put("title", GetText());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b6d634d74c0231173d6b43357b7cd3cecb76407d
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Nov 18 12:14:35 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Nov 27 11:42:38 2020 +0100

    jsdialog: remember dialog instance & handle close
    
    Change-Id: I1b10d12edfa7ffca1061f50b5219baae1ac3caeb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106706
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 13ffc1a33e06..83d19fd7b657 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -242,6 +242,18 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                 }
             }
         }
+        else if (sControlType == "dialog")
+        {
+            auto pDialog = dynamic_cast<weld::Dialog*>(pWidget);
+            if (pDialog)
+            {
+                if (sAction == "close")
+                {
+                    pDialog->response(RET_CANCEL);
+                    return true;
+                }
+            }
+        }
     }
 
     return false;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 58c8c64d1108..13b438022e7e 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -365,6 +365,9 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id)
     std::unique_ptr<weld::Dialog> pRet(pDialog ? new JSDialog(m_aOwnedToplevel, m_aOwnedToplevel,
                                                               pDialog, this, false, m_sTypeOfJSON)
                                                : nullptr);
+
+    RememberWidget("__DIALOG__", pRet.get());
+
     if (pDialog)
     {
         assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");


More information about the Libreoffice-commits mailing list