-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBX_MainMenuGUI2.py
More file actions
162 lines (152 loc) · 7.78 KB
/
Copy pathBX_MainMenuGUI2.py
File metadata and controls
162 lines (152 loc) · 7.78 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import sys
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtSql import QSqlDatabase, QSqlTableModel
from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QMainWindow,
QLabel, QLineEdit, QTableWidget, QTableWidgetItem,
QGridLayout, QVBoxLayout, QSizePolicy, QSpacerItem,
QMessageBox,QSpinBox, QComboBox, QTableView,QStyledItemDelegate)
from PyQt5.QtCore import Qt, QMetaObject, QCoreApplication
from PyQt5.QtGui import QFont
import sqlite3
class Ui_MainMenu(QMainWindow):
def __init__(self, parent = None):
super(Ui_MainMenu, self).__init__(parent)
self.setObjectName("MainMenu")
self.resize(808, 594)
self.setStyleSheet("background-color: rgb(0, 0, 0);")
self.centralwidget = QtWidgets.QWidget(self)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName("verticalLayout")
self.TitleLabel = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Android Insomnia")
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.TitleLabel.setFont(font)
self.TitleLabel.setStyleSheet("color: rgb(0, 255, 0);")
self.TitleLabel.setAlignment(QtCore.Qt.AlignCenter)
self.TitleLabel.setObjectName("TitleLabel")
self.verticalLayout.addWidget(self.TitleLabel)
self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Runlion")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.textBrowser.setFont(font)
self.textBrowser.setLayoutDirection(QtCore.Qt.LeftToRight)
self.textBrowser.setStyleSheet("color: rgb(255, 170, 0);")
self.textBrowser.setObjectName("textBrowser")
self.verticalLayout.addWidget(self.textBrowser)
self.textBrowser_2 = QtWidgets.QTextBrowser(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Runlion")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.textBrowser_2.setFont(font)
self.textBrowser_2.setStyleSheet("color: rgb(0, 0, 255);")
self.textBrowser_2.setObjectName("textBrowser_2")
self.verticalLayout.addWidget(self.textBrowser_2)
self.OnlineButton = QtWidgets.QPushButton(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Lethal Injector")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.OnlineButton.setFont(font)
self.OnlineButton.setStyleSheet("background-color: rgb(0, 255, 0);\n"
"border-style: outset;\n"
"border-width: 2px;\n"
"border-color: black;\n"
"padding: 4px;")
self.OnlineButton.setObjectName("OnlineButton")
self.verticalLayout.addWidget(self.OnlineButton)
self.OfflineButton = QtWidgets.QPushButton(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Lethal Injector")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.OfflineButton.setFont(font)
self.OfflineButton.setStyleSheet("background-color: rgb(255, 0, 0);\n"
"border-style: outset;\n"
"border-width: 2px;\n"
"border-color: black;\n"
"padding: 4px;")
self.OfflineButton.setObjectName("OfflineButton")
self.verticalLayout.addWidget(self.OfflineButton)
self.SettingsButton = QtWidgets.QPushButton(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Lethal Injector")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.SettingsButton.setFont(font)
self.SettingsButton.setStyleSheet("background-color: rgb(255, 170, 0);\n"
"border-style: outset;\n"
"border-width: 2px;\n"
"border-color: black;\n"
"padding: 4px;")
self.SettingsButton.setObjectName("SettingsButton")
self.verticalLayout.addWidget(self.SettingsButton)
self.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(self)
self.statusbar.setObjectName("statusbar")
self.setStatusBar(self.statusbar)
self.retranslateUi(self)
QtCore.QMetaObject.connectSlotsByName(self)
#----------------------------------------------------------------------------------------------------
# Button Actions
#----------------------------------------------------------------------------------------------------
#------------------------------------------
# Online Mode Button
#------------------------------------------
#When the Online Mode button is clicked -> OnlineClicked Function
OnlineButton = self.OnlineButton
OnlineButton.clicked.connect(self.OnlineClicked)
#------------------------------------------
#----------------------------------
# Online Mode Function
#----------------------------------
def OnlineClicked(self):
#Print in terminal for testing:
print("Online Mode Engaged")
self.close() #Close this screen
#Run Baxter
from BAXTER_V5 import BAXTER
BAXTER()
#----------------------------------
#----------------------------------------------------------------------------------------------------
# Retranslate Ui
#----------------------------------------------------------------------------------------------------
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
self.setWindowTitle(_translate("MainWindow", "BAXTER Menu"))
self.TitleLabel.setText(_translate("MainWindow", "B.A.X.T.E.R A.I System"))
self.textBrowser.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Runlion\'; font-size:12pt; font-weight:600; font-style:normal;\">\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Reminders:</p></body></html>"))
self.textBrowser_2.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Runlion\'; font-size:12pt; font-weight:600; font-style:normal;\">\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Todo:</p></body></html>"))
self.OnlineButton.setText(_translate("MainWindow", "Online Mode"))
self.OfflineButton.setText(_translate("MainWindow", "Offline Mode"))
self.SettingsButton.setText(_translate("MainWindow", "Settings"))
#----------------------------------------------------------------------------------------------------
# Run this Program
#----------------------------------------------------------------------------------------------------
def main():
app = QApplication(sys.argv)
win = Ui_MainMenu()
win.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
#----------------------------------------------------------------------------------------------------