archrelease: copy trunk to community-any
[ArchLinux/community.git] / gwget / trunk / gsettings-port.patch
blob962a486c1ca3faa71b47fed3c46de0c1331bb37e
1 diff -Naur gwget-1.0.4.orig/configure.ac gwget-1.0.4/configure.ac
2 --- gwget-1.0.4.orig/configure.ac 2018-09-02 09:37:59.856756000 +0200
3 +++ gwget-1.0.4/configure.ac 2018-09-02 09:43:52.956200139 +0200
4 @@ -4,7 +4,7 @@
5 AM_INIT_AUTOMAKE(gwget, 1.0.4)
6 AM_CONFIG_HEADER(config.h)
8 -AC_PATH_PROG(GCONFTOOL, gconftool-2)
9 +GLIB_GSETTINGS
10 IT_PROG_INTLTOOL([0.35.0])
12 AC_ISC_POSIX
13 @@ -12,8 +12,6 @@
14 AC_STDC_HEADERS
15 AM_PROG_LIBTOOL
17 -AM_GCONF_SOURCE_2
19 AC_ARG_ENABLE([gtk3],
20 [AC_HELP_STRING([--enable-gtk3],
21 [compile gwget against gtk+ 3.0 (default: yes)])],
22 @@ -28,12 +26,10 @@
25 GTK_REQUIRED=2.6.0
26 -GCONF_REQUIRED=1.1.11
27 DBUS_GLIB_REQUIRED=0.33
28 GIO_REQUIRED=2.16.0
30 PKG_CHECK_MODULES(GNOME, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
31 - gconf-2.0
32 gmodule-2.0
33 gio-unix-2.0 >= $GIO_REQUIRED)
35 diff -Naur gwget-1.0.4.orig/data/gwget.schemas.in gwget-1.0.4/data/gwget.schemas.in
36 --- gwget-1.0.4.orig/data/gwget.schemas.in 2009-06-16 19:58:06.000000000 +0200
37 +++ gwget-1.0.4/data/gwget.schemas.in 1970-01-01 01:00:00.000000000 +0100
38 @@ -1,402 +0,0 @@
39 -<gconfschemafile>
40 - <schemalist>
42 - <schema>
43 - <key>/schemas/apps/gwget2/convert_links</key>
44 - <applyto>/apps/gwget2/convert_links</applyto>
45 - <owner>gwget</owner>
46 - <type>bool</type>
47 - <default>false</default>
48 - <locale name="C">
49 - <short>Convert Links</short>
50 - <long>Convert to relative links in recursive mode.</long>
51 - </locale>
52 - </schema>
54 - <schema>
55 - <key>/schemas/apps/gwget2/default_height</key>
56 - <applyto>/apps/gwget2/default_height</applyto>
57 - <owner>gwget</owner>
58 - <type>int</type>
59 - <default>200</default>
60 - <locale name="C">
61 - <short></short>
62 - <long></long>
63 - </locale>
64 - </schema>
66 - <schema>
67 - <key>/schemas/apps/gwget2/default_width</key>
68 - <applyto>/apps/gwget2/default_width</applyto>
69 - <owner>gwget</owner>
70 - <type>int</type>
71 - <default>250</default>
72 - <locale name="C">
73 - <short></short>
74 - <long></long>
75 - </locale>
76 - </schema>
78 - <schema>
79 - <key>/schemas/apps/gwget2/dl_page_requisites</key>
80 - <applyto>/apps/gwget2/dl_page_requisites</applyto>
81 - <owner>gwget</owner>
82 - <type>bool</type>
83 - <default>false</default>
84 - <locale name="C">
85 - <short>Download Page Requisites</short>
86 - <long></long>
87 - </locale>
88 - </schema>
90 - <schema>
91 - <key>/schemas/apps/gwget2/download_dir</key>
92 - <applyto>/apps/gwget2/download_dir</applyto>
93 - <owner>gwget</owner>
94 - <type>string</type>
95 - <default></default>
96 - <locale name="C">
97 - <short>Default Download Directory</short>
98 - <long></long>
99 - </locale>
100 - </schema>
102 - <schema>
103 - <key>/schemas/apps/gwget2/ask_save_each_dl</key>
104 - <applyto>/apps/gwget2/ask_save_each_dl</applyto>
105 - <owner>gwget</owner>
106 - <type>bool</type>
107 - <default>true</default>
108 - <locale name="C">
109 - <short>Ask where to save each new download</short>
110 - <long>If true, always ask for a destination folder when starting a new download. If false, always save in the default directory without asking the user.</long>
111 - </locale>
112 - </schema>
115 - <schema>
116 - <key>/schemas/apps/gwget2/follow_relative</key>
117 - <applyto>/apps/gwget2/follow_relative</applyto>
118 - <owner>gwget</owner>
119 - <type>bool</type>
120 - <default>false</default>
121 - <locale name="C">
122 - <short>Follow relative links</short>
123 - <long></long>
124 - </locale>
125 - </schema>
127 - <schema>
128 - <key>/schemas/apps/gwget2/limit_speed</key>
129 - <applyto>/apps/gwget2/limit_speed</applyto>
130 - <owner>gwget</owner>
131 - <type>bool</type>
132 - <default>false</default>
133 - <locale name="C">
134 - <short>Limit maximum speed</short>
135 - <long></long>
136 - </locale>
137 - </schema>
139 - <schema>
140 - <key>/schemas/apps/gwget2/limit_simultaneousdownloads</key>
141 - <applyto>/apps/gwget2/limit_simultaneousdownloads</applyto>
142 - <owner>gwget</owner>
143 - <type>bool</type>
144 - <default>false</default>
145 - <locale name="C">
146 - <short>Limit number of simultaneous downloads</short>
147 - <long></long>
148 - </locale>
149 - </schema>
151 - <schema>
152 - <key>/schemas/apps/gwget2/max_depth</key>
153 - <applyto>/apps/gwget2/max_depth</applyto>
154 - <owner>gwget</owner>
155 - <type>int</type>
156 - <default>0</default>
157 - <locale name="C">
158 - <short>Maximum depth in recursive mode</short>
159 - <long></long>
160 - </locale>
161 - </schema>
163 - <schema>
164 - <key>/schemas/apps/gwget2/max_speed</key>
165 - <applyto>/apps/gwget2/max_speed</applyto>
166 - <owner>gwget</owner>
167 - <type>int</type>
168 - <default>0</default>
169 - <locale name="C">
170 - <short>Maximum speed limit</short>
171 - <long></long>
172 - </locale>
173 - </schema>
175 - <schema>
176 - <key>/schemas/apps/gwget2/max_simultaneousdownloads</key>
177 - <applyto>/apps/gwget2/max_simultaneousdownloads</applyto>
178 - <owner>gwget</owner>
179 - <type>int</type>
180 - <default>0</default>
181 - <locale name="C">
182 - <short>Maximum number of simultaneous downloads</short>
183 - <long></long>
184 - </locale>
185 - </schema>
187 - <schema>
188 - <key>/schemas/apps/gwget2/n_downloads</key>
189 - <applyto>/apps/gwget2/n_downloads</applyto>
190 - <owner>gwget</owner>
191 - <type>int</type>
192 - <default>0</default>
193 - <locale name="C">
194 - <short>Number of downloads</short>
195 - <long></long>
196 - </locale>
197 - </schema>
199 - <schema>
200 - <key>/schemas/apps/gwget2/no_create_directories</key>
201 - <applyto>/apps/gwget2/no_create_directories</applyto>
202 - <owner>gwget</owner>
203 - <type>bool</type>
204 - <default>false</default>
205 - <locale name="C">
206 - <short></short>
207 - <long></long>
208 - </locale>
209 - </schema>
211 - <schema>
212 - <key>/schemas/apps/gwget2/num_retrys</key>
213 - <applyto>/apps/gwget2/num_retrys</applyto>
214 - <owner>gwget</owner>
215 - <type>int</type>
216 - <default>3</default>
217 - <locale name="C">
218 - <short>Number of retries</short>
219 - <long></long>
220 - </locale>
221 - </schema>
223 - <schema>
224 - <key>/schemas/apps/gwget2/position_x</key>
225 - <applyto>/apps/gwget2/position_x</applyto>
226 - <owner>gwget</owner>
227 - <type>int</type>
228 - <default>0</default>
229 - <locale name="C">
230 - <short></short>
231 - <long></long>
232 - </locale>
233 - </schema>
235 - <schema>
236 - <key>/schemas/apps/gwget2/position_y</key>
237 - <applyto>/apps/gwget2/position_y</applyto>
238 - <owner>gwget</owner>
239 - <type>int</type>
240 - <default>0</default>
241 - <locale name="C">
242 - <short></short>
243 - <long></long>
244 - </locale>
245 - </schema>
247 - <schema>
248 - <key>/schemas/apps/gwget2/resume_at_start</key>
249 - <applyto>/apps/gwget2/resume_at_start</applyto>
250 - <owner>gwget</owner>
251 - <type>bool</type>
252 - <default>false</default>
253 - <locale name="C">
254 - <short>Resume downloads at startup</short>
255 - <long></long>
256 - </locale>
257 - </schema>
259 - <schema>
260 - <key>/schemas/apps/gwget2/open_after_dl</key>
261 - <applyto>/apps/gwget2/open_after_dl</applyto>
262 - <owner>gwget</owner>
263 - <type>bool</type>
264 - <default>false</default>
265 - <locale name="C">
266 - <short>Open the file after download</short>
267 - <long></long>
268 - </locale>
269 - </schema>
271 - <schema>
272 - <key>/schemas/apps/gwget2/view_actual_size</key>
273 - <applyto>/apps/gwget2/view_actual_size</applyto>
274 - <owner>gwget</owner>
275 - <type>bool</type>
276 - <default>true</default>
277 - <locale name="C">
278 - <short></short>
279 - <long></long>
280 - </locale>
281 - </schema>
283 - <schema>
284 - <key>/schemas/apps/gwget2/view_down_speed</key>
285 - <applyto>/apps/gwget2/view_down_speed</applyto>
286 - <owner>gwget</owner>
287 - <type>bool</type>
288 - <default>true</default>
289 - <locale name="C">
290 - <short>View download speed column</short>
291 - <long></long>
292 - </locale>
293 - </schema>
295 - <schema>
296 - <key>/schemas/apps/gwget2/view_elapse_time</key>
297 - <applyto>/apps/gwget2/view_elapse_time</applyto>
298 - <owner>gwget</owner>
299 - <type>bool</type>
300 - <default>false</default>
301 - <locale name="C">
302 - <short>View elapsed time column</short>
303 - <long></long>
304 - </locale>
305 - </schema>
307 - <schema>
308 - <key>/schemas/apps/gwget2/view_percentage</key>
309 - <applyto>/apps/gwget2/view_percentage</applyto>
310 - <owner>gwget</owner>
311 - <type>bool</type>
312 - <default>true</default>
313 - <locale name="C">
314 - <short>View percentage column</short>
315 - <long></long>
316 - </locale>
317 - </schema>
319 - <schema>
320 - <key>/schemas/apps/gwget2/view_rem_time</key>
321 - <applyto>/apps/gwget2/view_rem_time</applyto>
322 - <owner>gwget</owner>
323 - <type>bool</type>
324 - <default>true</default>
325 - <locale name="C">
326 - <short>View remaining time column</short>
327 - <long></long>
328 - </locale>
329 - </schema>
331 - <schema>
332 - <key>/schemas/apps/gwget2/view_toolbar</key>
333 - <applyto>/apps/gwget2/view_toolbar</applyto>
334 - <owner>gwget</owner>
335 - <type>bool</type>
336 - <default>true</default>
337 - <locale name="C">
338 - <short>View toolbar</short>
339 - <long>Whether to display the toolbar.</long>
340 - </locale>
341 - </schema>
343 - <schema>
344 - <key>/schemas/apps/gwget2/view_statusbar</key>
345 - <applyto>/apps/gwget2/view_statusbar</applyto>
346 - <owner>gwget</owner>
347 - <type>bool</type>
348 - <default>true</default>
349 - <locale name="C">
350 - <short>View statusbar</short>
351 - <long>Whether to display the statusbar.</long>
352 - </locale>
353 - </schema>
355 - <schema>
356 - <key>/schemas/apps/gwget2/view_total_size</key>
357 - <applyto>/apps/gwget2/view_total_size</applyto>
358 - <owner>gwget</owner>
359 - <type>bool</type>
360 - <default>true</default>
361 - <locale name="C">
362 - <short>View total size column</short>
363 - <long></long>
364 - </locale>
365 - </schema>
367 - <schema>
368 - <key>/schemas/apps/gwget2/network_mode</key>
369 - <applyto>/apps/gwget2/network_mode</applyto>
370 - <owner>gwget</owner>
371 - <type>string</type>
372 - <default>direct</default>
373 - <locale name="C">
374 - <short></short>
375 - <long></long>
376 - </locale>
377 - </schema>
379 - <schema>
380 - <key>/schemas/apps/gwget2/http_proxy</key>
381 - <applyto>/apps/gwget2/http_proxy</applyto>
382 - <owner>gwget</owner>
383 - <type>string</type>
384 - <default></default>
385 - <locale name="c">
386 - <short></short>
387 - <long></long>
388 - </locale>
389 - </schema>
391 - <schema>
392 - <key>/schemas/apps/gwget2/http_proxy_port</key>
393 - <applyto>/apps/gwget2/http_proxy_port</applyto>
394 - <owner>gwget</owner>
395 - <type>int</type>
396 - <default>8080</default>
397 - <locale name="c">
398 - <short></short>
399 - <long></long>
400 - </locale>
401 - </schema>
403 - <schema>
404 - <key>/schemas/apps/gwget2/proxy_uses_auth</key>
405 - <applyto>/apps/gwget2/proxy_uses_auth</applyto>
406 - <owner>gwget</owner>
407 - <type>bool</type>
408 - <default>false</default>
409 - <locale name="c">
410 - <short></short>
411 - <long></long>
412 - </locale>
413 - </schema>
415 - <schema>
416 - <key>/schemas/apps/gwget2/proxy_user</key>
417 - <applyto>/apps/gwget2/proxy_user</applyto>
418 - <owner>gwget</owner>
419 - <type>string</type>
420 - <default></default>
421 - <locale name="c">
422 - <short></short>
423 - <long></long>
424 - </locale>
425 - </schema>
427 - <schema>
428 - <key>/schemas/apps/gwget2/proxy_password</key>
429 - <applyto>/apps/gwget2/proxy_password</applyto>
430 - <owner>gwget</owner>
431 - <type>string</type>
432 - <default></default>
433 - <locale name="c">
434 - <short></short>
435 - <long></long>
436 - </locale>
437 - </schema>
439 - </schemalist>
440 -</gconfschemafile>
441 diff -Naur gwget-1.0.4.orig/data/Makefile.am gwget-1.0.4/data/Makefile.am
442 --- gwget-1.0.4.orig/data/Makefile.am 2009-08-14 19:55:48.000000000 +0200
443 +++ gwget-1.0.4/data/Makefile.am 2018-09-02 09:46:22.127182302 +0200
444 @@ -16,10 +16,8 @@
445 $(service_DATA): $(service_in_files) Makefile
446 @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
448 -schemasdir = $(GCONF_SCHEMA_FILE_DIR)
449 -schemas_in_files = gwget.schemas.in
450 -schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
451 -@INTLTOOL_SCHEMAS_RULE@
452 +gsettings_SCHEMAS = org.gwget.gschema.xml
453 +@GSETTINGS_RULES@
455 desktopdir = $(datadir)/applications
456 desktop_in_files = gwget.desktop.in.in
457 @@ -30,17 +28,10 @@
459 @INTLTOOL_DESKTOP_RULE@
461 -if GCONF_SCHEMAS_INSTALL
462 -install-data-local:
463 - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule gwget.schemas
464 -else
465 -install-data-local:
466 -endif
468 EXTRA_DIST = $(gwget_data_DATA) \
469 $(service_in_files) \
470 $(desktop_in_files) \
471 - $(schemas_in_files)
472 + $(gsettings_SCHEMAS)
474 DISTCLEANFILES = \
475 $(desktop_DATA)
476 diff -Naur gwget-1.0.4.orig/data/org.gwget.gschema.xml gwget-1.0.4/data/org.gwget.gschema.xml
477 --- gwget-1.0.4.orig/data/org.gwget.gschema.xml 1970-01-01 01:00:00.000000000 +0100
478 +++ gwget-1.0.4/data/org.gwget.gschema.xml 2018-09-02 11:44:17.589889148 +0200
479 @@ -0,0 +1,145 @@
480 +<schemalist>
481 + <schema id="org.gwget" path="/org/gwget2/">
482 + <key name="convert-links" type="b">
483 + <default>false</default>
484 + <summary>Convert Links</summary>
485 + <description>Convert to relative links in recursive mode.</description>
486 + </key>
487 + <key name="default-height" type="i">
488 + <default>200</default>
489 + </key>
490 + <key name="default-width" type="i">
491 + <default>250</default>
492 + </key>
493 + <key name="dl-page-requisites" type="b">
494 + <default>false</default>
495 + <summary>Download Page Requisites</summary>
496 + </key>
497 + <key name="download-dir" type="s">
498 + <default>''</default>
499 + <summary>Default Download Directory</summary>
500 + </key>
501 + <key name="ask-save-each-dl" type="b">
502 + <default>true</default>
503 + <summary>Ask where to save each new download</summary>
504 + <description>If true, always ask for a destination folder when starting a new download. If false, always save in the default directory without asking the user.</description>
505 + </key>
506 + <key name="follow-relative" type="b">
507 + <default>false</default>
508 + <summary>Follow relative links</summary>
509 + </key>
510 + <key name="limit-speed" type="b">
511 + <default>false</default>
512 + <summary>Limit maximum speed</summary>
513 + </key>
514 + <key name="limit-simultaneousdownloads" type="b">
515 + <default>false</default>
516 + <summary>Limit number of simultaneous downloads</summary>
517 + </key>
518 + <key name="max-depth" type="i">
519 + <default>0</default>
520 + <summary>Maximum depth in recursive mode</summary>
521 + </key>
522 + <key name="max-speed" type="i">
523 + <default>0</default>
524 + <summary>Maximum speed limit</summary>
525 + </key>
526 + <key name="max-simultaneousdownloads" type="i">
527 + <default>0</default>
528 + <summary>Maximum number of simultaneous downloads</summary>
529 + </key>
530 + <key name="n-downloads" type="i">
531 + <default>0</default>
532 + <summary>Number of downloads</summary>
533 + </key>
534 + <key name="no-create-directories" type="b">
535 + <default>false</default>
536 + </key>
537 + <key name="num-retries" type="i">
538 + <default>3</default>
539 + <summary>Number of retries</summary>
540 + </key>
541 + <key name="position-x" type="i">
542 + <default>0</default>
543 + </key>
544 + <key name="position-y" type="i">
545 + <default>0</default>
546 + </key>
547 + <key name="resume-at-start" type="b">
548 + <default>false</default>
549 + <summary>Resume downloads at startup</summary>
550 + </key>
551 + <key name="open-after-dl" type="b">
552 + <default>false</default>
553 + <summary>Open the file after download</summary>
554 + </key>
555 + <key name="view-actual-size" type="b">
556 + <default>true</default>
557 + </key>
558 + <key name="view-down-speed" type="b">
559 + <default>true</default>
560 + <summary>View download speed column</summary>
561 + </key>
562 + <key name="view-elapse-time" type="b">
563 + <default>false</default>
564 + <summary>View elapsed time column</summary>
565 + </key>
566 + <key name="view-percentage" type="b">
567 + <default>true</default>
568 + <summary>View percentage column</summary>
569 + </key>
570 + <key name="view-rem-time" type="b">
571 + <default>true</default>
572 + <summary>View remaining time column</summary>
573 + </key>
574 + <key name="view-toolbar" type="b">
575 + <default>true</default>
576 + <summary>View toolbar</summary>
577 + <description>Whether to display the toolbar.</description>
578 + </key>
579 + <key name="view-statusbar" type="b">
580 + <default>true</default>
581 + <summary>View statusbar</summary>
582 + <description>Whether to display the statusbar.</description>
583 + </key>
584 + <key name="view-total-size" type="b">
585 + <default>true</default>
586 + <summary>View total size column</summary>
587 + </key>
588 + <key name="network-mode" type="s">
589 + <default>'direct'</default>
590 + </key>
591 + <key name="http-proxy" type="s">
592 + <default>''</default>
593 + </key>
594 + <key name="http-proxy-port" type="i">
595 + <default>8080</default>
596 + </key>
597 + <key name="proxy-uses-auth" type="b">
598 + <default>false</default>
599 + </key>
600 + <key name="proxy-user" type="s">
601 + <default>''</default>
602 + </key>
603 + <key name="proxy-password" type="s">
604 + <default>''</default>
605 + </key>
606 + </schema>
607 + <schema id="org.gwget.download">
608 + <key name="url" type="s">
609 + <default>''</default>
610 + </key>
611 + <key name="dir" type="s">
612 + <default>''</default>
613 + </key>
614 + <key name="filename" type="s">
615 + <default>''</default>
616 + </key>
617 + <key name="state" type="i">
618 + <default>0</default>
619 + </key>
620 + <key name="file-size" type="s">
621 + <default>''</default>
622 + </key>
623 + </schema>
624 +</schemalist>
625 diff -Naur gwget-1.0.4.orig/src/gwget_data.c gwget-1.0.4/src/gwget_data.c
626 --- gwget-1.0.4.orig/src/gwget_data.c 2018-09-02 09:37:59.863423000 +0200
627 +++ gwget-1.0.4/src/gwget_data.c 2018-09-02 09:47:56.523025131 +0200
628 @@ -497,7 +497,7 @@
632 - * Update download list in gconf
633 + * Update download list in gsettings
635 gwget_remember_downloads();
637 diff -Naur gwget-1.0.4.orig/src/gwget_data.h gwget-1.0.4/src/gwget_data.h
638 --- gwget-1.0.4.orig/src/gwget_data.h 2018-09-02 09:37:59.863423000 +0200
639 +++ gwget-1.0.4/src/gwget_data.h 2018-09-02 11:51:39.469071743 +0200
640 @@ -51,7 +51,6 @@
641 gboolean view_down_speed;
642 gboolean view_toolbar;
643 gboolean view_statusbar;
644 - gboolean view_file_type;
645 gboolean docked;
646 gboolean limit_speed;
647 gboolean limit_simultaneousdownloads;
648 diff -Naur gwget-1.0.4.orig/src/main.c gwget-1.0.4/src/main.c
649 --- gwget-1.0.4.orig/src/main.c 2018-09-02 09:37:59.863423000 +0200
650 +++ gwget-1.0.4/src/main.c 2018-09-02 09:47:22.658808668 +0200
651 @@ -22,7 +22,6 @@
652 #include <glib/gi18n.h>
653 #include <gtk/gtk.h>
654 #include <string.h>
655 -#include <gconf/gconf-client.h>
656 #include <locale.h>
657 #include <gio/gio.h>
659 diff -Naur gwget-1.0.4.orig/src/main_window.c gwget-1.0.4/src/main_window.c
660 --- gwget-1.0.4.orig/src/main_window.c 2018-09-02 09:37:59.856756000 +0200
661 +++ gwget-1.0.4/src/main_window.c 2018-09-02 17:08:45.436630472 +0200
662 @@ -18,7 +18,6 @@
663 #include <stdlib.h>
664 #include <glib/gi18n.h>
665 #include <gtk/gtk.h>
666 -#include <gconf/gconf-client.h>
667 #include <glib/gstdio.h>
668 #include <string.h>
669 #include <sys/types.h>
670 @@ -42,12 +41,6 @@
671 static gboolean
672 gwget_destination_file_exists(GwgetData *data);
674 -static void
675 -gwget_gconf_notify_toolbar(GConfClient *client,
676 - guint cnxn_id,
677 - GConfEntry *entry,
678 - gpointer user_data);
680 static gboolean
681 view_selection_func (GtkTreeSelection *selection,
682 GtkTreeModel *model,
683 @@ -59,7 +52,7 @@
684 main_window(void)
686 GtkWidget * window = NULL;
687 - gchar *builder_file = NULL,*toolbar_setting;
688 + gchar *builder_file = NULL;
689 GtkWidget *treev,*toolbar,*menu_item, *combo;
690 GtkTreeSelection *select;
691 GError* error = NULL;
692 @@ -84,7 +77,7 @@
693 gtk_tree_selection_set_select_function(select, view_selection_func, NULL, NULL);
696 - * Update window size in gconf on resize
697 + * Update window size in gsettings on resize
699 g_signal_connect(GTK_WIDGET(window),
700 "configure-event",
701 @@ -94,14 +87,10 @@
702 /* add the columns titles to the tree view */
703 add_columns (GTK_TREE_VIEW (treev));
705 - gconf_client = gconf_client_get_default();
706 - gconf_client_add_dir (gconf_client,
707 - "/apps/gwget2",
708 - GCONF_CLIENT_PRELOAD_NONE,
709 - NULL);
710 + settings = g_settings_new("org.gwget");
712 /* gwget_pref.download_dir=NULL; */
713 - gwget_get_defaults_from_gconf();
714 + gwget_get_defaults_from_gsettings();
716 /* Drag and drop set up */
717 gtk_drag_dest_set(GTK_WIDGET(window),
718 @@ -115,36 +104,6 @@
719 G_CALLBACK(on_gwget_drag_received),
720 GUINT_TO_POINTER(dnd_type));
722 - /* Set the toolbar like gnome preferences */
723 - toolbar = GTK_WIDGET (gtk_builder_get_object(builder,"toolbar1"));
724 - toolbar_setting = gconf_client_get_string(gconf_client,"/desktop/gnome/interface/toolbar_style",NULL);
726 - if (toolbar_setting!=NULL) {
727 - if (!strcmp(toolbar_setting,"icons")) {
728 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_ICONS);
731 - if (!strcmp(toolbar_setting,"both")) {
732 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_BOTH);
735 - if (!strcmp(toolbar_setting,"both-horiz")) {
736 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_BOTH_HORIZ);
739 - if (!strcmp(toolbar_setting,"text")) {
740 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_TEXT);
744 - /* Listen to changes to the key. */
745 - gconf_client_notify_add (gconf_client,
746 - "/desktop/gnome/interface/toolbar_style",
747 - gwget_gconf_notify_toolbar,
748 - NULL,
749 - NULL,
750 - NULL);
752 /* Show the toolbar ? */
753 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM (gtk_builder_get_object(builder,"view_toolbar")),gwget_pref.view_toolbar);
754 toolbar = GTK_WIDGET (gtk_builder_get_object(builder,"toolbar1"));
755 @@ -228,90 +187,91 @@
758 void
759 -gwget_get_defaults_from_gconf(void)
760 +gwget_get_defaults_from_gsettings(void)
762 gint num_dl, i;
763 gint64 total_size;
764 GwgetData *data;
765 - gchar *key,*url,*dir,*name;
766 + gchar *path,*url,*dir,*name;
767 DlState state;
768 gint default_width, default_height;
769 - GError *error = NULL;
771 - gwget_pref.http_proxy=gconf_client_get_string(gconf_client,"/apps/gwget2/http_proxy",NULL);
772 - gwget_pref.http_proxy_port=gconf_client_get_int(gconf_client,"/apps/gwget2/http_proxy_port",NULL);
773 - gwget_pref.proxy_uses_auth=gconf_client_get_bool(gconf_client,"/apps/gwget2/proxy_uses_auth",NULL);
774 - gwget_pref.proxy_user=gconf_client_get_string(gconf_client,"/apps/gwget2/proxy_user",NULL);
775 - gwget_pref.proxy_password=gconf_client_get_string(gconf_client,"/apps/gwget2/proxy_password",NULL);
777 - gwget_pref.gnome_http_proxy=gconf_client_get_string(gconf_client,"/system/http_proxy/host",NULL);
778 - gwget_pref.gnome_http_proxy_port=gconf_client_get_int(gconf_client,"/system/http_proxy/port",NULL);
779 - gwget_pref.gnome_proxy_uses_auth=gconf_client_get_bool(gconf_client,"/system/http_proxy/use_authentication",NULL);
780 - gwget_pref.gnome_proxy_user=gconf_client_get_string(gconf_client,"/system/http_proxy/authentication_user",NULL);
781 - gwget_pref.gnome_proxy_password=gconf_client_get_string(gconf_client,"/system/http_proxy/authentication_password",NULL);
782 - gwget_pref.gnome_use_proxy=gconf_client_get_bool(gconf_client,"/system/http_proxy/use_http_proxy",NULL);
784 - gwget_pref.network_mode=gconf_client_get_string(gconf_client,"/apps/gwget2/network_mode",NULL);
785 - gwget_pref.download_dir=gconf_client_get_string(gconf_client,"/apps/gwget2/download_dir",NULL);
786 - gwget_pref.num_retries=gconf_client_get_int(gconf_client,"/apps/gwget2/num_retries",NULL);
787 - gwget_pref.resume_at_start=gconf_client_get_bool(gconf_client,"/apps/gwget2/resume_at_start",NULL);
788 - gwget_pref.open_after_dl=gconf_client_get_bool(gconf_client,"/apps/gwget2/open_after_dl",NULL);
789 - gwget_pref.no_create_directories=gconf_client_get_bool(gconf_client,"/apps/gwget2/no_create_directories",NULL);
790 - gwget_pref.follow_relative=gconf_client_get_bool(gconf_client,"/apps/gwget2/follow_relative",NULL);
791 - gwget_pref.convert_links = gconf_client_get_bool(gconf_client,"/apps/gwget2/convert_links",NULL);
792 - gwget_pref.dl_page_requisites = gconf_client_get_bool(gconf_client,"/apps/gwget2/dl_page_requisites",NULL);
793 - gwget_pref.max_depth=gconf_client_get_int(gconf_client,"/apps/gwget2/max_depth",NULL);
794 - gwget_pref.view_actual_size=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_actual_size",NULL);
795 - gwget_pref.view_total_size=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_total_size",NULL);
796 - gwget_pref.view_percentage=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_percentage",NULL);
797 - gwget_pref.view_elapse_time=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_elapse_time",NULL);
798 - gwget_pref.view_down_speed=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_down_speed",NULL);
799 - gwget_pref.view_toolbar=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_toolbar",NULL);
800 - gwget_pref.view_statusbar=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_statusbar",NULL);
801 - gwget_pref.view_file_type=gconf_client_get_bool(gconf_client,"/apps/gwget2/view_file_type",NULL);
802 - gwget_pref.limit_speed = gconf_client_get_bool (gconf_client,"/apps/gwget2/limit_speed", NULL);
803 - gwget_pref.max_speed=gconf_client_get_int(gconf_client,"/apps/gwget2/max_speed",NULL);
804 - gwget_pref.limit_simultaneousdownloads = gconf_client_get_bool (gconf_client,"/apps/gwget2/limit_simultaneousdownloads", NULL);
805 - gwget_pref.max_simultaneousdownloads=gconf_client_get_int(gconf_client,"/apps/gwget2/max_simultaneousdownloads",NULL);
806 - gwget_pref.ask_save_each_dl = gconf_client_get_bool (gconf_client,"/apps/gwget2/ask_save_each_dl", NULL);
807 + GSettingsSchemaSource *schema_source;
808 + GSettingsSchema *http_proxy_schema;
809 + GSettings *http_proxy_settings,*download_settings;
811 + gwget_pref.http_proxy=g_settings_get_string(settings,"http-proxy");
812 + gwget_pref.http_proxy_port=g_settings_get_int(settings,"http-proxy-port");
813 + gwget_pref.proxy_uses_auth=g_settings_get_boolean(settings,"proxy-uses-auth");
814 + gwget_pref.proxy_user=g_settings_get_string(settings,"proxy-user");
815 + gwget_pref.proxy_password=g_settings_get_string(settings,"proxy-password");
817 + schema_source=g_settings_schema_source_get_default();
818 + http_proxy_schema=g_settings_schema_source_lookup(schema_source,"org.gnome.system.proxy.http",FALSE);
820 + if (http_proxy_schema != NULL) {
821 + http_proxy_settings=g_settings_new("org.gnome.system.proxy.http");
822 + gwget_pref.gnome_http_proxy=g_settings_get_string(http_proxy_settings,"host");
823 + gwget_pref.gnome_http_proxy_port=g_settings_get_int(http_proxy_settings,"port");
824 + gwget_pref.gnome_proxy_uses_auth=g_settings_get_boolean(http_proxy_settings,"use-authentication");
825 + gwget_pref.gnome_proxy_user=g_settings_get_string(http_proxy_settings,"authentication-user");
826 + gwget_pref.gnome_proxy_password=g_settings_get_string(http_proxy_settings,"authentication-password");
827 + gwget_pref.gnome_use_proxy=g_settings_get_boolean(http_proxy_settings,"enabled");
828 + g_settings_schema_unref(http_proxy_schema);
831 + gwget_pref.network_mode=g_settings_get_string(settings,"network-mode");
832 + gwget_pref.download_dir=g_settings_get_string(settings,"download-dir");
833 + gwget_pref.num_retries=g_settings_get_int(settings,"num-retries");
834 + gwget_pref.resume_at_start=g_settings_get_boolean(settings,"resume-at-start");
835 + gwget_pref.open_after_dl=g_settings_get_boolean(settings,"open-after-dl");
836 + gwget_pref.no_create_directories=g_settings_get_boolean(settings,"no-create-directories");
837 + gwget_pref.follow_relative=g_settings_get_boolean(settings,"follow-relative");
838 + gwget_pref.convert_links = g_settings_get_boolean(settings,"convert-links");
839 + gwget_pref.dl_page_requisites = g_settings_get_boolean(settings,"dl-page-requisites");
840 + gwget_pref.max_depth=g_settings_get_int(settings,"max-depth");
841 + gwget_pref.view_actual_size=g_settings_get_boolean(settings,"view-actual-size");
842 + gwget_pref.view_total_size=g_settings_get_boolean(settings,"view-total-size");
843 + gwget_pref.view_percentage=g_settings_get_boolean(settings,"view-percentage");
844 + gwget_pref.view_elapse_time=g_settings_get_boolean(settings,"view-elapse-time");
845 + gwget_pref.view_down_speed=g_settings_get_boolean(settings,"view-down-speed");
846 + gwget_pref.view_toolbar=g_settings_get_boolean(settings,"view-toolbar");
847 + gwget_pref.view_statusbar=g_settings_get_boolean(settings,"view-statusbar");
848 + gwget_pref.limit_speed = g_settings_get_boolean(settings,"limit-speed");
849 + gwget_pref.max_speed=g_settings_get_int(settings,"max-speed");
850 + gwget_pref.limit_simultaneousdownloads = g_settings_get_boolean(settings,"limit-simultaneousdownloads");
851 + gwget_pref.max_simultaneousdownloads=g_settings_get_int(settings,"max-simultaneousdownloads");
852 + gwget_pref.ask_save_each_dl = g_settings_get_boolean(settings,"ask-save-each-dl");
854 if (!gwget_pref.download_dir) {
855 gwget_pref.download_dir = g_strdup(g_get_home_dir());
856 - gconf_client_set_string (gconf_client, "/apps/gwget2/download_dir", g_strdup(g_get_home_dir()), NULL);
857 + g_settings_set_string (settings, "download-dir", g_strdup(g_get_home_dir()));
860 if (!gwget_pref.network_mode) {
861 gwget_pref.network_mode = g_strdup("direct");
862 - gconf_client_set_string (gconf_client, "/apps/gwget2/network_mode", "direct", NULL);
863 + g_settings_set_string (settings, "network-mode", "direct");
866 /* Put in the list of save_in_paths (used by new dialog window) the initial download directory */
867 save_in_paths = g_list_append (save_in_paths, gwget_pref.download_dir);
869 - num_dl=gconf_client_get_int(gconf_client,"/apps/gwget2/n_downloads",NULL);
870 + num_dl=g_settings_get_int(settings,"n-downloads");
871 for (i=0;i<num_dl;i++) {
872 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/url",i);
873 - url=gconf_client_get_string(gconf_client,key,NULL);
874 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/dir",i);
875 - dir=gconf_client_get_string(gconf_client,key,NULL);
876 + path=g_strdup_printf("/org/gwget2/downloads-data/%d/",i);
877 + download_settings = g_settings_new_with_path("org.gwget.download", path);
878 + url=g_settings_get_string(download_settings,"url");
879 + dir=g_settings_get_string(download_settings,"dir");
881 if (url!=NULL) {
882 data=gwget_data_create(url,dir);
884 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/filename",i);
885 - name=gconf_client_get_string(gconf_client,key,NULL);
886 + name=g_settings_get_string(download_settings,"filename");
887 gwget_data_set_filename(data,name);
889 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/state",i);
890 - state=gconf_client_get_int(gconf_client,key,NULL);
891 + state=g_settings_get_int(download_settings,"state");
893 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/file_size",i);
894 - total_size = atoll(gconf_client_get_string (gconf_client, key, &error));
895 - if (!error) {
896 - gwget_data_set_total_size (data, total_size);
897 - } else {
898 - gwget_data_set_total_size (data, 0);
900 + total_size = atoll(g_settings_get_string (download_settings, "file-size"));
901 + gwget_data_set_total_size (data, total_size);
903 if ( state != DL_COMPLETED ) {
905 @@ -328,7 +288,7 @@
906 if ( !gwget_destination_file_exists(data) ) {
908 * We do not add download, the gwget_remember_downloads
909 - * call after the cycle will flush gconf
910 + * call after the cycle will flush gsettings
912 continue;
913 } else {
914 @@ -340,6 +300,8 @@
918 + g_object_unref (download_settings);
920 gwget_data_set_state_no_sync(data,DL_NOT_RUNNING);
921 if (gwget_pref.resume_at_start && data->state!=DL_COMPLETED) {
922 gwget_data_start_download(data);
923 @@ -351,21 +313,21 @@
927 - * We may have altered the download list so we sync gconf
928 + * We may have altered the download list so we sync gsettings
930 gwget_remember_downloads();
932 show_prefered_columns();
934 /* Default width and height */
935 - default_width=gconf_client_get_int (gconf_client,"/apps/gwget2/default_width",NULL);
936 - default_height=gconf_client_get_int (gconf_client,"/apps/gwget2/default_height",NULL);
937 + default_width=g_settings_get_int (settings,"default-width");
938 + default_height=g_settings_get_int (settings,"default-height");
939 gtk_window_resize (GTK_WINDOW (gtk_builder_get_object(builder,"main_window")),default_width,default_height);
941 /* Default position */
942 gtk_window_move(GTK_WINDOW(GTK_WIDGET (gtk_builder_get_object(builder,"main_window"))),
943 - gconf_client_get_int (gconf_client,"/apps/gwget2/position_x",NULL),
944 - gconf_client_get_int (gconf_client,"/apps/gwget2/position_y",NULL)
945 + g_settings_get_int (settings,"position-x"),
946 + g_settings_get_int (settings,"position-y")
950 @@ -585,40 +547,6 @@
954 -static void
955 -gwget_gconf_notify_toolbar(GConfClient *client,
956 - guint cnxn_id,
957 - GConfEntry *entry,
958 - gpointer user_data)
960 - GConfValue *value;
961 - GtkWidget *toolbar;
962 - gchar *toolbar_setting;
964 - value = gconf_entry_get_value (entry);
966 - toolbar = GTK_WIDGET (gtk_builder_get_object(builder,"toolbar1"));
967 - toolbar_setting = (gchar *)gconf_value_get_string(value);
969 - if (!strcmp(toolbar_setting,"icons")) {
970 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_ICONS);
973 - if (!strcmp(toolbar_setting,"both")) {
974 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_BOTH);
977 - if (!strcmp(toolbar_setting,"both-horiz")) {
978 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_BOTH_HORIZ);
981 - if (!strcmp(toolbar_setting,"text")) {
982 - gtk_toolbar_set_style(GTK_TOOLBAR(toolbar),GTK_TOOLBAR_TEXT);
985 - g_free(toolbar_setting);
988 static void
989 show_prefered_columns(void)
991 @@ -729,7 +657,6 @@
992 GtkWidget *main_window;
993 GtkAllocation allocation;
994 gint position_x,position_y;
995 - GConfChangeSet *cs;
997 main_window=GTK_WIDGET (gtk_builder_get_object(builder,"main_window"));
999 @@ -738,18 +665,13 @@
1001 /* Remember the size of the window */
1002 gtk_widget_get_allocation (main_window, &allocation);
1003 - cs = gconf_change_set_new ();
1004 - gconf_change_set_set_int (cs, "/apps/gwget2/default_height", allocation.height);
1005 - gconf_change_set_set_int (cs, "/apps/gwget2/default_width", allocation.width);
1006 + g_settings_set_int (settings, "default-height", allocation.height);
1007 + g_settings_set_int (settings, "default-width", allocation.width);
1009 /* Remember the position */
1010 gtk_window_get_position(GTK_WINDOW(main_window), &position_x, &position_y);
1011 - gconf_change_set_set_int (cs, "/apps/gwget2/position_x", position_x);
1012 - gconf_change_set_set_int (cs, "/apps/gwget2/position_y", position_y);
1014 - gconf_client_commit_change_set (gconf_client, cs, TRUE, NULL);
1016 - gconf_change_set_unref (cs);
1017 + g_settings_set_int (settings, "position-x", position_x);
1018 + g_settings_set_int (settings, "position-y", position_y);
1020 return FALSE;
1022 @@ -760,48 +682,40 @@
1023 gboolean
1024 gwget_remember_downloads(void)
1026 - gchar *url,*key;
1027 + gchar *url,*path;
1028 GwgetData *gwgetdata;
1029 GtkTreeIter iter;
1030 gint i,length;
1031 gboolean running = FALSE;
1032 gchar down_size[2048];
1033 + GSettings *download_settings;
1035 /* calculate the number of items in the treeview */
1036 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
1038 /* Save the number of current downloads in the treev */
1039 /* When load again we can known the number of directories to load */
1040 - gconf_client_set_int(gconf_client,"/apps/gwget2/n_downloads",length,NULL);
1041 + g_settings_set_int(settings,"n-downloads",length);
1043 gtk_tree_model_get_iter_first(model,&iter);
1044 - /* Save current downloads in GConf */
1045 + /* Save current downloads in GSettings */
1046 /* Calculate if there are any dl in retriving state */
1047 for (i=0;i<length;i++) {
1048 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
1049 gwgetdata=g_object_get_data(G_OBJECT(model),url);
1051 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d",i);
1052 - gconf_client_add_dir(gconf_client,
1053 - key,
1054 - GCONF_CLIENT_PRELOAD_NONE,
1055 - NULL);
1056 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/url",i);
1057 - gconf_client_set_string(gconf_client,key,gwgetdata->url,NULL);
1059 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/filename",i);
1060 - gconf_client_set_string(gconf_client,key,gwgetdata->filename,NULL);
1062 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/dir",i);
1063 - gconf_client_set_string(gconf_client,key,gwgetdata->dir,NULL);
1065 - key=g_strdup_printf("/apps/gwget2/downloads_data/%d/state",i);
1066 - gconf_client_set_int(gconf_client,key,gwgetdata->state,NULL);
1067 + path=g_strdup_printf("/org/gwget2/downloads-data/%d/",i);
1068 + download_settings = g_settings_new_with_path("org.gwget.download", path);
1070 + g_settings_set_string(download_settings,"url",gwgetdata->url);
1071 + g_settings_set_string(download_settings,"filename",gwgetdata->filename);
1072 + g_settings_set_string(download_settings,"dir",gwgetdata->dir);
1073 + g_settings_set_int(download_settings,"state",gwgetdata->state);
1075 - key=g_strdup_printf ("/apps/gwget2/downloads_data/%d/file_size",i);
1077 g_snprintf(down_size,2047, "%" G_GINT64_FORMAT,gwgetdata->total_size);
1078 - gconf_client_set_string (gconf_client,key,down_size,NULL);
1079 + g_settings_set_string(download_settings,"file-size",down_size);
1081 + g_object_unref (download_settings);
1083 if (gwgetdata->log_tag != -1)
1085 @@ -827,9 +741,11 @@
1086 _("There is at least one active download left. Really cancel all running transfers?"), _("No"), _("Yes"));
1087 if (response == GTK_RESPONSE_OK) {
1088 stop_all_downloads();
1089 + g_settings_sync();
1090 gtk_main_quit();
1092 } else {
1093 + g_settings_sync();
1094 gtk_main_quit();
1097 diff -Naur gwget-1.0.4.orig/src/main_window_cb.c gwget-1.0.4/src/main_window_cb.c
1098 --- gwget-1.0.4.orig/src/main_window_cb.c 2018-09-02 09:37:59.856756000 +0200
1099 +++ gwget-1.0.4/src/main_window_cb.c 2018-09-02 14:01:49.066804085 +0200
1100 @@ -18,7 +18,6 @@
1101 #include <stdlib.h>
1102 #include <glib/gi18n.h>
1103 #include <gtk/gtk.h>
1104 -#include <gconf/gconf-client.h>
1105 #include <signal.h>
1107 #include "main_window.h"
1108 @@ -422,53 +421,53 @@
1110 http_proxy=GTK_WIDGET (gtk_builder_get_object(builder_pref,"http_proxy_entry"));
1111 gwget_pref.http_proxy=g_strdup(gtk_entry_get_text(GTK_ENTRY(http_proxy)));
1112 - gconf_client_set_string(gconf_client,"/apps/gwget2/http_proxy",
1113 - g_strdup(gtk_entry_get_text(GTK_ENTRY(http_proxy))),NULL);
1114 + g_settings_set_string(settings,"http-proxy",
1115 + g_strdup(gtk_entry_get_text(GTK_ENTRY(http_proxy))));
1117 proxy_user=GTK_WIDGET (gtk_builder_get_object(builder_pref,"proxy_user"));
1118 gwget_pref.proxy_user=g_strdup(gtk_entry_get_text(GTK_ENTRY(proxy_user)));
1119 - gconf_client_set_string(gconf_client,"/apps/gwget2/proxy_user",
1120 - g_strdup(gtk_entry_get_text(GTK_ENTRY(proxy_user))),NULL);
1121 + g_settings_set_string(settings,"proxy-user",
1122 + g_strdup(gtk_entry_get_text(GTK_ENTRY(proxy_user))));
1124 proxy_password=GTK_WIDGET (gtk_builder_get_object(builder_pref,"proxy_password"));
1125 gwget_pref.proxy_password=g_strdup(gtk_entry_get_text(GTK_ENTRY(proxy_password)));
1126 - gconf_client_set_string(gconf_client,"/apps/gwget2/proxy_password",
1127 - g_strdup(gtk_entry_get_text(GTK_ENTRY(proxy_password))),NULL);
1128 + g_settings_set_string(settings,"proxy-password",
1129 + g_strdup(gtk_entry_get_text(GTK_ENTRY(proxy_password))));
1131 http_proxy_port_spin = GTK_WIDGET (gtk_builder_get_object (builder_pref, "http_proxy_port_spin"));
1132 gwget_pref.http_proxy_port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(http_proxy_port_spin));
1133 - gconf_client_set_int(gconf_client,"/apps/gwget2/http_proxy_port",
1134 - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(http_proxy_port_spin)),NULL);
1135 + g_settings_set_int(settings,"http-proxy-port",
1136 + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(http_proxy_port_spin)));
1138 proxy_uses_auth_radio=GTK_WIDGET (gtk_builder_get_object(builder_pref,"proxy_uses_auth_radio"));
1140 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (proxy_uses_auth_radio))) {
1141 - gconf_client_set_bool(gconf_client,"/apps/gwget2/network_mode",TRUE,NULL);
1142 + g_settings_set_boolean(settings,"network-mode",TRUE);
1143 gwget_pref.proxy_uses_auth=TRUE;
1146 manual_radio=GTK_WIDGET (gtk_builder_get_object(builder_pref,"manual_radio"));
1147 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(manual_radio))) {
1148 - gconf_client_set_string(gconf_client,"/apps/gwget2/network_mode","manual",NULL);
1149 + g_settings_set_string(settings,"network-mode","manual");
1150 gwget_pref.network_mode="manual";
1153 direct_radio=GTK_WIDGET (gtk_builder_get_object(builder_pref,"direct_radio"));
1154 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(direct_radio))) {
1155 - gconf_client_set_string(gconf_client,"/apps/gwget2/network_mode","direct",NULL);
1156 + g_settings_set_string(settings,"network-mode","direct");
1157 gwget_pref.network_mode="direct";
1160 default_radio=GTK_WIDGET (gtk_builder_get_object(builder_pref,"default_radio"));
1161 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(default_radio))) {
1162 - gconf_client_set_string(gconf_client,"/apps/gwget2/network_mode","default",NULL);
1163 + g_settings_set_string(settings,"network-mode","default");
1164 gwget_pref.network_mode="default";
1167 ask_each_dl = GTK_WIDGET (gtk_builder_get_object(builder_pref, "ask_save_each_dl_check"));
1168 gwget_pref.ask_save_each_dl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ask_each_dl));
1169 - gconf_client_set_bool(gconf_client, "/apps/gwget2/ask_save_each_dl",
1170 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ask_each_dl)), NULL);
1171 + g_settings_set_boolean(settings,"ask-save-each-dl",
1172 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ask_each_dl)));
1175 num_retries = GTK_WIDGET (gtk_builder_get_object(builder_pref,"num_retries_spin"));
1176 @@ -479,18 +478,18 @@
1178 open_after_dl = GTK_WIDGET (gtk_builder_get_object(builder_pref, "open_after_dl"));
1179 gwget_pref.open_after_dl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(open_after_dl));
1180 - gconf_client_set_bool(gconf_client, "/apps/gwget2/open_after_dl",
1181 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(open_after_dl)), NULL);
1182 + g_settings_set_boolean(settings,"open-after-dl",
1183 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(open_after_dl)));
1185 pref_window = GTK_WIDGET (gtk_builder_get_object(builder_pref,"pref_window"));
1186 gtk_widget_hide(pref_window);
1188 - gconf_client_set_string(gconf_client,"/apps/gwget2/download_dir",
1189 - g_strdup(gtk_entry_get_text(GTK_ENTRY(save_in))),NULL);
1190 - gconf_client_set_int(gconf_client,"/apps/gwget2/num_retries",
1191 - atoi(gtk_entry_get_text(GTK_ENTRY(num_retries))),NULL);
1192 - gconf_client_set_bool(gconf_client,"/apps/gwget2/resume_at_start",
1193 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resume)),NULL);
1194 + g_settings_set_string(settings,"download-dir",
1195 + g_strdup(gtk_entry_get_text(GTK_ENTRY(save_in))));
1196 + g_settings_set_int(settings,"num-retries",
1197 + atoi(gtk_entry_get_text(GTK_ENTRY(num_retries))));
1198 + g_settings_set_boolean(settings,"resume-at-start",
1199 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resume)));
1201 /* Limit Speed */
1202 limit_speed_check = GTK_WIDGET (gtk_builder_get_object (builder_pref, "limit_speed_check"));
1203 @@ -505,71 +504,71 @@
1204 inform_limit_speed_change();
1206 gwget_pref.limit_speed = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limit_speed_check));
1207 - gconf_client_set_bool(gconf_client,"/apps/gwget2/limit_speed",
1208 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limit_speed_check)),NULL);
1209 + g_settings_set_boolean(settings,"limit-speed",
1210 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limit_speed_check)));
1211 gwget_pref.max_speed = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(limit_speed_spin));
1212 - gconf_client_set_int(gconf_client,"/apps/gwget2/max_speed",
1213 - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(limit_speed_spin)),NULL);
1214 + g_settings_set_int(settings,"max-speed",
1215 + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(limit_speed_spin)));
1217 /* Limit Simultaneous downloads */
1218 limit_simultaneousdownloads_check = GTK_WIDGET (gtk_builder_get_object (builder_pref, "limit_simultaneousdownloads_check"));
1219 gwget_pref.limit_simultaneousdownloads = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limit_simultaneousdownloads_check));
1220 - gconf_client_set_bool(gconf_client,"/apps/gwget2/limit_simultaneousdownloads",
1221 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limit_simultaneousdownloads_check)),NULL);
1222 + g_settings_set_boolean(settings,"limit-simultaneousdownloads",
1223 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limit_simultaneousdownloads_check)));
1224 limit_simultaneousdownloads_spin = GTK_WIDGET (gtk_builder_get_object (builder_pref, "limit_simultaneousdownloads_spin"));
1225 gwget_pref.max_simultaneousdownloads = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(limit_simultaneousdownloads_spin));
1226 - gconf_client_set_int(gconf_client,"/apps/gwget2/max_simultaneousdownloads",
1227 - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(limit_simultaneousdownloads_spin)),NULL);
1228 + g_settings_set_int(settings,"max-simultaneousdownloads",
1229 + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(limit_simultaneousdownloads_spin)));
1231 /* Recursivity */
1232 no_create_directories = GTK_WIDGET (gtk_builder_get_object(builder_pref,"no_create_directories"));
1233 gwget_pref.no_create_directories = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(no_create_directories));
1234 - gconf_client_set_bool(gconf_client,"/apps/gwget2/no_create_directories",
1235 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(no_create_directories)),NULL);
1236 + g_settings_set_boolean(settings,"no-create-directories",
1237 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(no_create_directories)));
1239 /* Follow relative links only */
1240 follow_relative = GTK_WIDGET (gtk_builder_get_object(builder_pref,"follow_relative"));
1241 gwget_pref.follow_relative = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(follow_relative));
1242 - gconf_client_set_bool(gconf_client,"/apps/gwget2/follow_relative",gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(follow_relative)), NULL);
1243 + g_settings_set_boolean(settings,"follow-relative",gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(follow_relative)));
1245 /* Convert links */
1246 convert_links = GTK_WIDGET (gtk_builder_get_object(builder_pref,"convert_links"));
1247 gwget_pref.follow_relative = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(convert_links));
1248 - gconf_client_set_bool(gconf_client,"/apps/gwget2/convert_links",gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(convert_links)), NULL);
1249 + g_settings_set_boolean(settings,"convert-links",gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(convert_links)));
1250 /* Download page requisites */
1251 dl_page_requisites= GTK_WIDGET (gtk_builder_get_object(builder_pref,"dl_page_requisites"));
1252 gwget_pref.follow_relative = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dl_page_requisites));
1253 - gconf_client_set_bool(gconf_client,"/apps/gwget2/dl_page_requisites", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dl_page_requisites)), NULL);
1254 + g_settings_set_boolean(settings,"dl-page-requisites", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dl_page_requisites)));
1255 /* Max Depth */
1256 max_depth=GTK_WIDGET (gtk_builder_get_object(builder_pref,"max_depth"));
1257 gwget_pref.max_depth=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(max_depth));
1258 - gconf_client_set_int(gconf_client,"/apps/gwget2/max_depth",gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(max_depth)), NULL);
1259 + g_settings_set_int(settings,"max-depth",gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(max_depth)));
1261 /* Column listing */
1262 gwget_pref.view_actual_size=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_actual_size"))));
1263 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_actual_size",
1264 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_actual_size")))),NULL);
1265 + g_settings_set_boolean(settings,"view-actual-size",
1266 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_actual_size")))));
1268 gwget_pref.view_total_size=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_total_size"))));
1269 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_total_size",
1270 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_total_size")))),NULL);
1271 + g_settings_set_boolean(settings,"view-total-size",
1272 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_total_size")))));
1274 gwget_pref.view_percentage=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_percentage"))));
1275 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_percentage",
1276 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_percentage")))),NULL);
1277 + g_settings_set_boolean(settings,"view-percentage",
1278 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_percentage")))));
1281 gwget_pref.view_elapse_time=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_elapse_time"))));
1282 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_elapse_time",
1283 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_elapse_time")))),NULL);
1284 + g_settings_set_boolean(settings,"view-elapse-time",
1285 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_elapse_time")))));
1287 gwget_pref.view_rem_time=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_rem_time"))));
1288 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_rem_time",
1289 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_rem_time")))),NULL);
1290 + g_settings_set_boolean(settings,"view-rem-time",
1291 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_rem_time")))));
1293 gwget_pref.view_down_speed=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_down_speed"))));
1294 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_down_speed",
1295 - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_down_speed")))),NULL);
1296 + g_settings_set_boolean(settings,"view-down-speed",
1297 + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(GTK_WIDGET (gtk_builder_get_object(builder_pref,"check_down_speed")))));
1301 @@ -773,7 +772,7 @@
1302 } else {
1303 gtk_widget_show(GTK_WIDGET(toolbar));
1305 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_toolbar",state,NULL);
1306 + g_settings_set_boolean(settings,"view-toolbar",state);
1309 void
1310 @@ -792,7 +791,7 @@
1311 } else {
1312 gtk_widget_show(GTK_WIDGET(statusbar));
1314 - gconf_client_set_bool(gconf_client,"/apps/gwget2/view_statusbar",state,NULL);
1315 + g_settings_set_boolean(settings,"view-statusbar",state);
1318 void
1319 diff -Naur gwget-1.0.4.orig/src/main_window.h gwget-1.0.4/src/main_window.h
1320 --- gwget-1.0.4.orig/src/main_window.h 2009-08-14 19:19:51.000000000 +0200
1321 +++ gwget-1.0.4/src/main_window.h 2018-09-02 10:05:16.705190543 +0200
1322 @@ -17,7 +17,6 @@
1323 #ifndef _MAIN_WINDOW_H
1324 #define _MAIN_WINDOW_H
1326 -#include <gconf/gconf-client.h>
1327 #include <gtk/gtk.h>
1329 enum {
1330 @@ -70,8 +69,8 @@
1331 /* declared here for be used to add by main_window_cb */
1332 GtkTreeModel *model;
1334 -/* GConf Client */
1335 -GConfClient *gconf_client;
1336 +/* GSettings */
1337 +GSettings *settings;
1339 /* List of all current downloads */
1340 GList *downloads;
1341 @@ -81,7 +80,7 @@
1343 /* XML for the preferences gui */
1344 /* It's here because we must load it from main_window.c to put */
1345 -/* the options of the column list from Gconf on load */
1346 +/* the options of the column list from GSettings on load */
1347 GtkBuilder *builder_pref;
1349 /* List of introduced path in save in dialogs */
1350 @@ -94,7 +93,7 @@
1351 void on_main_window_delete_event(GtkWidget *widget, gpointer data);
1352 GtkTreeModel* create_model(void);
1353 void add_columns (GtkTreeView *treeview);
1354 -void gwget_get_defaults_from_gconf(void);
1355 +void gwget_get_defaults_from_gsettings(void);
1356 /* Drag received callback */
1357 void on_gwget_drag_received(GtkWidget * widget, GdkDragContext * context, int x,
1358 int y, GtkSelectionData * seldata, guint info,