Windows
This commit is contained in:
22
qt.py
22
qt.py
@@ -1750,7 +1750,7 @@ class WillSettingsWidget(QWidget):
|
|||||||
])
|
])
|
||||||
|
|
||||||
ics_content = "\r\n".join(lines) + "\r\n"
|
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(
|
opened = BalCalendar.open_with_default_app(
|
||||||
self.bal_window.bal_plugin.CALENDAR_APP.get(), temp_path
|
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}")
|
_logger.info(f"File opened with default app: {temp_path}")
|
||||||
else:
|
else:
|
||||||
export_meta_gui(
|
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):
|
def on_locktime_change(self):
|
||||||
locktime = self.widgets["locktime"].get_value()
|
locktime = self.widgets["locktime"].get_value()
|
||||||
threshold = self.widgets["threshold"].get_value()
|
threshold = self.widgets["threshold"].get_value()
|
||||||
@@ -4011,14 +4021,6 @@ class BalCalendar:
|
|||||||
_logger.error(f"starting calendar app {e}")
|
_logger.error(f"starting calendar app {e}")
|
||||||
return False
|
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
|
@staticmethod
|
||||||
def format_time(time):
|
def format_time(time):
|
||||||
|
|||||||
Reference in New Issue
Block a user