Skip to content

Commit

Permalink
V0.40.0 Added Extra Icons
Browse files Browse the repository at this point in the history
  • Loading branch information
domhnallmorr committed Dec 3, 2022
1 parent 9a9b37f commit 36ef22e
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 31 deletions.
Binary file modified src/Custom_Widgets/__pycache__/branch_tab.cpython-39.pyc
Binary file not shown.
19 changes: 10 additions & 9 deletions src/Custom_Widgets/branch_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def right_click_treeview(self, event):
# plugins.append(p)

# --------------- Open With Default Text Editor
popup_menu.add_command(label="Open in Text Editor", command=lambda branch_id=self.branch_id, file_name=file_name: self.view.controller.open_file_clicked(branch_id, file_name))
popup_menu.add_command(label="Open in Text Editor", command=lambda branch_id=self.branch_id, file_name=file_name: self.view.controller.open_file_clicked(branch_id, file_name), image=self.view.text_editor_icon2, compound="left")

# --------------- Open With Another App
# Ask controller to get open_with_apps
Expand All @@ -179,7 +179,7 @@ def right_click_treeview(self, event):
else:
mode="edit_folder"

popup_menu.add_command(label="Rename", command=lambda mode=mode, initialvalue=file_name, branch_id=self.branch_id: self.view.controller.new_edit_file_folder(mode, initialvalue, branch_id))
popup_menu.add_command(label="Rename", command=lambda mode=mode, initialvalue=file_name, branch_id=self.branch_id: self.view.controller.new_edit_file_folder(mode, initialvalue, branch_id), image=self.view.rename_icon2, compound="left")

popup_menu.add_separator()

Expand All @@ -191,7 +191,7 @@ def right_click_treeview(self, event):
# --------------- Filtering
if item_type != "Folder":
filter_menu = tk.Menu(popup_menu, tearoff=0)
popup_menu.add_cascade(label = "Filter",menu=filter_menu)
popup_menu.add_cascade(label = "Filter", menu=filter_menu, image=self.view.filter_icon2, compound="left")
filter_menu.add_command(label="Hide This File Type",
command=lambda branch_id=self.branch_id, mode="hide_this", file_extension=file_extension: self.view.controller.filter_files(branch_id, mode, file_extension), compound="left",)
filter_menu.add_command(label="Show Just This File Type",
Expand All @@ -216,17 +216,18 @@ def right_click_treeview(self, event):
for file_iid in self.treeview.selection():
selection.append(self.treeview.item(file_iid, 'text'))

popup_menu.add_command(label="Cut", command=lambda files=selection, branch_id=self.branch_id, mode="cut": self.view.controller.copy_cut_file_folder(files, branch_id, mode))
popup_menu.add_command(label="Copy", command=lambda files=selection, branch_id=self.branch_id, mode="copy": self.view.controller.copy_cut_file_folder(files, branch_id, mode))
popup_menu.add_command(label="Cut", command=lambda files=selection, branch_id=self.branch_id, mode="cut": self.view.controller.copy_cut_file_folder(files, branch_id, mode), image=self.view.cut_icon2, compound="left")
popup_menu.add_command(label="Copy", command=lambda files=selection, branch_id=self.branch_id, mode="copy": self.view.controller.copy_cut_file_folder(files, branch_id, mode), image=self.view.copy_icon2, compound="left")

if self.view.controller.file_to_copy != None or self.view.controller.file_to_cut != None:
popup_menu.add_command(label="Paste", command=lambda branch_id=self.branch_id: self.view.controller.paste_file_folder(branch_id))

popup_menu.add_command(label="Paste", command=lambda branch_id=self.branch_id: self.view.controller.paste_file_folder(branch_id), image=self.view.paste_icon2, compound="left")

if iid:
popup_menu.add_separator()

# ------------------ OPEN CMD/EXPLORER ------------------
popup_menu.add_command(label="Open in cmd", command=lambda mode="cmd", branch_id=self.branch_id: self.view.controller.open_in_cmd_explorer(mode, branch_id))
popup_menu.add_command(label="Open in explorer", command=lambda mode="explorer", branch_id=self.branch_id: self.view.controller.open_in_cmd_explorer(mode, branch_id))
popup_menu.add_command(label="Open in cmd", command=lambda mode="cmd", branch_id=self.branch_id: self.view.controller.open_in_cmd_explorer(mode, branch_id), image=self.view.cmd_icon2, compound="left")
popup_menu.add_command(label="Open in explorer", command=lambda mode="explorer", branch_id=self.branch_id: self.view.controller.open_in_cmd_explorer(mode, branch_id), image=self.view.file_explorer_icon2, compound="left")

try:
popup_menu.tk_popup(event.x_root, event.y_root, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, parent, *args, **kwargs):
self.controller = controller.Controller(root, parent, self)

# ----------------- VERSION -----------------------
self.version = "0.39.0"
self.version = "0.40.0"
# ----------------- WEEK NUMBER -----------------------
year, week_num, day_of_week = datetime.date.today().isocalendar()

Expand Down
Binary file modified src/model/__pycache__/model.cpython-39.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions src/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ def setup_variables(self):
self.known_file_types = {
".csv": "CSV File",
".das": "Das file",
".dat": "Dat file",
".doc": "Word 97-2003 Document",
".docx": "Word Document",
".exe": "application",
".f06": "Nastran F06 File",
".ipynb": "Jupyter Notebook",
".jpeg": "JPEG Image",
".jpg": "JPG Image",
Expand All @@ -69,6 +71,7 @@ def setup_variables(self):
".mp4": "MP4 Video",
".mplt": "mplt file",
".msg": "Email",
".op2": "Nastran OP2 File",
".out": "Output file",
".pdf": "PDF",
".png": "PNG Image",
Expand Down
Empty file added src/test.dat
Empty file.
Empty file added src/test.f06
Empty file.
Empty file added src/test.op2
Empty file.
21 changes: 2 additions & 19 deletions src/tk_path_finder_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,10 @@
]
],
"session_data": {
"DIWZ8hVf": {
"H25azKMT": {
"text": "0",
"branch_tabs": {
"kH6eUVyM": {
"text": "src",
"directory": "C:\\Users\\domhn\\Documents\\Python\\Tk Path Finder\\src"
},
"6FYo0KGN": {
"text": "src 3",
"directory": "C:\\Users\\domhn\\Documents\\Python\\Tk Path Finder\\src"
},
"DoQ6SdUq": {
"text": "src 2",
"directory": "C:\\Users\\domhn\\Documents\\Python\\Tk Path Finder\\src"
}
}
},
"QSr4vUoO": {
"text": "1",
"branch_tabs": {
"i2U7P3n7": {
"UulEwxZG": {
"text": "src",
"directory": "C:\\Users\\domhn\\Documents\\Python\\Tk Path Finder\\src"
}
Expand Down
Binary file modified src/view/__pycache__/rename_window.cpython-39.pyc
Binary file not shown.
Binary file modified src/view/__pycache__/tkexplorer_icons.cpython-39.pyc
Binary file not shown.
Binary file modified src/view/__pycache__/view.cpython-39.pyc
Binary file not shown.
10 changes: 8 additions & 2 deletions src/view/rename_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ def __init__(self, master, view, initialvalue, component_type, mode="Rename"):
self.top.title(f"{mode} Branch Tab")
else:
self.top.title(f"{mode} Tab")


if mode == "new_file":
self.top.title("New File")
if mode == "edit_file":
self.top.title("Rename File")

self.initialvalue = initialvalue
self.component_type = component_type
self.button = "cancel"
Expand All @@ -34,7 +39,8 @@ def __init__(self, master, view, initialvalue, component_type, mode="Rename"):
self.cancel_btn = ttk.Button(self.top, text='Cancel', width=10, style='danger.TButton', command=lambda button='cancel': self.cleanup(button))
self.cancel_btn.grid(row=2, column=4, padx=self.view.default_padx, pady=self.view.default_pady, sticky='nw')


self.name_entry.focus()

def cleanup(self, button):

if button == "ok":
Expand Down
Loading

0 comments on commit 36ef22e

Please sign in to comment.