- fixed an issue created by the fact that I used the '_' char inside the app to designate unused info and that conflicted with the _() function used by gettext
- made impossible to try to reapply current language that it's already applied (un-necessary)
This commit is contained in:
parent
3c2cc96b62
commit
f51c146f71
|
@ -5346,15 +5346,15 @@ class App(QtCore.QObject):
|
||||||
"All Files (*.*)"
|
"All Files (*.*)"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Gerber",
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Gerber",
|
||||||
directory=self.get_last_folder(), filter=_filter_)
|
directory=self.get_last_folder(), filter=_filter_)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Gerber", filter=_filter_)
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Gerber", filter=_filter_)
|
||||||
|
|
||||||
filenames = [str(filename) for filename in filenames]
|
filenames = [str(filename) for filename in filenames]
|
||||||
|
|
||||||
if len(filenames) == 0:
|
if len(filenames) == 0:
|
||||||
self.inform.emit(_("[WARNING_NOTCL]Open Gerber cancelled."))
|
self.inform.emit(_("[WARNING_NOTCL] Open Gerber cancelled."))
|
||||||
else:
|
else:
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
if filename != '':
|
if filename != '':
|
||||||
|
@ -5375,10 +5375,10 @@ class App(QtCore.QObject):
|
||||||
"All Files (*.*)"
|
"All Files (*.*)"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Excellon",
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Excellon",
|
||||||
directory=self.get_last_folder(), filter=_filter_)
|
directory=self.get_last_folder(), filter=_filter_)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Excellon", filter=_filter_)
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Open Excellon", filter=_filter_)
|
||||||
|
|
||||||
filenames = [str(filename) for filename in filenames]
|
filenames = [str(filename) for filename in filenames]
|
||||||
|
|
||||||
|
@ -5405,10 +5405,10 @@ class App(QtCore.QObject):
|
||||||
" *.din *.xpi *.hnc *.h *.i *.ncp *.min *.gcd *.rol *.mpr *.ply *.out *.eia *.plt *.sbp *.mpf);;" \
|
" *.din *.xpi *.hnc *.h *.i *.ncp *.min *.gcd *.rol *.mpr *.ply *.out *.eia *.plt *.sbp *.mpf);;" \
|
||||||
"All Files (*.*)"
|
"All Files (*.*)"
|
||||||
try:
|
try:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Open G-Code",
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Open G-Code",
|
||||||
directory=self.get_last_folder(), filter=_filter_)
|
directory=self.get_last_folder(), filter=_filter_)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Open G-Code", filter=_filter_)
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Open G-Code", filter=_filter_)
|
||||||
|
|
||||||
filenames = [str(filename) for filename in filenames]
|
filenames = [str(filename) for filename in filenames]
|
||||||
|
|
||||||
|
@ -5730,10 +5730,10 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
filter = "SVG File (*.svg);;All Files (*.*)"
|
filter = "SVG File (*.svg);;All Files (*.*)"
|
||||||
try:
|
try:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Import SVG",
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Import SVG",
|
||||||
directory=self.get_last_folder(), filter=filter)
|
directory=self.get_last_folder(), filter=filter)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption="Import SVG", filter=filter)
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption="Import SVG", filter=filter)
|
||||||
|
|
||||||
if type_of_obj is not "geometry" and type_of_obj is not "gerber":
|
if type_of_obj is not "geometry" and type_of_obj is not "gerber":
|
||||||
type_of_obj = "geometry"
|
type_of_obj = "geometry"
|
||||||
|
@ -5760,10 +5760,10 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
filter = "DXF File (*.DXF);;All Files (*.*)"
|
filter = "DXF File (*.DXF);;All Files (*.*)"
|
||||||
try:
|
try:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Import DXF"),
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Import DXF"),
|
||||||
directory=self.get_last_folder(), filter=filter)
|
directory=self.get_last_folder(), filter=filter)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
filenames, _ = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Import DXF"), filter=filter)
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Import DXF"), filter=filter)
|
||||||
|
|
||||||
if type_of_obj is not "geometry" and type_of_obj is not "gerber":
|
if type_of_obj is not "geometry" and type_of_obj is not "gerber":
|
||||||
type_of_obj = "geometry"
|
type_of_obj = "geometry"
|
||||||
|
|
|
@ -60,11 +60,17 @@ def on_language_apply_click(app, restart=False):
|
||||||
"""
|
"""
|
||||||
name = app.ui.general_defaults_form.general_app_group.language_cb.currentText()
|
name = app.ui.general_defaults_form.general_app_group.language_cb.currentText()
|
||||||
|
|
||||||
|
# do nothing if trying to apply the language that is the current language (already applied).
|
||||||
|
settings = QSettings("Open Source", "FlatCAM")
|
||||||
|
if settings.contains("language"):
|
||||||
|
current_language = settings.value('language', type=str)
|
||||||
|
if current_language == name:
|
||||||
|
return
|
||||||
|
|
||||||
if restart:
|
if restart:
|
||||||
msgbox = QtWidgets.QMessageBox()
|
msgbox = QtWidgets.QMessageBox()
|
||||||
|
msgbox.setText("The application will restart.")
|
||||||
msgbox.setInformativeText("Are you sure do you want to change the current language to %s?\n\n"
|
msgbox.setInformativeText("Are you sure do you want to change the current language to %s?" % name.capitalize())
|
||||||
"The application will restart." % name.capitalize())
|
|
||||||
msgbox.setWindowTitle("Apply Language ...")
|
msgbox.setWindowTitle("Apply Language ...")
|
||||||
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
|
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
|
||||||
msgbox.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.Cancel)
|
msgbox.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.Cancel)
|
||||||
|
@ -83,7 +89,6 @@ def on_language_apply_click(app, restart=False):
|
||||||
|
|
||||||
restart_program(app=app)
|
restart_program(app=app)
|
||||||
|
|
||||||
|
|
||||||
def apply_language(domain, lang=None):
|
def apply_language(domain, lang=None):
|
||||||
lang_code = ''
|
lang_code = ''
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- fixed bug in ToolCutOut where for each tool invocation the signals were reconnected
|
- fixed bug in ToolCutOut where for each tool invocation the signals were reconnected
|
||||||
- fixed some issues with ToolMeasurement due of above changes
|
- fixed some issues with ToolMeasurement due of above changes
|
||||||
- updated the App.final_save() function
|
- updated the App.final_save() function
|
||||||
|
- fixed an issue created by the fact that I used the '_' char inside the app to designate unused info and that conflicted with the _() function used by gettext
|
||||||
|
- made impossible to try to reapply current language that it's already applied (un-necessary)
|
||||||
|
|
||||||
8.03.2019
|
8.03.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue