-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (36 loc) · 1.12 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 日期: 2018年4月14日
# 软件名: 店面记录 1.0
# -*- coding: utf-8 -*-
from login import *
from language import *
from app import *
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QTableWidgetItem, QDialog
from PyQt5.QtGui import QIcon, QPixmap
from sys import argv, exit
import sys
from os import path
import MySQLdb
def main():
host = "localhost"
user = "root"
windowTitle = "店面记录 1.0"
app = QApplication(argv)
app.setStyle("fusion")
app.setWindowIcon(QIcon("icon.png"))
language = LanguageBox(windowTitle)
if language.exec_() == QDialog.Accepted:
login = Login(language.language, host, user, windowTitle)
if login.exec_() == QtWidgets.QDialog.Accepted:
try:
window = App(login.password, language.language, login.db, windowTitle)
window.show()
exit(app.exec_())
except Exception as e:
print(e)
login.db.close()
else:
window.db.close()
finally:
pass
if __name__ == '__main__':
main()