application/settings.h

Thu, 14 Nov 2024 22:28:36 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 14 Nov 2024 22:28:36 +0100
changeset 84
57a359c52617
parent 74
4466ebbd9fd5
permissions
-rw-r--r--

load properties after resource creation

60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2024 Olaf Wintermann. All rights reserved.
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #ifndef IDAV_SETTINGS_H
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #define IDAV_SETTINGS_H
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include "application.h"
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #include "config.h"
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 #ifdef __cplusplus
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 extern "C" {
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 #endif
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 typedef struct SettingsWindow {
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
41 UiObject *obj;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
42
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 DavConfig *config;
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
44 PwdStore *pwdstore;
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 UiList *repos;
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
47 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
48 * 0: repo list page
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
49 * 1: edit repo page
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
50 */
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 UiInteger *repo_tabview;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52
62
dbde5e038ea9 implement repo add/remove
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 60
diff changeset
53 DavBool repo_new;
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 UiString *repo_name;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 UiString *repo_url;
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
56 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
57 * value: char* credential id
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
58 *
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
59 * '-' entry + list of all credentials
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
60 * This list contains the same credential pointers as credentials_users
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
61 * and therefore doesn't need a destructor.
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
62 * Both lists are updated at the same time
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
63 */
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 UiList *repo_credentials;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 UiString *repo_user;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 UiString *repo_password;
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
67 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
68 * checkbox value
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
69 */
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 UiInteger *repo_encryption;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 UiList *repo_keys;
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
72 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
73 * value: char* tls version name
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
74 *
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
75 * static list of TLS version strings
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
76 */
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 UiList *repo_tls_versions;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 UiString *repo_cacert;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 UiInteger *repo_disable_verification;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
81 DavBool credentials_new;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
82 DavBool credentials_modified;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
83 DavBool credentials_list_needs_update;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
84 DavBool credentials_ignore_selectionevent;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
85 char *credentials_selected_id;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
86 int credentials_selected_index;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
87 int credentials_location_selected_index;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
88 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
89 * value: char* credentials id
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
90 *
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
91 * List of pwdstore locations and noloc credentials
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
92 * The value is a copy (allocated by the UiContext)
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
93 */
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
94 UiList *credentials_users;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
95 UiString *credentials_id;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
96 UiString *credentials_user;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
97 UiString *credentials_password;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
98 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
99 * value: char* url
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
100 *
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
101 * List of credential locations (PwdIndexEntry locations)
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
102 * The value is a copy (allocated by the UiContext)
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
103 */
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
104 UiList *credentials_locations;
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
105
72
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
106 /*
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
107 * value: char* key name
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
108 *
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
109 * List of encryption keys (DavKey)
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
110 * The value is a copy (allocated by the UiContext)
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
111 */
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
112 UiList *keys_list;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
113 UiString *key_name;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
114 UiString *key_file;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
115 UiString *key_type;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
116 UiInteger *key_secretstore;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
117 int keys_selected_index;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
118
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 int selected_repo;
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 } SettingsWindow;
72
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
121
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
122 typedef struct SettingsNewKeyDialog {
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
123 SettingsWindow *settings;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
124
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
125 UiString *name;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
126 UiString *file;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
127 UiString *import_path;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
128 UiString *message;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
129 /*
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
130 * value: char* key type name
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
131 *
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
132 * Static list of DavKey type names
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
133 */
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
134 UiList *type;
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
135 UiInteger *secretstore;
73
ede7885491b1 implement repo Generate Key button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 72
diff changeset
136
ede7885491b1 implement repo Generate Key button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 72
diff changeset
137 DavBool add_to_repo;
72
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
138 } SettingsNewKeyDialog;
74
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
139
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
140 typedef struct SettingsNewCredentialsDialog {
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
141 SettingsWindow *settings;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
142
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
143 UiString *id;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
144 UiString *user;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
145 UiString *password;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
146 UiInteger *addlocation;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
147 UiString *message;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
148 char *url;
4466ebbd9fd5 implement repo New Credentials button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 73
diff changeset
149 } SettingsNewCredentialsDialog;
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 void settings_window_open();
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
153 void settings_credentials_decrypt(SettingsWindow *settings);
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
154
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 void settings_ok(UiEvent *event, void *userdata);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157 void settings_cancel(UiEvent *event, void *userdata);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 void settings_init(UiObject *obj, SettingsWindow *settings);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 /*
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 * Open repository edit page for the repository settings->repos[repo_index]
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 * This function will set settings->selected_repo to repo_index
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 */
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 void settings_edit_repository(SettingsWindow *settings, int repo_index);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 /*
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 * Store settings from the settings window into the DavCfgRepository object.
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 *
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170 * This functions unsets settings->selected_repo and should only be called
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 * when switching back to the repo list or closing the settings window
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 */
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173 void settings_store_repository(SettingsWindow *settings);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174
63
d0eeb2b98dae repo add should clear the form first
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 62
diff changeset
175 void settings_clear_repository(SettingsWindow *settings);
d0eeb2b98dae repo add should clear the form first
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 62
diff changeset
176
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 void settings_update_repolist(SettingsWindow *settings);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 void* settings_repolist_getvalue(DavCfgRepository *repo, int col);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181
72
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
182 void settings_reload_repo_keys(SettingsWindow *settings);
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 void settings_reload_keys(SettingsWindow *settings);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185 const char* dav_tlsversion2str(int value);
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187 void settings_reload_credentials(SettingsWindow *settings);
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
188 void settings_reload_repo_credentials(SettingsWindow *settings);
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
190 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
191 * select credentials with the specified id and fill the credentials form
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
192 *
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
193 * if the id is specified, settings->credentials_id will be adjusted
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
194 * id no id is specified, credentials with the id settings->credentials_id
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
195 * are selected
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
196 */
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
197 void settings_credentials_select(SettingsWindow *settings, const char *id);
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198
65
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
199 /*
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
200 * clear the credentials form
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
201 */
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
202 void settings_credentials_clear(SettingsWindow *settings);
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
203
48f43130b4a2 implement UI for credentials settings
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
204 int settings_credentials_save(SettingsWindow *settings);
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205
72
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
206 void *keylist_getvalue(void *data, int col);
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
207
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
208 void settings_edit_key(SettingsWindow *settings, DavCfgKey *key);
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
209
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
210 void settings_clear_key(SettingsWindow *settings);
d5307e9ee384 implement key management UI
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
211
60
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213 #ifdef __cplusplus
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
214 }
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215 #endif
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217 #endif /* IDAV_SETTINGS_H */
ee4e4742391e add settings window and implement repository editing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218

mercurial