sc/UIConfig_scalc.mk | 2 sc/source/ui/dbgui/validate.cxx | 17 +- sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui | 151 +++++++++++++++++++ sc/uiconfig/scalc/ui/validationhelptabpage-mobile.ui | 109 +++++++++++++ vcl/source/window/builder.cxx | 7 5 files changed, 283 insertions(+), 3 deletions(-)
New commits: commit c52c159c7cb193bdee2098560d6c77a227d02cb2 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Mar 9 15:40:35 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Jul 17 14:31:37 2020 +0200 jsdialog: Add mobile version of data validation dialog Change-Id: I8c59892196ae015852fff6004c72e1990b35c1af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97762 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98902 Tested-by: Jenkins diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 38b6acaf0f0d..b2485054ab45 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -123,6 +123,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/dropmenu \ sc/uiconfig/scalc/ui/doubledialog \ sc/uiconfig/scalc/ui/erroralerttabpage \ + sc/uiconfig/scalc/ui/erroralerttabpage-mobile \ sc/uiconfig/scalc/ui/externaldata \ sc/uiconfig/scalc/ui/exponentialsmoothingdialog \ sc/uiconfig/scalc/ui/filldlg \ @@ -246,6 +247,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/validationdialog \ sc/uiconfig/scalc/ui/validationcriteriapage \ sc/uiconfig/scalc/ui/validationhelptabpage \ + sc/uiconfig/scalc/ui/validationhelptabpage-mobile \ sc/uiconfig/scalc/ui/xmlsourcedialog \ sc/uiconfig/scalc/ui/zoombox \ sc/uiconfig/scalc/ui/ztestdialog \ diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 0c1f63cabdfd..33d5fcd485a7 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -44,6 +44,11 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/childwin.hxx> #include <reffact.hxx> +#include <comphelper/lok.hxx> +#include <sfx2/lokhelper.hxx> + + +#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone()) /* Position indexes for "Allow" list box. They do not map directly to ScValidationMode and can safely be modified to @@ -93,6 +98,12 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, const SfxItemSet* pArgSe AddTabPage(m_sValuePageId, ScTPValidationValue::Create, nullptr); AddTabPage("inputhelp", ScTPValidationHelp::Create, nullptr); AddTabPage("erroralert", ScTPValidationError::Create, nullptr); + + if (IS_MOBILE) + { + m_xBuilder->weld_button("cancel")->hide(); + m_xBuilder->weld_button("help")->hide(); + } } ScValidationDlg::~ScValidationDlg() @@ -679,7 +690,8 @@ IMPL_LINK_NOARG(ScTPValidationValue, CheckHdl, weld::Button&, void) // Input Help Page ScTPValidationHelp::ScTPValidationHelp(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet) - : SfxTabPage(pPage, pController, "modules/scalc/ui/validationhelptabpage.ui", "ValidationHelpTabPage", &rArgSet) + : SfxTabPage(pPage, pController, IS_MOBILE ? OUString("modules/scalc/ui/validationhelptabpage-mobile.ui") + : OUString("modules/scalc/ui/validationhelptabpage.ui"), "ValidationHelpTabPage", &rArgSet) , m_xTsbHelp(m_xBuilder->weld_check_button("tsbhelp")) , m_xEdtTitle(m_xBuilder->weld_entry("title")) , m_xEdInputHelp(m_xBuilder->weld_text_view("inputhelp")) @@ -732,7 +744,8 @@ ScTPValidationError::ScTPValidationError(weld::Container* pPage, weld::DialogCon const SfxItemSet& rArgSet) : SfxTabPage ( pPage, pController, - "modules/scalc/ui/erroralerttabpage.ui", "ErrorAlertTabPage", + IS_MOBILE ? OUString("modules/scalc/ui/erroralerttabpage-mobile.ui") + : OUString("modules/scalc/ui/erroralerttabpage.ui"), "ErrorAlertTabPage", &rArgSet ) , m_xTsbShow(m_xBuilder->weld_check_button("tsbshow")) , m_xLbAction(m_xBuilder->weld_combo_box("actionCB")) diff --git a/sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui b/sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui new file mode 100644 index 000000000000..05406e413326 --- /dev/null +++ b/sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.4 --> +<interface domain="sc"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkBox" id="ErrorAlertTabPage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkCheckButton" id="tsbshow"> + <property name="label" translatable="yes" context="erroralerttabpage-mobile|tsbshow">Show error _message when invalid values are entered</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="hexpand">True</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="action_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="erroralerttabpage-mobile|action_label">_Action:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">actionCB</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="title_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="erroralerttabpage-mobile|title_label">_Title:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">erroralert_title</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTextView" id="errorMsg"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="vexpand">True</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="erroralert_title"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="activates_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="errormsg_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="erroralerttabpage-mobile|errormsg_label">_Error message:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">errorMsg</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> + </packing> + </child> + <child> + <object class="GtkButton" id="browseBtn"> + <property name="label" translatable="yes" context="erroralerttabpage-mobile|browseBtn">_Browse...</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="actionCB"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <items> + <item translatable="yes" context="erroralerttabpage-mobile|actionCB">Stop</item> + <item translatable="yes" context="erroralerttabpage-mobile|actionCB">Warning</item> + <item translatable="yes" context="erroralerttabpage-mobile|actionCB">Information</item> + </items> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> diff --git a/sc/uiconfig/scalc/ui/validationhelptabpage-mobile.ui b/sc/uiconfig/scalc/ui/validationhelptabpage-mobile.ui new file mode 100644 index 000000000000..9f191d10fc3e --- /dev/null +++ b/sc/uiconfig/scalc/ui/validationhelptabpage-mobile.ui @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.4 --> +<interface domain="sc"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkBox" id="ValidationHelpTabPage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkCheckButton" id="tsbhelp"> + <property name="label" translatable="yes" context="validationhelptabpage-mobile|tsbhelp">_Show input help when cell is selected</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="hexpand">True</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="inconsistent">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkEntry" id="title"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="title_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="validationhelptabpage-mobile|title_label">_Title:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">title</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="inputhelp_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="validationhelptabpage-mobile|inputhelp_label">_Input help:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">inputhelp</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTextView" id="inputhelp"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 6a02b7a9f86d..e280c0ce655b 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -165,7 +165,12 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString { if (rUIFile == "modules/swriter/ui/wordcount-mobile.ui" || rUIFile == "svx/ui/findreplacedialog-mobile.ui" || - rUIFile == "modules/swriter/ui/watermarkdialog.ui") + rUIFile == "modules/swriter/ui/watermarkdialog.ui" || + rUIFile == "modules/scalc/ui/validationdialog.ui" || + rUIFile == "modules/scalc/ui/validationcriteriapage.ui" || + rUIFile == "modules/scalc/ui/validationhelptabpage-mobile.ui" || + rUIFile == "modules/scalc/ui/erroralerttabpage-mobile.ui" || + rUIFile == "modules/scalc/ui/validationdialog.ui") bUseJSBuilder = true; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits