Skip to content

Commit 8d07be7

Browse files
Added Settings button to Test Runner
1 parent b6e16a5 commit 8d07be7

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

CHANGELOG.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
1111
=== Added
1212
- Added current executing keyword and other statuses to TestRunner status bar.
1313
- Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.
14-
- Added Config Panel button to Plugins, working example in Text Editor.
14+
- Added Config Panel button to Plugins, working examples in Text Editor and Test Runner.
1515
- Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
1616
when selecting in Tree shows the filename in StatusBar.
1717

src/robotide/application/CHANGELOG.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
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 current executing keyword and other statuses to TestRunner status bar.
5+
</li><li class="listitem">
46
Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.
57
</li><li class="listitem">
6-
Added Config Panel button to Plugins, working example in Text Editor.
8+
Added Config Panel button to Plugins, working examples in Text Editor and Test Runner.
79
</li><li class="listitem">
810
Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
911
when selecting in Tree shows the filename in StatusBar.

src/robotide/application/releasenotes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def set_content(self, html_win, content):
173173
<li>Added current executing keyword and other statuses to TestRunner status bar.</li>
174174
<li>Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.</li>
175175
<li>Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.</li>
176-
<li>Added Config Panel button to Plugins, working example in Text Editor.</li>
176+
<li>Added Config Panel button to Plugins, working examples in Text Editor and Test Runner.</li>
177177
<li>On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.</li>
178178
<li>Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
179179
when selecting in Tree shows the filename in StatusBar.</li>

src/robotide/contrib/testrunner/testrunnerplugin.py

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@
7777
from robotide.publish.messages import RideTestSelectedForRunningChanged
7878
from robotide.pluginapi import Plugin, ActionInfo
7979
from robotide.ui.notebook import NoteBook
80-
from robotide.widgets import Label, ImageProvider, RIDEDialog
80+
from robotide.widgets import Label, ImageProvider, ButtonWithHandler, RIDEDialog
8181
from robotide.robotapi import LOG_LEVELS
8282
from robotide.utils import robottime
83+
from robotide.preferences import PreferenceEditor
8384
from robotide.preferences.editors import read_fonts
8485
from sys import getfilesystemencoding, platform
8586
from robotide.lib.robot.utils.encodingsniffer import (get_console_encoding,
@@ -156,6 +157,7 @@ class TestRunnerPlugin(Plugin):
156157
title = 'Run'
157158

158159
def __init__(self, application=None):
160+
self.app = application
159161
self.title = _('Run')
160162
Plugin.__init__(self, application, initially_enabled=True,
161163
default_settings=self.defaults)
@@ -747,8 +749,11 @@ def _remove_from_notebook(self):
747749
def _build_runner_toolbar(self, parent):
748750
toolbar = wx.ToolBar(parent, wx.ID_ANY,
749751
style=wx.TB_HORIZONTAL | wx.TB_HORZ_TEXT | wx.TB_NODIVIDER)
752+
toolbar.SetThemeEnabled(True)
750753
toolbar.SetBackgroundColour(self._mysettings.color_background)
751754
toolbar.SetForegroundColour(self._mysettings.color_foreground)
755+
toolbar.SetOwnBackgroundColour(self._mysettings.color_background)
756+
toolbar.SetOwnForegroundColour(self._mysettings.color_foreground)
752757
toolbar.AddTool(ID_RUN, _("Start"), ImageProvider().TOOLBAR_PLAY,
753758
wx.NullBitmap, wx.ITEM_NORMAL, shortHelp=_("Start robot"),
754759
longHelp=_("Start running the robot test suite"))
@@ -775,6 +780,10 @@ def _build_runner_toolbar(self, parent):
775780
toolbar.AddTool(ID_STEP_OVER, STEP_OVER, ImageProvider().TOOLBAR_NEXT,
776781
wx.NullBitmap, wx.ITEM_NORMAL, shortHelp=STEP_OVER,
777782
longHelp=STEP_OVER)
783+
for i in toolbar.GetChildren():
784+
i.SetBackgroundColour(self._mysettings.color_secondary_background)
785+
i.SetOwnBackgroundColour(self._mysettings.color_secondary_background)
786+
i.SetForegroundColour(self._mysettings.color_secondary_foreground)
778787
toolbar.Realize()
779788
self._bind_runner_toolbar_events(toolbar)
780789
return toolbar
@@ -790,10 +799,18 @@ def _bind_runner_toolbar_events(self, toolbar):
790799
(wx.EVT_TOOL, self.on_step_over, ID_STEP_OVER)):
791800
toolbar.Bind(event, callback, id=idd)
792801

802+
@property
803+
def general_font_size(self):
804+
fsize = self.app.settings.get('General', None)['font size']
805+
return fsize
806+
793807
def _build_local_toolbar(self, parent):
794808
toolbar = wx.ToolBar(parent, wx.ID_ANY,
795809
style=wx.TB_HORIZONTAL | wx.TB_HORZ_TEXT | wx.TB_NODIVIDER | wx.TB_DOCKABLE)
796810
# print(f"DEBUG: toolbar before {toolbar.UseBackgroundColour()}")
811+
toolbar.SetThemeEnabled(True)
812+
toolbar.SetBackgroundColour(self._mysettings.color_background)
813+
toolbar.SetForegroundColour(self._mysettings.color_foreground)
797814
toolbar.SetOwnBackgroundColour(self._mysettings.color_background)
798815
toolbar.SetOwnForegroundColour(self._mysettings.color_foreground)
799816
profile_label = Label(toolbar, label=_("Execution Profile: "))
@@ -829,12 +846,19 @@ def _build_local_toolbar(self, parent):
829846
_(" Pause after failure "), False,
830847
_("Automatically pause after failing keyword"))
831848
toolbar.AddControl(self.pause_on_failure_cb)
832-
849+
config_button = ButtonWithHandler(toolbar, _('Settings'), bitmap='wrench.png', fsize=self.general_font_size,
850+
handler=lambda e: self.on_config_panel())
851+
config_button.SetBackgroundColour(self._mysettings.color_background)
852+
config_button.SetOwnBackgroundColour(self._mysettings.color_background)
853+
config_button.SetForegroundColour(self._mysettings.color_foreground)
854+
toolbar.AddStretchableSpace()
855+
toolbar.AddControl(config_button)
833856
toolbar.EnableTool(ID_OPEN_LOGS_DIR, False)
834857
toolbar.EnableTool(ID_SHOW_LOG, False)
835858
toolbar.EnableTool(ID_SHOW_REPORT, False)
836859
for i in toolbar.GetChildren():
837860
i.SetBackgroundColour(self._mysettings.color_background)
861+
i.SetOwnBackgroundColour(self._mysettings.color_background)
838862
i.SetForegroundColour(self._mysettings.color_foreground)
839863
toolbar.Realize()
840864
self._bind_local_toolbar_events(toolbar)
@@ -1163,6 +1187,18 @@ def _notify_user_no_logs_directory():
11631187
_("No logs directory"),
11641188
wx.ICON_INFORMATION | wx.OK)
11651189

1190+
def on_config_panel(self):
1191+
dlg = self.config_panel(self.frame)
1192+
dlg.Show(True)
1193+
1194+
def config_panel(self, parent):
1195+
__ = parent
1196+
_parent = wx.GetTopLevelWindows()
1197+
dlg = PreferenceEditor(_parent[0], _("RIDE - Preferences"),
1198+
self.app.preferences, style='single', index=5)
1199+
dlg.Show(False)
1200+
return dlg
1201+
11661202

11671203
class ProgressBar(wx.Panel):
11681204
"""A progress bar for the test runner plugin"""

0 commit comments

Comments
 (0)