- in Legacy Mode fixed a small issue: the status bar icon for the Grid axis was not colored on app start

- added a new string to the translatable strings
- fixed an error that sometime showed in Legacy Mode when moving the mouse outside canvas
- reactivated the shortcut key 'S' in TCL Shell, to close the shell dock when it was open (of course the focus has to be not on the command line)
This commit is contained in:
Marius Stanciu 2020-10-28 11:30:23 +02:00 committed by Marius
parent bd98bb42c4
commit 7ca44fa107
23 changed files with 124 additions and 51 deletions

View File

@ -240,7 +240,7 @@ class BookmarkManager(QtWidgets.QWidget):
index_list.append(index)
title_to_remove = self.table_widget.item(model_index.row(), 1).text()
if title_to_remove == 'FlatCAM' or title_to_remove == 'Backup Site':
if title_to_remove == 'FlatCAM' or title_to_remove == _('Backup Site'):
self.app.inform.emit('[WARNING_NOTCL] %s.' % _("This bookmark can not be removed"))
self.build_bm_ui()
return

View File

@ -17,6 +17,10 @@ CHANGELOG for FlatCAM beta
- some UI cleanup in the Geometry UI
- updated the translation strings except Russian which could be in the works
- fixed an error that did not allowed for the older preferences to be deleted when installing a different version of the software
- in Legacy Mode fixed a small issue: the status bar icon for the Grid axis was not colored on app start
- added a new string to the translatable strings
- fixed an error that sometime showed in Legacy Mode when moving the mouse outside canvas
- reactivated the shortcut key 'S' in TCL Shell, to close the shell dock when it was open (of course the focus has to be not on the command line)
27.10.2020

View File

@ -3757,14 +3757,18 @@ class _BrowserTextEdit(QTextEdit):
# Copy Text
elif key == QtCore.Qt.Key_C:
self.copy_text()
# Copy Text
# Save Log
elif key == QtCore.Qt.Key_S:
if self.app:
self.save_log(app=self.app)
elif modifiers == QtCore.Qt.NoModifier:
# Clear all
if key == QtCore.Qt.Key_Delete:
self.clear()
# Shell toggle
if key == QtCore.Qt.Key_S:
self.app.ui.toggle_shell_ui()
def copy_text(self):
tcursor = self.textCursor()

View File

@ -191,13 +191,13 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
# enable the HUD if it is activated in FlatCAM Preferences
if self.fcapp.defaults['global_hud'] is True:
self.on_toggle_hud(state=True)
self.on_toggle_hud(state=True, silent=True)
# Axis Display
self.axis_enabled = True
# enable Axis
self.on_toggle_axis(state=True)
self.on_toggle_axis(state=True, silent=True)
# enable Grid lines
self.grid_lines_enabled = True
@ -218,8 +218,8 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
self.graph_event_connect('mouse_wheel', self.on_mouse_scroll)
def on_toggle_axis(self, signal=None, state=None):
if state is None:
def on_toggle_axis(self, signal=None, state=None, silent=None):
if not state:
state = not self.axis_enabled
if state:
@ -234,16 +234,18 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
background-color: orange;
}
""")
self.fcapp.inform[str, bool].emit(_("Axis enabled."), False)
if silent is None:
self.fcapp.inform[str, bool].emit(_("Axis enabled."), False)
else:
self.axis_enabled = False
self.fcapp.defaults['global_axis'] = False
self.v_line.parent = None
self.h_line.parent = None
self.fcapp.ui.axis_status_label.setStyleSheet("")
self.fcapp.inform[str, bool].emit(_("Axis disabled."), False)
if silent is None:
self.fcapp.inform[str, bool].emit(_("Axis disabled."), False)
def on_toggle_hud(self, signal=None, state=None):
def on_toggle_hud(self, signal=None, state=None, silent=None):
if state is None:
state = not self.hud_enabled
@ -259,7 +261,8 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
background-color: mediumpurple;
}
""")
self.fcapp.inform[str, bool].emit(_("HUD enabled."), False)
if silent is None:
self.fcapp.inform[str, bool].emit(_("HUD enabled."), False)
else:
self.hud_enabled = False
@ -267,21 +270,24 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
self.text_hud.parent = None
self.fcapp.defaults['global_hud'] = False
self.fcapp.ui.hud_label.setStyleSheet("")
self.fcapp.inform[str, bool].emit(_("HUD disabled."), False)
if silent is None:
self.fcapp.inform[str, bool].emit(_("HUD disabled."), False)
def on_toggle_grid_lines(self):
def on_toggle_grid_lines(self, signal=None, silent=None):
state = not self.grid_lines_enabled
if state:
self.fcapp.defaults['global_grid_lines'] = True
self.grid_lines_enabled = True
self.grid.parent = self.view.scene
self.fcapp.inform[str, bool].emit(_("Grid enabled."), False)
if silent is None:
self.fcapp.inform[str, bool].emit(_("Grid enabled."), False)
else:
self.fcapp.defaults['global_grid_lines'] = False
self.grid_lines_enabled = False
self.grid.parent = None
self.fcapp.inform[str, bool].emit(_("Grid disabled."), False)
if silent is None:
self.fcapp.inform[str, bool].emit(_("Grid disabled."), False)
# HACK: enabling/disabling the cursor seams to somehow update the shapes on screen
# - perhaps is a bug in VisPy implementation

View File

@ -306,9 +306,13 @@ class PlotCanvasLegacy(QtCore.QObject):
# signal if there is a doubleclick
self.is_dblclk = False
# HUD Display
self.hud_enabled = False
self.text_hud = self.Thud(plotcanvas=self)
if self.app.defaults['global_hud'] is True:
self.on_toggle_hud(state=True, silent=None)
# enable Grid lines
self.grid_lines_enabled = True
@ -317,17 +321,21 @@ class PlotCanvasLegacy(QtCore.QObject):
if self.app.defaults['global_workspace'] is True:
self.draw_workspace(workspace_size=self.app.defaults["global_workspaceT"])
if self.app.defaults['global_hud'] is True:
self.on_toggle_hud(state=True)
# Axis Display
self.axis_enabled = True
# enable Axis
self.on_toggle_axis(state=True)
self.on_toggle_axis(state=True, silent=True)
self.app.ui.axis_status_label.setStyleSheet("""
QLabel
{
color: black;
background-color: orange;
}
""")
def on_toggle_axis(self, signal=None, state=None):
if state is None:
def on_toggle_axis(self, signal=None, state=None, silent=None):
if not state:
state = not self.axis_enabled
if state:
@ -343,7 +351,8 @@ class PlotCanvasLegacy(QtCore.QObject):
background-color: orange;
}
""")
self.app.inform[str, bool].emit(_("Axis enabled."), False)
if silent is None:
self.app.inform[str, bool].emit(_("Axis enabled."), False)
else:
self.axis_enabled = False
self.app.defaults['global_axis'] = False
@ -351,11 +360,12 @@ class PlotCanvasLegacy(QtCore.QObject):
self.axes.lines.remove(self.h_line)
self.axes.lines.remove(self.v_line)
self.app.ui.axis_status_label.setStyleSheet("")
self.app.inform[str, bool].emit(_("Axis disabled."), False)
if silent is None:
self.app.inform[str, bool].emit(_("Axis disabled."), False)
self.canvas.draw()
def on_toggle_hud(self, signal=None, state=None):
def on_toggle_hud(self, signal=None, state=None, silent=None):
if state is None:
state = not self.hud_enabled
@ -371,13 +381,15 @@ class PlotCanvasLegacy(QtCore.QObject):
background-color: mediumpurple;
}
""")
self.app.inform[str, bool].emit(_("HUD enabled."), False)
if silent is None:
self.app.inform[str, bool].emit(_("HUD enabled."), False)
else:
self.hud_enabled = False
self.text_hud.remove_artist()
self.app.defaults['global_hud'] = False
self.app.ui.hud_label.setStyleSheet("")
self.app.inform[str, bool].emit(_("HUD disabled."), False)
if silent is None:
self.app.inform[str, bool].emit(_("HUD disabled."), False)
self.canvas.draw()
@ -440,7 +452,7 @@ class PlotCanvasLegacy(QtCore.QObject):
if self.hud_holder in self.p.axes.artists:
self.p.axes.artists.remove(self.hud_holder)
def on_toggle_grid_lines(self):
def on_toggle_grid_lines(self, signal=None, silent=None):
state = not self.grid_lines_enabled
if state:
@ -451,7 +463,8 @@ class PlotCanvasLegacy(QtCore.QObject):
self.canvas.draw()
except IndexError:
pass
self.app.inform[str, bool].emit(_("Grid enabled."), False)
if silent is None:
self.app.inform[str, bool].emit(_("Grid enabled."), False)
else:
self.app.defaults['global_grid_lines'] = False
self.grid_lines_enabled = False
@ -460,7 +473,8 @@ class PlotCanvasLegacy(QtCore.QObject):
self.canvas.draw()
except IndexError:
pass
self.app.inform[str, bool].emit(_("Grid disabled."), False)
if silent is None:
self.app.inform[str, bool].emit(_("Grid disabled."), False)
def draw_workspace(self, workspace_size):
"""

View File

@ -3204,7 +3204,7 @@ class App(QtCore.QObject):
self.defaults["global_bookmarks"].update(
{
'1': ['FlatCAM', "http://flatcam.org"],
'2': ['Backup Site', ""]
'2': [_('Backup Site'), ""]
}
)
else:
@ -3246,7 +3246,7 @@ class App(QtCore.QObject):
act.setIcon(QtGui.QIcon(self.resource_location + '/link16.png'))
# from here: https://stackoverflow.com/questions/20390323/pyqt-dynamic-generate-qmenu-action-and-connect
if title == 'Backup Site' and weblink == "":
if title == _('Backup Site') and weblink == "":
act.triggered.connect(self.on_backup_site)
else:
act.triggered.connect(lambda sig, link=weblink: webbrowser.open(link))
@ -6377,7 +6377,10 @@ class App(QtCore.QObject):
pos_canvas = self.plotcanvas.translate_coords(event_pos)
if self.grid_status():
pos = self.geo_editor.snap(pos_canvas[0], pos_canvas[1])
try:
pos = self.geo_editor.snap(pos_canvas[0], pos_canvas[1])
except TypeError:
return
else:
pos = (pos_canvas[0], pos_canvas[1])

Binary file not shown.

View File

@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:19+0200\n"
"PO-Revision-Date: 2020-10-28 03:19+0200\n"
"POT-Creation-Date: 2020-10-28 10:53+0200\n"
"PO-Revision-Date: 2020-10-28 10:53+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\n"
@ -84,6 +84,12 @@ msgstr ""
msgid "Bookmark added."
msgstr "Lesezeichen verwalten."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
#, fuzzy
#| msgid "Backup"
msgid "Backup Site"
msgstr "Sicherungskopie"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Dieses Lesezeichen kann nicht entfernt werden"

Binary file not shown.

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:19+0200\n"
"PO-Revision-Date: 2020-10-28 03:19+0200\n"
"POT-Creation-Date: 2020-10-28 10:53+0200\n"
"PO-Revision-Date: 2020-10-28 10:53+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
@ -88,6 +88,11 @@ msgstr "Either the Title or the Weblink already in the table."
msgid "Bookmark added."
msgstr "Bookmark added."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
#| msgid "Backup"
msgid "Backup Site"
msgstr "Backup Site"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "This bookmark can not be removed"
@ -13466,7 +13471,6 @@ msgid "Working..."
msgstr "Working..."
#: appObjects/FlatCAMGeometry.py:2425
#| msgid "Add Polish"
msgid "Polish"
msgstr "Polish"

Binary file not shown.

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:19+0200\n"
"PO-Revision-Date: 2020-10-28 03:20+0200\n"
"POT-Creation-Date: 2020-10-28 10:53+0200\n"
"PO-Revision-Date: 2020-10-28 10:54+0200\n"
"Last-Translator: Marius Stanciu - Google Translate\n"
"Language-Team: \n"
"Language: es\n"
@ -88,6 +88,10 @@ msgstr "Ya sea el Título o el Enlace web ya en la tabla."
msgid "Bookmark added."
msgstr "Marcador agregado."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
msgid "Backup Site"
msgstr "Sitio de respaldo"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Este marcador no se puede eliminar"

Binary file not shown.

View File

@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:21+0200\n"
"PO-Revision-Date: 2020-10-28 03:21+0200\n"
"POT-Creation-Date: 2020-10-28 10:55+0200\n"
"PO-Revision-Date: 2020-10-28 10:55+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
@ -89,6 +89,12 @@ msgstr "Titre ou lien Web déjà dans le tableau."
msgid "Bookmark added."
msgstr "Signet ajouté."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
#, fuzzy
#| msgid "Backup"
msgid "Backup Site"
msgstr "F. Paramètres"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Ce menu ne peut être supprimé"

Binary file not shown.

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:21+0200\n"
"PO-Revision-Date: 2020-10-28 03:21+0200\n"
"POT-Creation-Date: 2020-10-28 10:55+0200\n"
"PO-Revision-Date: 2020-10-28 10:56+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: it\n"
@ -88,6 +88,10 @@ msgstr "Il titolo o il link sono già presenti nella tabella."
msgid "Bookmark added."
msgstr "Segnalibro aggiunto."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
msgid "Backup Site"
msgstr "Sito di backup"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Questo segnalibro non può essere rimosso"

Binary file not shown.

View File

@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:21+0200\n"
"PO-Revision-Date: 2020-10-28 03:25+0200\n"
"POT-Creation-Date: 2020-10-28 10:56+0200\n"
"PO-Revision-Date: 2020-10-28 10:57+0200\n"
"Last-Translator: Carlos Stein <carlos.stein@gmail.com>\n"
"Language-Team: \n"
"Language: pt_BR\n"
@ -84,6 +84,10 @@ msgstr "O título ou o link da Web já está na tabela."
msgid "Bookmark added."
msgstr "Favorito adicionado."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
msgid "Backup Site"
msgstr "Site de backup"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Este favorito não pode ser removido"

Binary file not shown.

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:25+0200\n"
"PO-Revision-Date: 2020-10-28 03:26+0200\n"
"POT-Creation-Date: 2020-10-28 10:57+0200\n"
"PO-Revision-Date: 2020-10-28 10:57+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ro\n"
@ -89,6 +89,10 @@ msgstr "Fie Titlul, fie Weblink-ul deja sunt in tabel."
msgid "Bookmark added."
msgstr "Bookmark adăugat."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
msgid "Backup Site"
msgstr "Site de Backup"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Acest bookmark nu poate fi eliminat"
@ -5026,7 +5030,7 @@ msgstr "F1"
#: appGUI/MainGUI.py:592 app_Main.py:3263 app_Main.py:3272
msgid "Bookmarks Manager"
msgstr "Bookmarks Manager"
msgstr "Manager Bookmark-uri"
#: appGUI/MainGUI.py:597
msgid "Report a bug"

Binary file not shown.

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:26+0200\n"
"PO-Revision-Date: 2020-10-28 03:26+0200\n"
"POT-Creation-Date: 2020-10-28 10:58+0200\n"
"PO-Revision-Date: 2020-10-28 10:58+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: tr_TR\n"
@ -88,6 +88,12 @@ msgstr "Başlık veya Web Bağlantısı zaten tabloda."
msgid "Bookmark added."
msgstr "Yer işareti eklendi."
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
#, fuzzy
#| msgid "Backup"
msgid "Backup Site"
msgstr "Yedekleme"
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr "Bu yer işareti silinemez"
@ -4980,7 +4986,7 @@ msgstr "Gerber Özellikleri"
#: appGUI/MainGUI.py:610
msgid "Shortcuts List"
msgstr "Shortcuts List"
msgstr ""
#: appGUI/MainGUI.py:610 appGUI/MainGUI.py:4398
msgid "F3"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2020-10-28 03:27+0200\n"
"POT-Creation-Date: 2020-10-28 10:53+0200\n"
"PO-Revision-Date: 2019-03-25 15:08+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -84,6 +84,10 @@ msgstr ""
msgid "Bookmark added."
msgstr ""
#: Bookmark.py:243 app_Main.py:3207 app_Main.py:3249
msgid "Backup Site"
msgstr ""
#: Bookmark.py:244
msgid "This bookmark can not be removed"
msgstr ""