MCPcopy Index your code
hub / github.com/AmberSahdev/Open-Interface / create_widgets

Method create_widgets

app/ui.py:144–215  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

142 self.theme_combobox.set(settings_dict.get('theme', 'superhero'))
143
144 def create_widgets(self) -> None:
145 # API Key Widgets
146 label_api = ttk.Label(self, text='OpenAI/Gemini/LLM Model API Key:', bootstyle="info")
147 label_api.pack(pady=10)
148 self.api_key_entry = ttk.Entry(self, width=30)
149 self.api_key_entry.pack()
150
151 # Label for Browser Choice
152 label_browser = ttk.Label(self, text='Choose Default Browser:', bootstyle="info")
153 label_browser.pack(pady=10)
154
155 # Dropdown for Browser Choice
156 self.browser_var = ttk.StringVar()
157 self.browser_combobox = ttk.Combobox(self, textvariable=self.browser_var,
158 values=['Safari', 'Firefox', 'Chrome'])
159 self.browser_combobox.pack(pady=5)
160 self.browser_combobox.set('Choose Browser')
161
162 # Label for Custom LLM Guidance
163 label_llm = ttk.Label(self, text='Custom LLM Guidance:', bootstyle="info")
164 label_llm.pack(pady=10)
165
166 # Text Box for Custom LLM Instructions
167 self.llm_instructions_text = ttk.Text(self, height=10, width=50)
168 self.llm_instructions_text.pack(padx=(10, 10), pady=(0, 10))
169
170 # Checkbox for "Play Ding" option
171 self.play_ding = ttk.IntVar()
172 play_ding_checkbox = ttk.Checkbutton(self, text="Play Ding on Completion", variable=self.play_ding,
173 bootstyle="round-toggle")
174 play_ding_checkbox.pack(pady=10)
175
176 # Theme Selection Widgets
177 label_theme = ttk.Label(self, text='UI Theme:', bootstyle="info")
178 label_theme.pack()
179 self.theme_var = ttk.StringVar()
180 self.theme_combobox = ttk.Combobox(self, textvariable=self.theme_var, values=self.available_themes,
181 state="readonly")
182 self.theme_combobox.pack(pady=5)
183 self.theme_combobox.set('superhero')
184 # Add binding for immediate theme change
185 self.theme_combobox.bind('<<ComboboxSelected>>', self.on_theme_change)
186
187 # Button to open Advanced Settings
188 advanced_settings_button = ttk.Button(self, text='Advanced Settings', bootstyle="info",
189 command=self.open_advanced_settings)
190 advanced_settings_button.pack(pady=(10, 0))
191
192 # Save Button
193 save_button = ttk.Button(self, text='Save Settings', bootstyle="success", command=self.save_button)
194 save_button.pack(pady=5)
195
196 # Restart App Label
197 restart_app_label = ttk.Label(self, text='Restart the app after any change in settings',
198 font=('Helvetica', 10))
199 restart_app_label.pack(pady=(0, 10))
200
201 # Hyperlink Label

Callers 1

__init__Method · 0.95

Calls 1

open_linkFunction · 0.85

Tested by

no test coverage detected