diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-11-21 03:13:32 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-11-21 03:13:32 +0100 |
commit | 39f27418afa22e63019aa569473b0ee12ff7eb7d (patch) | |
tree | eb6e86892e4cdb3377db73c30de04dfc138c3fff /src/ui/settings.c | |
parent | fc7f147d38bd144d3868861e97923c87d9d1a283 (diff) | |
download | messenger-gtk-39f27418afa22e63019aa569473b0ee12ff7eb7d.tar.gz messenger-gtk-39f27418afa22e63019aa569473b0ee12ff7eb7d.zip |
Added settings dialog
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/ui/settings.c')
-rw-r--r-- | src/ui/settings.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/ui/settings.c b/src/ui/settings.c new file mode 100644 index 0000000..ca58270 --- /dev/null +++ b/src/ui/settings.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | /* | ||
21 | * @author Tobias Frisch | ||
22 | * @file ui/settings.c | ||
23 | */ | ||
24 | |||
25 | #include "settings.h" | ||
26 | |||
27 | #include "../application.h" | ||
28 | |||
29 | static void | ||
30 | handle_dialog_destroy(UNUSED GtkWidget *window, | ||
31 | gpointer user_data) | ||
32 | { | ||
33 | ui_settings_dialog_cleanup((UI_SETTINGS_Handle*) user_data); | ||
34 | } | ||
35 | |||
36 | void | ||
37 | ui_settings_dialog_init(MESSENGER_Application *app, | ||
38 | UI_SETTINGS_Handle *handle) | ||
39 | { | ||
40 | handle->builder = gtk_builder_new_from_file("resources/ui/settings.ui"); | ||
41 | |||
42 | handle->dialog = HDY_PREFERENCES_WINDOW( | ||
43 | gtk_builder_get_object(handle->builder, "settings_dialog") | ||
44 | ); | ||
45 | |||
46 | gtk_window_set_transient_for( | ||
47 | GTK_WINDOW(handle->dialog), | ||
48 | GTK_WINDOW(app->ui.messenger.main_window) | ||
49 | ); | ||
50 | |||
51 | g_signal_connect( | ||
52 | handle->dialog, | ||
53 | "destroy", | ||
54 | G_CALLBACK(handle_dialog_destroy), | ||
55 | handle | ||
56 | ); | ||
57 | } | ||
58 | |||
59 | void | ||
60 | ui_settings_dialog_cleanup(UI_SETTINGS_Handle *handle) | ||
61 | { | ||
62 | g_object_unref(handle->builder); | ||
63 | } | ||