Skip to content

Commit

Permalink
V0.56.2
Browse files Browse the repository at this point in the history
  • Loading branch information
domhnallmorr committed Nov 26, 2023
1 parent 3aa71c0 commit 2605913
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ def copy_to_clipboard(self, file_name, branch_id, mode):
elif mode == "file_name_only":
pyperclip.copy(file_name)
self.view.update_clipboard_labels(0, 0, "filename")

elif mode == "address_bar":
pyperclip.copy(file_name)
self.view.update_clipboard_labels(0, 0, "address_bar")

def new_folders(self, branch_id):
initialvalue = None

Expand Down
19 changes: 17 additions & 2 deletions src/custom_widgets/address_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class AddressBarEntry(ttk.Entry):
def __init__(self, branch_tab):
super(AddressBarEntry, self).__init__(branch_tab)
self.branch_tab = branch_tab
self.bind('<Return>', self.enter_event)
self.bind("<Return>", self.enter_event)
self.bind("<Control-c>", self.copy_event)
self.raw_path = False

self.buttons = []
Expand All @@ -20,6 +21,14 @@ def __init__(self, branch_tab):
self.bind("<Configure>", lambda event: self.truncate_breadcrumbs())
self.text = None

@property
def controller(self):
return self.branch_tab.view.controller

@property
def branch_id(self):
return self.branch_tab.branch_id

def update_bar(self, text):
self.text = text
self.delete(0, END) #deletes the current value
Expand Down Expand Up @@ -59,7 +68,13 @@ def update_bar(self, text):
def enter_event(self, event):
# -------------- CALL THE CONTROLLER METHOD TO UPDATE THE BRANCH TAB BASED ON DIRECTORY IN THE ADDRESS BAR -------------
self.branch_tab.view.controller.update_branch_tab(self.branch_tab.branch_id, self.get().rstrip().lstrip())


def copy_event(self, event):
selected_text = self.selection_get()

self.controller.copy_to_clipboard(selected_text, self.branch_id, "address_bar")


def button_clicked(self, event, path):
if self.raw_path == True:
path = r"\\" + path
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, parent, *args, **kwargs):
self.controller = controller.Controller(root, parent, self)

# ----------------- VERSION -----------------------
self.version = "0.56.1"
self.version = "0.56.2"

# ----------------- WEEK NUMBER -----------------------
year, week_num, day_of_week = datetime.date.today().isocalendar()
Expand Down
5 changes: 4 additions & 1 deletion src/view/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,16 @@ def get_root_tabs_order(self):

def update_clipboard_labels(self, number_of_items, total_size_selected, mode):

assert mode in ["cut", "copy", "filename", "filepath"]
assert mode in ["cut", "copy", "filename", "filepath", "address_bar"]

for branch_id in self.branch_tabs.keys():

if mode in ["filename", "filepath"]:
self.clipboard_label_text = f"Clipboard: Selected {mode.capitalize()} to Copy"

elif mode == "address_bar":
self.clipboard_label_text = "Clipboard: Address Bar Path Selected to Copy"

else: # selected files/folder
if total_size_selected is None:
self.clipboard_label_text = f"Clipboard: {number_of_items} Selected to {mode.capitalize()}"
Expand Down

0 comments on commit 2605913

Please sign in to comment.