1 diff -Naur gwget-1.0.4.orig/configure.ac gwget-1.0.4/configure.ac
2 --- gwget-1.0.4.orig/configure.ac 2014-12-19 00:00:13.449718000 +0100
3 +++ gwget-1.0.4/configure.ac 2014-12-19 01:45:42.784569280 +0100
9 + [AC_HELP_STRING([--enable-gtk3],
10 + [compile gwget against gtk+ 3.0 (default: yes)])],
11 + [enable_gtk3="${enableval}"],
15 +if test x"$enable_gtk3" = x"yes"; then
16 + GTK_API_VERSION="3.0"
18 + GTK_API_VERSION="2.0"
23 DBUS_GLIB_REQUIRED=0.33
26 -PKG_CHECK_MODULES(GNOME, gtk+-2.0 >= $GTK_REQUIRED
27 +PKG_CHECK_MODULES(GNOME, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
30 gio-unix-2.0 >= $GIO_REQUIRED)
31 diff -Naur gwget-1.0.4.orig/data/gwget.ui gwget-1.0.4/data/gwget.ui
32 --- gwget-1.0.4.orig/data/gwget.ui 2009-10-17 22:18:33.000000000 +0200
33 +++ gwget-1.0.4/data/gwget.ui 2014-12-19 00:15:18.775347588 +0100
35 <property name="resizable">False</property>
36 <property name="window_position">center-on-parent</property>
37 <property name="type_hint">normal</property>
38 - <property name="has_separator">False</property>
39 <child internal-child="vbox">
40 <object class="GtkVBox" id="dialog-vbox1">
41 <property name="visible">True</property>
43 <property name="visible">True</property>
44 <property name="spacing">6</property>
46 - <object class="GtkComboBoxEntry" id="save_in_comboboxentry">
47 + <object class="GtkComboBox" id="save_in_comboboxentry">
48 <property name="visible">True</property>
49 + <property name="has-entry">True</property>
52 <property name="position">0</property>
53 diff -Naur gwget-1.0.4.orig/po/POTFILES.in gwget-1.0.4/po/POTFILES.in
54 --- gwget-1.0.4.orig/po/POTFILES.in 2009-08-14 19:19:51.000000000 +0200
55 +++ gwget-1.0.4/po/POTFILES.in 2014-12-19 03:38:43.516402402 +0100
59 epiphany-extension/gwget.xml.in.in
60 -src/custom-cell-renderer-progressbar.c
64 diff -Naur gwget-1.0.4.orig/src/gwget_data.c gwget-1.0.4/src/gwget_data.c
65 --- gwget-1.0.4.orig/src/gwget_data.c 2009-08-14 19:19:51.000000000 +0200
66 +++ gwget-1.0.4/src/gwget_data.c 2014-12-19 01:12:21.445521846 +0100
69 gwgetdata->log_fd = pipe_fd[0];
70 fcntl (gwgetdata->log_fd, F_SETFL, O_NONBLOCK);
71 - gwgetdata->log_tag = gtk_timeout_add (1000,
72 - (GtkFunction) gwget_data_process_information,
73 + gwgetdata->log_tag = g_timeout_add (1000,
74 + (GSourceFunc)gwget_data_process_information,
79 kill (data->wget_pid, SIGKILL);
81 /* Remove callback that communicates with wget */
82 - gtk_timeout_remove (data->log_tag);
83 + g_source_remove (data->log_tag);
85 /* Wait the finish of wget */
86 child_pid = waitpid (data->wget_pid, &status, WUNTRACED);
87 diff -Naur gwget-1.0.4.orig/src/main_window.c gwget-1.0.4/src/main_window.c
88 --- gwget-1.0.4.orig/src/main_window.c 2014-12-19 00:00:13.449718000 +0100
89 +++ gwget-1.0.4/src/main_window.c 2014-12-19 03:36:32.706530494 +0100
91 #include "main_window.h"
92 #include "main_window_cb.h"
93 #include "gwget_data.h"
94 -#include "custom-cell-renderer-progressbar.h"
97 #include "new_window.h"
99 save_in_model = (GtkTreeModel*)gtk_list_store_new (1, G_TYPE_STRING);
100 combo = GTK_WIDGET (gtk_builder_get_object (builder, "save_in_comboboxentry"));
101 gtk_combo_box_set_model(GTK_COMBO_BOX(combo), save_in_model);
102 - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY(combo), 0);
103 - gtk_entry_set_text(GTK_ENTRY(GTK_BIN(combo)->child), gwget_pref.download_dir);
104 + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX(combo), 0);
105 + gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo))), gwget_pref.download_dir);
110 gtk_tree_view_append_column (treeview, column);
113 - renderer = ephy_cell_renderer_progress_new();
114 + renderer = gtk_cell_renderer_progress_new();
115 column = gtk_tree_view_column_new_with_attributes (_("Percentage"),
121 if (dnd_type==TARGET_URI_LIST) {
122 - uris = g_uri_list_extract_uris ((gchar *)seldata->data);
123 + uris = g_uri_list_extract_uris ((gchar *)gtk_selection_data_get_data(seldata));
124 for (i=0; uris[i] != NULL; i++) {
125 files = g_list_prepend (files, uris[i]);
128 file = g_list_first(files)->data;
130 } else if (dnd_type==TARGET_NETSCAPE_URL) {
131 - file=((gchar *) (seldata->data));
132 + file=((gchar *) (gtk_selection_data_get_data(seldata)));
135 gtk_drag_finish(context, FALSE, TRUE, time);
136 @@ -728,16 +727,20 @@
137 gwget_remember_window_size_and_position(void)
139 GtkWidget *main_window;
140 - GtkAllocation *allocation;
141 + GtkAllocation allocation;
142 gint position_x,position_y;
145 - /* Remember the size of the window */
146 main_window=GTK_WIDGET (gtk_builder_get_object(builder,"main_window"));
147 - allocation= &(GTK_WIDGET (main_window)->allocation);
149 + if (!gtk_widget_get_visible(main_window))
152 + /* Remember the size of the window */
153 + gtk_widget_get_allocation (main_window, &allocation);
154 cs = gconf_change_set_new ();
155 - gconf_change_set_set_int (cs, "/apps/gwget2/default_height", allocation->height);
156 - gconf_change_set_set_int (cs, "/apps/gwget2/default_width", allocation->width);
157 + gconf_change_set_set_int (cs, "/apps/gwget2/default_height", allocation.height);
158 + gconf_change_set_set_int (cs, "/apps/gwget2/default_width", allocation.width);
160 /* Remember the position */
161 gtk_window_get_position(GTK_WINDOW(main_window), &position_x, &position_y);
163 /* When load again we can known the number of directories to load */
164 gconf_client_set_int(gconf_client,"/apps/gwget2/n_downloads",length,NULL);
166 - gtk_tree_model_get_iter_root(model,&iter);
167 + gtk_tree_model_get_iter_first(model,&iter);
168 /* Save current downloads in GConf */
169 /* Calculate if there are any dl in retriving state */
170 for (i=0;i<length;i++) {
171 diff -Naur gwget-1.0.4.orig/src/main_window_cb.c gwget-1.0.4/src/main_window_cb.c
172 --- gwget-1.0.4.orig/src/main_window_cb.c 2014-12-19 00:00:13.449718000 +0100
173 +++ gwget-1.0.4/src/main_window_cb.c 2014-12-19 00:00:46.080477412 +0100
177 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
178 - gtk_tree_model_get_iter_root(model,&iter);
179 + gtk_tree_model_get_iter_first(model,&iter);
180 for (i=0;i<length;i++) {
181 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
182 gwgetdata=g_object_get_data(G_OBJECT(model),url);
186 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
187 - gtk_tree_model_get_iter_root(model,&iter);
188 + gtk_tree_model_get_iter_first(model,&iter);
189 for (i=0;i<length;i++) {
190 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
191 gwgetdata=g_object_get_data(G_OBJECT(model),url);
193 response = run_dialog(_("Remove completed"),_("Really remove completed downloads from the list?"), GTK_STOCK_CANCEL, _("Remove"));
194 if (response == GTK_RESPONSE_OK) {
195 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
196 - gtk_tree_model_get_iter_root(model,&iter);
197 + gtk_tree_model_get_iter_first(model,&iter);
198 for (i=0;i<length;i++) {
199 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
200 gwgetdata=g_object_get_data(G_OBJECT(model),url);
202 response = run_dialog(_("Remove inactive"),_("Really remove inactive downloads from the list?"), GTK_STOCK_CANCEL, _("Remove inactive"));
203 if (response == GTK_RESPONSE_OK) {
204 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
205 - gtk_tree_model_get_iter_root(model,&iter);
206 + gtk_tree_model_get_iter_first(model,&iter);
207 for (i=0;i<length;i++) {
208 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
209 gwgetdata=g_object_get_data(G_OBJECT(model),url);
211 response = run_dialog(_("Remove all"),_("Really remove all downloads from the list?"), GTK_STOCK_CANCEL, _("Remove all"));
212 if (response == GTK_RESPONSE_OK) {
213 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
214 - gtk_tree_model_get_iter_root(model,&iter);
215 + gtk_tree_model_get_iter_first(model,&iter);
216 for (i=0;i<length;i++) {
217 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
218 gwgetdata=g_object_get_data(G_OBJECT(model),url);
219 @@ -1106,7 +1106,7 @@
222 length = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model), NULL);
223 - gtk_tree_model_get_iter_root(model, &iter);
224 + gtk_tree_model_get_iter_first(model, &iter);
227 for (i=0;i<length;i++) {
228 @@ -1136,7 +1136,7 @@
231 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
232 - gtk_tree_model_get_iter_root(model,&iter);
233 + gtk_tree_model_get_iter_first(model,&iter);
234 for (i=0;i<length;i++) {
235 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
236 gwgetdata=g_object_get_data(G_OBJECT(model),url);
237 @@ -1233,7 +1233,7 @@
238 response = run_dialog (message, _("Really remove this download from the list?"), GTK_STOCK_CANCEL, _("Remove download"));
239 if (response == GTK_RESPONSE_OK) {
240 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
241 - gtk_tree_model_get_iter_root(model,&iter);
242 + gtk_tree_model_get_iter_first(model,&iter);
243 for (i=0;i<length;i++) {
244 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
245 if (gwgetdata==g_object_get_data(G_OBJECT(model),url)) {
246 diff -Naur gwget-1.0.4.orig/src/Makefile.am gwget-1.0.4/src/Makefile.am
247 --- gwget-1.0.4.orig/src/Makefile.am 2009-06-16 19:58:06.000000000 +0200
248 +++ gwget-1.0.4/src/Makefile.am 2014-12-19 03:38:28.989379757 +0100
253 - custom-cell-renderer-progressbar.c\
254 - custom-cell-renderer-progressbar.h\
258 diff -Naur gwget-1.0.4.orig/src/new_window.c gwget-1.0.4/src/new_window.c
259 --- gwget-1.0.4.orig/src/new_window.c 2014-12-19 00:00:13.449718000 +0100
260 +++ gwget-1.0.4/src/new_window.c 2014-12-19 03:03:59.146165898 +0100
263 window = GTK_WIDGET (gtk_builder_get_object(builder, "new_window"));
264 combo = GTK_WIDGET (gtk_builder_get_object (builder, "save_in_comboboxentry"));
265 - save_in_entry=GTK_ENTRY(GTK_BIN(combo)->child);
266 + save_in_entry=GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo)));
268 - url=g_strstrip((gchar *)(gtk_entry_get_text (GTK_ENTRY(GTK_WIDGET (gtk_builder_get_object(builder, "url_entry"))))));
269 + url=gtk_entry_get_text (GTK_ENTRY(GTK_WIDGET (gtk_builder_get_object(builder, "url_entry"))));
271 if (strcmp(url,"")) {
273 - save_in=g_strdup(gtk_combo_box_get_active_text (GTK_COMBO_BOX( GTK_WIDGET (gtk_builder_get_object(builder, "save_in_comboboxentry")))));
274 + url = g_strstrip(url);
277 + if (strcmp(url,"")) {
278 + save_in=g_strdup(gtk_entry_get_text (GTK_ENTRY(save_in_entry)));
280 if (!strcmp(save_in,"") && gwget_pref.download_dir) {
281 save_in=g_strdup(gwget_pref.download_dir);
285 combo = GTK_WIDGET (gtk_builder_get_object (builder, "save_in_comboboxentry"));
286 - save_in_entry=GTK_ENTRY(GTK_BIN(combo)->child);
287 + save_in_entry=GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo)));
289 if (gtk_dialog_run (GTK_DIALOG (filesel)) == GTK_RESPONSE_ACCEPT) {
291 diff -Naur gwget-1.0.4.orig/src/systray.c gwget-1.0.4/src/systray.c
292 --- gwget-1.0.4.orig/src/systray.c 2014-12-19 00:00:13.453051000 +0100
293 +++ gwget-1.0.4/src/systray.c 2014-12-19 00:00:42.077050940 +0100
296 item = gtk_image_menu_item_new_from_stock(GTK_STOCK_NEW, NULL);
297 gtk_menu_shell_append(GTK_MENU_SHELL(systray_menu), item);
298 - gtk_signal_connect (GTK_OBJECT (item), "activate",
299 - GTK_SIGNAL_FUNC(on_button_new_clicked),
301 + g_signal_connect (G_OBJECT (item), "activate",
302 + G_CALLBACK(on_button_new_clicked),
305 gtk_widget_show(item);
306 downloads_menu = GTK_MENU(gtk_menu_new());
307 @@ -131,23 +131,23 @@
309 item = gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES, NULL);
310 gtk_menu_shell_append(GTK_MENU_SHELL(systray_menu), item);
311 - gtk_signal_connect (GTK_OBJECT (item), "activate",
312 - GTK_SIGNAL_FUNC(on_boton_pref_clicked),
314 + g_signal_connect (G_OBJECT (item), "activate",
315 + G_CALLBACK(on_boton_pref_clicked),
318 item = gtk_separator_menu_item_new();
319 gtk_menu_shell_append(GTK_MENU_SHELL(systray_menu), item);
320 item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL);
321 gtk_menu_shell_append(GTK_MENU_SHELL(systray_menu), item);
322 - gtk_signal_connect (GTK_OBJECT (item), "activate",
323 - GTK_SIGNAL_FUNC(gwget_quit),
325 + g_signal_connect (G_OBJECT (item), "activate",
326 + G_CALLBACK(gwget_quit),
329 gtk_widget_show_all(GTK_WIDGET(systray_menu));
330 gtk_menu_popup(GTK_MENU(systray_menu), NULL, NULL, NULL, NULL, button, time);
333 - /* gtk_object_sink(GTK_OBJECT(menu)); */
334 + /* gtk_object_sink(G_OBJECT(menu)); */
341 window = GTK_WIDGET (gtk_builder_get_object(builder,"main_window"));
342 - if((gdk_window_get_state(GTK_WIDGET(window)->window) &
343 + if((gdk_window_get_state(gtk_widget_get_window(window)) &
344 GDK_WINDOW_STATE_ICONIFIED) ||
345 - !GTK_WIDGET_VISIBLE(window))
346 + !gtk_widget_get_visible(window))
347 gtk_window_present (GTK_WINDOW(window));
349 gtk_widget_hide (GTK_WIDGET(window));
350 diff -Naur gwget-1.0.4.orig/src/systray.h gwget-1.0.4/src/systray.h
351 --- gwget-1.0.4.orig/src/systray.h 2009-06-16 19:58:06.000000000 +0200
352 +++ gwget-1.0.4/src/systray.h 2014-12-19 03:27:45.803915153 +0100
357 +#if GTK_CHECK_VERSION(3, 0, 0)
358 +#include <gtk/gtkx.h>
360 #include <gtk/gtkplug.h>
362 #ifdef GDK_WINDOWING_X11
363 #include <gdk/gdkx.h>
365 diff -Naur gwget-1.0.4.orig/src/utils.c gwget-1.0.4/src/utils.c
366 --- gwget-1.0.4.orig/src/utils.c 2014-12-19 00:00:13.499719000 +0100
367 +++ gwget-1.0.4/src/utils.c 2014-12-19 00:00:48.227194020 +0100
371 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
372 - gtk_tree_model_get_iter_root(model,&iter);
373 + gtk_tree_model_get_iter_first(model,&iter);
374 for (i=0;i<length;i++) {
375 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
376 gwgetdata=g_object_get_data(G_OBJECT(model),url);
380 length=gtk_tree_model_iter_n_children(GTK_TREE_MODEL(model),NULL);
381 - gtk_tree_model_get_iter_root(model,&iter);
382 + gtk_tree_model_get_iter_first(model,&iter);
383 for (i=0;i<length;i++) {
384 gtk_tree_model_get (model, &iter, URL_COLUMN, &url, -1);
385 gwgetdata=g_object_get_data(G_OBJECT(model),url);