Merged marius_stanciu/flatcam_beta/Beta_8.993 into Beta
This commit is contained in:
commit
8607c0372b
|
@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
4.05.2020
|
||||||
|
|
||||||
|
- in detachable tabs, Linux loose the reference of the detached tab and on close of the detachable tabs will gave a 'segmantation fault' error. Solved it by not deleting the reference in case of Unix-like systems
|
||||||
|
- some strigns added to translation strings
|
||||||
|
|
||||||
3.05.2020
|
3.05.2020
|
||||||
|
|
||||||
- small changes to allow making the x86 installer that is made from a Python 3.5 run FlatCAM beta
|
- small changes to allow making the x86 installer that is made from a Python 3.5 run FlatCAM beta
|
||||||
|
|
|
@ -3251,7 +3251,7 @@ class App(QtCore.QObject):
|
||||||
self.prog_grid_lay.addWidget(QtWidgets.QLabel('<b>%s</b>' % _("E-mail")), 0, 2)
|
self.prog_grid_lay.addWidget(QtWidgets.QLabel('<b>%s</b>' % _("E-mail")), 0, 2)
|
||||||
|
|
||||||
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Juan Pablo Caram"), 1, 0)
|
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Juan Pablo Caram"), 1, 0)
|
||||||
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Program Author"), 1, 1)
|
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % _("Program Author")), 1, 1)
|
||||||
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "<>"), 1, 2)
|
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "<>"), 1, 2)
|
||||||
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Denis Hayrullin"), 2, 0)
|
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Denis Hayrullin"), 2, 0)
|
||||||
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Kamil Sopko"), 3, 0)
|
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Kamil Sopko"), 3, 0)
|
||||||
|
@ -3604,6 +3604,7 @@ class App(QtCore.QObject):
|
||||||
# quit app by signalling for self.kill_app() method
|
# quit app by signalling for self.kill_app() method
|
||||||
# self.close_app_signal.emit()
|
# self.close_app_signal.emit()
|
||||||
QtWidgets.qApp.quit()
|
QtWidgets.qApp.quit()
|
||||||
|
# QtCore.QCoreApplication.exit()
|
||||||
|
|
||||||
# When the main event loop is not started yet in which case the qApp.quit() will do nothing
|
# When the main event loop is not started yet in which case the qApp.quit() will do nothing
|
||||||
# we use the following command
|
# we use the following command
|
||||||
|
@ -3613,6 +3614,7 @@ class App(QtCore.QObject):
|
||||||
else:
|
else:
|
||||||
os._exit(0) # fix to work with Python 3.8
|
os._exit(0) # fix to work with Python 3.8
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def kill_app():
|
def kill_app():
|
||||||
# QtCore.QCoreApplication.quit()
|
# QtCore.QCoreApplication.quit()
|
||||||
|
|
|
@ -767,7 +767,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.setCentralWidget(self.splitter)
|
self.setCentralWidget(self.splitter)
|
||||||
|
|
||||||
# self.notebook = QtWidgets.QTabWidget()
|
# self.notebook = QtWidgets.QTabWidget()
|
||||||
self.notebook = FCDetachableTab(protect=True)
|
self.notebook = FCDetachableTab(protect=True, parent=self)
|
||||||
self.notebook.setTabsClosable(False)
|
self.notebook.setTabsClosable(False)
|
||||||
self.notebook.useOldIndex(True)
|
self.notebook.useOldIndex(True)
|
||||||
|
|
||||||
|
@ -1174,7 +1174,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
# ########################## PLOT AREA Tab # #############################
|
# ########################## PLOT AREA Tab # #############################
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
self.plot_tab_area = FCDetachableTab2(protect=False, protect_by_name=[_('Plot Area')])
|
self.plot_tab_area = FCDetachableTab2(protect=False, protect_by_name=[_('Plot Area')], parent=self)
|
||||||
self.plot_tab_area.useOldIndex(True)
|
self.plot_tab_area.useOldIndex(True)
|
||||||
|
|
||||||
self.right_lay.addWidget(self.plot_tab_area)
|
self.right_lay.addWidget(self.plot_tab_area)
|
||||||
|
@ -1372,7 +1372,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.sh_tab_layout.addLayout(self.sh_hlay)
|
self.sh_tab_layout.addLayout(self.sh_hlay)
|
||||||
|
|
||||||
self.app_sh_msg = (
|
self.app_sh_msg = (
|
||||||
'''<b>General Shortcut list</b><br>
|
'''<b>%s</b><br>
|
||||||
<table border="0" cellpadding="0" cellspacing="0" style="width:283px">
|
<table border="0" cellpadding="0" cellspacing="0" style="width:283px">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr height="20">
|
<tr height="20">
|
||||||
|
@ -1716,6 +1716,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
</table>
|
</table>
|
||||||
''' %
|
''' %
|
||||||
(
|
(
|
||||||
|
_("General Shortcut list"),
|
||||||
_("SHOW SHORTCUT LIST"), _("Switch to Project Tab"), _("Switch to Selected Tab"),
|
_("SHOW SHORTCUT LIST"), _("Switch to Project Tab"), _("Switch to Selected Tab"),
|
||||||
_("Switch to Tool Tab"),
|
_("Switch to Tool Tab"),
|
||||||
_("New Gerber"), _("Edit Object (if selected)"), _("Grid On/Off"), _("Jump to Coordinates"),
|
_("New Gerber"), _("Edit Object (if selected)"), _("Grid On/Off"), _("Jump to Coordinates"),
|
||||||
|
@ -2446,6 +2447,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.grid_snap_btn.triggered.connect(self.on_grid_snap_triggered)
|
self.grid_snap_btn.triggered.connect(self.on_grid_snap_triggered)
|
||||||
self.snap_infobar_label.clicked.connect(self.on_grid_icon_snap_clicked)
|
self.snap_infobar_label.clicked.connect(self.on_grid_icon_snap_clicked)
|
||||||
|
|
||||||
|
# to be used in the future
|
||||||
|
# self.plot_tab_area.tab_attached.connect(lambda x: print(x))
|
||||||
|
# self.plot_tab_area.tab_detached.connect(lambda x: print(x))
|
||||||
|
|
||||||
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
# %%%%%%%%%%%%%%%%% GUI Building FINISHED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
# %%%%%%%%%%%%%%%%% GUI Building FINISHED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -20,6 +20,7 @@ from copy import copy
|
||||||
import re
|
import re
|
||||||
import logging
|
import logging
|
||||||
import html
|
import html
|
||||||
|
import sys
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
import FlatCAMTranslation as fcTranslate
|
import FlatCAMTranslation as fcTranslate
|
||||||
|
@ -1480,9 +1481,11 @@ class FCDetachableTab(QtWidgets.QTabWidget):
|
||||||
From here:
|
From here:
|
||||||
https://stackoverflow.com/questions/47267195/in-pyqt4-is-it-possible-to-detach-tabs-from-a-qtabwidget
|
https://stackoverflow.com/questions/47267195/in-pyqt4-is-it-possible-to-detach-tabs-from-a-qtabwidget
|
||||||
"""
|
"""
|
||||||
|
tab_detached = QtCore.pyqtSignal(str)
|
||||||
|
tab_attached = QtCore.pyqtSignal(str)
|
||||||
|
|
||||||
def __init__(self, protect=None, protect_by_name=None, parent=None):
|
def __init__(self, protect=None, protect_by_name=None, parent=None):
|
||||||
super().__init__()
|
super().__init__(parent=parent)
|
||||||
|
|
||||||
self.tabBar = self.FCTabBar(self)
|
self.tabBar = self.FCTabBar(self)
|
||||||
self.tabBar.onMoveTabSignal.connect(self.moveTab)
|
self.tabBar.onMoveTabSignal.connect(self.moveTab)
|
||||||
|
@ -1619,7 +1622,7 @@ class FCDetachableTab(QtWidgets.QTabWidget):
|
||||||
self.insertTab(toIndex, widget, icon, text)
|
self.insertTab(toIndex, widget, icon, text)
|
||||||
self.setCurrentIndex(toIndex)
|
self.setCurrentIndex(toIndex)
|
||||||
|
|
||||||
@pyqtSlot(int, QtCore.QPoint)
|
# @pyqtSlot(int, QtCore.QPoint)
|
||||||
def detachTab(self, index, point):
|
def detachTab(self, index, point):
|
||||||
"""
|
"""
|
||||||
Detach the tab by removing it's contents and placing them in
|
Detach the tab by removing it's contents and placing them in
|
||||||
|
@ -1656,6 +1659,8 @@ class FCDetachableTab(QtWidgets.QTabWidget):
|
||||||
# Create a reference to maintain access to the detached tab
|
# Create a reference to maintain access to the detached tab
|
||||||
self.detachedTabs[name] = detachedTab
|
self.detachedTabs[name] = detachedTab
|
||||||
|
|
||||||
|
self.tab_detached.emit(name)
|
||||||
|
|
||||||
def attachTab(self, contentWidget, name, icon, insertAt=None):
|
def attachTab(self, contentWidget, name, icon, insertAt=None):
|
||||||
"""
|
"""
|
||||||
Re-attach the tab by removing the content from the DetachedTab window,
|
Re-attach the tab by removing the content from the DetachedTab window,
|
||||||
|
@ -1668,11 +1673,11 @@ class FCDetachableTab(QtWidgets.QTabWidget):
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
old_name = name
|
||||||
|
|
||||||
# Make the content widget a child of this widget
|
# Make the content widget a child of this widget
|
||||||
contentWidget.setParent(self)
|
contentWidget.setParent(self)
|
||||||
|
|
||||||
# Remove the reference
|
|
||||||
del self.detachedTabs[name]
|
|
||||||
# make sure that we strip the 'FlatCAM' part of the detached name otherwise the tab name will be too long
|
# make sure that we strip the 'FlatCAM' part of the detached name otherwise the tab name will be too long
|
||||||
name = name.partition(' ')[2]
|
name = name.partition(' ')[2]
|
||||||
|
|
||||||
|
@ -1712,6 +1717,9 @@ class FCDetachableTab(QtWidgets.QTabWidget):
|
||||||
else:
|
else:
|
||||||
index = self.insertTab(insert_index, contentWidget, icon, name)
|
index = self.insertTab(insert_index, contentWidget, icon, name)
|
||||||
|
|
||||||
|
obj_name = contentWidget.objectName()
|
||||||
|
self.tab_attached.emit(obj_name)
|
||||||
|
|
||||||
# on reattaching the tab if protect is true then the closure button is not added
|
# on reattaching the tab if protect is true then the closure button is not added
|
||||||
if self.protect_tab is True:
|
if self.protect_tab is True:
|
||||||
self.protectTab(index)
|
self.protectTab(index)
|
||||||
|
@ -1727,6 +1735,14 @@ class FCDetachableTab(QtWidgets.QTabWidget):
|
||||||
if index > -1:
|
if index > -1:
|
||||||
self.setCurrentIndex(insert_index) if self.use_old_index else self.setCurrentIndex(index)
|
self.setCurrentIndex(insert_index) if self.use_old_index else self.setCurrentIndex(index)
|
||||||
|
|
||||||
|
# Remove the reference
|
||||||
|
# Unix-like OS's crash with segmentation fault after this. FOr whatever reason, they loose reference
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
try:
|
||||||
|
del self.detachedTabs[old_name]
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
def removeTabByName(self, name):
|
def removeTabByName(self, name):
|
||||||
"""
|
"""
|
||||||
Remove the tab with the given name, even if it is detached
|
Remove the tab with the given name, even if it is detached
|
||||||
|
|
Loading…
Reference in New Issue