@@ -59,24 +59,96 @@ struct HomeView: View {
5959 }
6060 } ,
6161 onDeleteComics: {
62- Log ( ) . info ( tag: TAG, message: " Deleting \( variantViewModel. selectionList. count) comic book(s) " )
62+ Log ( ) . info (
63+ tag: TAG,
64+ message:
65+ " Deleting \( variantViewModel. selectionList. count) comic book(s) "
66+ )
6367 Task {
6468 try await variantViewModel. deleteSelections ( )
6569 }
6670 }
6771 )
6872 . tag ( AppDestination . comics)
69- . tabItem { Label ( " Comics " , systemImage: " book.fill " ) }
73+ . tabItem {
74+ Label (
75+ String (
76+ localized: " destination.comics.label " ,
77+ defaultValue: " Comics "
78+ ) ,
79+ systemImage: " book.fill "
80+ )
81+ }
7082
71- ServerView ( )
72- . tag ( AppDestination . browseServer)
73- . tabItem {
74- Label ( " Browse " , systemImage: " person.crop.circle.fill " )
83+ ServerView (
84+ comicBookList: self . variantViewModel. comicBookList,
85+ currentPath: self . variantViewModel. browsingState. currentPath,
86+ title: self . variantViewModel. browsingState. title,
87+ parentPath: self . variantViewModel. browsingState. parentPath,
88+ directoryContents: self . variantViewModel. browsingState. contents,
89+ downloadingState: self . variantViewModel. browsingState
90+ . downloadingState,
91+ loading: self . variantViewModel. loading,
92+ onLoadDirectory: { path, reload in
93+ Log ( ) . debug (
94+ tag: TAG,
95+ message: " Loading path: \( path) reload= \( reload) "
96+ )
97+ self . variantViewModel. loadDirectory (
98+ path: path,
99+ reload: reload
100+ )
101+ } ,
102+ onDownloadFile: { path, filename in
103+ Task {
104+ Log ( ) . debug (
105+ tag: TAG,
106+ message: " Downloading file: \( filename) "
107+ )
108+
109+ self . variantViewModel. downloadFile (
110+ path: path,
111+ filename: filename
112+ )
113+ }
75114 }
115+ )
116+ . tag ( AppDestination . browseServer)
117+ . tabItem {
118+ Label (
119+ String (
120+ localized: " destination.browse-server.label " ,
121+ defaultValue: " Browse "
122+ ) ,
123+ systemImage: " person.crop.circle.fill "
124+ )
125+ }
76126
77- SettingsView ( )
78- . tag ( AppDestination . settings)
79- . tabItem { Label ( " Settings " , systemImage: " gearshape.fill " ) }
127+ SettingsView (
128+ address: variantViewModel. address,
129+ username: variantViewModel. username,
130+ password: variantViewModel. password,
131+ onSaveChanges: { address, username, password in
132+ Log ( ) . debug (
133+ tag: TAG,
134+ message:
135+ " Saving server settings: \( address) , \( username) , \( password) "
136+ )
137+ variantViewModel. address = address
138+ variantViewModel. username = username
139+ variantViewModel. password = password
140+ }
141+ )
142+ . tag ( AppDestination . settings)
143+ . tabItem {
144+ Label (
145+ String (
146+ localized: " destination.settings.label " ,
147+ defaultValue: " Settings "
148+ ) ,
149+ systemImage: " gearshape.fill "
150+ )
151+ }
80152 }
81153 . edgesIgnoringSafeArea ( . bottom)
82154 . onChange ( of: currentDestination) { tab in
0 commit comments