Skip to content

Commit 08ba4c5

Browse files
jnhyperionJohnny HuangvaleriobrunoValerio BrunoHelioGuilherme66
authored
Bug fixing on perference panel (#2220)
* Sync with upstreem (#1) * Fix parsing warning of report/ log html file (#2212) Should not show this warning message if there're report/log html file in the workspace. Co-authored-by: Johnny Huang <[email protected]> * Fix for 1668: Given a large test suite, selecting all tests from the root of tree, freezes RIDE for some time (#2210) * 1668: The Select All Tests command on the root of a deeply nested test folder, freezes RIDE for several minutes. The problem is caused by Tree.SelectAllTests strategy: expanding and collapsing all the nodes. This causes CPU waste to expand/collapse (and maybe render) and wait for the creation of the tree node handlers. The idea of the fix is to navigate the tests using the link between controllers. In order to avoid all the dancing of the tree nodes. In this commit: - Changed Tree.SelectAllTests() to extract all the TestCaseController(s) and invoke TestSelectionController to change the selection for these. - Now both _ActionHandler OnDeselectAllTests() and OnSelectAllTests() invoke Tree.SelectAllTests(), with a parameter. - When a new TestCaseHandler is created, is registered to be notified about selection changes. It uses this notification to update the graphical node with the check. - RideTestSelectedForRunningChanged now also holds the controller of the test which has changed selection and whether has been selected or unselected. * Replace Tree DeselectAllTests(node) with SelectAllTests(node,False) as it's much more efficient. * TestSelectionController: Keep a copy of the tests to propagate in the event, rather than rebuild it everytime. * When selecting multiple tests, from the test search, do it efficiently. TestSelectionController: add select_all() to select multiple tests efficiently. Rewrite unselect_all() in terms of select_all() Tree: when selecting multiple tests, no need to navigate the full tree, just use TestSelectionController. * When deselecting multiple tests, from the test search, do it efficiently. Tree: when deselecting multiple tests, no need to navigate the full tree, just use TestSelectionController. * Do not expand all the tree nodes when selecting failed/passed tests. - Keep the information of failed/passed tests in TestCaseController - Update the information on the test execution - When selecting only failed/passed tests navigate the controller'tree rather than the graphical tree. - removed method _for_all_tests() as it was causing all the nodes to be loaded/rendered. * When selecting/deselecting multiple Tests, notify a single selection change event. Rather than one for each Test. * Restore previous behavior with "Select Failed/Passed": select only those and de-select any other test. * keep track of the selected tests using the TestCaseController(s), instead of the list of names. This removes the need for listen of name changes. * No need to generate the list of names, when determining if there's any. * Fix TestSelectionController.add_tag() * Handle RideTestSelectedForRunningChanged event on a new wx thread stack. This is to avoid the "Recursionerror: maximum recursion depth exceeded" * Remove unused variable. * Propagate the RideTestSelectedForRunningChanged event only if the selection actually changed. Co-authored-by: Valerio Bruno <[email protected]> * Fix tree node (#2214) * Increase development version. * Fixes error message on RIDE Log about missing tree_node_selected. * Fixes error message on RIDE Log about missing clear_all. (#2215) * Separates AppendText for MessagesLog. Adds process memory limit on Me… (#2086) * Separates AppendText for MessagesLog. Adds process memory limit on MessagesLog. * Adds psutil to requirements. * Closes and reopens Messages Log window when process memory exceeds 80% * Key shortcuts update. * Fixes update notification * Improves Help links and About * Version 1.7.4rc1 * Update ride-1.7.4.rst Corrected rc1 version * Update ride-1.7.4.rst * Release notes for 1.7.4rc1 * Update ride-1.7.4.rst Make final version. * Development version * Improves release notes builder * Update ride-1.7.4.rst * Changes log to use unicode when on Python 2.7 (#2091) * Moved first condition at the end of the key processing event * Refactored structure of conditions in `OnKeyDown` * Makes some unit test files runnable * Version 1.7.4 * Back to development of 1.7.4.1 * Fixed shortcut in keyword tooltip. We no longer use Ctrl-M. (#2099) * Fixed shortcut in keyword tooltip. We no longer use Ctrl-M. * Updated implementation to use localize_shortcuts. * Fixed SelectAll issue in Grid Editor (#2096) * Moved first condition at the end of the key processing event * Refactored structure of conditions in `OnKeyDown` * Added debug prints and SelectAll shortcut when pressing Alt+A * Revert "Fixed SelectAll issue in Grid Editor (#2096)" (#2100) This reverts commit b7336e0. * Fixes newlines in cell tooltip (#2101) * Fixes newlines in cell tooltip * Fix tooltip unit test * Updates Maven and seleniumlibrary versions. (#2103) * Makes Text Editor read-only if file is read-only. Visual hint is back… (#2102) * Makes Text Editor read-only if file is read-only. Visual hint is background color change. * Updates Maven and seleniumlibrary versions. (#2103) * Fix named colors and update when file is read-only with focus on Text Editor * Update Travis to ubuntu xenial, wxPython and python 3.7 (#2104) * Corrects text update when on read-only on Text Editor (#2106) Fix read file when on read only on Text Editor * Fix for #1421, Repeated Resource files on Tree when on Windows (#2105) * Fix #2107 - Avoids changes in Resource file name when content assist. (#2109) * Removes changes to resource file name for suggestions of keywords * Avoids RuntimeError with ContentAssist for Resource Files * Fixes one test and reactivates other * Updates robotframework-mavenplugin version (#2110) * Uses unicode to calculate font name size when on Python 2.7 (#2112) * Made shortcuts from RIDE and Parser Log tabs to unregister when they're not selected * Removed debug prints and made Select All shortcut work (wasn't implemented) for Ride and Parser Log * Reverted workaround in previous commits and replaced `register_shortcuts` with OnKeyDown events to prevent further conflicts * Misc fixes (#2116) * Corrects Mac shortcut keys * Corrects messages for wxPython versions. * Added back shortcut registration for Cmd-C * Fixed SelectAll issue in Grid Editor, RIDE Log and Parser Log (#2113) * Moved first condition at the end of the key processing event * Refactored structure of conditions in `OnKeyDown` * Made shortcuts from RIDE and Parser Log tabs to unregister when they're not selected * Removed debug prints and made Select All shortcut work (wasn't implemented) for Ride and Parser Log * Reverted workaround in previous commits and replaced `register_shortcuts` with OnKeyDown events to prevent further conflicts * Added back shortcut registration for Cmd-C * Fixed SelectAll issue in Grid Editor, RIDE Log and Parser Log (#2113) * Moved first condition at the end of the key processing event * Refactored structure of conditions in `OnKeyDown` * Made shortcuts from RIDE and Parser Log tabs to unregister when they're not selected * Removed debug prints and made Select All shortcut work (wasn't implemented) for Ride and Parser Log * Reverted workaround in previous commits and replaced `register_shortcuts` with OnKeyDown events to prevent further conflicts * Added back shortcut registration for Cmd-C * Fixed SelectAll issue in Grid Editor, RIDE Log and Parser Log (#2113) * Moved first condition at the end of the key processing event * Refactored structure of conditions in `OnKeyDown` * Made shortcuts from RIDE and Parser Log tabs to unregister when they're not selected * Removed debug prints and made Select All shortcut work (wasn't implemented) for Ride and Parser Log * Reverted workaround in previous commits and replaced `register_shortcuts` with OnKeyDown events to prevent further conflicts * Added back shortcut registration for Cmd-C * Version 1.7.4.1 * Update ride-1.7.4.rst removed mentions to last support to python 2.7 * Update README.rest Version 1.7.4.1. * Back to development version - 2.0 * Replaces python 2.7 by 3.6 * Format Readme * Cleans Invoke * Removes python 2.7 from test_all.sh * Cleans tasks.py * Cleanup of wxPython/wxPhoenix version conditioning (#2121) * Adds pycodestyle for PyCharm PEP8 analysis * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Change max line length to 90 char, for PyCharm * Removes Python 2.7 support (#2124) * Adds pycodestyle for PyCharm PEP8 analysis * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Removal of wxPython version conditions, code cleanup phase 1 * Change max line length to 90 char, for PyCharm * Main removal of PY2 and PY3 * Final removal of PY2 and PY3 and basestring, unicode and unichar functions. * wx.NewId() to wx.NewIdRef() (#2125) * Changes wx.NewId to wx.NewIdRef * Add AppVeyor configuration (#2131) * Adds an autoclose timer to the Create Shortcut dialog. (#2130) * Adds an autoclose timer to the Create Shotcut dialog. * Changes Travis to use Ubuntu 18.04 * Appveyor (#2132) * Add AppVeyor configuration * Adds tox config * Changes install to be with tox (#2133) * Fixed Python 3.8 incompatibility (#2128) * Fixed setlocale error * Updated configobj to version 5.0.6 (latest). Old version was causing issues when reading from settings.cfg * Fixed small issue in preferences. Zoom factor wasn't getting set to negative values. * Fixes unit tests for #2128 (#2137) * Fixed setlocale error * Updated configobj to version 5.0.6 (latest). Old version was causing issues when reading from settings.cfg * Fixed small issue in preferences. Zoom factor wasn't getting set to negative values. * Fixes triggered errors and unit tests Co-authored-by: Nyral <[email protected]> * Fix travis (#2138) * Removes installation of RIDE. Avoids Segmentation fault on tags test * Fixes bad character when pressing a first key on Grid Editor * Fixes reprocessing of %date% %time% variables on Windows (#2141) * Inform that development branch is compatible with Python 3.8 * Cleans up unittests (#2142) * Fix one error that was being ignored * Restores two skipped tests. * Fixes resources and file unit tests * Better reason for skipped test. Removes errors of unclosed files * Reduced to two skipped tests * Attempt to clean C++ exceptions, only happens with Invoke * Fixed focus issue when using F2 to edit grid cell (#2140) * Added shortcut handling for F2 in order to set focus * Reverted previous commit and removed StartingClick because it's redundant. Text selection breaks if SelectAll() or SetSelection() is called after SetFocus(). This commit fixes that issue for double click and F2. * Added white color to inside the icon face (#2154) * Fixed crash when you delete tag and more (#2155) * Added condition to prevent event from return key from crashing RIDE * Added fix for when tag box remains empty when you delete the text you were writing in it; Added fix for TagBox deleted error when KillFocus is called. * Turns Test Suite Tree and File Explorer into Plugins (#2152) * Fix one error that was being ignored * First experiments * Test Suite Tree panel is now a Plugin * Changes File Explorer to be a Plugin * Added white color to inside the icon face (#2154) * Fixed crash when you delete tag and more (#2155) * Added condition to prevent event from return key from crashing RIDE * Added fix for when tag box remains empty when you delete the text you were writing in it; Added fix for TagBox deleted error when KillFocus is called. * Fixes perspectives on Tree pane * Fixes Perspectives and changes File Explorer to be a Plugin Co-authored-by: Nyral <[email protected]> * Fixes default arguments keyword help, #2134 (#2157) * Adds requirement for Python >=3.6 * Removes Python version conditioning * Adds APPDATA to environment and build step with Invoke. * Adds APPDATA var to tox.ini, changes to tox test * Adds badges for Travis and AppVeyor unit tests status * Adds README with ASCIIDoc format, will replace exisiting * Encloses text in Cell or selected text with certain symbols (#2158) * Encloses text in Cell or selected text with certain symbols * Corrects position of cursor. Fixes text selection highlight * Fixes select text (#2160) * Adds a flag to wx.TextControl to force selection highlight on Windows. * Text Editor - Encloses text in Cell or selected text with certain symbols. Adds support for Ctrl-3 and Ctrl-4 (Comment/Uncomment) * Fix comment/uncomment index range in Text Editor * Fix enclosing text * Fix variables creation * Fix keys in Grid editor * Fix keys in Grid Editor, [ and { still don't trigger * Fix error message from TreePlugin * Fix list selection on contextsuggestion. BREAKS enclose text in cell editor * Disable enclose text in cell editor when in Linux * Fixes { and [ in grid editor. Still disable in cell editor, on Linux * Adds autoident to Text Editor * Auto-indents, when first Task, Test or Keyword * Fixes { and [ in grid editor. Still disable in cell editor, on Linux * Fixes { and [ in Windows, grid editor * Fix keys (#2178) * Fixes { and [ in grid editor. Still disable in cell editor, on Linux * Avoids beep on keywords suggestions when on Linux * Adds ! to Save item on menu. Not detected when removed. (#2180) * Indents and de-indents block of selected text (#2181) * Experiments getting selection lines * Indent and de-indent blocks of text * Correct imports (#2182) * Adds conditions for wxPython 4.1.0 (#2184) * Upgrade wxPython to 4.1.0 (#2187) * Adds conditions for wxPython 4.1.0 * Fixes #2186 * Update docs about v1.7.4.2 * Log misc fixes (#2198) * Fixes syntax error * Makes error in removing log files a byte buffer. * Makes a test compatible with RF 3.2.1 * Better error and removal of old log files. (#2199) * Changes code to allow starting with File Explorer or Tree plugins disabled * Fix parsing warning of report/ log html file (#2212) Should not show this warning message if there're report/log html file in the workspace. Co-authored-by: Johnny Huang <[email protected]> * Fix for 1668: Given a large test suite, selecting all tests from the root of tree, freezes RIDE for some time (#2210) * 1668: The Select All Tests command on the root of a deeply nested test folder, freezes RIDE for several minutes. The problem is caused by Tree.SelectAllTests strategy: expanding and collapsing all the nodes. This causes CPU waste to expand/collapse (and maybe render) and wait for the creation of the tree node handlers. The idea of the fix is to navigate the tests using the link between controllers. In order to avoid all the dancing of the tree nodes. In this commit: - Changed Tree.SelectAllTests() to extract all the TestCaseController(s) and invoke TestSelectionController to change the selection for these. - Now both _ActionHandler OnDeselectAllTests() and OnSelectAllTests() invoke Tree.SelectAllTests(), with a parameter. - When a new TestCaseHandler is created, is registered to be notified about selection changes. It uses this notification to update the graphical node with the check. - RideTestSelectedForRunningChanged now also holds the controller of the test which has changed selection and whether has been selected or unselected. * Replace Tree DeselectAllTests(node) with SelectAllTests(node,False) as it's much more efficient. * TestSelectionController: Keep a copy of the tests to propagate in the event, rather than rebuild it everytime. * When selecting multiple tests, from the test search, do it efficiently. TestSelectionController: add select_all() to select multiple tests efficiently. Rewrite unselect_all() in terms of select_all() Tree: when selecting multiple tests, no need to navigate the full tree, just use TestSelectionController. * When deselecting multiple tests, from the test search, do it efficiently. Tree: when deselecting multiple tests, no need to navigate the full tree, just use TestSelectionController. * Do not expand all the tree nodes when selecting failed/passed tests. - Keep the information of failed/passed tests in TestCaseController - Update the information on the test execution - When selecting only failed/passed tests navigate the controller'tree rather than the graphical tree. - removed method _for_all_tests() as it was causing all the nodes to be loaded/rendered. * When selecting/deselecting multiple Tests, notify a single selection change event. Rather than one for each Test. * Restore previous behavior with "Select Failed/Passed": select only those and de-select any other test. * keep track of the selected tests using the TestCaseController(s), instead of the list of names. This removes the need for listen of name changes. * No need to generate the list of names, when determining if there's any. * Fix TestSelectionController.add_tag() * Handle RideTestSelectedForRunningChanged event on a new wx thread stack. This is to avoid the "Recursionerror: maximum recursion depth exceeded" * Remove unused variable. * Propagate the RideTestSelectedForRunningChanged event only if the selection actually changed. Co-authored-by: Valerio Bruno <[email protected]> * Fix tree node (#2214) * Increase development version. * Fixes error message on RIDE Log about missing tree_node_selected. * Fixes error message on RIDE Log about missing clear_all. (#2215) * Stops log when memory exceeds limit. Co-authored-by: Helio Guilherme <[email protected]> Co-authored-by: Nyral <[email protected]> Co-authored-by: Nyral <[email protected]> Co-authored-by: Johnny.H <[email protected]> Co-authored-by: Johnny Huang <[email protected]> Co-authored-by: Valerio <[email protected]> Co-authored-by: Valerio Bruno <[email protected]> * Nyral/fix encodings (#2217) * Refactored how text econding is done in _AppendText * Separates AppendText for MessagesLog. Adds process memory limit on MessagesLog. * Adds psutil to requirements. * Closes and reopens Messages Log window when process memory exceeds 80% * Windows: Log fixed, Output broken. More Debug Outputs. * Stops log when memory exceeds limit. * Correct output, when set PYTHONIOENCODING=utf-8 on Windows Co-authored-by: Nyral <[email protected]> Co-authored-by: Helio Guilherme <[email protected]> * Correct encoding for Log (#2218) * Fixes tree selection, because of wrong variable name. (#2219) Co-authored-by: Johnny Huang <[email protected]> Co-authored-by: Valerio <[email protected]> Co-authored-by: Valerio Bruno <[email protected]> Co-authored-by: Hélio Guilherme <[email protected]> Co-authored-by: Helio Guilherme <[email protected]> Co-authored-by: Nyral <[email protected]> Co-authored-by: Nyral <[email protected]> * Revert "Sync with upstreem (#1)" This reverts commit fb7ecbd. * Fix incorrect combo box size on Mac OS. * Fix typos. * Fix incorrect import preference textctrl focus on Windows. * Adjust combo box size for Linux. Co-authored-by: Johnny Huang <[email protected]> Co-authored-by: Valerio <[email protected]> Co-authored-by: Valerio Bruno <[email protected]> Co-authored-by: Hélio Guilherme <[email protected]> Co-authored-by: Helio Guilherme <[email protected]> Co-authored-by: Nyral <[email protected]> Co-authored-by: Nyral <[email protected]>
1 parent 37660e2 commit 08ba4c5

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

src/robotide/context/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
IS_WINDOWS = os.sep == '\\'
3131
IS_MAC = sys.platform == 'darwin'
32+
IS_LINUX = sys.platform == 'linux'
3233
WX_VERSION = wx.VERSION_STRING
3334

3435
if IS_WINDOWS:

src/robotide/preferences/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def __init__(self, settings):
3535
def preference_panels(self):
3636
return self._preference_panels
3737

38-
def add(self, prefrence_ui):
39-
if prefrence_ui not in self._preference_panels:
40-
self._preference_panels.append(prefrence_ui)
38+
def add(self, preference_ui):
39+
if preference_ui not in self._preference_panels:
40+
self._preference_panels.append(preference_ui)
4141

4242
def remove(self, panel_class):
4343
if panel_class in self._preference_panels:

src/robotide/preferences/widgets.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import wx
1717
import textwrap
1818
from robotide.widgets import HelpLabel, Label, TextField
19-
from robotide.context import IS_WINDOWS
19+
from robotide.context import IS_LINUX
2020

2121

2222
class PreferencesPanel(wx.Panel):
@@ -50,7 +50,7 @@ def __init__(self, parent, id, settings, key, choices):
5050
self.key = key
5151
super(PreferencesComboBox, self).__init__(parent, id, self._get_value(),
5252
size=self._get_size(choices),
53-
choices=choices)
53+
choices=choices, style=wx.CB_READONLY)
5454
self.Bind(wx.EVT_COMBOBOX, self.OnSelect)
5555

5656
def _get_value(self):
@@ -60,10 +60,10 @@ def _get_size(self, choices=[]):
6060
""" In Linux with GTK3 wxPython 4, there was not enough spacing.
6161
The value 72 is there for 2 digits numeric lists, for
6262
IntegerPreferenceComboBox.
63+
This issue only occurs in Linux, for Mac and Windows using default size.
6364
"""
64-
fact = 9 if IS_WINDOWS else 18 # On GTK3 labels are bigger
65-
if choices:
66-
return wx.Size(max(max(len(str(s)) for s in choices)*fact, 72), 20)
65+
if IS_LINUX and choices:
66+
return wx.Size(max(max(len(str(s)) for s in choices) * 9, 144), 20)
6767
return wx.DefaultSize
6868

6969
def OnSelect(self, event):
@@ -90,7 +90,7 @@ class PreferencesSpinControl(wx.SpinCtrl):
9090
def __init__(self, parent, id, settings, key, choices):
9191
self.settings = settings
9292
self.key = key
93-
super(PreferencesSpinControl, self).__init__(parent, id,
93+
super(PreferencesSpinControl, self).__init__(parent, id,
9494
size=self._get_size(choices[-1]))
9595
self.SetRange(*choices)
9696
self.SetValue(self._get_value())
@@ -104,10 +104,10 @@ def _get_size(self, max_value):
104104
""" In Linux with GTK3 wxPython 4, there was not enough spacing.
105105
The value 72 is there for 2 digits numeric lists, for
106106
IntegerPreferenceComboBox.
107+
This issue only occurs in Linux, for Mac and Windows using default size.
107108
"""
108-
fact = 9 if IS_WINDOWS else 18 # On GTK3 labels are bigger
109-
if max_value:
110-
return wx.Size(max(len(str(max_value))*fact, 72), 20)
109+
if IS_LINUX and max_value:
110+
return wx.Size(max(len(str(max_value)) * 9, 144), 20)
111111
return wx.DefaultSize
112112

113113
def OnChange(self, event):
@@ -193,10 +193,11 @@ def comma_separated_value_editor(parent, settings, name, label, help=''):
193193
editor = TextField(parent, initial_value)
194194
editor.SetToolTip(help)
195195

196-
def set_value():
196+
def set_value(evt):
197197
new_value = [token.strip() for token in editor.GetValue().split(',')
198198
if token.strip()]
199199
settings.set(name, new_value)
200-
editor.Bind(wx.EVT_KILL_FOCUS, lambda evt: set_value())
200+
evt.Skip()
201+
editor.Bind(wx.EVT_KILL_FOCUS, lambda evt: set_value(evt))
201202

202203
return Label(parent, label=label), editor

0 commit comments

Comments
 (0)