Skip to content

Commit d960aa6

Browse files
committed
hide and show plugin frame
1 parent 8a7f741 commit d960aa6

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

app_controller.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ def __init__(self):
5959

6060
# Device Information
6161
self.information = FrameDeviceInformation(self)
62-
6362
self.information.chip_info_btn.configure(command=lambda: self._esptool_command("chip_id"))
6463
self.information.memory_info_btn.configure(command=lambda: self._esptool_command("flash_id"))
6564
self.information.mac_info_btn.configure(command=lambda: self._esptool_command("read_mac"))
6665
self.information.flash_status_btn.configure(command=lambda: self._esptool_command("read_flash_status"))
67-
6866
self.information.mac_info_btn.pack_forget()
6967
self.information.flash_status_btn.pack_forget()
7068

@@ -74,17 +72,13 @@ def __init__(self):
7472

7573
# PlugIns
7674
self.plugins = FramePlugIns(self)
77-
7875
self.plugins.mp_debug_btn.configure(command=self._handler_toplevel_serial_debug)
7976
self.plugins.mp_version_btn.configure(command=self._get_version)
8077
self.plugins.mp_structure_btn.configure(command=self._get_structure)
81-
82-
self.plugins.mp_version_btn.pack_forget()
83-
self.plugins.mp_structure_btn.pack_forget()
78+
self.plugins.grid_remove()
8479

8580
# Flash Firmware
8681
self.flash_firmware = FrameFirmwareFlash(self)
87-
8882
self.flash_firmware.expert_mode.configure(command=self.toggle_expert_mode)
8983
self.flash_firmware.chip_option.configure(command=self._set_chip)
9084
self.flash_firmware.firmware_btn.configure(command=self._handle_firmware_selection)
@@ -94,7 +88,6 @@ def __init__(self):
9488
self.flash_firmware.baudrate_checkbox.select()
9589
self.flash_firmware.sector_input.bind("<KeyRelease>", self._handle_sector_input)
9690
self.flash_firmware.flash_btn.configure(command=self._flash_firmware_command)
97-
9891
self.flash_firmware.flash_mode_label.grid_remove()
9992
self.flash_firmware.flash_mode_option.grid_remove()
10093
self.flash_firmware.flash_mode_info.grid_remove()
@@ -112,12 +105,12 @@ def __init__(self):
112105
self.console = FrameConsole(self)
113106
self.console.console_text.bind("<Key>", BaseUI._block_text_input)
114107

115-
debug('Searching for USB devices')
116108
# search for devices on the start
109+
debug('Searching for USB devices')
117110
self._search_devices()
118111

119-
debug('Starting console queue poll')
120112
# poll the console queue for new lines
113+
debug('Starting console queue poll')
121114
self._poll_console_queue()
122115

123116
def open_url(self, event: Event) -> None:
@@ -144,8 +137,7 @@ def toggle_expert_mode(self) -> None:
144137
self.__expert_mode = True
145138
self.information.mac_info_btn.pack(padx=10, pady=5)
146139
self.information.flash_status_btn.pack(padx=10, pady=5)
147-
self.plugins.mp_version_btn.pack(padx=10, pady=5)
148-
self.plugins.mp_structure_btn.pack(padx=10, pady=5)
140+
self.plugins.grid(row=3, column=0, padx=10, pady=5, sticky="nsew")
149141
self.flash_firmware.flash_mode_label.grid(row=5, column=0, padx=10, pady=5, sticky="w")
150142
self.flash_firmware.flash_mode_option.grid(row=5, column=1, padx=10, pady=5, sticky="w")
151143
self.flash_firmware.flash_mode_info.grid(row=5, column=3, columnspan=3, padx=10, pady=5, sticky="w")
@@ -163,8 +155,7 @@ def toggle_expert_mode(self) -> None:
163155
self.__expert_mode = False
164156
self.information.mac_info_btn.pack_forget()
165157
self.information.flash_status_btn.pack_forget()
166-
self.plugins.mp_version_btn.pack_forget()
167-
self.plugins.mp_structure_btn.pack_forget()
158+
self.plugins.grid_remove()
168159
self.flash_firmware.flash_mode_label.grid_remove()
169160
self.flash_firmware.flash_mode_option.grid_remove()
170161
self.flash_firmware.flash_mode_info.grid_remove()

0 commit comments

Comments
 (0)