Skip to content

Commit 22d4cee

Browse files
committed
clearn up & GUI chanegs
1 parent dfb6b8c commit 22d4cee

5 files changed

Lines changed: 12 additions & 5 deletions

File tree

cmdcompass/gui/commandbodybox.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def set_command(self, command):
4444
def save_command(self):
4545
if self.main_window.selected_command:
4646
new_command_str = self.command_textbox.get("1.0", "end-1c")
47+
new_command_str = new_command_str.replace('\u2212', '-') # Minus sign should be dash
4748
self.main_window.selected_command.command_str = new_command_str
49+
if '\u2212' in self.command_textbox.get("1.0", "end-1c"):
50+
self.set_command(self.main_window.selected_command)
4851
self.main_window.data_manager.save_data()
4952
self.save_button.configure(state="disabled", fg_color="gray")
5053
self.main_window.refresh_command_list() # Refresh the command list

cmdcompass/gui/commandbox.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import customtkinter as ctk
22
import tkinter.font as tkFont
3+
import platform
34

45
COMMAND_LABLE_WIDTH = 200
6+
if platform.system() == "Windows":
7+
COMMAND_LABLE_WIDTH = 210
58

69
class TagBox(ctk.CTkFrame):
710
def __init__(self, master, tags, command, main_window,**kwargs):

cmdcompass/gui/main_window.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
from CTkToolTip import CTkToolTip
1414

1515
from CTkMessagebox import CTkMessagebox
16+
import platform
17+
1618
DEFAULT_BUTTON_COLOR = "blue"
19+
COMMAND_LIST_FRAME_WIDTH = 240
20+
if platform.system() == "Windows":
21+
COMMAND_LIST_FRAME_WIDTH = 230
1722

1823

1924
class MainWindow(ctk.CTk):
@@ -106,7 +111,7 @@ def __init__(self):
106111
CTkToolTip(tag_operations_button, message="Define/Remove Tags here to be later assigned to commands")
107112

108113
# Create scrollable frame for the command list
109-
self.command_list_frame = ctk.CTkScrollableFrame(self.left_frame, height=450, width=240)
114+
self.command_list_frame = ctk.CTkScrollableFrame(self.left_frame, height=450, width=COMMAND_LIST_FRAME_WIDTH)
110115
self.command_list_frame.grid(row=3, column=0, padx=10, pady=10, sticky="nsew")
111116

112117
# Configure scrolling behavior

cmdcompass/gui/manpagebox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def set_man_page(self, command):
7171
else:
7272
def download_and_update():
7373
progress_window = self.create_progress_window()
74-
progress_window.update_progress(HTML_CORE_DIR)
7574
progress_window.update_progress(f"Downloading {command_name}...")
7675
download_and_process_package(command_name, progress_window)
7776
# After download and processing is complete, update the HTML

cmdcompass/man_parser/loader.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,12 @@ def move_and_clean_man_pages(package_name, extract_to, man_dest_folder):
106106
return found_page
107107

108108
def download_and_process_package(package_name, progress_window):
109-
progress_window.update_progress(f"Searching for {package_name}...", 0.1)
110109
# Ensure destination folders exist
111110
if not os.path.exists(UNPACKING_DIR):
112111
os.makedirs(UNPACKING_DIR)
113-
progress_window.update_progress(f"read from {KV_DB_PATH}")
114112
with SqliteDict(KV_DB_PATH) as db:
115113
if package_name in db:
116114
try:
117-
progress_window.update_progress(f"found")
118115
# Note the db value can contain a list of package that includes the command man page.
119116
# The value is in tuple of ("package_link", #number of man pages in this package) and ordered by the #number
120117
# We can have a feature to allow user to choose which package to use

0 commit comments

Comments
 (0)