- added a few new GUI custom widgets
- removed the status bar Tcl Shell toggleable QLable. Now the Tcl Shell is toggled by clicking the Message in the Status bar
This commit is contained in:
@@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
9.03.2022
|
||||||
|
|
||||||
|
- added a few new GUI custom widgets
|
||||||
|
- removed the status bar Tcl Shell toggleable QLable. Now the Tcl Shell is toggled by clicking the Message in the Status bar
|
||||||
|
|
||||||
24.02.2022
|
24.02.2022
|
||||||
|
|
||||||
- some changes to the Preferences
|
- some changes to the Preferences
|
||||||
|
|||||||
@@ -5238,12 +5238,16 @@ class FlatCAMInfoBar(QtWidgets.QWidget):
|
|||||||
"""
|
"""
|
||||||
This class create a place to display the App messages in the Status Bar
|
This class create a place to display the App messages in the Status Bar
|
||||||
"""
|
"""
|
||||||
|
clicked = QtCore.pyqtSignal(bool)
|
||||||
|
|
||||||
def __init__(self, parent=None, app=None):
|
def __init__(self, parent=None, app=None):
|
||||||
super(FlatCAMInfoBar, self).__init__(parent=parent)
|
super(FlatCAMInfoBar, self).__init__(parent=parent)
|
||||||
|
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|
||||||
|
# for the usage of this label as a clickable label, to know that current state
|
||||||
|
self.clicked_state = False
|
||||||
|
|
||||||
self.icon = QtWidgets.QLabel(self)
|
self.icon = QtWidgets.QLabel(self)
|
||||||
self.icon.setGeometry(0, 0, 12, 12)
|
self.icon.setGeometry(0, 0, 12, 12)
|
||||||
self.pmap = QtGui.QPixmap(self.app.resource_location + '/graylight12.png')
|
self.pmap = QtGui.QPixmap(self.app.resource_location + '/graylight12.png')
|
||||||
@@ -5270,6 +5274,11 @@ class FlatCAMInfoBar(QtWidgets.QWidget):
|
|||||||
layout.addWidget(self.text)
|
layout.addWidget(self.text)
|
||||||
layout.addStretch()
|
layout.addStretch()
|
||||||
|
|
||||||
|
def mousePressEvent(self, event):
|
||||||
|
if event.button() == Qt.MouseButton.LeftButton:
|
||||||
|
self.clicked_state = not self.clicked_state
|
||||||
|
self.clicked.emit(self.clicked_state)
|
||||||
|
|
||||||
def set_text_(self, text, color=None):
|
def set_text_(self, text, color=None):
|
||||||
self.text.setText(text)
|
self.text.setText(text)
|
||||||
self.text.setToolTip(text)
|
self.text.setToolTip(text)
|
||||||
@@ -5489,6 +5498,53 @@ class FCMessageBox(QtWidgets.QMessageBox):
|
|||||||
self.move(event.globalPosition().toPoint() - self.offset.toPoint())
|
self.move(event.globalPosition().toPoint() - self.offset.toPoint())
|
||||||
|
|
||||||
|
|
||||||
|
class FCDateTime(QtWidgets.QDateTimeEdit):
|
||||||
|
|
||||||
|
def __init__(self, parent):
|
||||||
|
super(FCDateTime, self).__init__(parent)
|
||||||
|
|
||||||
|
def set_value(self, val):
|
||||||
|
year = val[0]
|
||||||
|
month = val[1]
|
||||||
|
day = val[2]
|
||||||
|
hour = val[3]
|
||||||
|
min = val[4]
|
||||||
|
date = QDateTime(year, month, day, hour, min)
|
||||||
|
self.setDateTime(date)
|
||||||
|
|
||||||
|
def get_value(self):
|
||||||
|
dt = self.dateTime()
|
||||||
|
date = dt.date()
|
||||||
|
time = dt.time()
|
||||||
|
date_list = [date.year(), date.month(), date.day(), time.hour(), time.minute()]
|
||||||
|
return date_list
|
||||||
|
|
||||||
|
|
||||||
|
class FCDate(QtWidgets.QDateEdit):
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
super(FCDate, self).__init__(parent)
|
||||||
|
self.setStyleSheet("""
|
||||||
|
QDateEdit {
|
||||||
|
border: 0px solid white;
|
||||||
|
background-color : none;
|
||||||
|
}
|
||||||
|
""")
|
||||||
|
|
||||||
|
def set_value(self, val):
|
||||||
|
val_split = val.split('-')
|
||||||
|
year = int(val_split[0])
|
||||||
|
month = int(val_split[1])
|
||||||
|
day = int(val_split[2])
|
||||||
|
date = QDate(year, month, day)
|
||||||
|
self.setDate(date)
|
||||||
|
|
||||||
|
def get_value(self):
|
||||||
|
date = self.date()
|
||||||
|
date_formated = date.toString(QtCore.Qt.DateFormat.ISODate)
|
||||||
|
return date_formated
|
||||||
|
|
||||||
|
|
||||||
def message_dialog(title, message, kind="info", parent=None):
|
def message_dialog(title, message, kind="info", parent=None):
|
||||||
"""
|
"""
|
||||||
Builds and show a custom QMessageBox to be used in FlatCAM.
|
Builds and show a custom QMessageBox to be used in FlatCAM.
|
||||||
|
|||||||
@@ -1354,12 +1354,6 @@ class MainGUI(QtWidgets.QMainWindow):
|
|||||||
self.status_toolbar.addWidget(self.pref_status_label)
|
self.status_toolbar.addWidget(self.pref_status_label)
|
||||||
self.status_toolbar.addWidget(FCLabel(" "))
|
self.status_toolbar.addWidget(FCLabel(" "))
|
||||||
|
|
||||||
self.shell_status_label = FCLabel()
|
|
||||||
self.shell_status_label.setToolTip(_("Command Line"))
|
|
||||||
self.shell_status_label.setPixmap(QtGui.QPixmap(self.app.resource_location + '/shell20.png'))
|
|
||||||
self.status_toolbar.addWidget(self.shell_status_label)
|
|
||||||
self.status_toolbar.addWidget(FCLabel(" "))
|
|
||||||
|
|
||||||
self.hud_label = FCLabel()
|
self.hud_label = FCLabel()
|
||||||
self.hud_label.setToolTip(_("HUD (Heads up display)"))
|
self.hud_label.setToolTip(_("HUD (Heads up display)"))
|
||||||
self.hud_label.setPixmap(QtGui.QPixmap(self.app.resource_location + '/hud16.png'))
|
self.hud_label.setPixmap(QtGui.QPixmap(self.app.resource_location + '/hud16.png'))
|
||||||
@@ -2009,7 +2003,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
|||||||
self.clear_btn.clicked.connect(self.on_gui_clear)
|
self.clear_btn.clicked.connect(self.on_gui_clear)
|
||||||
|
|
||||||
self.wplace_label.clicked.connect(self.app.on_workspace_toggle)
|
self.wplace_label.clicked.connect(self.app.on_workspace_toggle)
|
||||||
self.shell_status_label.clicked.connect(self.toggle_shell_ui)
|
self.fcinfo.clicked.connect(self.toggle_shell_ui)
|
||||||
|
|
||||||
# to be used in the future
|
# to be used in the future
|
||||||
# self.plot_tab_area.tab_attached.connect(lambda x: print(x))
|
# self.plot_tab_area.tab_attached.connect(lambda x: print(x))
|
||||||
@@ -2036,8 +2030,6 @@ class MainGUI(QtWidgets.QMainWindow):
|
|||||||
self.geom_update[int, int, int, int, int].connect(self.save_geometry)
|
self.geom_update[int, int, int, int, int].connect(self.save_geometry)
|
||||||
self.final_save.connect(self.app.final_save)
|
self.final_save.connect(self.app.final_save)
|
||||||
|
|
||||||
self.shell_dock.visibilityChanged.connect(self.on_shelldock_toggled)
|
|
||||||
|
|
||||||
# Notebook and Plot Tab Area signals
|
# Notebook and Plot Tab Area signals
|
||||||
# make the right click on the notebook tab and plot tab area tab raise a menu
|
# make the right click on the notebook tab and plot tab area tab raise a menu
|
||||||
self.notebook.tabBar.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.ActionsContextMenu)
|
self.notebook.tabBar.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.ActionsContextMenu)
|
||||||
@@ -2853,20 +2845,6 @@ class MainGUI(QtWidgets.QMainWindow):
|
|||||||
# no_km)
|
# no_km)
|
||||||
# QtCore.QCoreApplication.instance().sendEvent(self.shell._edit, f)
|
# QtCore.QCoreApplication.instance().sendEvent(self.shell._edit, f)
|
||||||
|
|
||||||
def on_shelldock_toggled(self, visibility):
|
|
||||||
if visibility is True:
|
|
||||||
self.shell_status_label.setStyleSheet("""
|
|
||||||
QLabel
|
|
||||||
{
|
|
||||||
color: black;
|
|
||||||
background-color: lightcoral;
|
|
||||||
}
|
|
||||||
""")
|
|
||||||
self.app.inform[str, bool].emit(_("Shell enabled."), False)
|
|
||||||
else:
|
|
||||||
self.shell_status_label.setStyleSheet("")
|
|
||||||
self.app.inform[str, bool].emit(_("Shell disabled."), False)
|
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
"""
|
"""
|
||||||
Key event handler for the entire app.
|
Key event handler for the entire app.
|
||||||
|
|||||||
Reference in New Issue
Block a user