Skip to content
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
33 changes: 29 additions & 4 deletions GraphicUser_InterFace/Airplane_Home_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import customtkinter
from PIL import Image, ImageTk
import os
import pickle as pk
from tkinter import PhotoImage
from tkinter import messagebox
import mysql.connector
Expand All @@ -13,12 +14,28 @@
customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

WINX = 1440
WINY = 540
SCALE = 100
THEME = 'Dark'

def update_config():
global WINX, WINY, SCALE, THEME
try:
with open('LocalDATA/config.ini', 'rb') as file:
WINX, WINY, SCALE, THEME = pk.load(file)
except:
with open('LocalDATA/config.ini', 'wb') as file:
pk.dump([WINX,WINY,SCALE,THEME], file)

update_config()

class Airplane(customtkinter.CTk):

def __init__(self):
super().__init__()
self.title("Airplane Home Page")
self.geometry(f"{1098}x{360}")
self.geometry(f"{WINX}x{WINY}")


self.sidebar_frame = customtkinter.CTkFrame(self, width=120, corner_radius=15)
Expand Down Expand Up @@ -135,12 +152,20 @@ def open_Info_window(self):


def change_appearance_mode_event(self, new_appearance_mode: str):
customtkinter.set_appearance_mode(new_appearance_mode)
global WINX, WINY, SCALE, THEME
THEME = new_appearance_mode
customtkinter.set_appearance_mode(THEME)
update_config()

def change_scaling_event(self, new_scaling: str):
global WINX, WINY, SCALE, THEME
new_scaling_float = int(new_scaling.replace("%", "")) / 100
customtkinter.set_widget_scaling(new_scaling_float)

SCALE = new_scaling_float
WINX = int((WINX)*new_scaling_float)
WINY = int((WINY)*new_scaling_float)
self.geometry(f"{WINX}x{WINY}")
customtkinter.set_widget_scaling(SCALE)
update_config()

if __name__ == "__main__":
app5 = Airplane()
Expand Down
31 changes: 28 additions & 3 deletions GraphicUser_InterFace/Bus_Home_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import customtkinter
from PIL import Image, ImageTk
import os
import pickle as pk
from tkinter import PhotoImage
from tkinter import messagebox
from tkinter import ttk
Expand All @@ -15,6 +16,21 @@
customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

WINX = 1440
WINY = 540
SCALE = 100
THEME = 'Dark'

def update_config():
global WINX, WINY, SCALE, THEME
try:
with open('LocalDATA/config.ini', 'rb') as file:
WINX, WINY, SCALE, THEME = pk.load(file)
except:
with open('LocalDATA/config.ini', 'wb') as file:
pk.dump([WINX,WINY,SCALE,THEME], file)

update_config()

class Bus(customtkinter.CTk):

Expand All @@ -23,7 +39,7 @@ def __init__(self):

super().__init__()
self.title("Bus Home Page")
self.geometry(f"{1024}x{360}")
self.geometry(f"{WINX}x{WINY}")


self.sidebar_frame = customtkinter.CTkFrame(self, width=120, corner_radius=15)
Expand Down Expand Up @@ -139,11 +155,20 @@ def open_Info_window(self):
Display_availability.Available().mainloop()

def change_appearance_mode_event(self, new_appearance_mode: str):
customtkinter.set_appearance_mode(new_appearance_mode)
global WINX, WINY, SCALE, THEME
THEME = new_appearance_mode
customtkinter.set_appearance_mode(THEME)
update_config()

def change_scaling_event(self, new_scaling: str):
global WINX, WINY, SCALE, THEME
new_scaling_float = int(new_scaling.replace("%", "")) / 100
customtkinter.set_widget_scaling(new_scaling_float)
SCALE = new_scaling_float
WINX = int((WINX)*new_scaling_float)
WINY = int((WINY)*new_scaling_float)
self.geometry(f"{WINX}x{WINY}")
customtkinter.set_widget_scaling(SCALE)
update_config()

if __name__ == "__main__":
app2 = Bus()
Expand Down
32 changes: 28 additions & 4 deletions GraphicUser_InterFace/Car_Home_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import customtkinter
from PIL import Image, ImageTk
import os
import pickle as pk
from tkinter import PhotoImage
from tkinter import messagebox
import mysql.connector
Expand All @@ -12,14 +13,29 @@
customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

WINX = 1440
WINY = 540
SCALE = 100
THEME = 'Dark'

def update_config():
global WINX, WINY, SCALE, THEME
try:
with open('LocalDATA/config.ini', 'rb') as file:
WINX, WINY, SCALE, THEME = pk.load(file)
except:
with open('LocalDATA/config.ini', 'wb') as file:
pk.dump([WINX,WINY,SCALE,THEME], file)

update_config()

class Car(customtkinter.CTk):

def __init__(self):

super().__init__()
self.title("Car Home Page")
self.geometry(f"{1024}x{380}")
self.geometry(f"{WINX}x{WINY}")


self.sidebar_frame = customtkinter.CTkFrame(self, width=120, corner_radius=15)
Expand Down Expand Up @@ -130,13 +146,21 @@ def open_Info_window(self):
import Display_availability
Display_availability.Available().mainloop()


def change_appearance_mode_event(self, new_appearance_mode: str):
customtkinter.set_appearance_mode(new_appearance_mode)
global WINX, WINY, SCALE, THEME
THEME = new_appearance_mode
customtkinter.set_appearance_mode(THEME)
update_config()

def change_scaling_event(self, new_scaling: str):
global WINX, WINY, SCALE, THEME
new_scaling_float = int(new_scaling.replace("%", "")) / 100
customtkinter.set_widget_scaling(new_scaling_float)
SCALE = new_scaling_float
WINX = int((WINX)*new_scaling_float)
WINY = int((WINY)*new_scaling_float)
self.geometry(f"{WINX}x{WINY}")
customtkinter.set_widget_scaling(SCALE)
update_config()

if __name__ == "__main__":
app3 = Car()
Expand Down
2 changes: 1 addition & 1 deletion GraphicUser_InterFace/Modules/SQL.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
UTTSdb = mysql.connector.connect(
host='localhost',
user='root',
password='2602',
password='Anjali@123',
database='UTTS')
cur=UTTSdb.cursor()

Expand Down
33 changes: 29 additions & 4 deletions GraphicUser_InterFace/Railway_Home_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import customtkinter
from PIL import Image, ImageTk
import os
import pickle as pk
from tkinter import PhotoImage
from tkinter import messagebox
import mysql.connector
Expand All @@ -12,11 +13,27 @@
customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

WINX = 1440
WINY = 540
SCALE = 100
THEME = 'Dark'

def update_config():
global WINX, WINY, SCALE, THEME
try:
with open('LocalDATA/config.ini', 'rb') as file:
WINX, WINY, SCALE, THEME = pk.load(file)
except:
with open('LocalDATA/config.ini', 'wb') as file:
pk.dump([WINX,WINY,SCALE,THEME], file)

update_config()

class Railway(customtkinter.CTk):
def __init__(self):
super().__init__()
self.title("Truck Home Page")
self.geometry(f"{1100}x{340}")
self.geometry(f"{WINX}x{WINY}")

self.sidebar_frame = customtkinter.CTkFrame(self, width=120, corner_radius=15)
self.sidebar_frame.grid(row=9, column=0, rowspan=4, sticky="nse")
Expand Down Expand Up @@ -114,12 +131,20 @@ def open_Info_window(self):


def change_appearance_mode_event(self, new_appearance_mode: str):
customtkinter.set_appearance_mode(new_appearance_mode)
global WINX, WINY, SCALE, THEME
THEME = new_appearance_mode
customtkinter.set_appearance_mode(THEME)
update_config()

def change_scaling_event(self, new_scaling: str):
global WINX, WINY, SCALE, THEME
new_scaling_float = int(new_scaling.replace("%", "")) / 100
customtkinter.set_widget_scaling(new_scaling_float)

SCALE = new_scaling_float
WINX = int((WINX)*new_scaling_float)
WINY = int((WINY)*new_scaling_float)
self.geometry(f"{WINX}x{WINY}")
customtkinter.set_widget_scaling(SCALE)
update_config()

if __name__ == "__main__":
app6 = Railway()
Expand Down
52 changes: 40 additions & 12 deletions GraphicUser_InterFace/StartPageGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
from tkinter import PhotoImage
from colorama import Fore, Style

import pickle as pk

import urllib.request
from urllib.request import Request

import pickle as pk
from discord_webhook import DiscordWebhook, DiscordEmbed


Expand All @@ -19,14 +21,30 @@
#AVAILABLE THEMES->"blue", "green", "dark-blue"
customtkinter.set_default_color_theme("blue")

WINX = 1440
WINY = 540
SCALE = 100
THEME = 'Dark'

def update_config():
global WINX, WINY, SCALE, THEME
try:
with open('LocalDATA/config.ini', 'rb') as file:
WINX, WINY, SCALE, THEME = pk.load(file)
except:
with open('LocalDATA/config.ini', 'wb') as file:
pk.dump([WINX,WINY,SCALE,THEME], file)

update_config()

class Main(customtkinter.CTk):

def __init__(self):
super().__init__()

#DEFINING WINDOW NAME AND SIZE
self.title("Home page")
self.geometry(f"{1440}x{540}")
self.title("Home Page")
self.geometry(f"{WINX}x{WINY}")

# configure grid layout (4x4)
self.grid_columnconfigure(1, weight=0)
Expand Down Expand Up @@ -58,12 +76,15 @@ def __init__(self):
# SCALING BUTTON
self.scaling_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame, values=["70%", "80%", "90%", "100%", "110%", "120%", "130%"],command=self.change_scaling_event)
self.scaling_optionemenu.grid(row=8, column=0, padx=20, pady=(5,20))

self.appearance_mode_optionemenu.set("Dark")
try:
with open('runtimevars.dat', 'rb') as file:
theme_selection = pk.load(file)
except:
theme_selection = 'Dark'
self.appearance_mode_optionemenu.set(theme_selection)
self.change_appearance_mode_event(theme_selection)
self.scaling_optionemenu.set("100%")



self.upper_name_frame = customtkinter.CTkFrame(self, width=140,height=50, corner_radius=15)
self.upper_name_frame.grid(row=0, column=2, rowspan=4, sticky="nsew")
self.upper_name_frame.grid_rowconfigure(6, weight=1)
Expand Down Expand Up @@ -186,17 +207,24 @@ def Submit():
# Show a success message after the message is sent
messagebox.showinfo("Success", "Feedback sent successfully")
win.mainloop()

button_submit = tk.Button(win, text="Submit", command=Submit)
button_submit.pack()


def change_appearance_mode_event(self, new_appearance_mode: str):
customtkinter.set_appearance_mode(new_appearance_mode)
global WINX, WINY, SCALE, THEME
THEME = new_appearance_mode
customtkinter.set_appearance_mode(THEME)
update_config()

def change_scaling_event(self, new_scaling: str):
global WINX, WINY, SCALE, THEME
new_scaling_float = int(new_scaling.replace("%", "")) / 100
customtkinter.set_widget_scaling(new_scaling_float)
SCALE = new_scaling_float
WINX = int((WINX)*new_scaling_float)
WINY = int((WINY)*new_scaling_float)
self.geometry(f"{WINX}x{WINY}")
customtkinter.set_widget_scaling(SCALE)
update_config()

def open_Login_window(self):
self.destroy()
Expand Down
Loading