Skip to content

Commit b8d7093

Browse files
author
Gauthier
committed
Ajout dialogue A Propos et diverses choses...
1 parent 8ed6c32 commit b8d7093

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+22153
-21856
lines changed

cn5X.py

+13
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from grblJog import grblJog
3939
from cn5X_gcodeFile import gcodeFile
4040
from grblConfig import grblConfig
41+
from cn5Xapropos import cn5XAPropos
4142
import mainWindow
4243

4344
class winMain(QtWidgets.QMainWindow):
@@ -137,6 +138,8 @@ def __init__(self, parent=None):
137138
self.ui.mnu_WPos.triggered.connect(self.on_mnu_WPos)
138139
self.ui.mnuDebug_mode.triggered.connect(self.on_mnuDebug_mode)
139140

141+
self.ui.mnuA_propos.triggered.connect(self.on_mnuA_propos)
142+
140143
self.ui.btnRefresh.clicked.connect(self.populatePortList) # Refresh de la liste des ports serie
141144
self.ui.btnConnect.clicked.connect(self.action_btnConnect) # un clic sur le bouton "(De)Connecter" appellera la méthode 'action_btnConnect'
142145
self.ui.btnSend.pressed.connect(self.sendCmd) # Bouton d'envoi de commandes unitaires
@@ -430,6 +433,7 @@ def on_mnu_GrblConfig(self):
430433
'''
431434
self.__grblConfigLoaded = True
432435
dlgConfig = grblConfig(self.__grblCom, self.__nbAxis, self.__axisNames)
436+
dlgConfig.setParent(self)
433437
dlgConfig.sig_config_changed.connect(self.on_sig_config_changed)
434438
dlgConfig.showDialog()
435439
self.__grblConfigLoaded = False
@@ -843,6 +847,15 @@ def on_mnuDebug_mode(self):
843847
self.__grblCom.startPooling()
844848

845849

850+
@pyqtSlot()
851+
def on_mnuA_propos(self):
852+
''' Appel de la boite de dialogue A Propos
853+
'''
854+
dlgApropos = cn5XAPropos(APP_VERSION_STRING)
855+
dlgApropos.setParent(self)
856+
dlgApropos.showDialog()
857+
858+
846859
@pyqtSlot()
847860
def on_btnDebug(self):
848861
''' Set the debug menu on the same status '''

cn5X_config.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from PyQt5 import QtGui
2626

2727
APP_NAME = "cn5X++"
28+
APP_VERSION_STRING = "Version 0.2"
2829

2930
DEFAULT_NB_AXIS = 3 # Laisser 3 permet de gérer un Grbl original à 3 axes
3031
DEFAULT_AXIS_NAMES = ['X', 'Y', 'Z']

cn5X_rc.py

+21,597-21,683
Large diffs are not rendered by default.

cn5Xapropos.py

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# -*- coding: UTF-8 -*-
2+
3+
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
4+
' '
5+
' Copyright 2018 Gauthier Brière (gauthier.briere "at" gmail.com) '
6+
' '
7+
' This file is part of cn5X++ '
8+
' '
9+
' cn5X++ is free software: you can redistribute it and/or modify it '
10+
' under the terms of the GNU General Public License as published by '
11+
' the Free Software Foundation, either version 3 of the License, or '
12+
' (at your option) any later version. '
13+
' '
14+
' cn5X++ is distributed in the hope that it will be useful, but '
15+
' WITHOUT ANY WARRANTY; without even the implied warranty of '
16+
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '
17+
' GNU General Public License for more details. '
18+
' '
19+
' You should have received a copy of the GNU General Public License '
20+
' along with this program. If not, see <http://www.gnu.org/licenses/>. '
21+
' '
22+
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
23+
24+
from PyQt5.QtCore import Qt, QObject, pyqtSignal, pyqtSlot
25+
from PyQt5.QtWidgets import QDialog, QAbstractButton, QDialogButtonBox, QCheckBox, QSpinBox, QDoubleSpinBox, QLineEdit
26+
from PyQt5.QtGui import QStandardItemModel, QStandardItem, QValidator
27+
from cn5X_config import *
28+
from grblCom import grblCom
29+
from dlgAPropos import *
30+
from msgbox import *
31+
from compilOptions import grblCompilOptions
32+
33+
class cn5XAPropos(QObject):
34+
''' Classe assurant la gestion de la boite de dialogue A Propos '''
35+
36+
37+
def __init__(self, versionString: str):
38+
super().__init__()
39+
self.__dlgApropos = QDialog()
40+
self.__di = Ui_dlgApropos()
41+
self.__di.setupUi(self.__dlgApropos)
42+
self.__di.lblVersion.setText(versionString)
43+
44+
45+
def showDialog(self):
46+
# Centrage de la boite de dialogue sur la fenêtre principale
47+
ParentX = self.parent().geometry().x()
48+
ParentY = self.parent().geometry().y()
49+
ParentWidth = self.parent().geometry().width()
50+
ParentHeight = self.parent().geometry().height()
51+
myWidth = self.__dlgApropos.geometry().width()
52+
myHeight = self.__dlgApropos.geometry().height()
53+
self.__dlgApropos.setFixedSize(self.__dlgApropos.geometry().width(),self.__dlgApropos.geometry().height())
54+
self.__dlgApropos.move(ParentX + ((ParentWidth - myWidth) / 2),ParentY + ((ParentHeight - myHeight) / 2),)
55+
self.__dlgApropos.setWindowFlags(Qt.Dialog | Qt.WindowStaysOnTopHint)
56+
57+
RC = self.__dlgApropos.exec_()
58+
return(RC)
59+

dlgAPropos.py

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Form implementation generated from reading ui file 'dlgAPropos.ui'
4+
#
5+
# Created by: PyQt5 UI code generator 5.10.1
6+
#
7+
# WARNING! All changes made in this file will be lost!
8+
9+
from PyQt5 import QtCore, QtGui, QtWidgets
10+
11+
class Ui_dlgApropos(object):
12+
def setupUi(self, dlgApropos):
13+
dlgApropos.setObjectName("dlgApropos")
14+
dlgApropos.setWindowModality(QtCore.Qt.ApplicationModal)
15+
dlgApropos.resize(590, 320)
16+
icon = QtGui.QIcon()
17+
icon.addPixmap(QtGui.QPixmap(":/cn5X/images/XYZAB.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
18+
dlgApropos.setWindowIcon(icon)
19+
dlgApropos.setSizeGripEnabled(False)
20+
dlgApropos.setModal(True)
21+
self.verticalLayout_3 = QtWidgets.QVBoxLayout(dlgApropos)
22+
self.verticalLayout_3.setObjectName("verticalLayout_3")
23+
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
24+
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
25+
self.frame = QtWidgets.QFrame(dlgApropos)
26+
self.frame.setObjectName("frame")
27+
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
28+
self.verticalLayout_2.setContentsMargins(0, -1, -1, -1)
29+
self.verticalLayout_2.setObjectName("verticalLayout_2")
30+
self.label = QtWidgets.QLabel(self.frame)
31+
self.label.setMaximumSize(QtCore.QSize(178, 141))
32+
self.label.setText("")
33+
self.label.setPixmap(QtGui.QPixmap(":/cn5X/images/XYZAB.svg"))
34+
self.label.setScaledContents(True)
35+
self.label.setAlignment(QtCore.Qt.AlignCenter)
36+
self.label.setWordWrap(False)
37+
self.label.setObjectName("label")
38+
self.verticalLayout_2.addWidget(self.label)
39+
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
40+
self.verticalLayout_2.addItem(spacerItem)
41+
self.horizontalLayout_2.addWidget(self.frame)
42+
self.verticalLayout = QtWidgets.QVBoxLayout()
43+
self.verticalLayout.setObjectName("verticalLayout")
44+
self.label_2 = QtWidgets.QLabel(dlgApropos)
45+
self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
46+
self.label_2.setObjectName("label_2")
47+
self.verticalLayout.addWidget(self.label_2)
48+
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
49+
self.verticalLayout.addItem(spacerItem1)
50+
self.lblVersion = QtWidgets.QLabel(dlgApropos)
51+
self.lblVersion.setObjectName("lblVersion")
52+
self.verticalLayout.addWidget(self.lblVersion)
53+
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
54+
self.verticalLayout.addItem(spacerItem2)
55+
self.label_3 = QtWidgets.QLabel(dlgApropos)
56+
self.label_3.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignTop)
57+
self.label_3.setWordWrap(True)
58+
self.label_3.setObjectName("label_3")
59+
self.verticalLayout.addWidget(self.label_3)
60+
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
61+
self.verticalLayout.addItem(spacerItem3)
62+
self.horizontalLayout_2.addLayout(self.verticalLayout)
63+
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
64+
self.horizontalLayout = QtWidgets.QHBoxLayout()
65+
self.horizontalLayout.setSpacing(0)
66+
self.horizontalLayout.setObjectName("horizontalLayout")
67+
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
68+
self.horizontalLayout.addItem(spacerItem4)
69+
self.buttonBox = QtWidgets.QDialogButtonBox(dlgApropos)
70+
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
71+
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
72+
self.buttonBox.setObjectName("buttonBox")
73+
self.horizontalLayout.addWidget(self.buttonBox)
74+
self.verticalLayout_3.addLayout(self.horizontalLayout)
75+
76+
self.retranslateUi(dlgApropos)
77+
self.buttonBox.accepted.connect(dlgApropos.accept)
78+
self.buttonBox.rejected.connect(dlgApropos.reject)
79+
QtCore.QMetaObject.connectSlotsByName(dlgApropos)
80+
81+
def retranslateUi(self, dlgApropos):
82+
_translate = QtCore.QCoreApplication.translate
83+
dlgApropos.setWindowTitle(_translate("dlgApropos", "A propos de cn5X++"))
84+
self.label_2.setText(_translate("dlgApropos", "<h1>cn5X++</h1>"))
85+
self.lblVersion.setText(_translate("dlgApropos", "Version 0.0"))
86+
self.label_3.setText(_translate("dlgApropos", "CN5X++ est une application de panneau de contrôle 5/6 axes pour les machines à commandes numériques pilotées par Grbl. Cette application a pour but d\'implémenter toutes les fonctionalités du microprogramme grbl-Mega-5X.\n"
87+
"\n"
88+
"Copyright (C) Gauthier Brière."))
89+
90+
import cn5X_rc

0 commit comments

Comments
 (0)