Skip to content

Commit 52c117c

Browse files
Merge pull request #2932 from HelioGuilherme66/new_status_bar
New status bar
2 parents 998fb76 + d770d6a commit 52c117c

File tree

14 files changed

+192
-102
lines changed

14 files changed

+192
-102
lines changed

CHANGELOG.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ All notable changes to this project will be documented in this file.
66
The format is based on http://keepachangelog.com/en/1.0.0/[Keep a Changelog]
77
and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioning].
88

9-
// == https://github.com/robotframework/RIDE[Unreleased]
9+
== https://github.com/robotframework/RIDE[Unreleased]
10+
11+
=== Added
12+
- Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
13+
when selecting in Tree shows the filename in StatusBar.
14+
15+
=== Changed
16+
- On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.
1017

1118
== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.1.3.rst[2.1.3] - 2025-03-24
1219

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.2, but RIDE is known to work w
4040

4141
`pip install -U robotframework-ride`
4242

43-
(3.8 <= python <= 3.13) Install current development version (**2.2dev15**) with:
43+
(3.8 <= python <= 3.13) Install current development version (**2.2dev16**) with:
4444

4545
`pip install -U https://github.com/robotframework/RIDE/archive/develop.zip`
4646

src/robotide/application/CHANGELOG.html

Lines changed: 57 additions & 52 deletions
Large diffs are not rendered by default.

src/robotide/application/application.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class RIDE(wx.App):
8080
def __init__(self, path=None, updatecheck=True, settingspath=None):
8181
self._updatecheck = updatecheck
8282
self.workspace_path = path
83+
self.changed_workspace = False
8384
self.settings_path = settingspath
8485
context.APP = self
8586
wx.App.__init__(self, redirect=False)
@@ -401,7 +402,7 @@ def OnEventLoopEnter(self, loop): # Overrides wx method
401402
def on_app_activate(self, event):
402403
if self.workspace_path is not None and RideFSWatcherHandler.is_watcher_created():
403404
if event.GetActive():
404-
if RideFSWatcherHandler.is_workspace_dirty():
405+
if not self.changed_workspace and RideFSWatcherHandler.is_workspace_dirty():
405406
self.frame.show_confirm_reload_dlg(event)
406407
RideFSWatcherHandler.stop_listening()
407408
else:

src/robotide/application/releasenotes.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def set_content(self, html_win, content):
150150
151151
<p><a class="reference external" href="https://github.com/robotframework/RIDE/">RIDE (Robot Framework IDE)</a>
152152
{VERSION} is a new release with some enhancements and bug fixes. The reference for valid arguments is
153-
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> previous version, which was 7.1.1
154-
(currently is 7.2.2). However, internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
153+
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.2.2. However,
154+
internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
155155
<ul class="simple">
156156
<li>This version supports Python 3.8 up to 3.13.</li>
157157
<li>There are some changes, or known issues:<ul>
@@ -168,19 +168,9 @@ def set_content(self, html_win, content):
168168
</ul>
169169
<p><strong>New Features and Fixes Highlights</strong></p>
170170
<ul class="simple">
171-
<li>Better Search element in Text Editor which allows to be cleared.</li>
172-
<li>When saving in Text Editor, the cursor remains at position, instead of jumping to Tree selection.</li>
173-
<li>Improved autocompletion lists, by using existing words in Test Suite file (still needs more improvements).</li>
174-
<li>Fixed not set text color on row labels in Grid Editor. Now the General <b>secondary foreground</b> is applied.</li>
175-
<li>Added on Text Editor, tab indentation markers and <b>tab markers</b> boolean setting with default <b>True</b>.</li>
176-
<li>Added on Text Editor, folding margin with markers style configurable with <b>fold symbols</b> in settings.cfg.</li>
177-
<li>Create directories when needed in New Project dialog.</li>
178-
<li>Improved the recognition of BDD/Gherkin prefixes when localized in autocomplete on Grid Editor.</li>
179-
<li>Added syntax colorization for the <em>GROUP</em> marker. Improved colorization for multiple Gherkin words, for
180-
example in the French language.</li>
181-
<li>Fixed multiple scroll bars in Grid Editor when editing Test Cases or Keywords. This caused bad navigation on cells.</li>
182-
<li>Regression fix from v2.1b1 - Fix wrong item selection, like Test Suite, when doing right-click actions in
183-
Project Explorer.</li>
171+
<li>On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.</li>
172+
<li>Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
173+
when selecting in Tree shows the filename in StatusBar.</li>
184174
</ul>
185175
<!-- <p>We hope to implement or complete features and make fixes on next major version 2.1 (in mid Autumm of 2024).</p>
186176
-->
@@ -235,7 +225,7 @@ def set_content(self, html_win, content):
235225
<pre class="literal-block">python -m robotide.postinstall -install</pre>
236226
<p>or</p>
237227
<pre class="literal-block">ride_postinstall.py -install</pre>
238-
<p>RIDE {VERSION} was released on 25/March/2025.</p>
228+
<p>RIDE {VERSION} was released on 28/March/2025.</p>
239229
<!-- <br/>
240230
<h3>May The Fourth Be With You!</h3>
241231
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/editor/texteditor.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from ..preferences.editors import read_fonts
4141
from ..publish import RideSettingsChanged, PUBLISHER
4242
from ..publish.messages import RideMessage
43-
from ..widgets import TextField, Label, HtmlDialog
43+
from ..widgets import SearchField, Label, HtmlDialog
4444
from ..widgets import VerticalSizer, HorizontalSizer, ButtonWithHandler, RIDEDialog
4545

4646
from robotide.lib.compat.parsing.language import Language
@@ -386,6 +386,8 @@ def __init__(self, application):
386386
self._doc_language = None
387387
self._save_flag = 0
388388
self.jump = True
389+
# self.status_bar = self.frame.FindWindowByName("StatusBar", self.frame)
390+
# self.frame.SetStatusBarPane(1)
389391
self.reformat = application.settings.get('reformat', False)
390392
self._register_shortcuts()
391393

@@ -459,6 +461,7 @@ def _open(self):
459461
# print(f"DEBUG: texteditor _open language={self._doc_language}")
460462
self._open_data_for_controller(datafile_controller)
461463
self._editor.store_position()
464+
wx.CallLater(2000, self.statusbar_message, f'{_("Source: ")}{self._editor.datafile_controller.source}', 2000)
462465

463466
def _get_shared_doc_lang(self):
464467
try:
@@ -1013,7 +1016,7 @@ def _create_editor_toolbar(self):
10131016
def _create_search(self, container_sizer):
10141017
container_sizer.AddSpacer(5)
10151018
size = wx.Size(200, 32)
1016-
self.search_field = TextField(self, '', size=size, process_enters=True)
1019+
self.search_field = SearchField(self, '', size=size, process_enters=True)
10171020
self.search_field.SetBackgroundColour(Colour(self.dlg.color_secondary_background))
10181021
self.search_field.SetForegroundColour(Colour(self.dlg.color_secondary_foreground))
10191022
self.search_field.Bind(wx.EVT_TEXT_ENTER, self.on_find)
@@ -1116,8 +1119,10 @@ def language(self, flanguage):
11161119

11171120
def on_find(self, event, forward=True):
11181121
if self.source_editor:
1119-
if event.GetEventType() != wx.wxEVT_TEXT_ENTER: # Was getting selected item from Tree
1120-
text = self.source_editor.GetSelectedText() or event.GetString()
1122+
if event.GetEventType() == wx.wxEVT_SEARCH:
1123+
text = event.GetString()
1124+
elif event.GetEventType() != wx.wxEVT_TEXT_ENTER: # Was getting selected item from Tree
1125+
text = self.source_editor.GetSelectedText()
11211126
else:
11221127
text = ''
11231128
if (len(text) > 0 and text.lower() != self.search_field.GetValue().lower() and
@@ -1372,6 +1377,7 @@ def open(self, data):
13721377
if hasattr(self._data, 'content'): # Special case for unit test
13731378
self.source_editor.set_text(self._data.content)
13741379
self.set_editor_caret_position()
1380+
wx.CallAfter(self.plugin.statusbar_message, f'{_("Source: ")}{self._controller_for_context.source}', 4000)
13751381
self._words_cache.clear()
13761382
self._suggestions.update_from_local(self.words_cache(self.source_editor.GetLineCount()), self.language)
13771383

src/robotide/lib/compat/pygments/robotframework.py

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ def __init__(self, new_lang=None):
237237
if self.new_lang is None:
238238
if new_lang is None:
239239
set_lang = shared_memory.ShareableList(name="language")
240-
self.new_lang = Language.from_name(set_lang[0].replace('_','-'))
240+
try:
241+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
242+
except ValueError:
243+
self.new_lang = ['En']
241244
else:
242245
self.new_lang = new_lang
243246
self._index = 0
@@ -286,7 +289,10 @@ def __init__(self, template_setter=None, new_lang=None):
286289
if self.new_lang is None:
287290
if new_lang is None:
288291
set_lang = shared_memory.ShareableList(name="language")
289-
self.new_lang = Language.from_name(set_lang[0].replace('_','-'))
292+
try:
293+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
294+
except ValueError:
295+
pass
290296
else:
291297
self.new_lang = new_lang
292298
if self.new_lang is None:
@@ -356,7 +362,10 @@ def __init__(self, new_lang=None):
356362
if self.new_lang is None:
357363
if new_lang is None:
358364
set_lang = shared_memory.ShareableList(name="language")
359-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
365+
try:
366+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
367+
except ValueError:
368+
self.new_lang = None
360369
else:
361370
self.new_lang = new_lang
362371
if self.new_lang is None:
@@ -380,7 +389,10 @@ def __init__(self, template_setter=None, new_lang=None):
380389
if self.new_lang is None:
381390
if new_lang is None:
382391
set_lang = shared_memory.ShareableList(name="language")
383-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
392+
try:
393+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
394+
except ValueError:
395+
self.new_lang = None
384396
else:
385397
self.new_lang = new_lang
386398
if self.new_lang is None:
@@ -427,7 +439,10 @@ def __init__(self, template_setter=None, new_lang=None):
427439
if self.new_lang is None:
428440
if new_lang is None:
429441
set_lang = shared_memory.ShareableList(name="language")
430-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
442+
try:
443+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
444+
except ValueError:
445+
self.new_lang = None
431446
else:
432447
self.new_lang = new_lang
433448
if self.new_lang is None:
@@ -465,7 +480,10 @@ def __init__(self, support_assign=True, new_lang=None):
465480
if self.new_lang is None:
466481
if new_lang is None:
467482
set_lang = shared_memory.ShareableList(name="language")
468-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
483+
try:
484+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
485+
except ValueError:
486+
self.new_lang = None
469487
else:
470488
self.new_lang = new_lang
471489
if self.new_lang is None:
@@ -496,7 +514,10 @@ def __init__(self, new_lang=None):
496514
if self.new_lang is None:
497515
if new_lang is None:
498516
set_lang = shared_memory.ShareableList(name="language")
499-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
517+
try:
518+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
519+
except ValueError:
520+
self.new_lang = None
500521
else:
501522
self.new_lang = new_lang
502523
if self.new_lang is None:
@@ -535,7 +556,10 @@ def __init__(self, new_lang=None):
535556
if self.new_lang is None:
536557
if new_lang is None:
537558
set_lang = shared_memory.ShareableList(name="language")
538-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
559+
try:
560+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
561+
except ValueError:
562+
self.new_lang = None
539563
else:
540564
self.new_lang = new_lang
541565
if self.new_lang is None:
@@ -561,7 +585,10 @@ def __init__(self, prev_tokenizer=None, new_lang=None):
561585
set_lang = shared_memory.ShareableList(name="language")
562586
except FileNotFoundError:
563587
set_lang = ['En']
564-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
588+
try:
589+
self.new_lang = Language.from_name(set_lang[0].replace('_','-'))
590+
except ValueError:
591+
self.new_lang = None
565592
else:
566593
self.new_lang = new_lang
567594
if self.new_lang is None:
@@ -621,7 +648,10 @@ def __init__(self, template_setter, prev_tokenizer=None, new_lang=None):
621648
if self.new_lang is None:
622649
if new_lang is None:
623650
set_lang = shared_memory.ShareableList(name="language")
624-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
651+
try:
652+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
653+
except ValueError:
654+
self.new_lang = None
625655
else:
626656
self.new_lang = new_lang
627657
if self.new_lang is None:
@@ -666,7 +696,10 @@ def __init__(self, prev_tokenizer=None, new_lang=None):
666696
if self.new_lang is None:
667697
if new_lang is None:
668698
set_lang = shared_memory.ShareableList(name="language")
669-
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
699+
try:
700+
self.new_lang = Language.from_name(set_lang[0].replace('_', '-'))
701+
except ValueError:
702+
self.new_lang = None
670703
else:
671704
self.new_lang = new_lang
672705
if self.new_lang is None:

src/robotide/namespace/namespace.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,10 @@ def __init__(self, keywords, caseless=True, new_lang=None):
646646
set_lang = shared_memory.ShareableList(new_lang, name="language")
647647
except FileExistsError: # Other instance created file
648648
set_lang = shared_memory.ShareableList(name="language")
649-
self.new_lang = Language.from_name(set_lang[0].replace('_','-'))
649+
try:
650+
self.new_lang = Language.from_name(set_lang[0].replace('_','-'))
651+
except ValueError:
652+
self.new_lang = new_lang
650653
else:
651654
self.new_lang = new_lang
652655
self.normalized_bdd_prefixes = utils.normalize_pipe_list(list(self.new_lang.bdd_prefixes), spaces=False)

src/robotide/pluginapi/plugin.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class Plugin(object):
5252
filemgr = property(lambda self: self.__frame.filemgr, doc='Provides access to the files and folders explorer')
5353
menubar = property(lambda self: self.__frame.GetMenuBar(), doc='Provides access to the application menubar')
5454
toolbar = property(lambda self: self.__frame.GetToolBar(), doc='Provides access to the application toolbar')
55+
statusbar = property(lambda self: self.__frame.FindWindowByName("StatusBar", self.__frame),
56+
doc='Provides access to the application statusbar')
5557
notebook = property(lambda self: self.__frame.notebook, doc='Provides access to the tabbed notebook')
5658
model = property(lambda self: self.__app.model, doc='Provides access to the data model')
5759
frame = property(lambda self: self.__frame, doc='Reference to the RIDE main frame')
@@ -448,3 +450,26 @@ def highlight(self, data, text):
448450
if not self.tree:
449451
return
450452
self.tree.highlight(data, text)
453+
454+
def statusbar_message(self, text, ttl=0):
455+
"""Set a text message at Plugin area of StatusBar
456+
:Parameters:
457+
text
458+
Message to show in StatusBar
459+
ttl
460+
Time to live in milliseconds, default = 0, means does not expire
461+
"""
462+
if text is None:
463+
text = ''
464+
self.statusbar.SetStatusText(text, 1)
465+
wx.CallAfter(self._delayed_clear, ttl)
466+
467+
def _delayed_clear(self, ttl):
468+
if ttl >= 100:
469+
from time import sleep
470+
sleep(ttl/1000)
471+
self.statusbar.SetStatusText('', 1)
472+
473+
def statusbar_clear(self):
474+
"""Clears the message at Plugin area of StatusBar"""
475+
self.statusbar.SetStatusText('', 1)

src/robotide/ui/mainframe.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from .treeplugin import Tree
3333
from ..action import action_info_collection, action_factory, SeparatorInfo
3434
from ..action.shortcut import localize_shortcuts
35-
from ..context import get_about_ride, SHORTCUT_KEYS
35+
from ..context import get_about_ride, SHORTCUT_KEYS, IS_WINDOWS
3636
from ..controller.ctrlcommands import SaveFile, SaveAll
3737
from ..editor import customsourceeditor
3838
from ..preferences import PreferenceEditor
@@ -289,14 +289,15 @@ def _init_ui(self):
289289

290290
# self.main_menu.take_menu_bar_into_use()
291291
if new_ui: # Only when creating UI we add panes
292-
self.CreateStatusBar(name="StatusBar")
292+
self.CreateStatusBar(number=2, name="StatusBar")
293293
self._status_bar = self.FindWindowByName("StatusBar", self)
294-
if self._status_bar:
295-
self._status_bar.SetFont(wx.Font(self.fontinfo))
296-
self._status_bar.SetBackgroundColour(Colour(self.color_background))
297-
self._status_bar.SetForegroundColour(Colour(self.color_foreground))
298294
# set main frame icon
299295
self.SetIcons(self._image_provider.PROGICONS)
296+
if self._status_bar:
297+
self.SetStatusBarPane(0)
298+
self._status_bar.SetFont(wx.Font(self.fontinfo))
299+
self._status_bar.SetBackgroundColour(Colour(self.color_background))
300+
self._status_bar.SetForegroundColour(Colour(self.color_foreground))
300301
# change notebook theme
301302
self.set_notebook_theme()
302303
# tell the manager to "commit" all the changes just made
@@ -497,6 +498,8 @@ def open_suite(self, path):
497498
# self._controller.default_dir will only save dir path
498499
# need to save path to self._application.workspace_path too
499500
self._application.workspace_path = path
501+
if IS_WINDOWS:
502+
self._application.changed_workspace = True
500503
from ..lib.compat.parsing.language import check_file_language
501504
self.controller.file_language = check_file_language(path)
502505
set_lang = []
@@ -519,8 +522,13 @@ def open_suite(self, path):
519522
except UserWarning:
520523
return False
521524
self._populate_tree()
525+
if IS_WINDOWS:
526+
wx.CallLater(60000, self.clear_workspace_state)
522527
return True
523528

529+
def clear_workspace_state(self):
530+
self._application.changed_workspace = False
531+
524532
def refresh_datafile(self, item, event):
525533
self.tree.refresh_datafile(item, event)
526534
if self.filemgr:

0 commit comments

Comments
 (0)