通过临时文件/databasename.txt实现传递数据库名, 寻找空闲题号基本完成
This commit is contained in:
parent
001f02cecc
commit
bc6aba924a
|
|
@ -1,5 +1,6 @@
|
||||||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QMainWindow
|
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QMainWindow
|
||||||
from Ui_tool_panel import Ui_MainWindow
|
from Ui_tool_panel import Ui_MainWindow
|
||||||
|
from PySide6.QtCore import Signal, Slot
|
||||||
from 寻找空闲题号 import MyWindow_kxth
|
from 寻找空闲题号 import MyWindow_kxth
|
||||||
from database_tools_2 import *
|
from database_tools_2 import *
|
||||||
|
|
||||||
|
|
@ -8,6 +9,7 @@ class MyWindow(QMainWindow,Ui_MainWindow):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.bind()
|
self.bind()
|
||||||
|
|
||||||
def bind(self):
|
def bind(self):
|
||||||
self.SelectTIKUTEST()
|
self.SelectTIKUTEST()
|
||||||
self.pushButton_tiku.clicked.connect(self.SelectTIKU)
|
self.pushButton_tiku.clicked.connect(self.SelectTIKU)
|
||||||
|
|
@ -19,10 +21,12 @@ class MyWindow(QMainWindow,Ui_MainWindow):
|
||||||
def SelectTIKU(self):
|
def SelectTIKU(self):
|
||||||
self.pushButton_tiku.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
self.pushButton_tiku.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
||||||
self.pushButton_tikutest.setStyleSheet("") #恢复原有背景, 取消粗体
|
self.pushButton_tikutest.setStyleSheet("") #恢复原有背景, 取消粗体
|
||||||
|
SaveTextFile("tiku","临时文件/databasename.txt")
|
||||||
self.database = "tiku"
|
self.database = "tiku"
|
||||||
def SelectTIKUTEST(self):
|
def SelectTIKUTEST(self):
|
||||||
self.pushButton_tikutest.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
self.pushButton_tikutest.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
||||||
self.pushButton_tiku.setStyleSheet("") #恢复原有背景, 取消粗体
|
self.pushButton_tiku.setStyleSheet("") #恢复原有背景, 取消粗体
|
||||||
|
SaveTextFile("tikutest","临时文件/databasename.txt")
|
||||||
self.database = "tikutest"
|
self.database = "tikutest"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ from database_tools_2 import *
|
||||||
class MyWindow_kxth(QWidget,Ui_Form):
|
class MyWindow_kxth(QWidget,Ui_Form):
|
||||||
def __init__(self,database_name):
|
def __init__(self,database_name):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.databaes_name = database_name
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.bind()
|
self.bind()
|
||||||
def bind(self):
|
def bind(self):
|
||||||
|
|
@ -16,6 +15,7 @@ class MyWindow_kxth(QWidget,Ui_Form):
|
||||||
|
|
||||||
|
|
||||||
def exec(self):
|
def exec(self):
|
||||||
|
self.databaes_name = ReadTextFile("临时文件/databasename.txt").strip()
|
||||||
self.label_used.setText(usedIDs(self.databaes_name))
|
self.label_used.setText(usedIDs(self.databaes_name))
|
||||||
self.label_available.setText(spareIDs(self.databaes_name))
|
self.label_available.setText(spareIDs(self.databaes_name))
|
||||||
print(self.databaes_name)
|
print(self.databaes_name)
|
||||||
|
|
|
||||||
Reference in New Issue