From b992ca3b09aaecd926de5b0f3ee6de2c75bf7927 Mon Sep 17 00:00:00 2001 From: svatantrya Date: Sat, 9 May 2026 10:16:12 -0400 Subject: [PATCH] Windows --- qt.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/qt.py b/qt.py index 78bc168..6f873bd 100644 --- a/qt.py +++ b/qt.py @@ -1750,7 +1750,7 @@ class WillSettingsWidget(QWidget): ]) ics_content = "\r\n".join(lines) + "\r\n" - temp_path = BalCalendar.write_temp_ics(ics_content) + self.temp_path = BalCalendar.write_temp_ics(ics_content) opened = BalCalendar.open_with_default_app( self.bal_window.bal_plugin.CALENDAR_APP.get(), temp_path ) @@ -1758,9 +1758,19 @@ class WillSettingsWidget(QWidget): _logger.info(f"File opened with default app: {temp_path}") else: export_meta_gui( - self.bal_window.window, f"will_event.ics", BalCalendar.save_to_cwd + self.bal_window.window, f"will_event.ics",self.save_to_cwd + ) + + def save_to_cwd(self,filename="event.ics"): + target = os.path.abspath(filename) + # se il file esiste, sovrascrive + _logger.debug(f"save_to_cwd {self.temp_path},{filename}") + with open(path, "rb") as src, open(target, "wb") as dst: + dst.write(src.read()) + return target + def on_locktime_change(self): locktime = self.widgets["locktime"].get_value() threshold = self.widgets["threshold"].get_value() @@ -4011,14 +4021,6 @@ class BalCalendar: _logger.error(f"starting calendar app {e}") return False - @staticmethod - def save_to_cwd(path, filename="event.ics"): - target = os.path.abspath(filename) - # se il file esiste, sovrascrive - _logger.debug(f"save_to_cwd {path},{filename}") - with open(path, "rb") as src, open(target, "wb") as dst: - dst.write(src.read()) - return target @staticmethod def format_time(time):