diff --git a/pyminer2/features/base.py b/pyminer2/features/base.py index 19b442078a7317cf796bb61c40617e0ecfa9196d..cc416844762ef4ac6ceb18e99a6526c867ce337e 100644 --- a/pyminer2/features/base.py +++ b/pyminer2/features/base.py @@ -6,13 +6,13 @@ import webbrowser from typing import Tuple, List import qdarkstyle -from qtpy.QtCore import QPoint, QRectF -from qtpy.QtGui import QMouseEvent, QPainter, QLinearGradient -from qtpy.QtGui import QCloseEvent -from qtpy.QtCore import Signal, Qt, QUrl, QPropertyAnimation -from qtpy.QtWidgets import QApplication, QListWidgetItem, QWizard, QHeaderView, QMessageBox -from qtpy.QtWebEngineWidgets import * -from qtpy.QtWidgets import QWidget, QDesktopWidget, QFileDialog, QApplication, QDialog +from PySide2.QtCore import QPoint, QRectF +from PySide2.QtGui import QMouseEvent, QPainter, QLinearGradient +from PySide2.QtGui import QCloseEvent +from PySide2.QtCore import Signal, Qt, QUrl, QPropertyAnimation +from PySide2.QtWidgets import QApplication, QListWidgetItem, QWizard, QHeaderView, QMessageBox +from PySide2.QtWebEngineWidgets import * +from PySide2.QtWidgets import QWidget, QDesktopWidget, QFileDialog, QApplication, QDialog from pmgwidgets import PMGPanel from pyminer2.ui.base.option import Ui_Form as Option_Ui_Form @@ -238,7 +238,7 @@ class ProjectWizardForm(QWizard, Project_Ui_Form): 新建项目引导窗口 """ - def __init__(self,parent=None): + def __init__(self, parent=None): super(ProjectWizardForm, self).__init__(parent=None) self.setupUi(self) self.center() @@ -257,23 +257,44 @@ class ProjectWizardForm(QWizard, Project_Ui_Form): self.toolButton.clicked.connect(self.getProjectDirectory) # 向导界面finish按钮按下后触发的事件 self.button(QWizard.FinishButton).clicked.connect(self.finishWizard) + # 向导界面next按钮按下后触发的事件 + self.button(QWizard.NextButton).clicked.connect(self.nextButtonCheck) # 项目名称框text发生改变时触发的事件 self.projectNameLineEdit.textChanged.connect(self.projectNameLineEditTextChange) # 选择不同项目类型时下方展示不同的类型描述 self.file_list.itemClicked.connect(self.fileListItemClicked) + # 自定义模板按钮按下后触发的事件 + self.customTemplate.clicked.connect(self.customTemplateClicked) def getProjectDirectory(self): """ 浏览按钮触发的事件,选择文件夹 :return: """ - directory_name = QFileDialog.getExistingDirectory(None, "请选择文件夹路径", "./") + absolute_directory = self.absoluteDirectoryEditLine.text() + project_directory = self.projectDirectoryEditLine.text() + directory_name = QFileDialog.getExistingDirectory(None, "请选择文件夹路径", "./").replace("/", "\\") self.projectDirectoryEditLine.setText(directory_name) project_name = self.projectNameLineEdit.text() - if project_name != "": - self.absoluteDirectoryEditLine.setText(directory_name + "/" + project_name) + if len(project_name) != 0: + if len(directory_name) != 0: + self.absoluteDirectoryEditLine.setText(directory_name + "\\" + project_name + '\\main.py') + self.projectDirectoryEditLine.setText(directory_name + "\\" + project_name) + else: + self.absoluteDirectoryEditLine.setText(absolute_directory) + self.projectDirectoryEditLine.setText(project_directory) + else: + if len(directory_name) != 0: + self.absoluteDirectoryEditLine.setText(directory_name + "\\" + project_name + '\\main.py') + self.projectDirectoryEditLine.setText(directory_name + "\\" + project_name) + else: + self.absoluteDirectoryEditLine.setText(absolute_directory) + self.projectDirectoryEditLine.setText(project_directory) + project_directory = self.projectDirectoryEditLine.text() + if project_directory != "" and os.path.exists(project_directory): + self.warningLabel.setText("警告:该项目已存在") else: - self.absoluteDirectoryEditLine.setText(directory_name) + self.warningLabel.setText("") def finishWizard(self): """ @@ -281,78 +302,85 @@ class ProjectWizardForm(QWizard, Project_Ui_Form): :return: """ import os + import pathlib file_path = self.absoluteDirectoryEditLine.text() - if os.path.exists(file_path): - print('文件已存在') # 创建空文件 + project_path = self.projectDirectoryEditLine.text() + current_project_type = self.file_list.item(self.file_list.currentRow()).text() + if os.path.exists(project_path): + # result = QMessageBox.warning(self, "警告", "该项目已存在,是否重新创建并覆盖?", QMessageBox.Yes, QMessageBox.No) + # if result == QMessageBox.Yes: + # print("Yes") + # else: + # print("No") + if current_project_type != "Python-Template-PySide2": + pathlib.Path(file_path).touch() # 创建空文件 + else: + from shutil import rmtree + rmtree(project_path) else: - current_project_type = self.file_list.item(self.file_list.currentRow()).text() - if current_project_type == "Python-Empty": # 创建空项目 + if current_project_type != "Python-Template-PySide2": + os.mkdir(project_path) + pathlib.Path(file_path).touch() + from shutil import copyfile + if current_project_type == "Python-Empty": # 创建空项目 + template_dir = "pyminer2/template/Empty-Template.py" + if os.path.exists(template_dir): + copyfile(template_dir, file_path) + else: # 若模板文件不存在,默认新建空main.py with open(file_path, "w") as f: - f.write('') - elif current_project_type == "Python-Template-Basic": # 创建base template项目 + f.write("") + elif current_project_type == "Python-Template-Basic": # 创建base template项目 + template_dir = "pyminer2/template/Basic-Template.py" + if os.path.exists(template_dir): + copyfile(template_dir, file_path) + else: # 若模板文件不存在,默认将以下内容写入main.py with open(file_path, "w") as f: - f.write("""#--coding:utf-8-- - - if __name__ == '__main__': - # Create your codes here - """) - elif current_project_type == "Python-Template-Plot": # 创建plot template项目 + f.write("# --coding:utf-8--\n") + f.write("if __name__ == '__main__':\n") + f.write(" # Create your codes here") + f.write(" pass") + elif current_project_type == "Python-Template-Plot": # 创建plot template项目 + template_dir = "pyminer2/template/Plot-Template.py" + if os.path.exists(template_dir): + copyfile(template_dir, file_path) + else: # 若模板文件不存在,默认将以下内容写入main.py with open(file_path, "w") as f: - f.write("""#--coding:utf-8-- - import matplotlib.pyplot as plt - import numpy as np - - def demoTemplate(): - x = np.linspace(0,5,200) - y1 = x + 1 - y2 = x -1 - plt.figure() - #### 去边框 - ax = plt.axes() - ax.spines['top'].set_visible(False) - ax.spines['right'].set_visible(False) - #### 关闭坐标轴//就剩下中间的绘图区,坐标轴连带标签都去掉了 - #### 网格设置 - plt.grid(axis="both",linestyle='-.',c='b') - #### 绘图 - plt.plot(x,y1,'c--') - plt.plot(x,y2,'r-.') - plt.text(1,0.5,"text") - #### legend - plt.legend(["y1","y2"]) - #### 标签 - plt.xlabel("xlabel") - plt.ylabel("ylabel") - plt.title("title") - plt.show() - - if __name__ == '__main__': - demoTemplate() - """) - elif current_project_type == "Python-Template-PyQt": # 创建pyqt template项目 - with open(file_path, "w") as f: - f.write("""#--coding:utf-8-- - import sys - from PyQt5.QtWidgets import QApplication, QDialog - - from pyqt_template import Ui_PyQtTemplate - - - class CallPyQtTemplate(QDialog, Ui_PyQtTemplate): - def __init__(self): - super(CallPyQtTemplate, self).__init__() - self.setupUi(self) - - - if __name__ == '__main__': - app = QApplication(sys.argv) - form = CallPyQtTemplate() - form.show() - sys.exit(app.exec()) - """) - project_path=self.projectDirectoryEditLine.text() - extension_lib.Program.set_work_dir(project_path) # 在文件树区域打开新建项目 - + f.write("# --coding:utf-8--\n") + f.write("\n") + f.write("import matplotlib.pyplot as plt\n") + f.write("import numpy as np\n") + f.write("\n") + f.write("\n") + f.write("def demoTemplate():\n") + f.write(" x = np.linspace(0, 5, 200)\n") + f.write(" y1 = x + 1\n") + f.write(" y2 = x - 1\n") + f.write(" plt.figure()\n") + f.write(" ax = plt.axes()\n") + f.write(" ax.spines['top'].set_visible(False)\n") + f.write(" ax.spines['right'].set_visible(False)\n") + f.write(" plt.grid(axis='both', linestyle='-.', c='b')\n") + f.write(" plt.plot(x, y1, 'c--')\n") + f.write(" plt.plot(x, y2, 'r-.')\n") + f.write(" plt.text(1, 0.5, 'text')\n") + f.write(" plt.legend(['y1', 'y2'])\n") + f.write(" plt.xlabel('xlabel')\n") + f.write(" plt.ylabel('ylabel')\n") + f.write(" plt.title('title')\n") + f.write(" plt.show()\n") + f.write("\n") + f.write("\n") + f.write("if __name__ == '__main__':\n") + f.write(" demoTemplate()\n") + elif current_project_type == "Python-Template-PySide2": # 创建pyqt template项目 + template_dir = "pyminer2/template/PySide2Template" + if os.path.exists(template_dir): + from shutil import copytree + copytree(template_dir, project_path) + else: # 若模板文件不存在,默认将以下内容写入main.py + QMessageBox.warning(self, "警告", "模板路径不存在,请确保模板在程序根目录下的pyminer2/template/PySide2Template", + QMessageBox.Ok) + extension_lib.Program.set_work_dir(project_path) # 在文件树区域打开新建项目,将当前工作路径切换为新建的项目 def projectNameLineEditTextChange(self): """ @@ -363,11 +391,20 @@ class ProjectWizardForm(QWizard, Project_Ui_Form): """ project_name = self.projectNameLineEdit.text() absolute_directory = self.absoluteDirectoryEditLine.text() - # 将文件路径按照/分割成列表,然后把最后一个元素也就是项目名称pop()移出列表,最后再拼接成完整的路径 - absolute_directory_list = absolute_directory.split("/") - absolute_directory_list.pop() + # 将文件路径按照\分割成列表,然后把右边2个元素也就是main.py与项目名称pop()移出列表,最后再拼接成完整的路径 + absolute_directory_list = absolute_directory.split("\\") + absolute_directory_list.pop() # 移除最右边的元素"main.py" + absolute_directory_list.pop() # 移除右边的项目名称元素 if absolute_directory != "": - self.absoluteDirectoryEditLine.setText("/".join(absolute_directory_list) + "/" + project_name) + # 将新项目名称和main.py与浏览按钮选择的路径进行拼接组合成新的绝对路径和项目路径 + self.projectDirectoryEditLine.setText("\\".join(absolute_directory_list) + "\\" + project_name) + self.absoluteDirectoryEditLine.setText("\\".join(absolute_directory_list) + "\\" + project_name + + "\\main.py") + project_dir = self.projectDirectoryEditLine.text() + if os.path.exists(project_dir): + self.warningLabel.setText("警告:该项目已存在") + else: + self.warningLabel.setText("") def fileListItemClicked(self): current_project_type = self.file_list.item(self.file_list.currentRow()).text() @@ -377,8 +414,18 @@ class ProjectWizardForm(QWizard, Project_Ui_Form): self.plainTextEdit.setPlainText("Create a Python Project containing a Base Template main.py.") elif current_project_type == "Python-Template-Plot": self.plainTextEdit.setPlainText("Create a Python Project containing a Plot Template main.py.") - elif current_project_type == "Python-Template-PyQt": - self.plainTextEdit.setPlainText("Create a Python Project containing a PyQt Template main.py.") + elif current_project_type == "Python-Template-PySide2": + self.plainTextEdit.setPlainText("Create a Python Project containing a PySide2 Template main.py.") + + def nextButtonCheck(self): + """ + 进行项目类型选择控制,必须选中一行才能进行下一步 + """ + # QMessageBox.warning(self, "警告", "请选择一行") + pass + + def customTemplateClicked(self): + pass def keyPressEvent(self, e): """ diff --git a/pyminer2/template/Basic-Template.py b/pyminer2/template/Basic-Template.py new file mode 100644 index 0000000000000000000000000000000000000000..6788f5a14368d20291240c5fc7836cb2276b8c8f --- /dev/null +++ b/pyminer2/template/Basic-Template.py @@ -0,0 +1,14 @@ +# --coding:utf-8-- + +""" +Please make sure the content of the file is complete. +If you customize the template, please make sure it can be executed correctly +by the interpreter after modification. +Do not delete the file and the directory where the file is located. +请确保文件内容完整。 +若自定义模板,请在修改后确保能够被解释器正确执行。 +【请勿删除】该文件以及文件所在目录。 +""" +if __name__ == '__main__': + # Create your codes here + pass diff --git a/pyminer2/template/Empty-Template.py b/pyminer2/template/Empty-Template.py new file mode 100644 index 0000000000000000000000000000000000000000..7532010d52681088bc245077b16225b06a1310df --- /dev/null +++ b/pyminer2/template/Empty-Template.py @@ -0,0 +1,9 @@ +""" +Please make sure the content of the file is complete. +If you customize the template, please make sure it can be executed correctly +by the interpreter after modification. +Do not delete the file and the directory where the file is located. +请确保文件内容完整。 +若自定义模板,请在修改后确保能够被解释器正确执行。 +【请勿删除】该文件以及文件所在目录 +""" \ No newline at end of file diff --git a/pyminer2/template/Plot-Template.py b/pyminer2/template/Plot-Template.py new file mode 100644 index 0000000000000000000000000000000000000000..000c5ab169cd4daba858ea52e011046d54880bf2 --- /dev/null +++ b/pyminer2/template/Plot-Template.py @@ -0,0 +1,36 @@ +# --coding:utf-8-- + +""" +Please make sure the content of the file is complete. +If you customize the template, please make sure it can be executed correctly +by the interpreter after modification. +Do not delete the file and the directory where the file is located. +请确保文件内容完整。 +若自定义模板,请在修改后确保能够被解释器正确执行。 +【请勿删除】该文件以及文件所在目录 +""" +import matplotlib.pyplot as plt +import numpy as np + + +def demoTemplate(): + x = np.linspace(0, 5, 200) + y1 = x + 1 + y2 = x - 1 + plt.figure() + ax = plt.axes() + ax.spines['top'].set_visible(False) + ax.spines['right'].set_visible(False) + plt.grid(axis="both", linestyle='-.', c='b') + plt.plot(x, y1, 'c--') + plt.plot(x, y2, 'r-.') + plt.text(1, 0.5, "text") + plt.legend(["y1", "y2"]) + plt.xlabel("xlabel") + plt.ylabel("ylabel") + plt.title("title") + plt.show() + + +if __name__ == '__main__': + demoTemplate() diff --git a/pyminer2/template/PyQt-Template.py b/pyminer2/template/PyQt-Template.py new file mode 100644 index 0000000000000000000000000000000000000000..e920801d5bd7eb0671ca452af912570e5a3756be --- /dev/null +++ b/pyminer2/template/PyQt-Template.py @@ -0,0 +1,16 @@ +# --coding:utf-8-- +import sys +from PySide2.QtWidgets import QApplication, QDialog + + +class CallPyQtTemplate(object): + def __init__(self): + super(CallPyQtTemplate, self).__init__() + self.setupUi(self) + + +if __name__ == '__main__': + app = QApplication(sys.argv) + form = CallPyQtTemplate() + form.show() + sys.exit(app.exec()) diff --git a/pyminer2/template/PySide2Template/PySide2_Template.py b/pyminer2/template/PySide2Template/PySide2_Template.py new file mode 100644 index 0000000000000000000000000000000000000000..7b9215ba81393a15168c1a1d728e3bf1b07916e6 --- /dev/null +++ b/pyminer2/template/PySide2Template/PySide2_Template.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'PySide2_Template.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + + +class Ui_PySide2Template(object): + def setupUi(self, PySide2Template): + if not PySide2Template.objectName(): + PySide2Template.setObjectName(u"PySide2Template") + PySide2Template.resize(402, 307) + icon = QIcon() + icon.addFile(u"../../ui/source/icons/logo.ico", QSize(), QIcon.Normal, QIcon.Off) + PySide2Template.setWindowIcon(icon) + self.verticalLayoutWidget = QWidget(PySide2Template) + self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget") + self.verticalLayoutWidget.setGeometry(QRect(9, 19, 381, 281)) + self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.textBrowser = QTextBrowser(self.verticalLayoutWidget) + self.textBrowser.setObjectName(u"textBrowser") + + self.verticalLayout.addWidget(self.textBrowser) + + + self.retranslateUi(PySide2Template) + + QMetaObject.connectSlotsByName(PySide2Template) + # setupUi + + def retranslateUi(self, PySide2Template): + PySide2Template.setWindowTitle(QCoreApplication.translate("PySide2Template", u"PySide2Template", None)) + self.textBrowser.setHtml(QCoreApplication.translate("PySide2Template", u"\n" +"\n" +"

This is a PySide2 Template.

", None)) + # retranslateUi + diff --git a/pyminer2/template/PySide2Template/PySide2_Template.ui b/pyminer2/template/PySide2Template/PySide2_Template.ui new file mode 100644 index 0000000000000000000000000000000000000000..40ee0698acdade5e1ef9fb3c76b26505fc646e63 --- /dev/null +++ b/pyminer2/template/PySide2Template/PySide2_Template.ui @@ -0,0 +1,46 @@ + + + PySide2Template + + + + 0 + 0 + 402 + 307 + + + + PySide2Template + + + + ../../ui/source/icons/logo.ico../../ui/source/icons/logo.ico + + + + + 9 + 19 + 381 + 281 + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600; color:#ff0000;">This is a PySide2 Template.</span></p></body></html> + + + + + + + + + diff --git a/pyminer2/template/PySide2Template/__init__.py b/pyminer2/template/PySide2Template/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/pyminer2/template/PySide2Template/main.py b/pyminer2/template/PySide2Template/main.py new file mode 100644 index 0000000000000000000000000000000000000000..6c1c6520d4f5299dc3e169b42c94c6ee56edd380 --- /dev/null +++ b/pyminer2/template/PySide2Template/main.py @@ -0,0 +1,26 @@ +# --coding:utf-8-- +""" +Please make sure the content of the file is complete. +If you customize the template, please make sure it can be executed correctly +by the interpreter after modification. +Do not delete the file and the directory where the file is located. +请确保文件内容完整。 +若自定义模板,请在修改后确保能够被解释器正确执行。 +【请勿删除】该文件以及文件所在目录。 +""" +import sys +from PySide2.QtWidgets import QApplication, QDialog +from PySide2_Template import Ui_PySide2Template + + +class CallPySideTemplate(QDialog, Ui_PySide2Template): + def __init__(self): + super(CallPySideTemplate, self).__init__() + self.setupUi(self) + + +if __name__ == '__main__': + app = QApplication(sys.argv) + form = CallPySideTemplate() + form.show() + sys.exit(app.exec_()) diff --git a/pyminer2/template/__init__.py b/pyminer2/template/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/pyminer2/ui/base/project_wizard.py b/pyminer2/ui/base/project_wizard.py index 8a51090cd4e9bea25c95a2f901658b85a33bca37..aae264a18e0203fd6f2b5e0e755af1c736e59285 100644 --- a/pyminer2/ui/base/project_wizard.py +++ b/pyminer2/ui/base/project_wizard.py @@ -20,6 +20,7 @@ class Ui_Wizard(object): Wizard.setObjectName(u"Wizard") Wizard.resize(736, 505) Wizard.setWizardStyle(QWizard.ModernStyle) + Wizard.setOptions(QWizard.HelpButtonOnRight|QWizard.NoBackButtonOnStartPage) self.wizardPage1 = QWizardPage() self.wizardPage1.setObjectName(u"wizardPage1") self.horizontalLayout = QHBoxLayout(self.wizardPage1) @@ -226,11 +227,6 @@ class Ui_Wizard(object): self.formLayout_2 = QFormLayout() self.formLayout_2.setObjectName(u"formLayout_2") - self.projectDirectory = QLabel(self.widget_right_2) - self.projectDirectory.setObjectName(u"projectDirectory") - - self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.projectDirectory) - self.projectNameText = QLabel(self.widget_right_2) self.projectNameText.setObjectName(u"projectNameText") @@ -238,25 +234,14 @@ class Ui_Wizard(object): self.projectNameLineEdit = QLineEdit(self.widget_right_2) self.projectNameLineEdit.setObjectName(u"projectNameLineEdit") - self.projectNameLineEdit.setClearButtonEnabled(True) + self.projectNameLineEdit.setClearButtonEnabled(False) self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.projectNameLineEdit) - self.absoluteDirectoryEditLine = QLineEdit(self.widget_right_2) - self.absoluteDirectoryEditLine.setObjectName(u"absoluteDirectoryEditLine") - self.absoluteDirectoryEditLine.setStyleSheet(u"") - self.absoluteDirectoryEditLine.setReadOnly(True) - - self.formLayout_2.setWidget(2, QFormLayout.FieldRole, self.absoluteDirectoryEditLine) - - self.absoluteDirectory = QLabel(self.widget_right_2) - self.absoluteDirectory.setObjectName(u"absoluteDirectory") - - self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.absoluteDirectory) - - self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + self.projectDirectory = QLabel(self.widget_right_2) + self.projectDirectory.setObjectName(u"projectDirectory") - self.formLayout_2.setItem(3, QFormLayout.LabelRole, self.verticalSpacer_3) + self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.projectDirectory) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") @@ -275,6 +260,30 @@ class Ui_Wizard(object): self.formLayout_2.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_4) + self.absoluteDirectory = QLabel(self.widget_right_2) + self.absoluteDirectory.setObjectName(u"absoluteDirectory") + + self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.absoluteDirectory) + + self.absoluteDirectoryEditLine = QLineEdit(self.widget_right_2) + self.absoluteDirectoryEditLine.setObjectName(u"absoluteDirectoryEditLine") + self.absoluteDirectoryEditLine.setStyleSheet(u"") + self.absoluteDirectoryEditLine.setReadOnly(True) + + self.formLayout_2.setWidget(2, QFormLayout.FieldRole, self.absoluteDirectoryEditLine) + + self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.formLayout_2.setItem(4, QFormLayout.LabelRole, self.verticalSpacer_3) + + self.warningLabel = QLabel(self.widget_right_2) + self.warningLabel.setObjectName(u"warningLabel") + self.warningLabel.setFont(font) + self.warningLabel.setStyleSheet(u"color: rgb(255, 102, 0);") + self.warningLabel.setTextFormat(Qt.AutoText) + + self.formLayout_2.setWidget(3, QFormLayout.FieldRole, self.warningLabel) + self.verticalLayout_6.addLayout(self.formLayout_2) @@ -323,7 +332,7 @@ class Ui_Wizard(object): ___qlistwidgetitem4 = self.file_list.item(2) ___qlistwidgetitem4.setText(QCoreApplication.translate("Wizard", u"Python-Template-Plot", None)); ___qlistwidgetitem5 = self.file_list.item(3) - ___qlistwidgetitem5.setText(QCoreApplication.translate("Wizard", u"Python-Template-PyQt", None)); + ___qlistwidgetitem5.setText(QCoreApplication.translate("Wizard", u"Python-Template-PySide2", None)); self.file_list.setSortingEnabled(__sortingEnabled2) self.plainTextEdit.setPlainText(QCoreApplication.translate("Wizard", u"Create a Python Project containing an empty main.py file.", None)) @@ -338,10 +347,11 @@ class Ui_Wizard(object): self.listWidget_2.setSortingEnabled(__sortingEnabled3) self.label_9.setText(QCoreApplication.translate("Wizard", u"Project Configuration", None)) - self.projectDirectory.setText(QCoreApplication.translate("Wizard", u"Project Directory:", None)) self.projectNameText.setText(QCoreApplication.translate("Wizard", u"Project Name:", None)) self.projectNameLineEdit.setText(QCoreApplication.translate("Wizard", u"PyMinerProject", None)) - self.absoluteDirectory.setText(QCoreApplication.translate("Wizard", u"Absolute Directory:", None)) + self.projectDirectory.setText(QCoreApplication.translate("Wizard", u"Project Directory:", None)) self.toolButton.setText(QCoreApplication.translate("Wizard", u"...", None)) + self.absoluteDirectory.setText(QCoreApplication.translate("Wizard", u"Absolute Directory:", None)) + self.warningLabel.setText("") # retranslateUi diff --git a/pyminer2/ui/base/project_wizard.ui b/pyminer2/ui/base/project_wizard.ui index 284c55bc8d72836de29abb96b3e61ed3501a87b9..2a45d89dc1d300f82097c92557ec17c9dbf29c64 100644 --- a/pyminer2/ui/base/project_wizard.ui +++ b/pyminer2/ui/base/project_wizard.ui @@ -16,6 +16,9 @@ QWizard::ModernStyle + + QWizard::HelpButtonOnRight|QWizard::NoBackButtonOnStartPage + @@ -283,7 +286,7 @@ - Python-Template-PyQt + Python-Template-PySide2 @@ -428,13 +431,6 @@ - - - - Project Directory: - - - @@ -448,40 +444,17 @@ PyMinerProject - true - - - - - - - - - - true + false - - + + - Absolute Directory: + Project Directory: - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -503,6 +476,55 @@ + + + + Absolute Directory: + + + + + + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 75 + true + + + + color: rgb(255, 102, 0); + + + + + + Qt::AutoText + + +