From ef63e5edf6573a1797b60e0f47ca09799f3a8c1b Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Wed, 17 Nov 2021 19:40:37 -0600 Subject: [PATCH] Fixed bugs with DnD and widget update on dir up --- .../pyfm-0.0.1/PyFM/new/pyfm/signal_classes/Signals.py | 4 ++-- .../PyFM/new/pyfm/signal_classes/mixins/TabMixin.py | 6 ++---- .../PyFM/new/pyfm/signal_classes/mixins/WidgetMixin.py | 8 +++++--- .../PyFM/new/pyfm/signal_classes/mixins/WindowMixin.py | 3 +-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/Signals.py b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/Signals.py index 65839b8..39bb35e 100644 --- a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/Signals.py +++ b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/Signals.py @@ -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) diff --git a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/TabMixin.py b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/TabMixin.py index 03da4ff..abf931d 100644 --- a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/TabMixin.py +++ b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/TabMixin.py @@ -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() diff --git a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WidgetMixin.py b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WidgetMixin.py index 4ed28cf..50c1690 100644 --- a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WidgetMixin.py +++ b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WidgetMixin.py @@ -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 diff --git a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WindowMixin.py b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WindowMixin.py index 5f02a42..37690b3 100644 --- a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WindowMixin.py +++ b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/signal_classes/mixins/WindowMixin.py @@ -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()