From 9cde8345cfed2fe5c2c1c8b15bbf327ea12a2650 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Wed, 2 Nov 2022 22:06:30 -0500 Subject: [PATCH] Tab dnd between windows (state not preserved, yet), plugin fix --- plugins/archiver/plugin.py | 2 +- src/versions/solarfm-0.0.1/SolarFM/solarfm/__main__.py | 9 +++++++-- .../SolarFM/solarfm/core/mixins/ui/tab_mixin.py | 5 +++++ user_config/usr/share/solarfm/Main_Window.glade | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/plugins/archiver/plugin.py b/plugins/archiver/plugin.py index 5426094..393de1f 100644 --- a/plugins/archiver/plugin.py +++ b/plugins/archiver/plugin.py @@ -122,4 +122,4 @@ class Plugin(PluginBase): def set_arc_buffer_text(self, widget=None, eve=None): sid = widget.get_active_id() - self.arc_command_buffer.set_text(self.arc_commands[int(sid)]) + self._arc_command_buffer.set_text(self.arc_commands[int(sid)]) diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/__main__.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/__main__.py index e1fa0e9..e256a29 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/__main__.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/__main__.py @@ -18,9 +18,9 @@ from __builtins__ import * from app import Application -if __name__ == "__main__": - """ Set process title, get arguments, and create GTK main thread. """ + +def run(): try: setproctitle(f"{app_name}") faulthandler.enable() # For better debug info @@ -47,3 +47,8 @@ if __name__ == "__main__": except Exception as e: traceback.print_exc() quit() + + +if __name__ == "__main__": + """ Set process title, get arguments, and create GTK main thread. """ + run() diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/tab_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/tab_mixin.py index 683e6b4..2460417 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/tab_mixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/tab_mixin.py @@ -35,6 +35,7 @@ class TabMixin(GridMixin): tab_widget = self.create_tab_widget(tab) scroll, store = self.create_scroll_and_store(tab, wid) index = notebook.append_page(scroll, tab_widget) + notebook.set_tab_detachable(scroll, True) self.fm_controller.set_wid_and_tid(wid, tab.get_id()) path_entry.set_text(tab.get_current_directory()) @@ -67,6 +68,10 @@ class TabMixin(GridMixin): self.fm_controller.save_state() self.set_window_title() + # NOTE: Not actually getting called even tho set in the glade file... + def on_tab_dnded(self, notebook, page, x, y): + ... + def on_tab_reorder(self, child, page_num, new_index): wid, tid = page_num.get_name().split("|") window = self.get_fm_window(wid) diff --git a/user_config/usr/share/solarfm/Main_Window.glade b/user_config/usr/share/solarfm/Main_Window.glade index c5d79b1..de3b02a 100644 --- a/user_config/usr/share/solarfm/Main_Window.glade +++ b/user_config/usr/share/solarfm/Main_Window.glade @@ -1053,6 +1053,8 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe 5 False True + sfm_windows + @@ -1106,6 +1108,8 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe 5 False True + sfm_windows + @@ -1173,6 +1177,8 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe 5 False True + sfm_windows + @@ -1225,6 +1231,8 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe 5 False True + sfm_windows +