aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-03-16 19:10:30 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2022-03-16 19:10:30 +0100
commit5481b37fcf1a820e55719da9593216e58774da18 (patch)
treee4f63edf5802bc918a24dd6c625390c489661d61
parent4d8a11bc5778037f0eeb5d94d9b3de2f04b6fee6 (diff)
downloadmessenger-gtk-5481b37fcf1a820e55719da9593216e58774da18.tar.gz
messenger-gtk-5481b37fcf1a820e55719da9593216e58774da18.zip
Added about dialog and ui files of contact information dialog
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--Makefile3
-rw-r--r--resources/ui.gresource.xml2
-rw-r--r--resources/ui/about.ui105
-rw-r--r--resources/ui/contact_info.ui180
-rw-r--r--resources/ui/delete_messages.ui3
-rw-r--r--resources/ui/messenger.ui59
-rw-r--r--resources/ui/new_account.ui3
-rw-r--r--resources/ui/new_contact.ui1
-rw-r--r--resources/ui/new_group.ui1
-rw-r--r--resources/ui/new_platform.ui1
-rw-r--r--src/application.c8
-rw-r--r--src/application.h12
-rw-r--r--src/ui/about.c101
-rw-r--r--src/ui/about.h45
-rw-r--r--src/ui/contact_info.c125
-rw-r--r--src/ui/contact_info.h61
-rw-r--r--src/ui/messenger.c52
-rw-r--r--src/ui/messenger.h1
18 files changed, 741 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 845f5d4..4adb048 100644
--- a/Makefile
+++ b/Makefile
@@ -13,11 +13,13 @@ SOURCES = messenger_gtk.c\
13 file.c\ 13 file.c\
14 resources.c\ 14 resources.c\
15 chat/messenger.c\ 15 chat/messenger.c\
16 ui/about.c\
16 ui/account_entry.c\ 17 ui/account_entry.c\
17 ui/accounts.c\ 18 ui/accounts.c\
18 ui/chat_entry.c\ 19 ui/chat_entry.c\
19 ui/chat.c\ 20 ui/chat.c\
20 ui/contact_entry.c\ 21 ui/contact_entry.c\
22 ui/contact_info.c\
21 ui/contacts.c\ 23 ui/contacts.c\
22 ui/delete_messages.c\ 24 ui/delete_messages.c\
23 ui/file_load_entry.c\ 25 ui/file_load_entry.c\
@@ -118,6 +120,7 @@ install:
118 $(foreach SIZE,$(ICON_SIZES),$(call install-icon,$(SIZE));) 120 $(foreach SIZE,$(ICON_SIZES),$(call install-icon,$(SIZE));)
119 install -Dm644 $(addprefix $(APPICON_DIR), full_color.svg) $(addprefix $(INSTALL_DIR), share/icons/hicolor/scalable/apps/$(APP_ID).svg) 121 install -Dm644 $(addprefix $(APPICON_DIR), full_color.svg) $(addprefix $(INSTALL_DIR), share/icons/hicolor/scalable/apps/$(APP_ID).svg)
120 desktop-file-install --dir=$(addprefix $(INSTALL_DIR), share/applications/) $(addprefix $(RESOURCES_DIR), $(APP_ID).desktop) 122 desktop-file-install --dir=$(addprefix $(INSTALL_DIR), share/applications/) $(addprefix $(RESOURCES_DIR), $(APP_ID).desktop)
123 gtk-update-icon-cache -f -t $(addprefix $(INSTALL_DIR), share/icons/hicolor)
121 124
122.PHONY: uninstall 125.PHONY: uninstall
123 126
diff --git a/resources/ui.gresource.xml b/resources/ui.gresource.xml
index cbdcf3d..eb0072e 100644
--- a/resources/ui.gresource.xml
+++ b/resources/ui.gresource.xml
@@ -1,10 +1,12 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<gresources> 2<gresources>
3 <gresource prefix="/org/gnunet/Messenger"> 3 <gresource prefix="/org/gnunet/Messenger">
4 <file compressed="true">ui/about.ui</file>
4 <file compressed="true">ui/accounts.ui</file> 5 <file compressed="true">ui/accounts.ui</file>
5 <file compressed="true">ui/chat_entry.ui</file> 6 <file compressed="true">ui/chat_entry.ui</file>
6 <file compressed="true">ui/chat.ui</file> 7 <file compressed="true">ui/chat.ui</file>
7 <file compressed="true">ui/contact_entry.ui</file> 8 <file compressed="true">ui/contact_entry.ui</file>
9 <file compressed="true">ui/contact_info.ui</file>
8 <file compressed="true">ui/contacts.ui</file> 10 <file compressed="true">ui/contacts.ui</file>
9 <file compressed="true">ui/delete_messages.ui</file> 11 <file compressed="true">ui/delete_messages.ui</file>
10 <file compressed="true">ui/file_load_entry.ui</file> 12 <file compressed="true">ui/file_load_entry.ui</file>
diff --git a/resources/ui/about.ui b/resources/ui/about.ui
new file mode 100644
index 0000000..40c8ecf
--- /dev/null
+++ b/resources/ui/about.ui
@@ -0,0 +1,105 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Generated with glade 3.38.2
3
4Copyright (C) 2022 GNUnet e.V.
5
6GNUnet is free software: you can redistribute it and/or modify it
7under the terms of the GNU Affero General Public License as published
8by the Free Software Foundation, either version 3 of the License,
9or (at your option) any later version.
10
11GNUnet is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19SPDX-License-Identifier: AGPL3.0-or-later
20Author: Tobias Frisch
21
22-->
23<interface>
24 <requires lib="gtk+" version="3.24"/>
25 <object class="GtkAboutDialog" id="about_dialog">
26 <property name="can-focus">False</property>
27 <property name="modal">True</property>
28 <property name="window-position">center-on-parent</property>
29 <property name="type-hint">dialog</property>
30 <property name="program-name">GNUnet Messenger</property>
31 <property name="version">0.0.1</property>
32 <property name="copyright" translatable="yes">This application is part of GNUnet.
33Copyright (C) 2021--2022 GNUnet e.V.</property>
34 <property name="website">https://www.gnunet.org</property>
35 <property name="authors">Tobias Frisch</property>
36 <property name="documenters">Tobias Frisch
37Marcos Marado</property>
38 <property name="translator-credits" translatable="yes">Tobias Frisch</property>
39 <property name="artists">Tobias Frisch</property>
40 <property name="logo-icon-name">org.gnunet.Messenger</property>
41 <property name="license-type">agpl-3-0</property>
42 <child internal-child="vbox">
43 <object class="GtkBox">
44 <property name="can-focus">False</property>
45 <property name="orientation">vertical</property>
46 <property name="spacing">2</property>
47 <child internal-child="action_area">
48 <object class="GtkButtonBox">
49 <property name="can-focus">False</property>
50 <property name="layout-style">end</property>
51 <child>
52 <placeholder/>
53 </child>
54 <child>
55 <placeholder/>
56 </child>
57 </object>
58 <packing>
59 <property name="expand">False</property>
60 <property name="fill">False</property>
61 <property name="position">0</property>
62 </packing>
63 </child>
64 <child>
65 <object class="GtkButtonBox">
66 <property name="visible">True</property>
67 <property name="can-focus">False</property>
68 <property name="layout-style">end</property>
69 <child>
70 <object class="GtkButton" id="close_button">
71 <property name="label" translatable="yes">Close</property>
72 <property name="visible">True</property>
73 <property name="can-focus">True</property>
74 <property name="receives-default">True</property>
75 </object>
76 <packing>
77 <property name="expand">True</property>
78 <property name="fill">True</property>
79 <property name="position">0</property>
80 </packing>
81 </child>
82 </object>
83 <packing>
84 <property name="expand">False</property>
85 <property name="fill">True</property>
86 <property name="pack-type">end</property>
87 <property name="position">1</property>
88 </packing>
89 </child>
90 <child>
91 <object class="GtkSeparator">
92 <property name="visible">True</property>
93 <property name="can-focus">False</property>
94 </object>
95 <packing>
96 <property name="expand">False</property>
97 <property name="fill">True</property>
98 <property name="pack-type">end</property>
99 <property name="position">2</property>
100 </packing>
101 </child>
102 </object>
103 </child>
104 </object>
105</interface>
diff --git a/resources/ui/contact_info.ui b/resources/ui/contact_info.ui
new file mode 100644
index 0000000..8ac2e04
--- /dev/null
+++ b/resources/ui/contact_info.ui
@@ -0,0 +1,180 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Generated with glade 3.38.2
3
4Copyright (C) 2021‑‑2022 GNUnet e.V.
5
6GNUnet is free software: you can redistribute it and/or modify it
7under the terms of the GNU Affero General Public License as published
8by the Free Software Foundation, either version 3 of the License,
9or (at your option) any later version.
10
11GNUnet is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19SPDX-License-Identifier: AGPL3.0-or-later
20Author: Tobias Frisch
21
22-->
23<interface>
24 <requires lib="gtk+" version="3.24"/>
25 <requires lib="libhandy" version="1.2"/>
26 <object class="GtkDialog" id="contact_info_dialog">
27 <property name="can-focus">False</property>
28 <property name="modal">True</property>
29 <property name="window-position">center-on-parent</property>
30 <property name="type-hint">dialog</property>
31 <child internal-child="vbox">
32 <object class="GtkBox">
33 <property name="can-focus">False</property>
34 <property name="orientation">vertical</property>
35 <property name="spacing">2</property>
36 <child internal-child="action_area">
37 <object class="GtkButtonBox">
38 <property name="can-focus">False</property>
39 <property name="layout-style">end</property>
40 <child>
41 <object class="GtkButton" id="back_button">
42 <property name="label" translatable="yes">Back</property>
43 <property name="visible">True</property>
44 <property name="can-focus">True</property>
45 <property name="receives-default">True</property>
46 </object>
47 <packing>
48 <property name="expand">True</property>
49 <property name="fill">True</property>
50 <property name="position">0</property>
51 </packing>
52 </child>
53 <child>
54 <object class="GtkButton" id="close_button">
55 <property name="label" translatable="yes">Close</property>
56 <property name="visible">True</property>
57 <property name="can-focus">True</property>
58 <property name="receives-default">True</property>
59 </object>
60 <packing>
61 <property name="expand">True</property>
62 <property name="fill">True</property>
63 <property name="position">1</property>
64 </packing>
65 </child>
66 </object>
67 <packing>
68 <property name="expand">False</property>
69 <property name="fill">False</property>
70 <property name="position">0</property>
71 </packing>
72 </child>
73 <child>
74 <object class="GtkStack" id="contact_info_stack">
75 <property name="visible">True</property>
76 <property name="can-focus">False</property>
77 <property name="border-width">8</property>
78 <child>
79 <object class="GtkBox" id="details_box">
80 <property name="visible">True</property>
81 <property name="can-focus">False</property>
82 <property name="halign">center</property>
83 <property name="valign">center</property>
84 <property name="border-width">8</property>
85 <property name="orientation">vertical</property>
86 <property name="spacing">4</property>
87 <child>
88 <object class="HdyAvatar" id="contact_avatar">
89 <property name="visible">True</property>
90 <property name="can-focus">False</property>
91 <property name="halign">center</property>
92 <property name="margin-top">8</property>
93 <property name="margin-bottom">8</property>
94 <property name="icon-name">avatar-default-symbolic</property>
95 <property name="size">128</property>
96 </object>
97 <packing>
98 <property name="expand">False</property>
99 <property name="fill">True</property>
100 <property name="position">0</property>
101 </packing>
102 </child>
103 <child>
104 <object class="GtkLabel">
105 <property name="visible">True</property>
106 <property name="can-focus">False</property>
107 <property name="label" translatable="yes">Name:</property>
108 <property name="xalign">0</property>
109 </object>
110 <packing>
111 <property name="expand">False</property>
112 <property name="fill">True</property>
113 <property name="position">1</property>
114 </packing>
115 </child>
116 <child>
117 <object class="GtkEntry" id="contact_name">
118 <property name="width-request">250</property>
119 <property name="visible">True</property>
120 <property name="can-focus">True</property>
121 </object>
122 <packing>
123 <property name="expand">False</property>
124 <property name="fill">True</property>
125 <property name="position">2</property>
126 </packing>
127 </child>
128 <child>
129 <object class="GtkButton" id="reveal_identity_button">
130 <property name="label" translatable="yes">Reveal Identity</property>
131 <property name="visible">True</property>
132 <property name="can-focus">True</property>
133 <property name="receives-default">True</property>
134 </object>
135 <packing>
136 <property name="expand">False</property>
137 <property name="fill">True</property>
138 <property name="position">3</property>
139 </packing>
140 </child>
141 <child>
142 <object class="GtkButton" id="open_chat_button">
143 <property name="label" translatable="yes">Open Private Chat</property>
144 <property name="visible">True</property>
145 <property name="can-focus">True</property>
146 <property name="receives-default">True</property>
147 </object>
148 <packing>
149 <property name="expand">False</property>
150 <property name="fill">True</property>
151 <property name="position">4</property>
152 </packing>
153 </child>
154 </object>
155 <packing>
156 <property name="name">details_page</property>
157 </packing>
158 </child>
159 <child>
160 <object class="GtkDrawingArea" id="id_drawing_area">
161 <property name="height-request">250</property>
162 <property name="visible">True</property>
163 <property name="can-focus">False</property>
164 </object>
165 <packing>
166 <property name="name">drawing_page</property>
167 <property name="position">1</property>
168 </packing>
169 </child>
170 </object>
171 <packing>
172 <property name="expand">True</property>
173 <property name="fill">True</property>
174 <property name="position">1</property>
175 </packing>
176 </child>
177 </object>
178 </child>
179 </object>
180</interface>
diff --git a/resources/ui/delete_messages.ui b/resources/ui/delete_messages.ui
index 860f6ea..7078f6c 100644
--- a/resources/ui/delete_messages.ui
+++ b/resources/ui/delete_messages.ui
@@ -97,6 +97,7 @@
97 <property name="visible">True</property> 97 <property name="visible">True</property>
98 <property name="can-focus">False</property> 98 <property name="can-focus">False</property>
99 <property name="halign">center</property> 99 <property name="halign">center</property>
100 <property name="valign">center</property>
100 <property name="border-width">8</property> 101 <property name="border-width">8</property>
101 <property name="orientation">vertical</property> 102 <property name="orientation">vertical</property>
102 <property name="spacing">8</property> 103 <property name="spacing">8</property>
@@ -157,7 +158,7 @@
157 </child> 158 </child>
158 </object> 159 </object>
159 <packing> 160 <packing>
160 <property name="expand">False</property> 161 <property name="expand">True</property>
161 <property name="fill">True</property> 162 <property name="fill">True</property>
162 <property name="position">1</property> 163 <property name="position">1</property>
163 </packing> 164 </packing>
diff --git a/resources/ui/messenger.ui b/resources/ui/messenger.ui
index 28dd808..bc8d302 100644
--- a/resources/ui/messenger.ui
+++ b/resources/ui/messenger.ui
@@ -442,7 +442,7 @@ Author: Tobias Frisch
442 <packing> 442 <packing>
443 <property name="expand">False</property> 443 <property name="expand">False</property>
444 <property name="fill">True</property> 444 <property name="fill">True</property>
445 <property name="position">1</property> 445 <property name="position">0</property>
446 </packing> 446 </packing>
447 </child> 447 </child>
448 <child> 448 <child>
@@ -490,7 +490,7 @@ Author: Tobias Frisch
490 <packing> 490 <packing>
491 <property name="expand">False</property> 491 <property name="expand">False</property>
492 <property name="fill">True</property> 492 <property name="fill">True</property>
493 <property name="position">2</property> 493 <property name="position">1</property>
494 </packing> 494 </packing>
495 </child> 495 </child>
496 <child> 496 <child>
@@ -538,7 +538,7 @@ Author: Tobias Frisch
538 <packing> 538 <packing>
539 <property name="expand">False</property> 539 <property name="expand">False</property>
540 <property name="fill">True</property> 540 <property name="fill">True</property>
541 <property name="position">3</property> 541 <property name="position">2</property>
542 </packing> 542 </packing>
543 </child> 543 </child>
544 <child> 544 <child>
@@ -586,7 +586,7 @@ Author: Tobias Frisch
586 <packing> 586 <packing>
587 <property name="expand">False</property> 587 <property name="expand">False</property>
588 <property name="fill">True</property> 588 <property name="fill">True</property>
589 <property name="position">4</property> 589 <property name="position">3</property>
590 </packing> 590 </packing>
591 </child> 591 </child>
592 <child> 592 <child>
@@ -634,6 +634,53 @@ Author: Tobias Frisch
634 <packing> 634 <packing>
635 <property name="expand">False</property> 635 <property name="expand">False</property>
636 <property name="fill">True</property> 636 <property name="fill">True</property>
637 <property name="position">4</property>
638 </packing>
639 </child>
640 <child>
641 <object class="GtkButton" id="about_button">
642 <property name="visible">True</property>
643 <property name="can-focus">True</property>
644 <property name="receives-default">True</property>
645 <property name="relief">none</property>
646 <child>
647 <object class="GtkBox">
648 <property name="visible">True</property>
649 <property name="can-focus">False</property>
650 <property name="border-width">4</property>
651 <property name="spacing">16</property>
652 <child>
653 <object class="GtkImage">
654 <property name="visible">True</property>
655 <property name="can-focus">False</property>
656 <property name="icon-name">help-about-symbolic</property>
657 <property name="icon_size">3</property>
658 </object>
659 <packing>
660 <property name="expand">False</property>
661 <property name="fill">True</property>
662 <property name="position">0</property>
663 </packing>
664 </child>
665 <child>
666 <object class="GtkLabel" id="about-label">
667 <property name="visible">True</property>
668 <property name="can-focus">False</property>
669 <property name="label" translatable="yes">About</property>
670 <property name="xalign">0</property>
671 </object>
672 <packing>
673 <property name="expand">False</property>
674 <property name="fill">True</property>
675 <property name="position">1</property>
676 </packing>
677 </child>
678 </object>
679 </child>
680 </object>
681 <packing>
682 <property name="expand">False</property>
683 <property name="fill">True</property>
637 <property name="position">6</property> 684 <property name="position">6</property>
638 </packing> 685 </packing>
639 </child> 686 </child>
@@ -651,7 +698,7 @@ Author: Tobias Frisch
651 <property name="border-width">16</property> 698 <property name="border-width">16</property>
652 <property name="orientation">vertical</property> 699 <property name="orientation">vertical</property>
653 <child> 700 <child>
654 <object class="GtkLabel"> 701 <object class="GtkLabel" id="application-name-label">
655 <property name="visible">True</property> 702 <property name="visible">True</property>
656 <property name="can-focus">False</property> 703 <property name="can-focus">False</property>
657 <property name="halign">start</property> 704 <property name="halign">start</property>
@@ -667,7 +714,7 @@ Author: Tobias Frisch
667 </packing> 714 </packing>
668 </child> 715 </child>
669 <child> 716 <child>
670 <object class="GtkLabel"> 717 <object class="GtkLabel" id="application-version-label">
671 <property name="visible">True</property> 718 <property name="visible">True</property>
672 <property name="can-focus">False</property> 719 <property name="can-focus">False</property>
673 <property name="halign">start</property> 720 <property name="halign">start</property>
diff --git a/resources/ui/new_account.ui b/resources/ui/new_account.ui
index daa7f11..0e0a33d 100644
--- a/resources/ui/new_account.ui
+++ b/resources/ui/new_account.ui
@@ -76,6 +76,7 @@ Author: Tobias Frisch
76 <property name="visible">True</property> 76 <property name="visible">True</property>
77 <property name="can-focus">False</property> 77 <property name="can-focus">False</property>
78 <property name="halign">center</property> 78 <property name="halign">center</property>
79 <property name="valign">center</property>
79 <property name="border-width">8</property> 80 <property name="border-width">8</property>
80 <property name="orientation">vertical</property> 81 <property name="orientation">vertical</property>
81 <property name="spacing">4</property> 82 <property name="spacing">4</property>
@@ -134,7 +135,7 @@ Author: Tobias Frisch
134 </child> 135 </child>
135 </object> 136 </object>
136 <packing> 137 <packing>
137 <property name="expand">False</property> 138 <property name="expand">True</property>
138 <property name="fill">True</property> 139 <property name="fill">True</property>
139 <property name="position">1</property> 140 <property name="position">1</property>
140 </packing> 141 </packing>
diff --git a/resources/ui/new_contact.ui b/resources/ui/new_contact.ui
index a4dc25d..6a09ea4 100644
--- a/resources/ui/new_contact.ui
+++ b/resources/ui/new_contact.ui
@@ -87,6 +87,7 @@ Author: Tobias Frisch
87 <object class="GtkBox" id="fail_box"> 87 <object class="GtkBox" id="fail_box">
88 <property name="visible">True</property> 88 <property name="visible">True</property>
89 <property name="can-focus">False</property> 89 <property name="can-focus">False</property>
90 <property name="halign">center</property>
90 <property name="valign">center</property> 91 <property name="valign">center</property>
91 <property name="orientation">vertical</property> 92 <property name="orientation">vertical</property>
92 <property name="spacing">8</property> 93 <property name="spacing">8</property>
diff --git a/resources/ui/new_group.ui b/resources/ui/new_group.ui
index 009c218..dc498b7 100644
--- a/resources/ui/new_group.ui
+++ b/resources/ui/new_group.ui
@@ -104,6 +104,7 @@ Author: Tobias Frisch
104 <property name="visible">True</property> 104 <property name="visible">True</property>
105 <property name="can-focus">False</property> 105 <property name="can-focus">False</property>
106 <property name="halign">center</property> 106 <property name="halign">center</property>
107 <property name="valign">center</property>
107 <property name="border-width">8</property> 108 <property name="border-width">8</property>
108 <property name="orientation">vertical</property> 109 <property name="orientation">vertical</property>
109 <property name="spacing">4</property> 110 <property name="spacing">4</property>
diff --git a/resources/ui/new_platform.ui b/resources/ui/new_platform.ui
index 19aa01f..e55f879 100644
--- a/resources/ui/new_platform.ui
+++ b/resources/ui/new_platform.ui
@@ -76,6 +76,7 @@ Author: Tobias Frisch
76 <property name="visible">True</property> 76 <property name="visible">True</property>
77 <property name="can-focus">False</property> 77 <property name="can-focus">False</property>
78 <property name="halign">center</property> 78 <property name="halign">center</property>
79 <property name="valign">center</property>
79 <property name="border-width">8</property> 80 <property name="border-width">8</property>
80 <property name="orientation">vertical</property> 81 <property name="orientation">vertical</property>
81 <property name="spacing">4</property> 82 <property name="spacing">4</property>
diff --git a/src/application.c b/src/application.c
index 335db11..d960ed9 100644
--- a/src/application.c
+++ b/src/application.c
@@ -89,13 +89,13 @@ application_init(MESSENGER_Application *app,
89 hdy_init(); 89 hdy_init();
90 90
91 app->application = gtk_application_new( 91 app->application = gtk_application_new(
92 "org.gnunet.Messenger", 92 MESSENGER_APPLICATION_ID,
93 G_APPLICATION_NON_UNIQUE 93 G_APPLICATION_NON_UNIQUE
94 ); 94 );
95 95
96 resources_register(); 96 resources_register();
97 97
98 notify_init("Messenger-GTK"); 98 notify_init(MESSENGER_APPLICATION_NAME);
99 app->notifications = NULL; 99 app->notifications = NULL;
100 100
101 _load_ui_stylesheets(app); 101 _load_ui_stylesheets(app);
@@ -177,8 +177,8 @@ _application_chat_thread(void *args)
177 app->chat.status = (GNUNET_PROGRAM_run( 177 app->chat.status = (GNUNET_PROGRAM_run(
178 app->argc, 178 app->argc,
179 app->argv, 179 app->argv,
180 "messenger-gtk", 180 MESSENGER_APPLICATION_BINARY,
181 gettext_noop("A GTK based GUI for the Messenger service of GNUnet."), 181 gettext_noop(MESSENGER_APPLICATION_DESCRIPTION),
182 options, 182 options,
183 &chat_messenger_run, 183 &chat_messenger_run,
184 app 184 app
diff --git a/src/application.h b/src/application.h
index d678e1b..8e0149b 100644
--- a/src/application.h
+++ b/src/application.h
@@ -30,6 +30,7 @@
30 30
31#include "chat/messenger.h" 31#include "chat/messenger.h"
32 32
33#include "ui/about.h"
33#include "ui/accounts.h" 34#include "ui/accounts.h"
34#include "ui/contacts.h" 35#include "ui/contacts.h"
35#include "ui/delete_messages.h" 36#include "ui/delete_messages.h"
@@ -45,6 +46,16 @@
45 46
46#include "util.h" 47#include "util.h"
47 48
49#define MESSENGER_APPLICATION_APPNAME "GNUnet Messenger"
50#define MESSENGER_APPLICATION_BINARY "messenger-gtk"
51#define MESSENGER_APPLICATION_ID "org.gnunet.Messenger"
52#define MESSENGER_APPLICATION_NAME "Messenger-GTK"
53#define MESSENGER_APPLICATION_DESCRIPTION \
54 "A GTK based GUI for the Messenger service of GNUnet."
55#define MESSENGER_APPLICATION_TITLE "Messenger"
56#define MESSENGER_APPLICATION_SUBTITLE "GNUnet"
57#define MESSENGER_APPLICATION_VERSION "0.0.1"
58
48typedef enum MESSENGER_ApplicationSignal 59typedef enum MESSENGER_ApplicationSignal
49{ 60{
50 MESSENGER_NONE = 0, 61 MESSENGER_NONE = 0,
@@ -81,6 +92,7 @@ typedef struct MESSENGER_Application
81 int status; 92 int status;
82 93
83 UI_MESSENGER_Handle messenger; 94 UI_MESSENGER_Handle messenger;
95 UI_ABOUT_Handle about;
84 96
85 UI_INVITE_CONTACT_Handle invite_contact; 97 UI_INVITE_CONTACT_Handle invite_contact;
86 UI_SEND_FILE_Handle send_file; 98 UI_SEND_FILE_Handle send_file;
diff --git a/src/ui/about.c b/src/ui/about.c
new file mode 100644
index 0000000..70b2cd0
--- /dev/null
+++ b/src/ui/about.c
@@ -0,0 +1,101 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2022 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 about.c
23 */
24
25#include "about.h"
26
27#include "../application.h"
28
29static void
30handle_close_button_click(UNUSED GtkButton *button,
31 gpointer user_data)
32{
33 GtkAboutDialog *dialog = GTK_ABOUT_DIALOG(user_data);
34 gtk_window_close(GTK_WINDOW(dialog));
35}
36
37static void
38handle_dialog_destroy(UNUSED GtkWidget *window,
39 gpointer user_data)
40{
41 ui_about_dialog_cleanup((UI_ABOUT_Handle*) user_data);
42}
43
44void
45ui_about_dialog_init(MESSENGER_Application *app,
46 UI_ABOUT_Handle *handle)
47{
48 handle->builder = gtk_builder_new_from_resource(
49 application_get_resource_path(app, "ui/about.ui")
50 );
51
52 handle->dialog = GTK_ABOUT_DIALOG(
53 gtk_builder_get_object(handle->builder, "about_dialog")
54 );
55
56 gtk_window_set_transient_for(
57 GTK_WINDOW(handle->dialog),
58 GTK_WINDOW(app->ui.messenger.main_window)
59 );
60
61 gtk_about_dialog_set_program_name(
62 handle->dialog,
63 MESSENGER_APPLICATION_APPNAME
64 );
65
66 gtk_about_dialog_set_version(
67 handle->dialog,
68 MESSENGER_APPLICATION_VERSION
69 );
70
71 gtk_about_dialog_set_logo_icon_name(
72 handle->dialog,
73 MESSENGER_APPLICATION_ID
74 );
75
76 handle->close_button = GTK_BUTTON(
77 gtk_builder_get_object(handle->builder, "close_button")
78 );
79
80 g_signal_connect(
81 handle->close_button,
82 "clicked",
83 G_CALLBACK(handle_close_button_click),
84 handle->dialog
85 );
86
87 g_signal_connect(
88 handle->dialog,
89 "destroy",
90 G_CALLBACK(handle_dialog_destroy),
91 handle
92 );
93}
94
95void
96ui_about_dialog_cleanup(UI_ABOUT_Handle *handle)
97{
98 g_object_unref(handle->builder);
99
100 memset(handle, 0, sizeof(*handle));
101}
diff --git a/src/ui/about.h b/src/ui/about.h
new file mode 100644
index 0000000..86e7fe0
--- /dev/null
+++ b/src/ui/about.h
@@ -0,0 +1,45 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2022 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 about.h
23 */
24
25#ifndef UI_ABOUT_H_
26#define UI_ABOUT_H_
27
28#include "messenger.h"
29
30typedef struct UI_ABOUT_Handle
31{
32 GtkBuilder *builder;
33 GtkAboutDialog *dialog;
34
35 GtkButton *close_button;
36} UI_ABOUT_Handle;
37
38void
39ui_about_dialog_init(MESSENGER_Application *app,
40 UI_ABOUT_Handle *handle);
41
42void
43ui_about_dialog_cleanup(UI_ABOUT_Handle *handle);
44
45#endif /* UI_ABOUT_H_ */
diff --git a/src/ui/contact_info.c b/src/ui/contact_info.c
new file mode 100644
index 0000000..b8e504b
--- /dev/null
+++ b/src/ui/contact_info.c
@@ -0,0 +1,125 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2022 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/contact_info.c
23 */
24
25#include "contact_info.h"
26
27#include "../application.h"
28
29static void
30handle_close_button_click(UNUSED GtkButton *button,
31 gpointer user_data)
32{
33 GtkDialog *dialog = GTK_DIALOG(user_data);
34 gtk_window_close(GTK_WINDOW(dialog));
35}
36
37static void
38handle_dialog_destroy(UNUSED GtkWidget *window,
39 gpointer user_data)
40{
41 ui_contact_info_dialog_cleanup((UI_CONTACT_INFO_Handle*) user_data);
42}
43
44void
45ui_contact_info_dialog_init(MESSENGER_Application *app,
46 UI_CONTACT_INFO_Handle *handle)
47{
48 handle->builder = gtk_builder_new_from_resource(
49 application_get_resource_path(app, "ui/contact_info.ui")
50 );
51
52 handle->dialog = GTK_DIALOG(
53 gtk_builder_get_object(handle->builder, "contact_info_dialog")
54 );
55
56 gtk_window_set_transient_for(
57 GTK_WINDOW(handle->dialog),
58 GTK_WINDOW(app->ui.messenger.main_window)
59 );
60
61 handle->contact_info_stack = GTK_STACK(
62 gtk_builder_get_object(handle->builder, "contact_info_stack")
63 );
64
65 handle->details_box = GTK_WIDGET(
66 gtk_builder_get_object(handle->builder, "details_box")
67 );
68
69 handle->contact_avatar = HDY_AVATAR(
70 gtk_builder_get_object(handle->builder, "contact_avatar")
71 );
72
73 handle->contact_name = GTK_ENTRY(
74 gtk_builder_get_object(handle->builder, "contact_name")
75 );
76
77 handle->reveal_identity_button = GTK_BUTTON(
78 gtk_builder_get_object(handle->builder, "reveal_identity_button")
79 );
80
81 handle->open_chat_button = GTK_BUTTON(
82 gtk_builder_get_object(handle->builder, "open_chat_button")
83 );
84
85 handle->id_drawing_area = GTK_DRAWING_AREA(
86 gtk_builder_get_object(handle->builder, "id_drawing_area")
87 );
88
89 handle->back_button = GTK_BUTTON(
90 gtk_builder_get_object(handle->builder, "back_button")
91 );
92
93 handle->close_button = GTK_BUTTON(
94 gtk_builder_get_object(handle->builder, "close_button")
95 );
96
97 g_signal_connect(
98 handle->close_button,
99 "clicked",
100 G_CALLBACK(handle_close_button_click),
101 handle->dialog
102 );
103
104 g_signal_connect(
105 handle->dialog,
106 "destroy",
107 G_CALLBACK(handle_dialog_destroy),
108 handle
109 );
110}
111
112void
113ui_contact_info_dialog_update(UI_CONTACT_INFO_Handle *handle,
114 struct GNUNET_CHAT_Contact *contact)
115{
116 // TODO
117}
118
119void
120ui_contact_info_dialog_cleanup(UI_CONTACT_INFO_Handle *handle)
121{
122 g_object_unref(handle->builder);
123
124 memset(handle, 0, sizeof(*handle));
125}
diff --git a/src/ui/contact_info.h b/src/ui/contact_info.h
new file mode 100644
index 0000000..ef44c0c
--- /dev/null
+++ b/src/ui/contact_info.h
@@ -0,0 +1,61 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2022 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/contact_info.h
23 */
24
25#ifndef UI_CONTACT_INFO_H_
26#define UI_CONTACT_INFO_H_
27
28#include "messenger.h"
29
30typedef struct UI_CONTACT_INFO_Handle
31{
32 GtkBuilder *builder;
33 GtkDialog *dialog;
34
35 GtkStack *contact_info_stack;
36
37 GtkWidget *details_box;
38 HdyAvatar *contact_avatar;
39 GtkEntry *contact_name;
40
41 GtkButton *reveal_identity_button;
42 GtkButton *open_chat_button;
43
44 GtkDrawingArea *id_drawing_area;
45
46 GtkButton *back_button;
47 GtkButton *close_button;
48} UI_CONTACT_INFO_Handle;
49
50void
51ui_contact_info_dialog_init(MESSENGER_Application *app,
52 UI_CONTACT_INFO_Handle *handle);
53
54void
55ui_contact_info_dialog_update(UI_CONTACT_INFO_Handle *handle,
56 struct GNUNET_CHAT_Contact *contact);
57
58void
59ui_contact_info_dialog_cleanup(UI_CONTACT_INFO_Handle *handle);
60
61#endif /* UI_CONTACT_INFO_H_ */
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
index 45da0cd..b4d12af 100644
--- a/src/ui/messenger.c
+++ b/src/ui/messenger.c
@@ -140,9 +140,7 @@ handle_new_contact_button_click(UNUSED GtkButton* button,
140 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 140 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
141 141
142 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); 142 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
143
144 ui_new_contact_dialog_init(app, &(app->ui.new_contact)); 143 ui_new_contact_dialog_init(app, &(app->ui.new_contact));
145
146 gtk_widget_show(GTK_WIDGET(app->ui.new_contact.dialog)); 144 gtk_widget_show(GTK_WIDGET(app->ui.new_contact.dialog));
147} 145}
148 146
@@ -153,9 +151,7 @@ handle_new_group_button_click(UNUSED GtkButton* button,
153 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 151 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
154 152
155 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); 153 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
156
157 ui_new_group_dialog_init(app, &(app->ui.new_group)); 154 ui_new_group_dialog_init(app, &(app->ui.new_group));
158
159 gtk_widget_show(GTK_WIDGET(app->ui.new_group.dialog)); 155 gtk_widget_show(GTK_WIDGET(app->ui.new_group.dialog));
160} 156}
161 157
@@ -166,9 +162,7 @@ handle_new_platform_button_click(UNUSED GtkButton* button,
166 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 162 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
167 163
168 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); 164 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
169
170 ui_new_platform_dialog_init(app, &(app->ui.new_platform)); 165 ui_new_platform_dialog_init(app, &(app->ui.new_platform));
171
172 gtk_widget_show(GTK_WIDGET(app->ui.new_platform.dialog)); 166 gtk_widget_show(GTK_WIDGET(app->ui.new_platform.dialog));
173} 167}
174 168
@@ -179,9 +173,7 @@ handle_contacts_button_click(UNUSED GtkButton* button,
179 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 173 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
180 174
181 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); 175 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
182
183 ui_contacts_dialog_init(app, &(app->ui.contacts)); 176 ui_contacts_dialog_init(app, &(app->ui.contacts));
184
185 gtk_widget_show(GTK_WIDGET(app->ui.contacts.dialog)); 177 gtk_widget_show(GTK_WIDGET(app->ui.contacts.dialog));
186} 178}
187 179
@@ -192,13 +184,22 @@ handle_settings_button_click(UNUSED GtkButton* button,
192 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 184 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
193 185
194 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); 186 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
195
196 ui_settings_dialog_init(app, &(app->ui.settings)); 187 ui_settings_dialog_init(app, &(app->ui.settings));
197
198 gtk_widget_show(GTK_WIDGET(app->ui.settings.dialog)); 188 gtk_widget_show(GTK_WIDGET(app->ui.settings.dialog));
199} 189}
200 190
201static void 191static void
192handle_about_button_click(UNUSED GtkButton* button,
193 gpointer user_data)
194{
195 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
196
197 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
198 ui_about_dialog_init(app, &(app->ui.about));
199 gtk_widget_show(GTK_WIDGET(app->ui.about.dialog));
200}
201
202static void
202handle_chats_listbox_row_activated(UNUSED GtkListBox* listbox, 203handle_chats_listbox_row_activated(UNUSED GtkListBox* listbox,
203 GtkListBoxRow* row, 204 GtkListBoxRow* row,
204 gpointer user_data) 205 gpointer user_data)
@@ -295,6 +296,16 @@ ui_messenger_init(MESSENGER_Application *app,
295 gtk_builder_get_object(handle->builder, "main_window") 296 gtk_builder_get_object(handle->builder, "main_window")
296 ); 297 );
297 298
299 gtk_window_set_startup_id(
300 GTK_WINDOW(handle->main_window),
301 MESSENGER_APPLICATION_ID
302 );
303
304 gtk_window_set_icon_name(
305 GTK_WINDOW(handle->main_window),
306 MESSENGER_APPLICATION_ID
307 );
308
298 gtk_application_add_window( 309 gtk_application_add_window(
299 app->application, 310 app->application,
300 GTK_WINDOW(handle->main_window) 311 GTK_WINDOW(handle->main_window)
@@ -317,6 +328,16 @@ ui_messenger_init(MESSENGER_Application *app,
317 gtk_builder_get_object(handle->builder, "title_bar") 328 gtk_builder_get_object(handle->builder, "title_bar")
318 ); 329 );
319 330
331 hdy_header_bar_set_title(
332 handle->title_bar,
333 MESSENGER_APPLICATION_TITLE
334 );
335
336 hdy_header_bar_set_subtitle(
337 handle->title_bar,
338 MESSENGER_APPLICATION_SUBTITLE
339 );
340
320 g_object_bind_property( 341 g_object_bind_property(
321 handle->leaflet_chat, 342 handle->leaflet_chat,
322 "folded", 343 "folded",
@@ -458,6 +479,17 @@ ui_messenger_init(MESSENGER_Application *app,
458 app 479 app
459 ); 480 );
460 481
482 handle->about_button = GTK_BUTTON(
483 gtk_builder_get_object(handle->builder, "about_button")
484 );
485
486 g_signal_connect(
487 handle->about_button,
488 "clicked",
489 G_CALLBACK(handle_about_button_click),
490 app
491 );
492
461 handle->user_details_button = GTK_BUTTON( 493 handle->user_details_button = GTK_BUTTON(
462 gtk_builder_get_object(handle->builder, "user_details_button") 494 gtk_builder_get_object(handle->builder, "user_details_button")
463 ); 495 );
diff --git a/src/ui/messenger.h b/src/ui/messenger.h
index 54f8dfa..6c36ed9 100644
--- a/src/ui/messenger.h
+++ b/src/ui/messenger.h
@@ -67,6 +67,7 @@ typedef struct UI_MESSENGER_Handle
67 GtkButton *new_platform_button; 67 GtkButton *new_platform_button;
68 GtkButton *contacts_button; 68 GtkButton *contacts_button;
69 GtkButton *settings_button; 69 GtkButton *settings_button;
70 GtkButton *about_button;
70 71
71 GtkButton *user_details_button; 72 GtkButton *user_details_button;
72 GtkSearchEntry *chats_search; 73 GtkSearchEntry *chats_search;