1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef IDAV_SETTINGS_H
30 #define IDAV_SETTINGS_H
31
32 #include "application.h"
33 #include "config.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39
40 typedef struct SettingsWindow {
41 UiObject *obj;
42
43 DavConfig *config;
44 PwdStore *pwdstore;
45
46 UiList *repos;
47
48
49
50
51 UiInteger *repo_tabview;
52
53 DavBool repo_new;
54 UiString *repo_name;
55 UiString *repo_url;
56
57
58
59
60
61
62
63
64 UiList *repo_credentials;
65 UiString *repo_user;
66 UiString *repo_password;
67
68
69
70 UiInteger *repo_encryption;
71 UiList *repo_keys;
72
73
74
75
76
77 UiList *repo_tls_versions;
78 UiString *repo_cacert;
79 UiInteger *repo_disable_verification;
80
81 DavBool credentials_new;
82 DavBool credentials_modified;
83 DavBool credentials_list_needs_update;
84 DavBool credentials_ignore_selectionevent;
85 char *credentials_selected_id;
86 int credentials_selected_index;
87 int credentials_location_selected_index;
88
89
90
91
92
93
94 UiList *credentials_users;
95 UiString *credentials_id;
96 UiString *credentials_user;
97 UiString *credentials_password;
98
99
100
101
102
103
104 UiList *credentials_locations;
105
106
107
108
109
110
111
112 UiList *keys_list;
113 UiString *key_name;
114 UiString *key_file;
115 UiString *key_type;
116 UiInteger *key_secretstore;
117 int keys_selected_index;
118
119 int selected_repo;
120 } SettingsWindow;
121
122 typedef struct SettingsNewKeyDialog {
123 SettingsWindow *settings;
124
125 UiString *name;
126 UiString *file;
127 UiString *import_path;
128 UiString *message;
129
130
131
132
133
134 UiList *type;
135 UiInteger *secretstore;
136
137 DavBool add_to_repo;
138 } SettingsNewKeyDialog;
139
140 typedef struct SettingsNewCredentialsDialog {
141 SettingsWindow *settings;
142
143 UiString *id;
144 UiString *user;
145 UiString *password;
146 UiInteger *addlocation;
147 UiString *message;
148 char *url;
149 } SettingsNewCredentialsDialog;
150
151 void settings_window_open();
152
153 void settings_credentials_decrypt(SettingsWindow *settings);
154
155 void settings_ok(UiEvent *event,
void *userdata);
156
157 void settings_cancel(UiEvent *event,
void *userdata);
158
159 void settings_init(UiObject *obj, SettingsWindow *settings);
160
161
162
163
164
165 void settings_edit_repository(SettingsWindow *settings,
int repo_index);
166
167
168
169
170
171
172
173 void settings_store_repository(SettingsWindow *settings);
174
175 void settings_clear_repository(SettingsWindow *settings);
176
177
178 void settings_update_repolist(SettingsWindow *settings);
179
180 void* settings_repolist_getvalue(DavCfgRepository *repo,
int col);
181
182 void settings_reload_repo_keys(SettingsWindow *settings);
183 void settings_reload_keys(SettingsWindow *settings);
184
185 const char* dav_tlsversion2str(
int value);
186
187 void settings_reload_credentials(SettingsWindow *settings);
188 void settings_reload_repo_credentials(SettingsWindow *settings);
189
190
191
192
193
194
195
196
197 void settings_credentials_select(SettingsWindow *settings,
const char *id);
198
199
200
201
202 void settings_credentials_clear(SettingsWindow *settings);
203
204 int settings_credentials_save(SettingsWindow *settings);
205
206 void *keylist_getvalue(
void *data,
int col);
207
208 void settings_edit_key(SettingsWindow *settings, DavCfgKey *key);
209
210 void settings_clear_key(SettingsWindow *settings);
211
212
213
214
215
216
217 #ifdef __cplusplus
218 }
219 #endif
220
221 #endif
222
223