File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change
1
+ import os
1
2
import datetime
2
3
from loguru import logger
3
4
from textwrap import dedent
4
5
from pathlib import Path
6
+ import webbrowser
5
7
6
8
import flet
7
9
from flet import (
@@ -208,6 +210,12 @@ def on_pick_calendar_file(self, event: FilePickerResultEvent):
208
210
else :
209
211
logger .info ("Cancelled!" )
210
212
213
+ def on_click_open_invoice_folder (self , event ):
214
+ invoice_dir = self .app .con .home / self .app .con .preferences .invoice_dir
215
+ logger .info (f"trying to open { invoice_dir } " )
216
+ # os.system(f"open {invoice_dir}")
217
+ webbrowser .open (f"file:///{ invoice_dir } " )
218
+
211
219
def update_content (self ):
212
220
super ().update_content ()
213
221
@@ -304,6 +312,11 @@ def update_content(self):
304
312
icon = icons .EDIT_NOTE ,
305
313
on_click = self .on_click_generate_invoices ,
306
314
),
315
+ ElevatedButton (
316
+ "Open invoice folder" ,
317
+ icon = icons .FOLDER_OPEN ,
318
+ on_click = self .on_click_open_invoice_folder ,
319
+ ),
307
320
]
308
321
),
309
322
]
You can’t perform that action at this time.
0 commit comments