Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
when selecting in Tree shows the filename in StatusBar.

=== Changed
- Changed some informative dialogs and JSON Editor to use the customized colors.
- Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.
- On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.

Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.2, but RIDE is known to work w

`pip install -U robotframework-ride`

(3.8 <= python <= 3.13) Install current development version (**2.2dev19**) with:
(3.8 <= python <= 3.13) Install current development version (**2.2dev20**) with:

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

Expand Down
2 changes: 2 additions & 0 deletions src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
Added divided Status Bar. Left side for main window, right side for Plugins. Working example in Text Editor,
when selecting in Tree shows the filename in StatusBar.
</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">
Changed some informative dialogs and JSON Editor to use the customized colors.
</li><li class="listitem">
Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.
</li><li class="listitem">
On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.
Expand Down
9 changes: 8 additions & 1 deletion src/robotide/application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

from contextlib import contextmanager
from pathlib import Path

from pygments.styles.dracula import background

from ..namespace import Namespace
from ..controller import Project
from ..spec import librarydatabase
Expand Down Expand Up @@ -329,7 +332,11 @@ def _load_data(self):
self.workspace_path = self.workspace_path or self._get_latest_path()
if self.workspace_path:
self._controller.update_default_dir(self.workspace_path)
observer = LoadProgressObserver(self.frame)
theme = self.settings.get_without_default('General')
background = theme['background']
foreground = theme['foreground']
# print(f"DEBUG: application.py RIDE _load_data CALL PROGRESS {background=} {foreground=}")
observer = LoadProgressObserver(self.frame, background=background, foreground=foreground)
self._controller.load_data(self.workspace_path, observer)

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Changed some informative dialogs and JSON Editor to use the customized colors.</li>
<li>Added current executing keyword and other statuses to TestRunner status bar.</li>
<li>Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.</li>
<li>Added Config Panel button to supported installed Plugins next to their name in Plugin Manager dialog.</li>
Expand Down Expand Up @@ -231,7 +232,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">python -m robotide.postinstall -install</pre>
<p>or</p>
<pre class="literal-block">ride_postinstall.py -install</pre>
<p>RIDE {VERSION} was released on 02/April/2025.</p>
<p>RIDE {VERSION} was released on 12/April/2025.</p>
<!-- <br/>
<h3>May The Fourth Be With You!</h3>
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>
Expand Down
3 changes: 2 additions & 1 deletion src/robotide/context/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def _is_ignored_warning(self, msg):
def _show_message(self, msg, level):
try:
icon = level == 'ERROR' and wx.ICON_ERROR or wx.ICON_WARNING
wx.MessageBox(msg, level, icon)
message_box = RIDEDialog(title=level, message=msg, style=icon)
message_box.ShowModal()
except wx.PyNoAppError:
sys.stderr.write('%s: %s\n' % (level, msg))

Expand Down
6 changes: 4 additions & 2 deletions src/robotide/contrib/testrunner/runprofiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,12 @@ def _parse_windows_command(self):
try:
output = output.decode(os_encoding)
except UnicodeDecodeError:
wx.MessageBox(f"An UnicodeDecodeError occurred when processing the Arguments."
message_box = RIDEDialog(title="UnicodeDecodeError",
message=f"An UnicodeDecodeError occurred when processing the Arguments."
f" The encoding used was '{os_encoding}'. You may try to define the environment variable"
f" RIDE_ENCODING with a proper value. Other possibility, is to replace 'pythonw.exe' by "
f"'python.exe' in the Desktop Shortcut.", "UnicodeDecodeError")
f"'python.exe' in the Desktop Shortcut.", style=wx.OK | wx.ICON_ERROR)
message_box.ShowModal()
output = str(output).lstrip("b\'").lstrip('"').replace('\\r\\n', '').replace('\'', '').\
replace('\\""', '\"').strip()
# print(f"DEBUG: run_profiles _parse_windows_command: output ={output}")
Expand Down
27 changes: 13 additions & 14 deletions src/robotide/contrib/testrunner/testrunnerplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,22 +460,21 @@ def _can_start_running_tests(self):

@staticmethod
def _ask_user_to_save_before_running():
ret = wx.MessageBox(_("""There are unsaved modifications.
Do you want to save all changes and run the tests?"""),
_("Unsaved Modifications"),
wx.ICON_QUESTION | wx.YES_NO)
return ret == wx.YES
message_box = RIDEDialog(title=_("Unsaved Modifications"),
message=_("""There are unsaved modifications.
Do you want to save all changes and run the tests?"""), style=wx.ICON_QUESTION | wx.YES_NO)
ret = message_box.ShowModal()
return ret == wx.ID_YES

def _tests_selected(self):
return len(self._selected_tests) != 0

@staticmethod
def _ask_user_to_run_anyway():
ret = wx.MessageBox(_('No tests selected. \n'
'Continue anyway?'),
_('No tests selected'),
wx.ICON_QUESTION | wx.YES_NO)
return ret == wx.YES
message_box = RIDEDialog(title=_('No tests selected'), message=_('No tests selected. \nContinue anyway?'),
style=wx.ICON_QUESTION | wx.YES_NO)
ret = message_box.ShowModal()
return ret == wx.ID_YES

def _initialize_ui_for_running(self):
self._show_notebook_tab()
Expand Down Expand Up @@ -1182,10 +1181,10 @@ def _enable_runner_toolbar(self, run, paused):

@staticmethod
def _notify_user_no_logs_directory():
wx.MessageBox(_("There isn't logs directory. \n"
"Please, run the tests and try again"),
_("No logs directory"),
wx.ICON_INFORMATION | wx.OK)
message_box = RIDEDialog(title=_("No logs directory"), message=_("There isn't logs directory. \n"
"Please, run the tests and try again"),
style=wx.OK | wx.ICON_INFORMATION)
message_box.ShowModal()

def on_config_panel(self):
dlg = self.config_panel(self.frame)
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/controller/ctrlcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class RenameKeywordOccurrences(_ReversibleCommand):

def __init__(self, original_name, new_name, observer, keyword_info=None, language='En'):
self._language = language[0] if isinstance(language, list) else language
if self._language.lower() not in ['en', 'english']:
if self._language and self._language.lower() not in ['en', 'english']:
bdd_prefix = f"{obtain_bdd_prefixes(self._language)}|{BDD_ENGLISH}"
else:
bdd_prefix = BDD_ENGLISH
Expand Down
17 changes: 13 additions & 4 deletions src/robotide/editor/kweditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,8 @@ def on_create_keyword(self, event):
try:
self._execute(add_keyword_from_cells(cells))
except ValueError as err:
wx.MessageBox(str(err))
message_box = RIDEDialog(title=_('Validation Error'), message=str(err), style=wx.ICON_ERROR|wx.OK)
message_box.ShowModal()

def _data_cells_from_current_row(self):
currow, curcol = self.selection.cell
Expand Down Expand Up @@ -1161,7 +1162,8 @@ def on_rename_keyword(self, event):
new_name = wx.GetTextFromUser(_('New name'), _(REN_KW), default_value=old_name)
if new_name:
self._execute(RenameKeywordOccurrences(
old_name, new_name, RenameProgressObserver(self.GetParent()), language=self._language))
old_name, new_name, RenameProgressObserver(self.GetParent(), background=self.color_background,
foreground=self.color_foreground), language=self._language))

# Add one new Dialog to edit pretty json String TODO: use better editor with more functions
def on_json_editor(self, event=None):
Expand All @@ -1171,10 +1173,16 @@ def on_json_editor(self, event=None):
dialog.SetTitle('JSON Editor')
dialog.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
ok_btn = wx.Button(dialog, wx.ID_OK, _("Save"))
ok_btn.SetBackgroundColour(self.color_secondary_background)
ok_btn.SetForegroundColour(self.color_secondary_foreground)
cnl_btn = wx.Button(dialog, wx.ID_CANCEL, _("Cancel"))
cnl_btn.SetBackgroundColour(self.color_secondary_background)
cnl_btn.SetForegroundColour(self.color_secondary_foreground)
rich_text = wx.TextCtrl(dialog, wx.ID_ANY, "If supported by the native control, this is reversed, and this is"
" a different font.", size=(400, 475),
style=wx.HSCROLL | wx.TE_MULTILINE | wx.TE_NOHIDESEL)
rich_text.SetBackgroundColour(self.settings['background unknown'])
rich_text.SetForegroundColour(self.settings['text empty'])
dialog.Sizer.Add(rich_text, flag=wx.GROW, proportion=1)
dialog.Sizer.Add(ok_btn, flag=wx.ALL)
dialog.Sizer.Add(cnl_btn, flag=wx.ALL)
Expand All @@ -1197,8 +1205,9 @@ def on_json_editor(self, event=None):
try:
json.loads(content) # Yes, we need the error
except JSONDecodeError as e:
res = wx.MessageDialog(dialog, f"{_('Error in JSON:')} {e}\n\n{_('Save anyway?')}",
_("Validation Error!"), wx.YES_NO)
res = RIDEDialog(title=_('Validation Error!'),
message=f"{_('Error in JSON:')} {e}\n\n{_('Save anyway?')}",
style=wx.ICON_ERROR | wx.YES_NO)
res.InheritAttributes()
response = res.ShowModal()
if response == wx.ID_YES:
Expand Down
1 change: 1 addition & 0 deletions src/robotide/editor/settingeditors.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def __init__(self, parent, controller, plugin, tree):
self._language = [set_lang[0]]
# print(f"DEBUG: settings.py SettingEditor __init__ SHAREDMEM language={self._language}")
except AttributeError:
print("DEBUG: settings.py SettingEditor __init__ AttributeError")
try:
self._language = self._controller.language
# print(f"DEBUG: settings.py SettingEditor __init__ CONTROLLER language={self._language}")
Expand Down
10 changes: 4 additions & 6 deletions src/robotide/editor/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ def _new_validate_and_update(self, data, text, lang='en'):
try:
self._doc_language = obtain_language(lang, text)
except ValueError:
# wx.MessageBox(f"Error when selecting Language: {e}", 'Error')
self._doc_language = 'en'
# print(f"DEBUG: textedit.py validate_and_update Language in doc--> lang={self._doc_language}")
else:
Expand Down Expand Up @@ -896,10 +895,10 @@ def _handle_sanity_check_failure(self, message):
if self._last_answer == wx.ID_NO and time() - self._last_answer_time <= 0.2:
# self.source_editor._mark_file_dirty(True)
return False
# DEBUG: use widgets.Dialog
dlg = wx.MessageDialog(self._editor, f"{_('ERROR: Data sanity check failed!')}\n{_('Error at line')}"
f" {message[1]}:\n{message[0]}\n\n{_('Reset changes?')}",
_("Can not apply changes from Text Editor"), style=wx.YES | wx.NO)
dlg = RIDEDialog(title=_("Can not apply changes from Text Editor"),
message=f"{_('ERROR: Data sanity check failed!')}\n{_('Error at line')}"
f" {message[1]}:\n{message[0]}\n\n{_('Reset changes?')}",
style=wx.ICON_ERROR | wx.YES_NO)
dlg.InheritAttributes()
did = dlg.ShowModal()
self._last_answer = did
Expand Down Expand Up @@ -2722,7 +2721,6 @@ def set_language(self, dlanguage):
try:
self.language = obtain_language(dlanguage, content)
except ValueError:
# wx.MessageBox(f"Error when selecting Language: {e}", 'Error')
self.language = 'English'
else:
self.language = 'English'
Expand Down
11 changes: 7 additions & 4 deletions src/robotide/run/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import wx

from .process import Process
from ..widgets import Label, Font, VerticalSizer, HorizontalSizer
from ..widgets import Font, VerticalSizer, HorizontalSizer, RIDEDialog
from ..log import LogOutput
from ..publish import RideRunnerStopped

Expand Down Expand Up @@ -63,15 +63,17 @@ def run(self):
# print(f"DEBUG: runanything.py Runner run process object={self._process}"
# f"\nCommand: {self._config.command}")
if self._process is None:
wx.MessageBox(f"FAILED TO RUN {self._config.command}", style=wx.ICON_ERROR)
message_box = RIDEDialog(message=f"FAILED TO RUN {self._config.command}", style=wx.ICON_ERROR)
message_box.ShowModal()
return
try:
self._process.start()
self._timer.Start(500)
self._pid = self._process.pid
return self._pid
except Exception as err:
wx.MessageBox(str(err), style=wx.ICON_ERROR)
message_box = RIDEDialog(message=str(err), style=wx.ICON_ERROR)
message_box.ShowModal()
return -1

def on_timer(self, event=None):
Expand All @@ -85,7 +87,8 @@ def stop(self):
try:
self._process.stop()
except Exception as err:
wx.MessageBox(str(err), style=wx.ICON_ERROR)
message_box = RIDEDialog(message=str(err), style=wx.ICON_ERROR)
message_box.ShowModal()


class _OutputWindow(wx.Panel): # wx.ScrolledWindow):
Expand Down
13 changes: 9 additions & 4 deletions src/robotide/spec/specimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from ..action import ActionInfo
from ..pluginapi import Plugin
from ..publish import PUBLISHER, RideExecuteSpecXmlImport
from ..widgets import RIDEDialog
from .xmlreaders import get_name_from_xml

_ = wx.GetTranslation # To keep linter/code analyser happy
Expand Down Expand Up @@ -74,8 +75,12 @@ def _store_spec(self, path):
name = get_name_from_xml(path)
if name:
shutil.copy(path, os.path.join(context.LIBRARY_XML_DIRECTORY, name+'.xml'))
wx.MessageBox(_('Library "%s" imported\nfrom "%s"\nThis may require RIDE restart.') % (name, path),
_('Info'), wx.OK | wx.ICON_INFORMATION)
message_box = RIDEDialog(title=_('Info'),
message=_('Library "%s" imported\nfrom "%s"\nThis may require RIDE restart.')
% (name, path), style=wx.OK | wx.ICON_INFORMATION)
message_box.ShowModal()
else:
wx.MessageBox(_('Could not import library from file "%s"') % path, _('Import failed'),
wx.OK | wx.ICON_ERROR)
message_box = RIDEDialog(title=_('Import failed'),
message=_('Could not import library from file "%s"')
% path, style=wx.OK | wx.ICON_ERROR)
message_box.ShowModal()
3 changes: 2 additions & 1 deletion src/robotide/ui/filedialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ def _execute(self):
else CreateNewFileProject
self.language = self.selected_language()
cmd(self._get_path(), self._is_task_type(), self.language).execute(self._controller)
del self.dlg
if self.dlg:
del self.dlg


class NewResourceDialog(_WithImmutableParent, _CreationDialog):
Expand Down
Loading
Loading