summaryrefslogtreecommitdiff
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-06 09:26:09 +0200
commitd9e3b08d83cfadbff12da2fbba6a37830fb6f7cf (patch)
treebfe50d5c22dac607ded1f8a30ac2f737ed4e898a
parent4c84a73d741022e6ee0015a4a6bd3e4e8dc884e7 (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>
-rw-r--r--sc/UIConfig_scalc.mk2
-rw-r--r--sc/source/ui/dbgui/validate.cxx17
-rw-r--r--sc/uiconfig/scalc/ui/erroralerttabpage-mobile.ui151
-rw-r--r--sc/uiconfig/scalc/ui/validationhelptabpage-mobile.ui109
-rw-r--r--vcl/source/window/builder.cxx7
5 files changed, 283 insertions, 3 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index bf1798cd5275..075b3173739e 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -125,6 +125,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 \
@@ -244,6 +245,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/ztestdialog \
))
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 41bc913db911..e2c960d1820f 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..2faa72dba83d
--- /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|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|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|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|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|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|actionCB">Stop</item>
+ <item translatable="yes" context="erroralerttabpage|actionCB">Warning</item>
+ <item translatable="yes" context="erroralerttabpage|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..ea5146be8f1f
--- /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|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|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|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 6cc2c91d137c..ecc497f0c142 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -157,7 +157,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;
}