summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/validate.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-03-09 15:40:35 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-07-17 14:31:37 +0200
commitc52c159c7cb193bdee2098560d6c77a227d02cb2 (patch)
treea95012a850089fd661211c567d3d15658d076495 /sc/source/ui/dbgui/validate.cxx
parent056fda41dd3da6795e772bebcdaab41e78f31716 (diff)
jsdialog: Add mobile version of data validation dialog
Change-Id: I8c59892196ae015852fff6004c72e1990b35c1af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97762 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98902 Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/dbgui/validate.cxx')
-rw-r--r--sc/source/ui/dbgui/validate.cxx17
1 files changed, 15 insertions, 2 deletions
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"))