@@ -102,10 +102,32 @@ def add_demo_data(self, event):
102
102
def build (self ):
103
103
self .main_column = Column (
104
104
[
105
- ElevatedButton (
106
- "Install demo data" ,
107
- icon = icons .TOYS ,
108
- on_click = self .add_demo_data ,
105
+ Text ("Demo" , style = "titleMedium" ),
106
+ Row (
107
+ [
108
+ views .make_card (
109
+ [
110
+ Text (
111
+ dedent (
112
+ """
113
+ Welcome to the Tuttle demo.
114
+
115
+ 1. Getting started: Press the button below to install some demo data and start exploring some of the functions of the app:
116
+ """
117
+ )
118
+ )
119
+ ]
120
+ )
121
+ ]
122
+ ),
123
+ Row (
124
+ [
125
+ ElevatedButton (
126
+ "Install demo data" ,
127
+ icon = icons .TOYS ,
128
+ on_click = self .add_demo_data ,
129
+ ),
130
+ ]
109
131
),
110
132
],
111
133
)
@@ -232,12 +254,16 @@ def on_click_generate_invoices(self, event):
232
254
timetracking_method = "file_calendar" ,
233
255
calendar_file_path = self .calendar_file_path ,
234
256
)
257
+ self .app .snackbar_message (
258
+ f"created invoice and timesheet for { self .project_select .value } - open the invoice folder to see the result"
259
+ )
235
260
236
261
def on_pick_calendar_file (self , event : FilePickerResultEvent ):
237
262
"""Handle the result of the calendar file picker."""
238
263
if event .files :
239
264
logger .info (f"Calendar file picked: { event .files [0 ].path } " )
240
265
self .calendar_file_path = Path (event .files [0 ].path )
266
+ self .app .snackbar_message (f"Calendar file picked: { event .files [0 ].path } " )
241
267
else :
242
268
logger .info ("Cancelled!" )
243
269
@@ -247,6 +273,15 @@ def on_click_open_invoice_folder(self, event):
247
273
# os.system(f"open {invoice_dir}")
248
274
webbrowser .open (f"file:///{ invoice_dir } " )
249
275
276
+ def on_click_load_demo_calendar (self , event ):
277
+ """Load the demo calendar file."""
278
+ self .calendar_file_path = Path (__file__ ).parent .parent / Path (
279
+ "tuttle_tests/data/TuttleDemo-TimeTracking.ics"
280
+ )
281
+ self .app .snackbar_message (
282
+ f"Loaded demo calendar file: { self .calendar_file_path } "
283
+ )
284
+
250
285
def update_content (self ):
251
286
super ().update_content ()
252
287
@@ -282,8 +317,8 @@ def update_content(self):
282
317
Text (
283
318
dedent (
284
319
"""
285
- 1. select a time tracking data source
286
- """
320
+ 1. load the demo timetracking data, or select a time tracking calendar file
321
+ """
287
322
)
288
323
)
289
324
]
@@ -292,6 +327,11 @@ def update_content(self):
292
327
),
293
328
Row (
294
329
[
330
+ ElevatedButton (
331
+ "Load demo calendar" ,
332
+ icon = icons .DATE_RANGE ,
333
+ on_click = self .on_click_load_demo_calendar ,
334
+ ),
295
335
ElevatedButton (
296
336
"Pick Calendar File" ,
297
337
icon = icons .UPLOAD_FILE ,
0 commit comments