Kaydet (Commit) 525f7c67 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld OfaAutocorrExceptPage

Change-Id: I735ca7d70045b278d6b885cc2de35bf76885b487
Reviewed-on: https://gerrit.libreoffice.org/64258Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8186f8e2
......@@ -178,42 +178,8 @@ public:
virtual void ActivatePage( const SfxItemSet& ) override;
};
// class AutoCorrEdit ----------------------------------------------------
class AutoCorrEdit : public Edit
{
Link<AutoCorrEdit&,bool> aActionLink;
VclPtr<SvTabListBox> m_xReplaceTLB;
sal_Int32 m_nCol;
bool bSpaces;
void dispose() override;
public:
AutoCorrEdit(vcl::Window* pParent)
: Edit(pParent)
, m_nCol(0)
, bSpaces(false)
{
}
virtual ~AutoCorrEdit() override;
void SetActionHdl( const Link<AutoCorrEdit&,bool>& rLink )
{ aActionLink = rLink;}
void ConnectColumn(const VclPtr<SvTabListBox>& rTable, sal_Int32 nCol);
void SetSpaces(bool bSet)
{bSpaces = bSet;}
virtual void KeyInput( const KeyEvent& rKEvent ) override;
virtual void Resize() override;
};
// class OfaAutocorrReplacePage ------------------------------------------
struct DoubleString
{
OUString sShort;
......@@ -308,34 +274,34 @@ class OfaAutocorrExceptPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
VclPtr<AutoCorrEdit> m_pAbbrevED;
VclPtr<ListBox> m_pAbbrevLB;
VclPtr<PushButton> m_pNewAbbrevPB;
VclPtr<PushButton> m_pDelAbbrevPB;
VclPtr<CheckBox> m_pAutoAbbrevCB;
VclPtr<AutoCorrEdit> m_pDoubleCapsED;
VclPtr<ListBox> m_pDoubleCapsLB;
VclPtr<PushButton> m_pNewDoublePB;
VclPtr<PushButton> m_pDelDoublePB;
VclPtr<CheckBox> m_pAutoCapsCB;
StringsTable aStringsTable;
std::unique_ptr<CollatorWrapper> pCompareClass;
LanguageType eLang;
DECL_LINK(NewDelButtonHdl, Button*, void);
DECL_LINK(NewDelActionHdl, AutoCorrEdit&, bool);
DECL_LINK(SelectHdl, ListBox&, void);
DECL_LINK(ModifyHdl, Edit&, void);
void NewDelHdl(void const *);
std::unique_ptr<weld::Entry> m_xAbbrevED;
std::unique_ptr<weld::TreeView> m_xAbbrevLB;
std::unique_ptr<weld::Button> m_xNewAbbrevPB;
std::unique_ptr<weld::Button> m_xDelAbbrevPB;
std::unique_ptr<weld::CheckButton> m_xAutoAbbrevCB;
std::unique_ptr<weld::Entry> m_xDoubleCapsED;
std::unique_ptr<weld::TreeView> m_xDoubleCapsLB;
std::unique_ptr<weld::Button> m_xNewDoublePB;
std::unique_ptr<weld::Button> m_xDelDoublePB;
std::unique_ptr<weld::CheckButton> m_xAutoCapsCB;
DECL_LINK(NewDelButtonHdl, weld::Button&, void);
DECL_LINK(NewDelActionHdl, weld::Entry&, bool);
DECL_LINK(SelectHdl, weld::TreeView&, void);
DECL_LINK(ModifyHdl, weld::Entry&, void);
void NewDelHdl(const weld::Widget*);
/// Box filled with new language
void RefillReplaceBoxes(bool bFromReset,
LanguageType eOldLanguage,
LanguageType eNewLanguage);
public:
OfaAutocorrExceptPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaAutocorrExceptPage() override;
OfaAutocorrExceptPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~OfaAutocorrExceptPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent,
......
......@@ -2,6 +2,22 @@
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkTreeStore" id="liststore2">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkBox" id="AcorExceptPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -33,7 +49,7 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="cuilo-AutoCorrEdit" id="abbrev">
<object class="GtkEntry" id="abbrev">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
......@@ -135,18 +151,38 @@
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="width_request">1</property>
<object class="GtkScrolledWindow">
<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="GtkTreeView" id="abbrevlist:border">
<property name="show_expanders">False</property>
<object class="GtkTreeView" id="abbrevlist">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="headers_visible">False</property>
<property name="model">liststore2</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Macro Library List-selection2"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="resizable">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer2"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
......@@ -203,7 +239,7 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="cuilo-AutoCorrEdit" id="double">
<object class="GtkEntry" id="double">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">start</property>
......@@ -306,18 +342,38 @@
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="width_request">1</property>
<object class="GtkScrolledWindow">
<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="GtkTreeView" id="doublelist:border">
<property name="show_expanders">False</property>
<object class="GtkTreeView" id="doublelist">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="headers_visible">False</property>
<property name="model">liststore1</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Macro Library List-selection1"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="resizable">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
......
......@@ -268,9 +268,6 @@
<glade-widget-class title="Dictionary Edit" name="cuilo-SvxDictEdit"
generic-name="SvxDictEdit" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="AutoCorrect Edit" name="cuilo-AutoCorrEdit"
generic-name="AutoCorrEdit" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Glossary List" name="swuilo-SwGlossaryGroupTLB"
generic-name="Glossary List" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
......
......@@ -59,16 +59,16 @@ class autocorrectOptions(UITestCase):
delabbrev = xDialog.getChild("delabbrev")
abbrevlist = xDialog.getChild("abbrevlist")
nrRowsAbb = get_state_as_dict(abbrevlist)["EntryCount"]
nrRowsAbb = get_state_as_dict(abbrevlist)["Children"]
abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"}))
newabbrev.executeAction("CLICK", tuple())
nrRowsAbbNew = get_state_as_dict(abbrevlist)["EntryCount"]
nrRowsAbbNew = get_state_as_dict(abbrevlist)["Children"]
nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
delabbrev.executeAction("CLICK", tuple())
self.assertEqual(get_state_as_dict(abbrevlist)["EntryCount"], nrRowsAbb) #we have default nr of rules
self.assertEqual(get_state_as_dict(abbrevlist)["Children"], nrRowsAbb) #we have default nr of rules
#words with two initial capitals
double = xDialog.getChild("double")
......@@ -76,16 +76,16 @@ class autocorrectOptions(UITestCase):
deldouble = xDialog.getChild("deldouble")
doublelist = xDialog.getChild("doublelist")
nrRowsDouble = get_state_as_dict(doublelist)["EntryCount"]
nrRowsDouble = get_state_as_dict(doublelist)["Children"]
double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"}))
newdouble.executeAction("CLICK", tuple())
nrRowsDoubleNew = get_state_as_dict(doublelist)["EntryCount"]
nrRowsDoubleNew = get_state_as_dict(doublelist)["Children"]
nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and
self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule
deldouble.executeAction("CLICK", tuple())
self.assertEqual(get_state_as_dict(doublelist)["EntryCount"], nrRowsDouble) #we have default nr of rules
self.assertEqual(get_state_as_dict(doublelist)["Children"], nrRowsDouble) #we have default nr of rules
xCancelButton = xDialog.getChild("cancel")
xCancelButton.executeAction("CLICK", tuple())
......
......@@ -60,16 +60,16 @@ class autocorrectOptions(UITestCase):
delabbrev = xDialog.getChild("delabbrev")
abbrevlist = xDialog.getChild("abbrevlist")
nrRowsAbb = get_state_as_dict(abbrevlist)["EntryCount"]
nrRowsAbb = get_state_as_dict(abbrevlist)["Children"]
abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"}))
newabbrev.executeAction("CLICK", tuple())
nrRowsAbbNew = get_state_as_dict(abbrevlist)["EntryCount"]
nrRowsAbbNew = get_state_as_dict(abbrevlist)["Children"]
nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
delabbrev.executeAction("CLICK", tuple())
self.assertEqual(get_state_as_dict(abbrevlist)["EntryCount"], nrRowsAbb) #we have default nr of rules
self.assertEqual(get_state_as_dict(abbrevlist)["Children"], nrRowsAbb) #we have default nr of rules
#words with two initial capitals
double = xDialog.getChild("double")
......@@ -77,16 +77,16 @@ class autocorrectOptions(UITestCase):
deldouble = xDialog.getChild("deldouble")
doublelist = xDialog.getChild("doublelist")
nrRowsDouble = get_state_as_dict(doublelist)["EntryCount"]
nrRowsDouble = get_state_as_dict(doublelist)["Children"]
double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"}))
newdouble.executeAction("CLICK", tuple())
nrRowsDoubleNew = get_state_as_dict(doublelist)["EntryCount"]
nrRowsDoubleNew = get_state_as_dict(doublelist)["Children"]
nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and
self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule
deldouble.executeAction("CLICK", tuple())
self.assertEqual(get_state_as_dict(doublelist)["EntryCount"], nrRowsDouble) #we have default nr of rules
self.assertEqual(get_state_as_dict(doublelist)["Children"], nrRowsDouble) #we have default nr of rules
xCancelButton = xDialog.getChild("cancel")
xCancelButton.executeAction("CLICK", tuple())
......
......@@ -403,7 +403,6 @@ constructor_map = {
custom_widgets = [
'ArgEdit',
'AutoCompleteMultiListBox',
'AutoCorrEdit',
'BookmarksBox',
'CaptionComboBox',
'CategoryListBox',
......
......@@ -18,6 +18,8 @@ cui/uiconfig/ui/aboutconfigdialog.ui://GtkLabel[@id='value'] orphan-label
cui/uiconfig/ui/aboutconfigdialog.ui://svtlo-SvSimpleTableContainer[@id='preferences'] no-labelled-by
cui/uiconfig/ui/aboutconfigvaluedialog.ui://GtkLabel[@id='label1'] orphan-label
cui/uiconfig/ui/aboutconfigvaluedialog.ui://cuilo-CuiCustomMultilineEdit[@id='valuebox'] no-labelled-by
cui/uiconfig/ui/acorexceptpage.ui://GtkEntry[@id='abbrev'] no-labelled-by
cui/uiconfig/ui/acorexceptpage.ui://GtkEntry[@id='double'] no-labelled-by
cui/uiconfig/ui/applyautofmtpage.ui://GtkLabel[@id='label1'] orphan-label
cui/uiconfig/ui/applyautofmtpage.ui://GtkLabel[@id='label2'] orphan-label
cui/uiconfig/ui/applyautofmtpage.ui://GtkLabel[@id='m'] orphan-label
......
......@@ -59,16 +59,16 @@ class autocorrectOptions(UITestCase):
delabbrev = xDialog.getChild("delabbrev")
abbrevlist = xDialog.getChild("abbrevlist")
nrRowsAbb = get_state_as_dict(abbrevlist)["EntryCount"]
nrRowsAbb = get_state_as_dict(abbrevlist)["Children"]
abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"}))
newabbrev.executeAction("CLICK", tuple())
nrRowsAbbNew = get_state_as_dict(abbrevlist)["EntryCount"]
nrRowsAbbNew = get_state_as_dict(abbrevlist)["Children"]
nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
delabbrev.executeAction("CLICK", tuple())
self.assertEqual(get_state_as_dict(abbrevlist)["EntryCount"], nrRowsAbb) #we have default nr of rules
self.assertEqual(get_state_as_dict(abbrevlist)["Children"], nrRowsAbb) #we have default nr of rules
#words with two initial capitals
double = xDialog.getChild("double")
......@@ -76,16 +76,16 @@ class autocorrectOptions(UITestCase):
deldouble = xDialog.getChild("deldouble")
doublelist = xDialog.getChild("doublelist")
nrRowsDouble = get_state_as_dict(doublelist)["EntryCount"]
nrRowsDouble = get_state_as_dict(doublelist)["Children"]
double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"}))
newdouble.executeAction("CLICK", tuple())
nrRowsDoubleNew = get_state_as_dict(doublelist)["EntryCount"]
nrRowsDoubleNew = get_state_as_dict(doublelist)["Children"]
nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and
self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule
deldouble.executeAction("CLICK", tuple())
self.assertEqual(get_state_as_dict(doublelist)["EntryCount"], nrRowsDouble) #we have default nr of rules
self.assertEqual(get_state_as_dict(doublelist)["Children"], nrRowsDouble) #we have default nr of rules
xCancelButton = xDialog.getChild("cancel")
xCancelButton.executeAction("CLICK", tuple())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment