Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Second committed Dec 23, 2020
1 parent c8c8535 commit bb62f2a
Show file tree
Hide file tree
Showing 7 changed files with 10,538 additions and 9,810 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ venv/

imgs/
.idea/
*.spec
9 changes: 9 additions & 0 deletions MsgBox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from PyQt5.QtWidgets import QDialog

from MsgBoxModel import Ui_Dialog


class MsgBox(QDialog, Ui_Dialog):
def __init__(self, parent=None):
super(MsgBox, self).__init__(parent)
self.setupUi(self)
65 changes: 65 additions & 0 deletions MsgBoxModel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'MsgBox.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
import icons_rc
import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("myappid")


class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(438, 146)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/imgs/warning.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Dialog.setWindowIcon(icon)
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(Dialog)
self.label.setStyleSheet("border-image: url(:/imgs/warning.png);")
self.label.setText("")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.label_2 = QtWidgets.QLabel(Dialog)
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(11)
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setStyleSheet("color: rgb(255, 0, 0);")
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.horizontalLayout.setStretch(0, 1)
self.horizontalLayout.setStretch(1, 2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.verticalLayout_2.addLayout(self.verticalLayout)

self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label_2.setText(_translate("Dialog", "You Should run the app as an Administrator!!"))

17 changes: 7 additions & 10 deletions envEditor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import getpass
import os
import socket
import sys

import icons_rc

Expand Down Expand Up @@ -429,7 +428,14 @@ def slotFunc(msg: str):
self.message = msg

dialog.connectWithThis(slotFunc)

font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(8)
font.setWeight(75)
dialog.valueLabel.setFont(font)
dialog.valueLabel.setText("Registry File Save Path:")
dialog.valueLabel.setStyleSheet("")
self.setWindowOpacity(0.5)
res = dialog.exec_()
self.setWindowOpacity(1.0)
Expand All @@ -443,12 +449,3 @@ def showInformation(cls):
dialog = InfoDialog(None)
dialog.exec()
pass


if __name__ == '__main__':
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
app = QApplication(sys.argv)
editor = env_editor()
editor.setApp(app)
editor.show()
sys.exit(app.exec_())
Loading

0 comments on commit bb62f2a

Please sign in to comment.