[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - desktop/source include/vcl vcl/inc vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri May 15 08:33:59 UTC 2020


 desktop/source/lib/init.cxx          |   11 +++++++++++
 include/vcl/tabctrl.hxx              |    2 ++
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   16 ++++++++++++++++
 vcl/jsdialog/jsdialogbuilder.cxx     |   13 +++++++++++++
 vcl/source/control/tabctrl.cxx       |   18 ++++++++++++++++++
 5 files changed, 60 insertions(+)

New commits:
commit 452faf81ff5c1fb56f4366be76cb3d51a4e4e48f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 4 16:04:08 2020 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Fri May 15 10:33:15 2020 +0200

    jsdialog: send tab names
    
    Change-Id: Iaae09ec6fc1af0de7f052b89a09ea184a023be70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94182
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6a95b2656409..a540771f4307 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3595,6 +3595,17 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
                         pUIWindow->execute(sClearAction, aMap);
                         pUIWindow->execute(sTypeAction, aMap);
                     }
+                    else if (aMap["cmd"] == "value")
+                    {
+                        aMap["VALUE"] = aMap["data"];
+                        pUIWindow->execute(sValue, aMap);
+                    }
+                    else if (aMap["cmd"] == "selecttab")
+                    {
+                        aMap["POS"] = aMap["data"];
+
+                        pUIWindow->execute(sSelectAction, aMap);
+                    }
                     else
                         bIsClickAction = true;
                 }
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 789c200b159d..6789045b9c4e 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -185,6 +185,8 @@ public:
     virtual FactoryFunction GetUITestFactory() const override;
 
     virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
+
+    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 };
 
 class NotebookBar;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 1f32f7de8c1a..96ca6dd4f9fc 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2185,6 +2185,24 @@ FactoryFunction TabControl::GetUITestFactory() const
     return TabControlUIObject::create;
 }
 
+boost::property_tree::ptree TabControl::DumpAsPropertyTree()
+{
+    boost::property_tree::ptree aTree = Control::DumpAsPropertyTree();
+
+    boost::property_tree::ptree aTabs;
+    for(auto id : GetPageIDs())
+    {
+        boost::property_tree::ptree aTab;
+        aTab.put("text", GetPageText(id));
+        aTab.put("id", id);
+        aTabs.push_back(std::make_pair("", aTab));
+    }
+
+    aTree.add_child("tabs", aTabs);
+
+    return aTree;
+}
+
 sal_uInt16 NotebookbarTabControlBase::m_nHeaderHeight = 0;
 
 IMPL_LINK_NOARG(NotebookbarTabControlBase, OpenMenu, Button*, void)
commit a3c807d0e957bd40f2bf75f42973cf87d568addb
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 28 15:10:24 2020 +0100
Commit:     Szymon Kłos <eszkadev at gmail.com>
CommitDate: Fri May 15 10:33:15 2020 +0200

    jsdialog: react on button state change
    
    Change-Id: I19b8b4f123373da1acc7e2815086a67bcdb43e76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94148
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 98126bfcc12f..24b1ef7808c1 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -8,6 +8,7 @@
 #include <vcl/builder.hxx>
 #include <salvtables.hxx>
 #include <vcl/combobox.hxx>
+#include <vcl/button.hxx>
 
 class JSDialogSender
 {
@@ -30,6 +31,8 @@ public:
                                                       bool bTakeOwnership = true) override;
     virtual std::unique_ptr<weld::Label> weld_label(const OString& id,
                                                     bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Button> weld_button(const OString& id,
+                                                      bool bTakeOwnership = false) override;
     virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id,
                                                     bool bTakeOwnership = false) override;
     virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id,
@@ -58,6 +61,12 @@ public:
         BaseInstanceClass::hide();
         notifyDialogState();
     }
+
+    virtual void set_sensitive(bool sensitive) override
+    {
+        BaseInstanceClass::set_sensitive(sensitive);
+        notifyDialogState();
+    }
 };
 
 class VCL_DLLPUBLIC JSLabel : public JSWidget<SalInstanceLabel, FixedText>
@@ -68,6 +77,13 @@ public:
     virtual void set_label(const OUString& rText) override;
 };
 
+class VCL_DLLPUBLIC JSButton : public JSWidget<SalInstanceButton, ::Button>
+{
+public:
+    JSButton(VclPtr<vcl::Window> aOwnedToplevel, ::Button* pButton, SalInstanceBuilder* pBuilder,
+             bool bTakeOwnership);
+};
+
 class VCL_DLLPUBLIC JSEntry : public JSWidget<SalInstanceEntry, ::Edit>
 {
 public:
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 52fa6a19a8e1..2d104e424bd9 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -65,6 +65,13 @@ std::unique_ptr<weld::Label> JSInstanceBuilder::weld_label(const OString& id, bo
     return std::make_unique<JSLabel>(m_aOwnedToplevel, pLabel, this, bTakeOwnership);
 }
 
+std::unique_ptr<weld::Button> JSInstanceBuilder::weld_button(const OString& id, bool bTakeOwnership)
+{
+    ::Button* pButton = m_xBuilder->get<::Button>(id);
+    return pButton ? o3tl::make_unique<JSButton>(m_aOwnedToplevel, pButton, this, bTakeOwnership)
+                   : nullptr;
+}
+
 std::unique_ptr<weld::Entry> JSInstanceBuilder::weld_entry(const OString& id, bool bTakeOwnership)
 {
     Edit* pEntry = m_xBuilder->get<Edit>(id);
@@ -96,6 +103,12 @@ void JSLabel::set_label(const OUString& rText)
     notifyDialogState();
 };
 
+JSButton::JSButton(VclPtr<vcl::Window> aOwnedToplevel, ::Button* pButton,
+                   SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+    : JSWidget<SalInstanceButton, ::Button>(aOwnedToplevel, pButton, pBuilder, bTakeOwnership)
+{
+}
+
 JSEntry::JSEntry(VclPtr<vcl::Window> aOwnedToplevel, ::Edit* pEntry, SalInstanceBuilder* pBuilder,
                  bool bTakeOwnership)
     : JSWidget<SalInstanceEntry, ::Edit>(aOwnedToplevel, pEntry, pBuilder, bTakeOwnership)


More information about the Libreoffice-commits mailing list