From b32eafcabe6a37450e83052f1375be57a25f0b33 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Fri, 14 Apr 2023 22:54:58 -0500 Subject: [PATCH] Fixing save/delete process --- src/core/widgets/page_widget.py | 2 -- src/core/widgets/template/dynamic_header_widget.py | 4 ++-- src/core/widgets/template/dynamic_widget_template.py | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/widgets/page_widget.py b/src/core/widgets/page_widget.py index f72a0e0..32997d7 100644 --- a/src/core/widgets/page_widget.py +++ b/src/core/widgets/page_widget.py @@ -23,7 +23,6 @@ class Page(Gtk.ScrolledWindow): self._name = None self._date = None - self.mouse_held = False self.was_dragging = False self._setup_styling() @@ -92,7 +91,6 @@ class Page(Gtk.ScrolledWindow): settings.update_manifest(self._manifest_pth, self._name, self._date) def _release_event(self, widget = None, eve = None): - self.mouse_held = False if self.was_dragging: self.was_dragging = False return diff --git a/src/core/widgets/template/dynamic_header_widget.py b/src/core/widgets/template/dynamic_header_widget.py index 698c906..6a69386 100644 --- a/src/core/widgets/template/dynamic_header_widget.py +++ b/src/core/widgets/template/dynamic_header_widget.py @@ -26,6 +26,7 @@ class DynamicHeaderWidget(Gtk.Box): self._drag_start_y = 0 self._prior_time = 0 self._update_block = False + self.is_dragging = False self._setup_styling() self._setup_signals() @@ -47,15 +48,14 @@ class DynamicHeaderWidget(Gtk.Box): ... def _load_widgets(self): - self.is_dragging = False drag_eve = Gtk.Button(label = "...") hresize_eve = Gtk.Button(label = "< >") - drag_eve.set_hexpand(True) hresize_eve.connect("button-press-event", self._press_event) hresize_eve.connect("motion-notify-event", self._resize_motion_event) hresize_eve.connect("button-release-event", self._release_event) + drag_eve.set_hexpand(True) drag_eve.connect("button-press-event", self._press_event) drag_eve.connect("motion-notify-event", self._motion_event) drag_eve.connect("button-release-event", self._release_event) diff --git a/src/core/widgets/template/dynamic_widget_template.py b/src/core/widgets/template/dynamic_widget_template.py index 329a1b9..368f42f 100644 --- a/src/core/widgets/template/dynamic_widget_template.py +++ b/src/core/widgets/template/dynamic_widget_template.py @@ -95,7 +95,7 @@ class DynamicWidget(Gtk.Box): self._body_widget.load_saveable_data() def delete(self): - path = f"{settings.get_active_page()}{self.uuid}" + path = f"{settings.get_active_page().replace('MANIFEST', '')}{self.uuid}" logger.debug(f"Deleteing: {path}") try: @@ -121,7 +121,8 @@ class DynamicWidget(Gtk.Box): save_collection["x"] = self._header_widget._current_x save_collection["y"] = self._header_widget._current_y - path = f"{settings.get_active_page()}{self.uuid}" + page = settings.get_active_page().replace('MANIFEST', '') + path = f"{page}{self.uuid}" logger.debug(f"Saving: {path}") with open(path, "wb") as f: pickle.dump(save_collection, f, protocol = pickle.HIGHEST_PROTOCOL, fix_imports = True, buffer_callback = None)