From 67b209e57bc0ca0729145fc940b7ed152407f8e9 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Mon, 22 Nov 2021 21:18:14 -0600 Subject: [PATCH] Tracking tab shifts --- .../PyFM/new/pyfm/resources/Main_Window.glade | 504 +++++++++--------- .../pyfm/signal_classes/mixins/TabMixin.py | 16 + .../pyfm/signal_classes/mixins/WidgetMixin.py | 2 + 3 files changed, 272 insertions(+), 250 deletions(-) diff --git a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/resources/Main_Window.glade b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/resources/Main_Window.glade index f6df595..e61bd5a 100644 --- a/src/versions/pyfm-0.0.1/PyFM/new/pyfm/resources/Main_Window.glade +++ b/src/versions/pyfm-0.0.1/PyFM/new/pyfm/resources/Main_Window.glade @@ -382,256 +382,6 @@ PyFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspecti - - False - mouse - splashscreen - south - - - - False - vertical - 2 - - - False - end - - - - - - - - - False - False - 0 - - - - - 500 - True - False - vertical - - - True - False - vertical - - - gtk-delete - delete - True - True - True - Delete... - True - True - - - - False - True - 4 - - - - - gtk-cut - cut - True - True - True - Cut... - True - True - - - - False - True - 0 - - - - - gtk-copy - copy - True - True - True - Copy... - True - True - - - - False - True - 1 - - - - - Trash - trash - True - True - True - Move to Trash... - trashImage - True - - - - False - True - end - 3 - - - - - gtk-paste - paste - True - True - True - Paste... - 20 - True - True - - - - False - True - 4 - - - - - False - True - 0 - - - - - 500 - 26 - True - True - 20 - gtk-edit - New File/Dir Name... - - - False - True - 1 - - - - - True - False - vertical - - - True - False - - - True - False - 15 - Folder - - - - - - True - True - 0 - - - - - True - False - 15 - File - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - True - File/Folder - True - - - False - True - 1 - - - - - Create - create - True - True - True - Create File/Folder... - createImage - True - - - - False - True - 2 - - - - - False - True - 2 - - - - - False - True - 1 - - - - - True False @@ -1045,6 +795,7 @@ PyFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspecti 5 False True + @@ -1081,6 +832,7 @@ PyFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspecti 5 False True + @@ -1131,6 +883,7 @@ PyFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspecti 5 False True + @@ -1166,6 +919,7 @@ PyFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspecti 5 False True + @@ -1212,4 +966,254 @@ PyFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspecti False icons/trash.png + + False + mouse + splashscreen + south + + + + False + vertical + 2 + + + False + end + + + + + + + + + False + False + 0 + + + + + 500 + True + False + vertical + + + True + False + vertical + + + gtk-delete + delete + True + True + True + Delete... + True + True + + + + False + True + 4 + + + + + gtk-cut + cut + True + True + True + Cut... + True + True + + + + False + True + 0 + + + + + gtk-copy + copy + True + True + True + Copy... + True + True + + + + False + True + 1 + + + + + Trash + trash + True + True + True + Move to Trash... + trashImage + True + + + + False + True + end + 3 + + + + + gtk-paste + paste + True + True + True + Paste... + 20 + True + True + + + + False + True + 4 + + + + + False + True + 0 + + + + + 500 + 26 + True + True + 20 + gtk-edit + New File/Dir Name... + + + False + True + 1 + + + + + True + False + vertical + + + True + False + + + True + False + 15 + Folder + + + + + + True + True + 0 + + + + + True + False + 15 + File + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + True + File/Folder + True + + + False + True + 1 + + + + + Create + create + True + True + True + Create File/Folder... + createImage + True + + + + False + True + 2 + + + + + False + True + 2 + + + + + False + True + 1 + + + + + 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 2eccfa2..fb23342 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 @@ -51,6 +51,22 @@ class TabMixin(WidgetMixin): self.window_controller.save_state() self.set_window_title() + def on_tab_reorder(self, child, page_num, new_index): + wid, tid = page_num.get_name().split("|") + window = self.get_fm_window(wid) + view = None + + for i, view in enumerate(window.views): + if view.id == tid: + _view = window.get_view_by_id(tid) + watcher = _view.get_dir_watcher() + watcher.cancel() + window.views.insert(new_index, window.views.pop(i)) + + view = window.get_view_by_id(tid) + self.set_file_watcher(view) + self.window_controller.save_state() + def on_tab_switch_update(self, notebook, content=None, index=None): self.selected_files.clear() wid, tid = content.get_children()[0].get_name().split("|") 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 e25e678..4988336 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 @@ -141,6 +141,7 @@ class WidgetMixin: grid.show_all() scroll.add(grid) grid.set_name(f"{wid}|{view.id}") + scroll.set_name(f"{wid}|{view.id}") self.builder.expose_object(f"{wid}|{view.id}|iconview", grid) self.builder.expose_object(f"{wid}|{view.id}", scroll) return scroll, store @@ -189,6 +190,7 @@ class WidgetMixin: grid.show_all() scroll.add(grid) grid.set_name(f"{wid}|{view.id}") + scroll.set_name(f"{wid}|{view.id}") grid.columns_autosize() self.builder.expose_object(f"{wid}|{view.id}", scroll) return scroll, store