Fixed bugs with DnD and widget update on dir up

This commit is contained in:
itdominator 2021-11-17 19:40:37 -06:00
parent 3825892405
commit ef63e5edf6
4 changed files with 10 additions and 11 deletions

View File

@ -66,9 +66,9 @@ class Signals(WindowMixin, PaneMixin):
self, ids = data
wid, tid = ids.split("|")
notebook = self.builder.get_object(f"window_{wid}")
icon_view, tab_label = self.get_icon_view_and_label_from_notebook(notebook, f"{wid}|{tid}")
store, tab_label = self.get_store_and_label_from_notebook(notebook, f"{wid}|{tid}")
view = self.get_fm_window(wid).get_view_by_id(tid)
store = icon_view.get_model()
view.load_directory()
self.load_store(view, store)

View File

@ -60,10 +60,8 @@ class TabMixin(WidgetMixin):
action = widget.get_name()
wid, tid = self.window_controller.get_active_data()
notebook = self.builder.get_object(f"window_{wid}")
icon_view, tab_label = self.get_icon_view_and_label_from_notebook(notebook, f"{wid}|{tid}")
view = self.get_fm_window(wid).get_view_by_id(tid)
store = icon_view.get_model()
store, tab_label = self.get_store_and_label_from_notebook(notebook, f"{wid}|{tid}")
view = self.get_fm_window(wid).get_view_by_id(tid)
if action == "go_up":
view.pop_from_path()

View File

@ -99,7 +99,7 @@ class WidgetMixin:
close.connect("button_release_event", self.close_tab)
tab.show_all()
tid.hide()
# tid.hide()
return tab
def create_grid_iconview_widget(self, view, wid):
@ -174,14 +174,16 @@ class WidgetMixin:
return scroll, store
def get_icon_view_and_label_from_notebook(self, notebook, _name):
def get_store_and_label_from_notebook(self, notebook, _name):
icon_view = None
tab_label = None
store = None
for obj in notebook.get_children():
icon_view = obj.get_children()[0]
name = icon_view.get_name()
if name == _name:
store = icon_view.get_model()
tab_label = notebook.get_tab_label(obj).get_children()[0]
return icon_view, tab_label
return store, tab_label

View File

@ -127,10 +127,9 @@ class WindowMixin(TabMixin):
if info == 80:
wid, tid = self.window_controller.get_active_data()
notebook = self.builder.get_object(f"window_{wid}")
icon_view, tab_label = self.get_icon_view_and_label_from_notebook(notebook, f"{wid}|{tid}")
store, tab_label = self.get_store_and_label_from_notebook(notebook, f"{wid}|{tid}")
view = self.get_fm_window(wid).get_view_by_id(tid)
store = icon_view.get_model()
uris = data.get_uris()
dest = view.get_current_directory()