From c52c159c7cb193bdee2098560d6c77a227d02cb2 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 9 Mar 2020 15:40:35 +0100 Subject: jsdialog: Add mobile version of data validation dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8c59892196ae015852fff6004c72e1990b35c1af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97762 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98902 Tested-by: Jenkins --- sc/source/ui/dbgui/validate.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sc/source/ui/dbgui/validate.cxx') 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 #include #include +#include +#include + + +#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")) -- cgit