77 lines
2.0 KiB
Python
77 lines
2.0 KiB
Python
|
|
import sys
|
|
from PySide2.QtWidgets import QApplication
|
|
from PySide2.QtWidgets import QMainWindow
|
|
from mainwindow import Ui_MainWindow
|
|
|
|
class kmanWindow(QMainWindow):
|
|
"""
|
|
def __init__(self, *args, **kwargs):
|
|
super(kmanWindow, self).__init__(*args, **kwargs)
|
|
"""
|
|
|
|
def __init__(self, parent=None):
|
|
super(kmanWindow, self).__init__(parent)
|
|
|
|
# create ui and initial it
|
|
ui = Ui_MainWindow()
|
|
ui.setupUi(self)
|
|
self.ui = ui
|
|
|
|
# connect action to slot functions
|
|
ui.actionimportkindle.triggered.connect(lambda: self.importkindle())
|
|
ui.actionimportlocal.triggered.connect(lambda: self.importlocal())
|
|
ui.actionconfig.triggered.connect(lambda: self.config())
|
|
ui.actionwords.triggered.connect(lambda: self.words())
|
|
ui.actionstatistic.triggered.connect(lambda: self.statistic())
|
|
ui.actionhomepage.triggered.connect(lambda: self.homepage())
|
|
ui.actionabout.triggered.connect(lambda: self.about())
|
|
ui.actionflush.triggered.connect(lambda: self.flush())
|
|
|
|
# define slot functions
|
|
def importkindle(self):
|
|
print("call slot importkindle()")
|
|
pass
|
|
|
|
def importlocal(self):
|
|
print("call slot importlocal()")
|
|
pass
|
|
|
|
def config(self):
|
|
print("call slot config()")
|
|
pass
|
|
|
|
def words(self):
|
|
print("call slot words()")
|
|
pass
|
|
|
|
def statistic(self):
|
|
print("call slot statistic()")
|
|
pass
|
|
|
|
def homepage(self):
|
|
print("call slot homepage()")
|
|
pass
|
|
|
|
def about(self):
|
|
print("call slot about()")
|
|
pass
|
|
|
|
def flush(self):
|
|
print("call slot flush()")
|
|
pass
|
|
|
|
def messageBox(self, showInfo):
|
|
box = QMessageBox.about(self, 'Kindle Management', showInfo)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
from PySide2.QtWidgets import QApplication, QLabel
|
|
|
|
app = QApplication(sys.argv)
|
|
kmw = kmanWindow()
|
|
kmw.resize(900, 600)
|
|
kmw.show()
|
|
app.exec_()
|