-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
64 lines (53 loc) · 2.57 KB
/
main.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
import tkinter as tk
from tkinter import ttk
from code_editor import CodeEditor
from api_tester import APITester
from git_manager import GitManager
from discord_maker import DiscordBotMaker
from styles import apply_light_theme # Change import
from settings import Settings # Add import
from updater import update_application # Import updater
import os # Add import
class MainApplication:
def __init__(self, root):
self.root = root
self.root.title("All-in-One Developer Tool")
self.root.state('zoomed')
# Set application icon
icon_path = os.path.join(os.path.dirname(__file__), 'allinonedevelopertool.ico')
self.root.iconbitmap(icon_path)
# Apply light theme instead of dark
self.theme = apply_light_theme(root)
self.root.configure(bg=self.theme['bg'])
# Create main container with padding
self.main_container = ttk.Frame(root, padding="10")
self.main_container.pack(fill='both', expand=True)
# Create and style notebook
self.notebook = ttk.Notebook(self.main_container)
self.notebook.pack(fill='both', expand=True, padx=5, pady=5)
# Initialize components with theme
self.code_editor = CodeEditor(self.notebook, self.theme)
self.api_tester = APITester(self.notebook, self.theme)
self.git_manager = GitManager(self.notebook, self.theme)
self.discord_maker = DiscordBotMaker(self.notebook, self.theme)
self.settings = Settings(self.notebook, self.theme, self) # Pass MainApplication instance
# Add tabs with icons (you'll need to add icon files)
self.notebook.add(self.code_editor, text=' Code Editor ')
self.notebook.add(self.api_tester, text=' API Tester ')
self.notebook.add(self.git_manager, text=' Git Manager ')
self.notebook.add(self.discord_maker, text=' Discord Bot ')
self.notebook.add(self.settings, text=' Settings ') # Add settings tab
# Add menu
self.create_menu()
def create_menu(self):
menu_bar = tk.Menu(self.root)
self.root.config(menu=menu_bar)
file_menu = tk.Menu(menu_bar, tearoff=0)
menu_bar.add_cascade(label="File", menu=file_menu)
file_menu.add_command(label="Check for Updates", command=update_application)
file_menu.add_separator()
file_menu.add_command(label="Exit", command=self.root.quit)
if __name__ == '__main__':
root = tk.Tk()
app = MainApplication(root)
root.mainloop()