forked from syx9527/LibraryManage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminHome.py
100 lines (84 loc) · 3.55 KB
/
AdminHome.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AdminHome.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import qdarkstyle
from addBookDialog import addBookDialog
from dropBookDialog import dropBookDialog
from BookStorageViewer import BookStorageViewer
from UserManage import UserManage
class AdminHome(QWidget):
def __init__(self):
super().__init__()
self.setupUi()
def setupUi(self):
self.setObjectName("AdminHome")
self.resize(1200, 600)
self.layout = QtWidgets.QHBoxLayout(self)
self.layout.setObjectName("layout")
self.buttonlayout = QtWidgets.QVBoxLayout()
self.buttonlayout.setObjectName("buttonlayout")
self.addBookButton = QtWidgets.QPushButton(self)
self.addBookButton.setEnabled(True)
self.addBookButton.setMaximumSize(QtCore.QSize(100, 42))
font = QtGui.QFont()
font.setPointSize(16)
self.addBookButton.setFont(font)
self.addBookButton.setObjectName("addBookButton")
self.buttonlayout.addWidget(self.addBookButton)
self.dropBookButton = QtWidgets.QPushButton(self)
self.dropBookButton.setMaximumSize(QtCore.QSize(100, 42))
font = QtGui.QFont()
font.setPointSize(16)
self.dropBookButton.setFont(font)
self.dropBookButton.setObjectName("dropBookButton")
self.buttonlayout.addWidget(self.dropBookButton)
self.userManageButton = QtWidgets.QPushButton(self)
self.userManageButton.setMaximumSize(QtCore.QSize(100, 42))
font = QtGui.QFont()
font.setPointSize(16)
self.userManageButton.setFont(font)
self.userManageButton.setObjectName("userManageButton")
self.buttonlayout.addWidget(self.userManageButton)
self.layout.addLayout(self.buttonlayout)
self.storageView = BookStorageViewer()
self.layout.addWidget(self.storageView)
self.addBookButton.clicked.connect(self.addBookButtonClicked)
self.dropBookButton.clicked.connect(self.dropBookButtonClicked)
self.userManageButton.clicked.connect(self.userManage)
self.retranslateUi()
QtCore.QMetaObject.connectSlotsByName(self)
def retranslateUi(self):
_translate = QtCore.QCoreApplication.translate
self.setWindowTitle(_translate("AdminHome", "欢迎使用图书馆管理系统"))
self.addBookButton.setText(_translate("AdminHome", "添加书籍"))
self.dropBookButton.setText(_translate("AdminHome", "淘汰书籍"))
self.userManageButton.setText(_translate("AdminHome", "用户管理"))
def addBookButtonClicked(self):
addDialog = addBookDialog(self)
addDialog.add_book_success_signal.connect(self.storageView.searchButtonClicked)
addDialog.show()
addDialog.exec_()
def dropBookButtonClicked(self):
dropDialog = dropBookDialog(self)
dropDialog.drop_book_successful_signal.connect(self.storageView.searchButtonClicked)
dropDialog.show()
dropDialog.exec_()
def userManage(self):
UserDelete = UserManage(self)
UserDelete.show()
UserDelete.exec_()
pass
if __name__ == "__main__":
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("./images/MainWindow_1.ico"))
# app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
mainMindow = AdminHome()
mainMindow.show()
sys.exit(app.exec_())