Skip to content

Commit 16f974a

Browse files
Change tree (#2486)
* disable item selection WIP * Fix menu icons in Linux (finally)! * Avoid AssertionError when monitoring files or directories with multibyte names, like Chinese chars * Fix save status in Text Editor no need to double Ctrl-S * Improves Undo in Text Edit
1 parent 4ff0dff commit 16f974a

File tree

11 files changed

+141
-60
lines changed

11 files changed

+141
-60
lines changed

doc/releasenotes/ride-2.0b2.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ This version v2.0b2 includes removal of Python 2.7 support. The reference for va
1010
- On Text Editor the TAB key adds the defined number of spaces. With Shift moves to the left, and together with Control selects text.
1111
- On Text Editor the **: FOR** loop structure must use Robot Framework 3.1.2 syntax, i.e. **FOR** and **END**.
1212
- On Grid Editor and Linux the auto enclose is only working on cell selection, but not on cell content edit.
13-
- On Text Editor when Saving with Ctrl-S, you must do this twice :(.
13+
- On Text Editor when Saving the selection os tests in Test Suites (Tree) is cleared.
1414

1515
**New Features and Fixes Highlights**
1616

17-
* Auto enclose text in {}, [], "", ''
17+
* Auto enclose text in #123;}, [], "", ''
1818
* Auto indent in Text Editor on new lines
1919
* Block indent in Text Editor (TAB on block of selected text)
2020
* Ctrl-number with number, 1-5 also working on Text Editor:
@@ -87,7 +87,7 @@ You can then go to `Tools>Create RIDE Desktop Shortcut`, or run the shortcut cre
8787

8888
python -m robotide.postinstall -install
8989

90-
RIDE v2.0b2 was released on 01/Sep/2022.
90+
RIDE v2.0b2 was released on 05/Sep/2022.
9191

9292
.. _RIDE (Robot Framework IDE): https://github.com/robotframework/RIDE/
9393
.. _Robot Framework: http://robotframework.org

src/robotide/application/CHANGELOG.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="idm45568595860432"></a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="idm46270233289248"></a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
33
and this project adheres to <a class="ulink" href="http://semver.org/spec/v2.0.0.html" target="_top">Semantic Versioning</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_unreleased_ulink"></a>1. <a class="ulink" href="https://github.com/robotframework/RIDE" target="_top">Unreleased</a></h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_added"></a>1.1. Added</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
44
Added menu entry at Help → Offline Change Log to view this file on disk
55
</li><li class="listitem">
@@ -105,6 +105,8 @@
105105
</li><li class="listitem">
106106
Performance improvements for loading large test suites
107107
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed"></a>1.4. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
108+
Fixed missing menu icons on Linux (was working on Windows)
109+
</li><li class="listitem">
108110
Fixed removal of animation in Project tree when test run is interrupted
109111
</li><li class="listitem">
110112
Fixed console log width to fit visible area, depending on font size

src/robotide/application/application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ def OnInit(self):
9595
self.fileexplorerplugin.register_frame(self.frame)
9696
if not self.treeplugin.opened:
9797
self.treeplugin.close_tree()
98-
else:
99-
wx.CallLater(200, self.treeplugin.populate, self.model)
98+
# else:
99+
# wx.CallLater(200, self.treeplugin.populate, self.model)
100100
if not self.fileexplorerplugin.opened:
101101
self.fileexplorerplugin.close_tree()
102102
self.editor = self._get_editor()

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def set_content(self, html_win, content):
150150
<li>On Text Editor the TAB key adds the defined number of spaces. With Shift moves to the left, and together with Control selects text.</li>
151151
<li>On Text Editor the <strong>: FOR</strong> loop structure must use Robot Framework 3.1.2 syntax, i.e. <strong>FOR</strong> and <strong>END</strong>.</li>
152152
<li>On Grid Editor and Linux the auto enclose is only working on cell selection, but not on cell content edit.</li>
153-
<li>On Text Editor when Saving with Ctrl-S, you must do this twice :(.</li>
153+
<li>On Text Editor when Saving the selection os tests in Test Suites (Tree) is cleared.</li>
154154
</ul>
155155
</li>
156156
</ul>
@@ -211,6 +211,6 @@ def set_content(self, html_win, content):
211211
<pre class="literal-block">
212212
python -m robotide.postinstall -install
213213
</pre>
214-
<p>RIDE v2.0b2 was released on 01/Sep/2022.</p>
214+
<p>RIDE v2.0b2 was released on 05/Sep/2022.</p>
215215
</div>
216216
"""

src/robotide/controller/filecontrollers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def unmark_dirty(self):
223223
self.refresh_stat()
224224
if self.dirty:
225225
self.dirty = False
226+
# print(f"DEBUG: filecontrollers unmark_dirty PUBLISH RideDataDirtyCleared")
226227
RideDataDirtyCleared(datafile=self).publish()
227228

228229
def create_keyword(self, name, argstr=''):

src/robotide/editor/texteditor.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def _open(self):
112112
self._editor.store_position()
113113

114114
def OnSaving(self, message):
115-
# print(f"DEBUG: OnSaving entering function {message}")
116115
if self.is_focused():
117116
self._editor.save()
118117
self._editor.GetFocus(None)
@@ -127,6 +126,8 @@ def OnDataChanged(self, message):
127126
# print(f"DEBUG: OnDataChanged message {message}")
128127
self._editor.reset()
129128
self._editor.set_editor_caret_position()
129+
if isinstance(message, RideNotebookTabChanging):
130+
return
130131
if self._editor.dirty and not self._apply_txt_changes_to_model():
131132
return
132133
self._refresh_timer.Start(500, True)
@@ -206,6 +207,7 @@ def OnTabChanging(self, message):
206207
def _apply_txt_changes_to_model(self):
207208
if not self._editor.save():
208209
return False
210+
# print(f"DEBUG: texteditor _apply_txt_changes_to_model going to RESET dirty={self._editor.dirty}")
209211
self._editor.reset()
210212
self._editor.set_editor_caret_position()
211213
return True
@@ -328,6 +330,7 @@ def mark_data_dirty(self):
328330
self._data.mark_dirty()
329331

330332
def mark_data_pristine(self):
333+
# print(f"DEBUG: texteditor mark_data_pristine calling unmark_dirty")
331334
self._data.unmark_dirty()
332335

333336
def _create_target(self):
@@ -491,7 +494,7 @@ def set_editor_caret_position(self):
491494

492495
@property
493496
def dirty(self):
494-
return self._dirty == 1
497+
return self._dirty == 1 # self._editor.IsModified() and self._dirty == 1
495498

496499
@property
497500
def datafile_controller(self):
@@ -709,15 +712,18 @@ def write_ident(self):
709712
self._editor.WriteText(spaces)
710713

711714
def reset(self):
715+
# print(f"DEBUG: textedit enter RESET calling _mark_file_dirty")
712716
self._dirty = 0
717+
self._mark_file_dirty(False)
713718

714719
def save(self, *args):
715720
# print(f"DEBUG: enter save path={self.datafile_controller.source}")
716721
self.store_position()
717722
if self.dirty:
718723
if not self._data_validator.validate_and_update(self._data, self._editor.utf8_text):
719724
return False
720-
self.reset()
725+
# DEBUG: Was resetting when leaving editor
726+
# self.reset()
721727
self.GetFocus(None)
722728
return True
723729

@@ -767,7 +773,8 @@ def select_all(self):
767773
def undo(self):
768774
self._editor.Undo()
769775
self.store_position()
770-
self._mark_file_dirty(self._editor.GetModify())
776+
# print(f"DEBUG: TextEditor calling dirty from Undo self._dirty={self._dirty}")
777+
self._mark_file_dirty(self._dirty == 1 and self._editor.GetModify())
771778

772779
def redo(self):
773780
self._editor.Redo()
@@ -823,10 +830,12 @@ def OnEditorKey(self, event):
823830
self._editor.DeleteRange(selected[0], 1)
824831
else:
825832
self._editor.DeleteRange(selected[0], selected[1] - selected[0])
826-
self._mark_file_dirty(self._editor.GetModify())
827833
if keycode in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
828834
# print(f"DEBUG: Enter released {keycode}")
829835
return
836+
if self.is_focused() and keycode != wx.WXK_CONTROL and self._dirty == 0:
837+
# print(f"DEBUG: texteditor OnKeyDown calling _mark_file_dirty event={event}")
838+
self._mark_file_dirty(self._editor.GetModify())
830839
event.Skip()
831840

832841
def OnKeyDown(self, event):
@@ -1024,11 +1033,14 @@ def OnSettingsChanged(self, message):
10241033
self._tab_size = self._parent._app.settings.get('txt number of spaces', 4)
10251034

10261035
def _mark_file_dirty(self, dirty=True):
1036+
if not self.is_focused(): # DEBUG: Was marking file clean from Grid Editor
1037+
return
10271038
if self._data:
1028-
if dirty:
1039+
if self._dirty == 0 and dirty:
10291040
self._data.mark_data_dirty()
10301041
self._dirty = 1
1031-
else:
1042+
elif self._dirty == 1:
1043+
# print(f"DEBUG: texteditor _mark_file_dirty calling mark_data_pristine _dirty={self._dirty}")
10321044
self._data.mark_data_pristine()
10331045
self._dirty = 0
10341046

src/robotide/ui/mainframe.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,26 @@ def _init_ui(self):
274274
275275
##### End Test
276276
"""
277+
# self.leftpanel = wx.Panel(self, name="left_panel", size = (275, 250))
277278
# Tree is always created here
278279
self.tree = Tree(self, self.actions, self._application.settings)
279280
self.tree.SetMinSize(wx.Size(275, 250))
281+
# self.leftpanel.Bind(wx.EVT_SIZE, self.tree.OnSize)
282+
# self._mgr.AddPane(self.leftpanel, aui.AuiPaneInfo().Name("left_panel").Caption("left_panel").Left())
283+
# DEBUG: Next was already called from application.py
284+
self._mgr.AddPane(self.tree,
285+
aui.AuiPaneInfo().Name("tree_content").
286+
LeftDockable())
287+
#### self._mgr.GetPane(self.tree).DestroyOnClose()
280288
# TreePlugin will manage showing the Tree
281289
self.actions.register_actions(ActionInfoCollection(_menudata, self, self.tree))
282290
# ##### File explorer panel is always created here
283291
self.filemgr = FileExplorer(self, self._controller)
284292
self.filemgr.SetMinSize(wx.Size(275, 250))
293+
# DEBUG: Next was already called from application.py
294+
self._mgr.AddPane(self.filemgr,
295+
aui.AuiPaneInfo().Name("file_manager").
296+
LeftDockable())
285297

286298
mb.take_menu_bar_into_use()
287299
self.CreateStatusBar(name="StatusBar")
@@ -882,6 +894,6 @@ class RIDETaskBarIcon(TaskBarIcon):
882894
def __init__(self, img_provider):
883895
TaskBarIcon.__init__(self, TBI_DOCK)
884896
self._img_provider = img_provider
885-
if IS_MAC:
886-
# only use in mac to display RIDE app icon in dock
887-
self.SetIcon(wx.Icon(self._img_provider.RIDE_ICON), "RIDE")
897+
# if IS_MAC:
898+
# # only use in mac to display RIDE app icon in dock
899+
self.SetIcon(wx.Icon(self._img_provider.RIDE_ICON), "RIDE")

0 commit comments

Comments
 (0)