diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-08 16:15:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-08 16:15:03 +0000 |
commit | d2e37fdd5039617bc565953e2718531092478365 (patch) | |
tree | ed917f829b45e45f02f7b6cba137d68a7b298b75 | |
parent | 5938304d8d06c67467d05a506357da69f18ce445 (diff) | |
download | gnunet-gtk-d2e37fdd5039617bc565953e2718531092478365.tar.gz gnunet-gtk-d2e37fdd5039617bc565953e2718531092478365.zip |
LRN: Starting to get rid of gtk_dialog_run(), and more
* Call AC_INIT() with different package name and tarball name
* Get version from VCS instead of hard-coding it in configure.ac
* Don't supply version to AM_INIT_AUTOMAKE
* Use silent rules
* Make a few GNUNET_FS_GTK_* AM variables to be used in .glade files
* Add contrib/gnunet_fs_gtk_about_window.glade.in
* GNUNET_GTK_display_about () doesn't take dialog name anymore
(it should always be 'about_window' now)
* GNUNET_GTK_get_new_builder () now passes the builder as a callback
argument
* about.c now implements most of the things that were previously done
by GtkAboutDialog.
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | contrib/Makefile.am | 3 | ||||
-rwxr-xr-x | contrib/get_version.sh | 34 | ||||
-rw-r--r-- | contrib/gnunet_fs_gtk_about_window.glade.in | 364 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-about.c | 3 | ||||
-rw-r--r-- | src/include/gnunet_gtk.h | 5 | ||||
-rw-r--r-- | src/lib/about.c | 117 | ||||
-rw-r--r-- | src/lib/glade.c | 2 | ||||
-rw-r--r-- | src/peerinfo/gnunet-peerinfo-gtk-about.c | 3 | ||||
-rw-r--r-- | src/statistics/gnunet-statistics-gtk.c | 1 |
11 files changed, 530 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index fe1f3509..7e9a52b6 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -20,8 +20,8 @@ | |||
20 | # Process this file with autoconf to produce a configure script. | 20 | # Process this file with autoconf to produce a configure script. |
21 | # | 21 | # |
22 | AC_PREREQ(2.61) | 22 | AC_PREREQ(2.61) |
23 | AC_INIT([gnunet-gtk],[0.9.0],[bug-gnunet@gnu.org]) | 23 | AC_INIT([GNUnet GTK],m4_esyscmd([contrib/get_version.sh .version | tr -d '\n']),[bug-gnunet@gnu.org],[gnunet-gtk]) |
24 | AM_INIT_AUTOMAKE([gnunet-gtk], [0.9.0]) | 24 | AM_INIT_AUTOMAKE([silent-rules]) |
25 | AM_CONFIG_HEADER(gnunet_gtk_config.h) | 25 | AM_CONFIG_HEADER(gnunet_gtk_config.h) |
26 | 26 | ||
27 | AH_TOP([#define _GNU_SOURCE 1]) | 27 | AH_TOP([#define _GNU_SOURCE 1]) |
@@ -358,6 +358,11 @@ AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read- | |||
358 | packagesrcdir=`cd $srcdir && pwd` | 358 | packagesrcdir=`cd $srcdir && pwd` |
359 | AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir]) | 359 | AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir]) |
360 | 360 | ||
361 | AC_SUBST(GNUNET_FS_GTK_NAME, $PACKAGE_NAME, [name of the program]) | ||
362 | AC_SUBST(GNUNET_FS_GTK_VERSION3, $PACKAGE_VERSION, [version of the program]) | ||
363 | AC_SUBST(GNUNET_FS_GTK_YEARFROM, [2010], [year of the first release]) | ||
364 | AC_SUBST(GNUNET_FS_GTK_YEARTO, [$(date | sed -e 's/.* \([[[:digit:]]]\+\)$/\1/')], [year of the most current release]) | ||
365 | |||
361 | AC_OUTPUT([ | 366 | AC_OUTPUT([ |
362 | Makefile | 367 | Makefile |
363 | contrib/Makefile | 368 | contrib/Makefile |
@@ -374,4 +379,5 @@ po/Makefile.in | |||
374 | po/Makefile | 379 | po/Makefile |
375 | gnunet-fs-gtk.desktop | 380 | gnunet-fs-gtk.desktop |
376 | gnunet-setup.desktop | 381 | gnunet-setup.desktop |
382 | contrib/gnunet_fs_gtk_about_window.glade | ||
377 | ]) | 383 | ]) |
diff --git a/contrib/Makefile.am b/contrib/Makefile.am index c79d3fdf..606eeba2 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am | |||
@@ -34,7 +34,8 @@ pkgdata_DATA = \ | |||
34 | gnunet_peerinfo_gtk_main_window.glade \ | 34 | gnunet_peerinfo_gtk_main_window.glade \ |
35 | gnunet_statistics_gtk_about_dialog.glade \ | 35 | gnunet_statistics_gtk_about_dialog.glade \ |
36 | gnunet_statistics_gtk_main_window.glade \ | 36 | gnunet_statistics_gtk_main_window.glade \ |
37 | gnunet_setup_gtk_main_window.glade | 37 | gnunet_setup_gtk_main_window.glade \ |
38 | gnunet_fs_gtk_about_window.glade | ||
38 | 39 | ||
39 | install-data-local: | 40 | install-data-local: |
40 | $(mkinstalldirs) $(DESTDIR)$(pkgpixdir) | 41 | $(mkinstalldirs) $(DESTDIR)$(pkgpixdir) |
diff --git a/contrib/get_version.sh b/contrib/get_version.sh new file mode 100755 index 00000000..77e1fcaf --- /dev/null +++ b/contrib/get_version.sh | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/bin/sh | ||
2 | # Gets the version number from VCS, or from the contents of the file $1 | ||
3 | version= | ||
4 | if test -f "$1" | ||
5 | then | ||
6 | version=$(cat $1) | ||
7 | fi | ||
8 | if test "x$version" = "x" -a -d "./.git" | ||
9 | then | ||
10 | version=$(git svn info | grep "Revision: [[:digit:]]\+" | sed -e 's/Revision: //') | ||
11 | if test "x$version" = "x" | ||
12 | then | ||
13 | version=$(git log -1 | grep 'commit [a-f0-9]\+' | sed -e 's/commit //') | ||
14 | if test ! "x$version" = "x" | ||
15 | then | ||
16 | version="git-$version" | ||
17 | fi | ||
18 | else | ||
19 | version="r$version" | ||
20 | fi | ||
21 | fi | ||
22 | if test "x$version" = "x" -a -d "./.svn" | ||
23 | then | ||
24 | version=$(svn info | grep "Revision: [[:digit:]]\+" | sed -e 's/Revision: //') | ||
25 | if test ! "x$version" = "x" | ||
26 | then | ||
27 | version="r$version" | ||
28 | fi | ||
29 | fi | ||
30 | if test "x$version" = "x" | ||
31 | then | ||
32 | version="unknown" | ||
33 | fi | ||
34 | echo $version | ||
diff --git a/contrib/gnunet_fs_gtk_about_window.glade.in b/contrib/gnunet_fs_gtk_about_window.glade.in new file mode 100644 index 00000000..f214ca91 --- /dev/null +++ b/contrib/gnunet_fs_gtk_about_window.glade.in | |||
@@ -0,0 +1,364 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <interface> | ||
3 | <requires lib="gtk+" version="2.24"/> | ||
4 | <!-- interface-naming-policy project-wide --> | ||
5 | <object class="GtkWindow" id="about_window"> | ||
6 | <property name="can_focus">False</property> | ||
7 | <property name="modal">True</property> | ||
8 | <property name="destroy_with_parent">True</property> | ||
9 | <signal name="destroy-event" handler="GNUNET_GTK_about_window_got_destroy_event" swapped="no"/> | ||
10 | <signal name="frame-event" handler="GNUNET_GTK_about_window_got_frame_event" swapped="no"/> | ||
11 | <signal name="realize" handler="GNUNET_GTK_about_window_realized" swapped="no"/> | ||
12 | <signal name="delete-event" handler="GNUNET_GTK_about_window_got_delete_event" swapped="no"/> | ||
13 | <child> | ||
14 | <object class="GtkVBox" id="about_main_vbox"> | ||
15 | <property name="visible">True</property> | ||
16 | <property name="can_focus">False</property> | ||
17 | <property name="border_width">10</property> | ||
18 | <child> | ||
19 | <object class="GtkImage" id="about_logo_image"> | ||
20 | <property name="visible">True</property> | ||
21 | <property name="can_focus">False</property> | ||
22 | <property name="pixbuf">gnunet_logo.png</property> | ||
23 | </object> | ||
24 | <packing> | ||
25 | <property name="expand">False</property> | ||
26 | <property name="fill">True</property> | ||
27 | <property name="position">0</property> | ||
28 | </packing> | ||
29 | </child> | ||
30 | <child> | ||
31 | <object class="GtkLabel" id="about_name_version_label"> | ||
32 | <property name="visible">True</property> | ||
33 | <property name="can_focus">False</property> | ||
34 | <property name="label">@GNUNET_FS_GTK_NAME@ @GNUNET_FS_GTK_VERSION3@</property> | ||
35 | <attributes> | ||
36 | <attribute name="weight" value="bold"/> | ||
37 | <attribute name="size" value="200"/> | ||
38 | </attributes> | ||
39 | </object> | ||
40 | <packing> | ||
41 | <property name="expand">False</property> | ||
42 | <property name="fill">True</property> | ||
43 | <property name="position">1</property> | ||
44 | </packing> | ||
45 | </child> | ||
46 | <child> | ||
47 | <object class="GtkLabel" id="about_copyright_label"> | ||
48 | <property name="visible">True</property> | ||
49 | <property name="can_focus">False</property> | ||
50 | <property name="label">(C) @GNUNET_FS_GTK_YEARFROM@-@GNUNET_FS_GTK_YEARTO@ The GNUnet Project</property> | ||
51 | </object> | ||
52 | <packing> | ||
53 | <property name="expand">False</property> | ||
54 | <property name="fill">True</property> | ||
55 | <property name="position">2</property> | ||
56 | </packing> | ||
57 | </child> | ||
58 | <child> | ||
59 | <object class="GtkLabel" id="about_link_label"> | ||
60 | <property name="visible">True</property> | ||
61 | <property name="can_focus">False</property> | ||
62 | <property name="label"><a href="https://gnunet.org/">GNUnet: GNU's Framework for Secure P2P Networking</a></property> | ||
63 | <property name="use_markup">True</property> | ||
64 | <property name="wrap">True</property> | ||
65 | </object> | ||
66 | <packing> | ||
67 | <property name="expand">False</property> | ||
68 | <property name="fill">True</property> | ||
69 | <property name="position">3</property> | ||
70 | </packing> | ||
71 | </child> | ||
72 | <child> | ||
73 | <object class="GtkNotebook" id="about_credits_notebook"> | ||
74 | <property name="can_focus">True</property> | ||
75 | <child> | ||
76 | <object class="GtkScrolledWindow" id="about_credits_authors_scroller"> | ||
77 | <property name="visible">True</property> | ||
78 | <property name="can_focus">True</property> | ||
79 | <property name="hscrollbar_policy">automatic</property> | ||
80 | <property name="vscrollbar_policy">automatic</property> | ||
81 | <child> | ||
82 | <object class="GtkTextView" id="about_credits_authors_textview"> | ||
83 | <property name="visible">True</property> | ||
84 | <property name="can_focus">True</property> | ||
85 | <property name="editable">False</property> | ||
86 | <property name="wrap_mode">word</property> | ||
87 | <property name="cursor_visible">False</property> | ||
88 | <property name="buffer">credits_authors_contents</property> | ||
89 | <property name="accepts_tab">False</property> | ||
90 | </object> | ||
91 | </child> | ||
92 | </object> | ||
93 | </child> | ||
94 | <child type="tab"> | ||
95 | <object class="GtkLabel" id="about_credits_authors_tab"> | ||
96 | <property name="visible">True</property> | ||
97 | <property name="can_focus">False</property> | ||
98 | <property name="label" translatable="yes">Developed by</property> | ||
99 | </object> | ||
100 | <packing> | ||
101 | <property name="tab_fill">False</property> | ||
102 | </packing> | ||
103 | </child> | ||
104 | <child> | ||
105 | <object class="GtkScrolledWindow" id="about_credits_docs_scroller"> | ||
106 | <property name="visible">True</property> | ||
107 | <property name="can_focus">True</property> | ||
108 | <property name="hscrollbar_policy">automatic</property> | ||
109 | <property name="vscrollbar_policy">automatic</property> | ||
110 | <child> | ||
111 | <object class="GtkTextView" id="about_credits_docs_textview"> | ||
112 | <property name="visible">True</property> | ||
113 | <property name="can_focus">True</property> | ||
114 | <property name="editable">False</property> | ||
115 | <property name="wrap_mode">word</property> | ||
116 | <property name="cursor_visible">False</property> | ||
117 | <property name="buffer">credits_docs_contents</property> | ||
118 | <property name="accepts_tab">False</property> | ||
119 | </object> | ||
120 | </child> | ||
121 | </object> | ||
122 | <packing> | ||
123 | <property name="position">1</property> | ||
124 | </packing> | ||
125 | </child> | ||
126 | <child type="tab"> | ||
127 | <object class="GtkLabel" id="about_credits_docs_tab"> | ||
128 | <property name="visible">True</property> | ||
129 | <property name="can_focus">False</property> | ||
130 | <property name="label" translatable="yes">Documented by</property> | ||
131 | </object> | ||
132 | <packing> | ||
133 | <property name="position">1</property> | ||
134 | <property name="tab_fill">False</property> | ||
135 | </packing> | ||
136 | </child> | ||
137 | <child> | ||
138 | <object class="GtkScrolledWindow" id="about_credits_trans_scroller"> | ||
139 | <property name="visible">True</property> | ||
140 | <property name="can_focus">True</property> | ||
141 | <property name="hscrollbar_policy">automatic</property> | ||
142 | <property name="vscrollbar_policy">automatic</property> | ||
143 | <child> | ||
144 | <object class="GtkTextView" id="about_credits_trans_textview"> | ||
145 | <property name="visible">True</property> | ||
146 | <property name="can_focus">True</property> | ||
147 | <property name="editable">False</property> | ||
148 | <property name="wrap_mode">word</property> | ||
149 | <property name="cursor_visible">False</property> | ||
150 | <property name="buffer">credits_trans_contents</property> | ||
151 | <property name="accepts_tab">False</property> | ||
152 | </object> | ||
153 | </child> | ||
154 | </object> | ||
155 | <packing> | ||
156 | <property name="position">2</property> | ||
157 | </packing> | ||
158 | </child> | ||
159 | <child type="tab"> | ||
160 | <object class="GtkLabel" id="about_credits_trans_tab"> | ||
161 | <property name="visible">True</property> | ||
162 | <property name="can_focus">False</property> | ||
163 | <property name="label" translatable="yes">Translated by</property> | ||
164 | </object> | ||
165 | <packing> | ||
166 | <property name="position">2</property> | ||
167 | <property name="tab_fill">False</property> | ||
168 | </packing> | ||
169 | </child> | ||
170 | <child> | ||
171 | <object class="GtkScrolledWindow" id="about_credits_art_scroller"> | ||
172 | <property name="visible">True</property> | ||
173 | <property name="can_focus">True</property> | ||
174 | <property name="hscrollbar_policy">automatic</property> | ||
175 | <property name="vscrollbar_policy">automatic</property> | ||
176 | <child> | ||
177 | <object class="GtkTextView" id="about_credits_art_textview"> | ||
178 | <property name="visible">True</property> | ||
179 | <property name="can_focus">True</property> | ||
180 | <property name="editable">False</property> | ||
181 | <property name="wrap_mode">word</property> | ||
182 | <property name="cursor_visible">False</property> | ||
183 | <property name="buffer">credits_art_contents</property> | ||
184 | <property name="accepts_tab">False</property> | ||
185 | </object> | ||
186 | </child> | ||
187 | </object> | ||
188 | <packing> | ||
189 | <property name="position">3</property> | ||
190 | </packing> | ||
191 | </child> | ||
192 | <child type="tab"> | ||
193 | <object class="GtkLabel" id="about_credits_art_tab"> | ||
194 | <property name="visible">True</property> | ||
195 | <property name="can_focus">False</property> | ||
196 | <property name="label" translatable="yes">Artwork by</property> | ||
197 | </object> | ||
198 | <packing> | ||
199 | <property name="position">3</property> | ||
200 | <property name="tab_fill">False</property> | ||
201 | </packing> | ||
202 | </child> | ||
203 | </object> | ||
204 | <packing> | ||
205 | <property name="expand">True</property> | ||
206 | <property name="fill">True</property> | ||
207 | <property name="position">4</property> | ||
208 | </packing> | ||
209 | </child> | ||
210 | <child> | ||
211 | <object class="GtkScrolledWindow" id="about_license_scroller"> | ||
212 | <property name="can_focus">True</property> | ||
213 | <property name="hscrollbar_policy">automatic</property> | ||
214 | <property name="vscrollbar_policy">automatic</property> | ||
215 | <child> | ||
216 | <object class="GtkTextView" id="about_license_textview"> | ||
217 | <property name="can_focus">True</property> | ||
218 | <property name="editable">False</property> | ||
219 | <property name="wrap_mode">word</property> | ||
220 | <property name="cursor_visible">False</property> | ||
221 | <property name="buffer">license_contents</property> | ||
222 | <property name="accepts_tab">False</property> | ||
223 | </object> | ||
224 | </child> | ||
225 | </object> | ||
226 | <packing> | ||
227 | <property name="expand">True</property> | ||
228 | <property name="fill">True</property> | ||
229 | <property name="position">5</property> | ||
230 | </packing> | ||
231 | </child> | ||
232 | <child> | ||
233 | <object class="GtkHBox" id="about_buttons_hbox"> | ||
234 | <property name="visible">True</property> | ||
235 | <property name="can_focus">False</property> | ||
236 | <property name="border_width">5</property> | ||
237 | <property name="homogeneous">True</property> | ||
238 | <child> | ||
239 | <object class="GtkButton" id="about_credits_button"> | ||
240 | <property name="label" translatable="yes">Credits</property> | ||
241 | <property name="visible">True</property> | ||
242 | <property name="can_focus">True</property> | ||
243 | <property name="receives_default">True</property> | ||
244 | <property name="use_action_appearance">False</property> | ||
245 | <signal name="clicked" handler="GNUNET_GTK_about_credits_button_clicked" swapped="no"/> | ||
246 | </object> | ||
247 | <packing> | ||
248 | <property name="expand">True</property> | ||
249 | <property name="fill">False</property> | ||
250 | <property name="position">0</property> | ||
251 | </packing> | ||
252 | </child> | ||
253 | <child> | ||
254 | <object class="GtkButton" id="about_license_button"> | ||
255 | <property name="label" translatable="yes">License</property> | ||
256 | <property name="visible">True</property> | ||
257 | <property name="can_focus">True</property> | ||
258 | <property name="receives_default">True</property> | ||
259 | <property name="use_action_appearance">False</property> | ||
260 | <signal name="clicked" handler="GNUNET_GTK_about_license_button_clicked" swapped="no"/> | ||
261 | </object> | ||
262 | <packing> | ||
263 | <property name="expand">True</property> | ||
264 | <property name="fill">False</property> | ||
265 | <property name="position">1</property> | ||
266 | </packing> | ||
267 | </child> | ||
268 | <child> | ||
269 | <object class="GtkButton" id="about_close_button"> | ||
270 | <property name="label">gtk-close</property> | ||
271 | <property name="visible">True</property> | ||
272 | <property name="can_focus">True</property> | ||
273 | <property name="receives_default">True</property> | ||
274 | <property name="use_action_appearance">False</property> | ||
275 | <property name="use_stock">True</property> | ||
276 | <signal name="clicked" handler="GNUNET_GTK_about_close_button_clicked" swapped="no"/> | ||
277 | </object> | ||
278 | <packing> | ||
279 | <property name="expand">True</property> | ||
280 | <property name="fill">False</property> | ||
281 | <property name="pack_type">end</property> | ||
282 | <property name="position">2</property> | ||
283 | </packing> | ||
284 | </child> | ||
285 | <child> | ||
286 | <placeholder/> | ||
287 | </child> | ||
288 | </object> | ||
289 | <packing> | ||
290 | <property name="expand">False</property> | ||
291 | <property name="fill">False</property> | ||
292 | <property name="pack_type">end</property> | ||
293 | <property name="position">6</property> | ||
294 | </packing> | ||
295 | </child> | ||
296 | </object> | ||
297 | </child> | ||
298 | </object> | ||
299 | <object class="GtkTextBuffer" id="credits_art_contents"> | ||
300 | <property name="text">Jakub 'jimmac' Steiner <jimmac@ximian.org> | ||
301 | Christian Muellner <chris@flop.de> | ||
302 | Alex Jones <alexrjones@ntlworld.com> | ||
303 | Nicklas Larsson <whybill@gmail.com> | ||
304 | </property> | ||
305 | </object> | ||
306 | <object class="GtkTextBuffer" id="credits_authors_contents"> | ||
307 | <property name="text">Juergen Appel <jappel@linux01.gwdg.de> | ||
308 | Krista Grothoff <krista@grothoff.org> | ||
309 | James Blackwell <jblack@linuxguru.net> | ||
310 | Ludovic Courtes <ludo@chbouib.org> | ||
311 | Nils Durner <durner@gnunet.org> | ||
312 | Renaldo Ferreira <rf@cs.purdue.edu> | ||
313 | Christian Grothoff <christian@grothoff.org> | ||
314 | Eric Haumant | ||
315 | Tzvetan Horozov <horozov@motorola.com> | ||
316 | Gerd Knorr <kraxel@bytesex.org> | ||
317 | Werner Koch <libgcrypt@g10code.com> | ||
318 | Uli Luckas <luckas@musoft.de> | ||
319 | Blake Matheny | ||
320 | Glenn McGrath | ||
321 | Hendrik Pagenhardt <Hendrik.Pagenhardt@gmx.net> | ||
322 | Ioana Patrascu <ioanapatrascu@yahoo.com> | ||
323 | Marko Raeihae | ||
324 | Paul Ruth <ruth@cs.purdue.edu> | ||
325 | Risto Saarelma | ||
326 | Antti Salonen | ||
327 | Tiberius Stef <tstef@cs.purdue.edu> | ||
328 | Tuomas Toivonen | ||
329 | Tomi Tukiainen | ||
330 | Kevin Vandersloot <kfv101@psu.edu> | ||
331 | Simo Viitanen | ||
332 | Larry Waldo | ||
333 | Igor Wronsky <iwronsky@users.sourceforge.net> | ||
334 | <january@hushmail.com></property> | ||
335 | </object> | ||
336 | <object class="GtkTextBuffer" id="credits_docs_contents"> | ||
337 | <property name="text">Christian Grothoff <christian@grothoff.org> | ||
338 | Anders Carlsson <andersca@gnu.org> | ||
339 | Nils Durner <durner@gnunet.org> | ||
340 | Nicklas Larsson <whybill@gmail.com> | ||
341 | Milan Bouchet-Valat <nalimilan@club.fr> | ||
342 | Igor Wronsky <iwronsky@users.sourceforge.net> | ||
343 | </property> | ||
344 | </object> | ||
345 | <object class="GtkTextBuffer" id="credits_trans_contents"> | ||
346 | <property name="text">Di Ma | ||
347 | Jens Palsberg <palsberg@cs.ucla.edu> | ||
348 | Christian Grothoff <christian@grothoff.org> | ||
349 | Nils Durner <durner@gnunet.org> | ||
350 | Mathieu <mollo@bghflt.org> | ||
351 | Eric Haumant | ||
352 | milan@skoid.org | ||
353 | Hiroshi Yamauchi <yamauchi@cs.purdue.edu> | ||
354 | Adam Welc <welc@cs.purdue.edu> | ||
355 | Bogdan Carbunar <carbunar@cs.purdue.edu> | ||
356 | Steven Michael Murphy <murf@e-tools.com> | ||
357 | Phan Vinh Thinh <teppi82@gmail.com> | ||
358 | Daniel Nylander <po@danielnylander.se> | ||
359 | </property> | ||
360 | </object> | ||
361 | <object class="GtkTextBuffer" id="license_contents"> | ||
362 | <property name="text" translatable="yes">License should be loaded here at runtime from the license file (no need to copy the whole GPL in here...).</property> | ||
363 | </object> | ||
364 | </interface> | ||
diff --git a/src/Makefile.am b/src/Makefile.am index d0768e0f..373812f3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -1 +1 @@ | |||
SUBDIRS = . include lib $(GNUNET_FS_APP) $(GNUNET_SETUP_APP) $(GNUNET_PEERINFO_APP) statistics | SUBDIRS = . include lib $(GNUNET_FS_APP) $(GNUNET_SETUP_APP) $(GNUNET_PEERINFO_APP) | ||
diff --git a/src/fs/gnunet-fs-gtk-about.c b/src/fs/gnunet-fs-gtk-about.c index 1ffdcca4..4c7701bd 100644 --- a/src/fs/gnunet-fs-gtk-about.c +++ b/src/fs/gnunet-fs-gtk-about.c | |||
@@ -34,8 +34,7 @@ | |||
34 | void | 34 | void |
35 | GNUNET_GTK_main_menu_help_about_activate_cb (GtkWidget * dummy, gpointer data) | 35 | GNUNET_GTK_main_menu_help_about_activate_cb (GtkWidget * dummy, gpointer data) |
36 | { | 36 | { |
37 | GNUNET_GTK_display_about ("gnunet_fs_gtk_about_dialog.glade", | 37 | GNUNET_GTK_display_about ("gnunet_fs_gtk_about_window.glade"); |
38 | "GNUNET_FS_GTK_about_dialog"); | ||
39 | } | 38 | } |
40 | 39 | ||
41 | 40 | ||
diff --git a/src/include/gnunet_gtk.h b/src/include/gnunet_gtk.h index c567efb0..4f3e2cdb 100644 --- a/src/include/gnunet_gtk.h +++ b/src/include/gnunet_gtk.h | |||
@@ -37,8 +37,8 @@ | |||
37 | #include <gnunet/gnunet_util_lib.h> | 37 | #include <gnunet/gnunet_util_lib.h> |
38 | #include <gnunet/gnunet_fs_service.h> | 38 | #include <gnunet/gnunet_fs_service.h> |
39 | #include <extractor.h> | 39 | #include <extractor.h> |
40 | #include <gladeui/glade.h> | ||
41 | #include <gtk/gtk.h> | 40 | #include <gtk/gtk.h> |
41 | #include <gladeui/glade.h> | ||
42 | 42 | ||
43 | /* ****************** Initialization *************** */ | 43 | /* ****************** Initialization *************** */ |
44 | 44 | ||
@@ -93,10 +93,9 @@ GNUNET_GTK_get_new_builder (const char *filename); | |||
93 | * This displays an about dialog. | 93 | * This displays an about dialog. |
94 | * | 94 | * |
95 | * @param dialogfile name of the glade file containing the dialog | 95 | * @param dialogfile name of the glade file containing the dialog |
96 | * @param dialogname name of the about dialog in the file | ||
97 | */ | 96 | */ |
98 | void | 97 | void |
99 | GNUNET_GTK_display_about (const char *dialogfile, const char *dialogname); | 98 | GNUNET_GTK_display_about (const char *dialogfile); |
100 | 99 | ||
101 | 100 | ||
102 | 101 | ||
diff --git a/src/lib/about.c b/src/lib/about.c index 095ce21a..a41f6d0e 100644 --- a/src/lib/about.c +++ b/src/lib/about.c | |||
@@ -26,6 +26,115 @@ | |||
26 | */ | 26 | */ |
27 | #include "gnunet_gtk.h" | 27 | #include "gnunet_gtk.h" |
28 | 28 | ||
29 | static void | ||
30 | destroy_about_dialog (GtkBuilder *builder) | ||
31 | { | ||
32 | GtkWidget *ad; | ||
33 | ad = GTK_WIDGET (gtk_builder_get_object (builder, "about_window")); | ||
34 | gtk_widget_destroy (ad); | ||
35 | g_object_unref (G_OBJECT (builder)); | ||
36 | } | ||
37 | |||
38 | static void | ||
39 | about_window_show_exclusively (GtkBuilder *builder, gchar *name) | ||
40 | { | ||
41 | GtkWidget *about_credits_notebook; | ||
42 | GtkWidget *about_license_textview; | ||
43 | GtkWidget *about_license_scroller; | ||
44 | about_credits_notebook = GTK_WIDGET (gtk_builder_get_object (builder, "about_credits_notebook")); | ||
45 | about_license_textview = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_textview")); | ||
46 | about_license_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_scroller")); | ||
47 | if (name == NULL) | ||
48 | { | ||
49 | gtk_widget_hide (about_credits_notebook); | ||
50 | gtk_widget_hide (about_license_textview); | ||
51 | gtk_widget_hide (about_license_scroller); | ||
52 | } | ||
53 | else if (strcmp ("about_credits_notebook", name) == 0) | ||
54 | { | ||
55 | gtk_widget_show (about_credits_notebook); | ||
56 | gtk_widget_hide (about_license_textview); | ||
57 | gtk_widget_hide (about_license_scroller); | ||
58 | } | ||
59 | else if (strcmp ("about_license_textview", name) == 0) | ||
60 | { | ||
61 | gtk_widget_show (about_license_textview); | ||
62 | gtk_widget_show (about_license_scroller); | ||
63 | gtk_widget_hide (about_credits_notebook); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | G_MODULE_EXPORT gboolean | ||
68 | GNUNET_GTK_about_window_got_frame_event (GtkWindow *window, GdkEvent *event, | ||
69 | gpointer user_data) | ||
70 | { | ||
71 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
72 | |||
73 | switch (event->type) | ||
74 | { | ||
75 | case GDK_DELETE: | ||
76 | destroy_about_dialog (builder); | ||
77 | return TRUE; | ||
78 | break; | ||
79 | default: | ||
80 | return FALSE; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | G_MODULE_EXPORT void | ||
85 | GNUNET_GTK_about_window_realized (GtkWidget *widget, gpointer user_data) | ||
86 | { | ||
87 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
88 | GtkTextBuffer *license_contents; | ||
89 | gchar *license = NULL; | ||
90 | license_contents = GTK_TEXT_BUFFER (gtk_builder_get_object (builder, "license_contents")); | ||
91 | if (g_file_get_contents ("COPYING", &license, NULL, NULL) && license != NULL) | ||
92 | { | ||
93 | gtk_text_buffer_set_text (license_contents, license, -1); | ||
94 | g_free (license); | ||
95 | } | ||
96 | about_window_show_exclusively (builder, NULL); | ||
97 | } | ||
98 | |||
99 | G_MODULE_EXPORT void | ||
100 | GNUNET_GTK_about_close_button_clicked (GtkButton *widget, gpointer user_data) | ||
101 | { | ||
102 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
103 | destroy_about_dialog (builder); | ||
104 | } | ||
105 | |||
106 | G_MODULE_EXPORT gboolean | ||
107 | GNUNET_GTK_about_window_got_delete_event (GtkWidget *widget, GdkEvent *event, | ||
108 | gpointer user_data) | ||
109 | { | ||
110 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
111 | destroy_about_dialog (builder); | ||
112 | return FALSE; | ||
113 | } | ||
114 | |||
115 | G_MODULE_EXPORT gboolean | ||
116 | GNUNET_GTK_about_window_got_destroy_event (GtkWidget *widget, GdkEvent *event, | ||
117 | gpointer user_data) | ||
118 | { | ||
119 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
120 | destroy_about_dialog (builder); | ||
121 | return FALSE; | ||
122 | } | ||
123 | |||
124 | G_MODULE_EXPORT void | ||
125 | GNUNET_GTK_about_credits_button_clicked (GtkButton *widget, gpointer user_data) | ||
126 | { | ||
127 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
128 | about_window_show_exclusively (builder, "about_credits_notebook"); | ||
129 | } | ||
130 | |||
131 | G_MODULE_EXPORT void | ||
132 | GNUNET_GTK_about_license_button_clicked (GtkButton *widget, gpointer user_data) | ||
133 | { | ||
134 | GtkBuilder *builder = GTK_BUILDER (user_data); | ||
135 | about_window_show_exclusively (builder, "about_license_textview"); | ||
136 | } | ||
137 | |||
29 | /** | 138 | /** |
30 | * This displays an about dialog. | 139 | * This displays an about dialog. |
31 | * | 140 | * |
@@ -33,7 +142,7 @@ | |||
33 | * @param dialogname name of the about dialog in the file | 142 | * @param dialogname name of the about dialog in the file |
34 | */ | 143 | */ |
35 | void | 144 | void |
36 | GNUNET_GTK_display_about (const char *dialogfile, const char *dialogname) | 145 | GNUNET_GTK_display_about (const char *dialogfile) |
37 | { | 146 | { |
38 | GtkBuilder *builder; | 147 | GtkBuilder *builder; |
39 | GtkWidget *ad; | 148 | GtkWidget *ad; |
@@ -41,10 +150,14 @@ GNUNET_GTK_display_about (const char *dialogfile, const char *dialogname) | |||
41 | builder = GNUNET_GTK_get_new_builder (dialogfile); | 150 | builder = GNUNET_GTK_get_new_builder (dialogfile); |
42 | if (builder == NULL) | 151 | if (builder == NULL) |
43 | return; | 152 | return; |
44 | ad = GTK_WIDGET (gtk_builder_get_object (builder, dialogname)); | 153 | ad = GTK_WIDGET (gtk_builder_get_object (builder, "about_window")); |
154 | g_object_set_data (G_OBJECT (ad), "gnunet-gtk-builder", builder); | ||
155 | gtk_widget_show (ad); | ||
156 | /* | ||
45 | gtk_dialog_run (GTK_DIALOG (ad)); | 157 | gtk_dialog_run (GTK_DIALOG (ad)); |
46 | gtk_widget_destroy (ad); | 158 | gtk_widget_destroy (ad); |
47 | g_object_unref (G_OBJECT (builder)); | 159 | g_object_unref (G_OBJECT (builder)); |
160 | */ | ||
48 | } | 161 | } |
49 | 162 | ||
50 | 163 | ||
diff --git a/src/lib/glade.c b/src/lib/glade.c index 90c4649e..4e5957cd 100644 --- a/src/lib/glade.c +++ b/src/lib/glade.c | |||
@@ -84,7 +84,7 @@ GNUNET_GTK_get_new_builder (const char *filename) | |||
84 | GNUNET_free (glade_path); | 84 | GNUNET_free (glade_path); |
85 | return NULL; | 85 | return NULL; |
86 | } | 86 | } |
87 | gtk_builder_connect_signals (ret, NULL); | 87 | gtk_builder_connect_signals (ret, ret); |
88 | GNUNET_free (glade_path); | 88 | GNUNET_free (glade_path); |
89 | return ret; | 89 | return ret; |
90 | } | 90 | } |
diff --git a/src/peerinfo/gnunet-peerinfo-gtk-about.c b/src/peerinfo/gnunet-peerinfo-gtk-about.c index 68994424..5eb9b406 100644 --- a/src/peerinfo/gnunet-peerinfo-gtk-about.c +++ b/src/peerinfo/gnunet-peerinfo-gtk-about.c | |||
@@ -35,8 +35,7 @@ void | |||
35 | GNUNET_PEERINFO_GTK_main_menu_help_about_activate_cb (GtkWidget * dummy, | 35 | GNUNET_PEERINFO_GTK_main_menu_help_about_activate_cb (GtkWidget * dummy, |
36 | gpointer data) | 36 | gpointer data) |
37 | { | 37 | { |
38 | GNUNET_GTK_display_about ("gnunet_peerinfo_gtk_about_dialog.glade", | 38 | GNUNET_GTK_display_about ("gnunet_peerinfo_gtk_about_window.glade"); |
39 | "GNUNET_PEERINFO_GTK_about_dialog"); | ||
40 | } | 39 | } |
41 | 40 | ||
42 | 41 | ||
diff --git a/src/statistics/gnunet-statistics-gtk.c b/src/statistics/gnunet-statistics-gtk.c index fd1d72c7..4d130471 100644 --- a/src/statistics/gnunet-statistics-gtk.c +++ b/src/statistics/gnunet-statistics-gtk.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <gnunet/gnunet_util_lib.h> | 28 | #include <gnunet/gnunet_util_lib.h> |
29 | #include <gnunet/gnunet_statistics_service.h> | 29 | #include <gnunet/gnunet_statistics_service.h> |
30 | #include <cairo.h> | ||
30 | 31 | ||
31 | #define MAX_HISTORY 1280 | 32 | #define MAX_HISTORY 1280 |
32 | 33 | ||