Skip to content

Commit 417984a

Browse files
Merge pull request #2933 from HelioGuilherme66/config_panel
Config panel
2 parents 52c117c + 28155f3 commit 417984a

File tree

14 files changed

+207
-22
lines changed

14 files changed

+207
-22
lines changed

CHANGELOG.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
99
== https://github.com/robotframework/RIDE[Unreleased]
1010

1111
=== Added
12+
- Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.
13+
- Added Config Panel button to Plugins, working example in Text Editor.
1214
- Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
1315
when selecting in Tree shows the filename in StatusBar.
1416

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.2dev16**) with:
43+
(3.8 <= python <= 3.13) Install current development version (**2.2dev17**) with:
4444

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

src/robotide/application/CHANGELOG.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!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" xml:lang="en"><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="id1337"></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">
4+
Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.
5+
</li><li class="listitem">
6+
Added Config Panel button to Plugins, working example in Text Editor.
7+
</li><li class="listitem">
48
Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
59
when selecting in Tree shows the filename in StatusBar.
610
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_changed"></a>1.2. Changed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">

src/robotide/application/pluginconnector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def __init__(self, plugin, application):
4646
self.conn_plugin = plugin
4747
self._settings = application.settings['Plugins'].add_section(plugin.name)
4848
self.config_panel = plugin.config_panel
49+
try:
50+
self.on_config_panel = plugin.on_config_panel
51+
except AttributeError:
52+
pass
4953
self.metadata = plugin.metadata
5054

5155
def enable_on_startup(self):

src/robotide/application/releasenotes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ def set_content(self, html_win, content):
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>
158+
<!--
158159
<li>🐞 - When upgrading RIDE and activate Restart, some errors are visible about missing /language file, and behaviour
159160
is not normal. Better to close RIDE and start a new instance.</li>
160161
<li>🐞 - Problems with COPY/PASTE in Text Editor have been reported when using wxPython 4.2.0, but not with
161162
version 4.2.1 and 4.2.2, which we now <em>recommend</em>.</li>
163+
-->
162164
<li>🐞 - Rename Keywords, Find Usages/Find where used are not finding all occurrences. Please, double-check findings and changes.</li>
163165
<li>🐞 - Some argument types detection (and colorization) is not correct in Grid Editor.</li>
164166
<li>🐞 - RIDE <strong>DOES NOT KEEP</strong> Test Suites formatting or structure, causing differences in files when used
@@ -168,6 +170,8 @@ def set_content(self, html_win, content):
168170
</ul>
169171
<p><strong>New Features and Fixes Highlights</strong></p>
170172
<ul class="simple">
173+
<li>Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.</li>
174+
<li>Added Config Panel button to Plugins, working example in Text Editor.</li>
171175
<li>On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.</li>
172176
<li>Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
173177
when selecting in Tree shows the filename in StatusBar.</li>
@@ -225,7 +229,7 @@ def set_content(self, html_win, content):
225229
<pre class="literal-block">python -m robotide.postinstall -install</pre>
226230
<p>or</p>
227231
<pre class="literal-block">ride_postinstall.py -install</pre>
228-
<p>RIDE {VERSION} was released on 28/March/2025.</p>
232+
<p>RIDE {VERSION} was released on 30/March/2025.</p>
229233
<!-- <br/>
230234
<h3>May The Fourth Be With You!</h3>
231235
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/editor/texteditor.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from ..pluginapi import Plugin, action_info_collection, TreeAwarePluginMixin
3838
from ..publish.messages import (RideSaved, RideTreeSelection, RideNotebookTabChanging, RideDataChanged, RideOpenSuite,
3939
RideDataChangedToDirty, RideBeforeSaving, RideSaving, RideDataDirtyCleared)
40+
from ..preferences import TextEditorPreferences, PreferenceEditor
4041
from ..preferences.editors import read_fonts
4142
from ..publish import RideSettingsChanged, PUBLISHER
4243
from ..publish.messages import RideMessage
@@ -389,6 +390,8 @@ def __init__(self, application):
389390
# self.status_bar = self.frame.FindWindowByName("StatusBar", self.frame)
390391
# self.frame.SetStatusBarPane(1)
391392
self.reformat = application.settings.get('reformat', False)
393+
self.settings = application.settings
394+
self.application = application
392395
self._register_shortcuts()
393396

394397
@property
@@ -636,6 +639,18 @@ def is_focused(self):
636639
except AttributeError:
637640
return self._editor.is_focused()
638641

642+
def on_config_panel(self):
643+
dlg = self.config_panel(self.frame)
644+
dlg.Show(True)
645+
646+
def config_panel(self, parent):
647+
__ = parent
648+
_parent = wx.GetTopLevelWindows()
649+
dlg = PreferenceEditor(_parent[0], _("RIDE - Preferences"),
650+
self.application.preferences, style='single', index=4)
651+
dlg.Show(False)
652+
return dlg
653+
639654

640655
class DummyController(WithStepsController):
641656
_populator = robotapi.UserKeywordPopulator
@@ -1008,9 +1023,15 @@ def _create_editor_toolbar(self):
10081023
handler=lambda e: self.plugin._apply_txt_changes_to_model())
10091024
button.SetBackgroundColour(Colour(self.dlg.color_secondary_background))
10101025
button.SetForegroundColour(Colour(self.dlg.color_secondary_foreground))
1026+
config_button = ButtonWithHandler(self, _('Settings'), bitmap='wrench.png', fsize=self.general_font_size,
1027+
handler=lambda e: self.plugin.on_config_panel())
1028+
config_button.SetBackgroundColour(Colour(self.dlg.color_background))
1029+
config_button.SetOwnBackgroundColour(Colour(self.dlg.color_background))
1030+
config_button.SetForegroundColour(Colour(self.dlg.color_foreground))
10111031
default_components.add_with_padding(button)
10121032
self._create_search(default_components)
10131033
self.editor_toolbar.add_expanding(default_components)
1034+
self.editor_toolbar.add_with_padding(config_button)
10141035
self.Sizer.add_expanding(self.editor_toolbar, propotion=0)
10151036

10161037
def _create_search(self, container_sizer):

src/robotide/namespace/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,9 @@ def __init__(self, keywords, caseless=True, new_lang=None):
649649
try:
650650
self.new_lang = Language.from_name(set_lang[0].replace('_','-'))
651651
except ValueError:
652-
self.new_lang = new_lang
652+
self.new_lang = Language.from_name(new_lang[0])
653653
else:
654-
self.new_lang = new_lang
654+
self.new_lang = Language.from_name(new_lang[0])
655655
self.normalized_bdd_prefixes = utils.normalize_pipe_list(list(self.new_lang.bdd_prefixes), spaces=False)
656656
self.gherkin_prefix = re.compile(fr'^({self.normalized_bdd_prefixes}) (.*)', re.IGNORECASE)
657657
self.keywords = robotapi.NormalizedDict(ignore=['_'], caseless=caseless)

src/robotide/preferences/editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
class PreferenceEditor(wx.Dialog):
5151
"""A dialog for showing the preference panels"""
52-
def __init__(self, parent, title, preferences, style="auto"):
52+
def __init__(self, parent, title, preferences, style="auto", index=0):
5353
wx.Dialog.__init__(self, parent, wx.ID_ANY, title, size=(850, 700),
5454
style=wx.RESIZE_BORDER | wx.DEFAULT_DIALOG_STYLE)
5555
# set Left to Right direction (while we don't have localization)
@@ -116,7 +116,7 @@ def __init__(self, parent, title, preferences, style="auto"):
116116
sizer.Add(self._container, 1, wx.EXPAND)
117117
self.SetSizer(sizer)
118118

119-
panel = self._container.AddPanel(panels[0], self._settings)
119+
panel = self._container.AddPanel(panels[index], self._settings)
120120
self._container.ShowPanel(panel)
121121

122122
def on_close(self, evt):

src/robotide/ui/pluginmanager.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from ..context import LOG
2323
from ..publish import RideLogException
24-
from ..widgets import Label, RIDEDialog
24+
from ..widgets import Label, RIDEDialog, ButtonWithHandler
2525

2626
_ = wx.GetTranslation # To keep linter/code analyser happy
2727
builtins.__dict__['_'] = wx.GetTranslation
@@ -82,10 +82,9 @@ def _create_body(self, plugins, activation_callback):
8282
sizer.Add(self._create_label(panel, _('Enabled')), 0, wx.BOTTOM, border=8)
8383
sizer.Add(self._create_label(panel, _('Plugin')), 0, wx.BOTTOM | wx.EXPAND, border=8)
8484
for plugin in sorted(plugins, key=lambda p: p.name):
85-
sizer.Add(_PluginEnablationCheckBox(panel, plugin,
86-
activation_callback),
87-
flag=wx.ALIGN_CENTER_HORIZONTAL)
88-
sizer.Add(_PluginRow(panel, plugin), 0, wx.EXPAND)
85+
sizer.Add(_PluginEnablationCheckBox(panel, plugin, activation_callback),
86+
flag=wx.ALIGN_LEFT)
87+
sizer.Add(_PluginRow(panel, plugin, self.color_background), 0, wx.EXPAND)
8988
panel.SetSizer(sizer)
9089
return panel
9190

@@ -141,16 +140,26 @@ def _execute(self, method):
141140

142141
class _PluginRow(wx.Panel):
143142

144-
def __init__(self, parent, plugin):
143+
def __init__(self, parent, plugin, backgound_color):
145144
wx.Panel.__init__(self, parent)
145+
sz_head = wx.FlexGridSizer(0, 3, hgap=4, vgap=4)
146+
l_name = self._get_name(plugin)
147+
sz_head.Add(l_name)
148+
b_spacing = Label(self, label=' ')
149+
sz_head.Add(b_spacing)
150+
if hasattr(plugin, 'on_config_panel'):
151+
try:
152+
sz_head.Add(ButtonWithHandler(self, _('Settings'), bitmap='wrench.png',
153+
color_secondary_background=backgound_color,
154+
handler=lambda e: plugin.on_config_panel()),
155+
flag=wx.ALIGN_LEFT)
156+
except AttributeError:
157+
pass
146158
sizer = wx.BoxSizer(wx.VERTICAL)
147-
sizer.Add(self._get_name(plugin))
159+
sizer.Add(sz_head)
148160
for name, value in plugin.metadata.items():
149161
sizer.Add(self._get_metadata(name, value))
150162
sizer.Add(self._get_description(plugin), 0, wx.EXPAND)
151-
config = plugin.config_panel(self)
152-
if config:
153-
sizer.Add(config, 1, wx.EXPAND | wx.LEFT, border=16)
154163
self.SetSizer(sizer)
155164

156165
def _get_name(self, plugin):

src/robotide/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.2dev16'
18+
VERSION = 'v2.2dev17'

0 commit comments

Comments
 (0)