Merge lp:~kalikiana/midori/gtk2.24 into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6229
Merged at revision: 6228
Proposed branch: lp:~kalikiana/midori/gtk2.24
Merge into: lp:midori
Diff against target: 912 lines (+34/-390)
15 files modified
README (+1/-1)
extensions/adblock.c (+0/-9)
katze/gtk3-compat.h (+0/-34)
katze/katze-throbber.c (+0/-121)
midori/gtkiconentry.h (+0/-41)
midori/main.c (+0/-26)
midori/midori-browser.c (+0/-55)
midori/midori-locationaction.c (+13/-17)
midori/midori-platform.h (+0/-1)
midori/midori-searchaction.c (+8/-12)
midori/midori-speeddial.vala (+0/-17)
midori/midori-view.c (+0/-43)
midori/sokoke.c (+5/-6)
toolbars/midori-findbar.c (+6/-6)
wscript (+1/-1)
To merge this branch: bzr merge lp:~kalikiana/midori/gtk2.24
Reviewer Review Type Date Requested Status
gue5t gue5t Approve
Review via email: mp+170710@code.launchpad.net

Commit message

Bump GTK+ requirement to 2.24 and drop support for earlier versions

Description of the change

Bump GTK+ requirement to 2.24 and drop support for earlier versions

To post a comment you must log in.
Revision history for this message
gue5t gue5t (gue5t) wrote :

Mostly looks good, except:

403 + if (g_str_has_prefix (uri, "mailto:"))
404 + {
405 + gchar* newuri = NULL;
406 + if (!g_str_has_prefix (uri, "mailto:"))

The inner condition will never be true. I don't think the function should be interpreting "fuzzy" URIs anyhow--if we want it to accept "fuzzy" uris, I think we should reuse "stronger" existing functions for the purpose. Most likely though all the logic can simply be removed--we can put full URIs in the dialogs.

review: Needs Fixing
lp:~kalikiana/midori/gtk2.24 updated
6228. By Cris Dywan

Drop Gtk.AboutDialog::activate-link signal callback

The default works well enough.

6229. By Cris Dywan

Remove Gtk.IconEntry compatibility aliases

Revision history for this message
gue5t gue5t (gue5t) wrote :

Looks good now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2013-06-17 17:53:51 +0000
3+++ README 2013-06-21 20:53:25 +0000
4@@ -11,7 +11,7 @@
5 * Straightforward bookmark management.
6 * Customizable interface, extensions written in C and Vala.
7
8-Requirements: GLib 2.22, GTK+ 2.16, WebkitGTK+ 1.8.3, libXML2,
9+Requirements: GLib 2.22, GTK+ 2.24, WebkitGTK+ 1.8.3, libXML2,
10 libsoup 2.27.90, sqlite 3.0, Vala 0.14, libnotify
11
12 Optional: GTK+ 3.0, Unique 0.9, gcr, Granite 0.2, WebKit2GTK+ 1.11.91/ 2.0.0
13
14=== modified file 'extensions/adblock.c'
15--- extensions/adblock.c 2013-06-20 20:53:02 +0000
16+++ extensions/adblock.c 2013-06-21 20:53:25 +0000
17@@ -439,7 +439,6 @@
18 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
19 }
20
21-#if GTK_CHECK_VERSION (2, 18, 0)
22 static gboolean
23 adblock_activate_link_cb (GtkWidget* label,
24 const gchar* uri)
25@@ -449,7 +448,6 @@
26 midori_browser_set_current_tab (browser, view);
27 return TRUE;
28 }
29-#endif
30
31 static GtkWidget*
32 adblock_get_preferences_dialog (MidoriExtension* extension)
33@@ -512,17 +510,10 @@
34 "Type the address of a preconfigured filter list in the text entry "
35 "and click \"Add\" to add it to the list. "
36 "You can find more lists at %s."),
37- #if GTK_CHECK_VERSION (2, 18, 0)
38 "<a href=\"http://adblockplus.org/en/subscriptions\">adblockplus.org/en/subscriptions</a> "
39 "<a href=\"http://easylist.adblockplus.org/\">easylist.adblockplus.org</a>");
40- #else
41- "<u>http://adblockplus.org/en/subscriptions</u> "
42- "<u>http://easylist.adblockplus.org/</u>");
43- #endif
44- #if GTK_CHECK_VERSION (2, 18, 0)
45 g_signal_connect (button, "activate-link",
46 G_CALLBACK (adblock_activate_link_cb), NULL);
47- #endif
48 gtk_label_set_markup (GTK_LABEL (button), description);
49 g_free (description);
50 gtk_label_set_line_wrap (GTK_LABEL (button), TRUE);
51
52=== modified file 'katze/gtk3-compat.h'
53--- katze/gtk3-compat.h 2012-12-13 22:58:07 +0000
54+++ katze/gtk3-compat.h 2013-06-21 20:53:25 +0000
55@@ -50,31 +50,6 @@
56 #define g_format_size(sz) g_format_size_for_display ((goffset)sz)
57 #endif
58
59-#if !GTK_CHECK_VERSION (2, 18, 0)
60- #define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL (widget)
61- #define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget)
62- #define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE (widget)
63- #define gtk_widget_get_sensitive(widget) GTK_WIDGET_IS_SENSITIVE (widget)
64- #define gtk_widget_set_can_focus(widget,flag) \
65- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS)
66- #define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation
67- #define gtk_widget_get_has_window(wdgt) !GTK_WIDGET_NO_WINDOW (wdgt)
68- #define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation
69- #define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw
70- #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
71- #define gtk_widget_get_drawable GTK_WIDGET_VISIBLE
72- #define gtk_widget_set_has_window(wdgt, wnd) \
73- if (wnd) GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_NO_WINDOW); \
74- else GTK_WIDGET_SET_FLAGS (wdgt, GTK_NO_WINDOW)
75-#endif
76-
77-#if !GTK_CHECK_VERSION (2, 20, 0)
78- #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED (widget)
79- #define gtk_widget_set_realized(wdgt, real) \
80- if (real) GTK_WIDGET_SET_FLAGS (wdgt, GTK_REALIZED); \
81- else GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_REALIZED)
82-#endif
83-
84 #if GTK_CHECK_VERSION (3, 0, 0)
85 #define GTK_DIALOG_NO_SEPARATOR 0
86 #endif
87@@ -84,15 +59,6 @@
88 const gchar* gtk_entry_get_placeholder_text (GtkEntry* entry);
89 #endif
90
91-#if !GTK_CHECK_VERSION (2, 24 ,0)
92- #define gtk_combo_box_text_append_text gtk_combo_box_append_text
93- #define gtk_combo_box_text_new gtk_combo_box_new_text
94- #define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text
95- #define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
96- #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
97- #define GtkComboBoxText GtkComboBox
98-#endif
99-
100 #ifndef GDK_KEY_Return
101 #define GDK_KEY_0 GDK_0
102 #define GDK_KEY_BackSpace GDK_BackSpace
103
104=== modified file 'katze/katze-throbber.c'
105--- katze/katze-throbber.c 2013-04-01 14:21:39 +0000
106+++ katze/katze-throbber.c 2013-06-21 20:53:25 +0000
107@@ -16,16 +16,9 @@
108 #include <glib/gi18n.h>
109 #include <math.h>
110
111-#define HAVE_SPINNER GTK_CHECK_VERSION (2, 20, 0)
112-
113 struct _KatzeThrobber
114 {
115- #if HAVE_SPINNER
116 GtkSpinner parent_instance;
117- #else
118- GtkMisc parent_instance;
119- #endif
120-
121 GtkIconSize icon_size;
122 gchar* icon_name;
123 GdkPixbuf* pixbuf;
124@@ -43,18 +36,10 @@
125
126 struct _KatzeThrobberClass
127 {
128- #if HAVE_SPINNER
129 GtkSpinnerClass parent_class;
130- #else
131- GtkMiscClass parent_class;
132- #endif
133 };
134
135-#if HAVE_SPINNER
136 G_DEFINE_TYPE (KatzeThrobber, katze_throbber, GTK_TYPE_SPINNER);
137-#else
138-G_DEFINE_TYPE (KatzeThrobber, katze_throbber, GTK_TYPE_MISC);
139-#endif
140
141 enum
142 {
143@@ -136,14 +121,6 @@
144 static void
145 icon_theme_changed (KatzeThrobber* throbber);
146
147-#if !HAVE_SPINNER
148-static gboolean
149-katze_throbber_timeout (KatzeThrobber* throbber);
150-
151-static void
152-katze_throbber_timeout_destroy (KatzeThrobber* throbber);
153-#endif
154-
155 static void
156 katze_throbber_class_init (KatzeThrobberClass* class)
157 {
158@@ -251,9 +228,6 @@
159 katze_throbber_init (KatzeThrobber *throbber)
160 {
161 gtk_widget_set_has_window (GTK_WIDGET (throbber), FALSE);
162- #if !HAVE_SPINNER
163- gtk_misc_set_alignment (GTK_MISC (throbber), 0.0, 0.5);
164- #endif
165
166 throbber->timer_id = -1;
167 }
168@@ -486,14 +460,7 @@
169
170 throbber->animated = animated;
171
172- #if HAVE_SPINNER
173 g_object_set (throbber, "active", animated, NULL);
174- #else
175- if (animated && (throbber->timer_id < 0))
176- throbber->timer_id = midori_timeout_add (50,
177- (GSourceFunc)katze_throbber_timeout, throbber,
178- (GDestroyNotify)katze_throbber_timeout_destroy);
179- #endif
180 gtk_widget_queue_draw (GTK_WIDGET (throbber));
181
182 g_object_notify (G_OBJECT (throbber), "animated");
183@@ -797,24 +764,6 @@
184 GTK_WIDGET_CLASS (katze_throbber_parent_class)->unmap (widget);
185 }
186
187-#if !HAVE_SPINNER
188-static gboolean
189-katze_throbber_timeout (KatzeThrobber* throbber)
190-{
191- throbber->index++;
192- gtk_widget_queue_draw (GTK_WIDGET (throbber));
193-
194- return throbber->animated;
195-}
196-
197-static void
198-katze_throbber_timeout_destroy (KatzeThrobber* throbber)
199-{
200- throbber->index = 0;
201- throbber->timer_id = -1;
202-}
203-#endif
204-
205 static void
206 katze_throbber_style_set (GtkWidget* widget,
207 GtkStyle* prev_style)
208@@ -888,16 +837,9 @@
209 GtkAllocation allocation;
210 GtkRequisition requisition;
211
212- #if HAVE_SPINNER
213 xalign = 0.0;
214 yalign = 0.5;
215 xpad = ypad = 0.0;
216- #else
217- gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign);
218- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
219- xalign = 1.0f - xalign;
220- gtk_misc_get_padding (GTK_MISC (widget), &xpad, &ypad);
221- #endif
222
223 #if GTK_CHECK_VERSION (3, 0, 0)
224 allocation.x = allocation.y = 0;
225@@ -978,75 +920,12 @@
226 }
227 else
228 {
229- #if HAVE_SPINNER
230 if (throbber->animated)
231 #if GTK_CHECK_VERSION (3, 0, 0)
232 return GTK_WIDGET_CLASS (katze_throbber_parent_class)->draw (widget, cr);
233 #else
234 return GTK_WIDGET_CLASS (katze_throbber_parent_class)->expose_event (widget, event);
235 #endif
236- #else
237- gint cols, rows;
238-
239- if (G_UNLIKELY (throbber->icon_name && !throbber->pixbuf))
240- {
241- icon_theme_changed (KATZE_THROBBER (widget));
242-
243- if (!throbber->pixbuf)
244- {
245- /* Fallback to a stock icon */
246- katze_assign (throbber->icon_name, g_strdup (GTK_STOCK_EXECUTE));
247- g_object_notify (G_OBJECT (throbber), "icon-name");
248- return TRUE;
249- }
250- }
251-
252- cols = gdk_pixbuf_get_width (throbber->pixbuf) / throbber->width;
253- rows = gdk_pixbuf_get_height (throbber->pixbuf) / throbber->height;
254-
255- if (G_UNLIKELY (cols == 1 && cols == rows))
256- {
257- katze_throbber_aligned_coords (widget, &ax, &ay);
258-
259- if (throbber->animated)
260- gdk_draw_pixbuf (event->window, NULL, throbber->pixbuf,
261- 0, 0, ax, ay,
262- throbber->width, throbber->height,
263- GDK_RGB_DITHER_NONE, 0, 0);
264- return TRUE;
265- }
266-
267- if (G_LIKELY (cols > 0 && rows > 0))
268- {
269- gint idx;
270- guint x, y;
271-
272- katze_throbber_aligned_coords (widget, &ax, &ay);
273-
274- idx = throbber->index % (cols * rows);
275- if (G_LIKELY (throbber->timer_id >= 0))
276- idx = MAX (idx, 1);
277-
278- x = (idx % cols) * throbber->width;
279- y = (idx / cols) * throbber->height;
280-
281- gdk_draw_pixbuf (event->window, NULL, throbber->pixbuf,
282- x, y, ax, ay,
283- throbber->width, throbber->height,
284- GDK_RGB_DITHER_NONE, 0, 0);
285- }
286- else
287- {
288- g_warning (_("Animation frames are broken"));
289- katze_assign (throbber->icon_name, NULL);
290- katze_object_assign (throbber->pixbuf, NULL);
291-
292- g_object_freeze_notify (G_OBJECT (throbber));
293- g_object_notify (G_OBJECT (throbber), "icon-name");
294- g_object_notify (G_OBJECT (throbber), "pixbuf");
295- g_object_thaw_notify (G_OBJECT (throbber));
296- }
297- #endif
298 }
299
300 return TRUE;
301
302=== removed file 'midori/gtkiconentry.h'
303--- midori/gtkiconentry.h 2012-11-18 15:48:46 +0000
304+++ midori/gtkiconentry.h 1970-01-01 00:00:00 +0000
305@@ -1,41 +0,0 @@
306-/*
307- * Copyright (C) 2004-2006 Christian Hammond.
308- * Copyright (C) 2008 Cody Russell <bratsche@gnome.org>
309- *
310- * This library is free software; you can redistribute it and/or
311- * modify it under the terms of the GNU Lesser General Public
312- * License as published by the Free Software Foundation; either
313- * version 2 of the License, or (at your option) any later version.
314- *
315- * This library is distributed in the hope that it will be useful,
316- * but WITHOUT ANY WARRANTY; without even the implied warranty of
317- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
318- * Lesser General Public License for more details.
319- *
320- * You should have received a copy of the GNU Lesser General Public
321- * License along with this library; if not, write to the
322- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
323- * Boston, MA 02111-1307, USA.
324- */
325-
326-#ifndef __GTK_ICON_ENTRY_H__
327-#define __GTK_ICON_ENTRY_H__
328-
329-#include <gio/gio.h>
330-#include <gtk/gtk.h>
331-
332-G_BEGIN_DECLS
333-
334- #define GtkIconEntryPosition GtkEntryIconPosition
335- #define GTK_ICON_ENTRY_PRIMARY GTK_ENTRY_ICON_PRIMARY
336- #define GTK_ICON_ENTRY_SECONDARY GTK_ENTRY_ICON_SECONDARY
337- #define GTK_ICON_ENTRY GTK_ENTRY
338- #define gtk_icon_entry_set_icon_from_stock gtk_entry_set_icon_from_stock
339- #define gtk_icon_entry_set_icon_from_icon_name gtk_entry_set_icon_from_icon_name
340-
341- #define gtk_icon_entry_set_tooltip gtk_entry_set_icon_tooltip_text
342- #define gtk_icon_entry_set_icon_highlight gtk_entry_set_icon_activatable
343-
344-G_END_DECLS
345-
346-#endif /* __GTK_ICON_ENTRY_H__ */
347
348=== modified file 'midori/main.c'
349--- midori/main.c 2013-05-23 21:10:22 +0000
350+++ midori/main.c 2013-06-21 20:53:25 +0000
351@@ -39,36 +39,16 @@
352 g_free (uri);
353 }
354
355-#define HAVE_OFFSCREEN GTK_CHECK_VERSION (2, 20, 0)
356-
357 #ifndef HAVE_WEBKIT2
358 static void
359 snapshot_load_finished_cb (GtkWidget* web_view,
360 WebKitWebFrame* web_frame,
361 gchar* filename)
362 {
363- #if HAVE_OFFSCREEN
364 GdkPixbuf* pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (
365 gtk_widget_get_parent (web_view)));
366 gdk_pixbuf_save (pixbuf, filename, "png", NULL, "compression", "7", NULL);
367 g_object_unref (pixbuf);
368- #else
369- GError* error;
370- GtkPrintOperation* operation = gtk_print_operation_new ();
371-
372- gtk_print_operation_set_export_filename (operation, filename);
373- error = NULL;
374- webkit_web_frame_print_full (web_frame, operation,
375- GTK_PRINT_OPERATION_ACTION_EXPORT, &error);
376-
377- if (error != NULL)
378- {
379- g_error ("%s", error->message);
380- gtk_main_quit ();
381- }
382-
383- g_object_unref (operation);
384- #endif
385 g_print (_("Snapshot saved to: %s\n"), filename);
386 gtk_main_quit ();
387 }
388@@ -268,14 +248,10 @@
389 gchar* filename;
390 GtkWidget* web_view;
391 gchar* uri;
392- #if HAVE_OFFSCREEN
393 GtkWidget* offscreen;
394 GdkScreen* screen;
395
396 gint fd = g_file_open_tmp ("snapshot-XXXXXX.png", &filename, &error);
397- #else
398- gint fd = g_file_open_tmp ("snapshot-XXXXXX.pdf", &filename, &error);
399- #endif
400 close (fd);
401
402 if (error)
403@@ -291,7 +267,6 @@
404 }
405
406 web_view = webkit_web_view_new ();
407- #if HAVE_OFFSCREEN
408 offscreen = gtk_offscreen_window_new ();
409 gtk_container_add (GTK_CONTAINER (offscreen), web_view);
410 if ((screen = gdk_screen_get_default ()))
411@@ -300,7 +275,6 @@
412 else
413 gtk_widget_set_size_request (web_view, 800, 600);
414 gtk_widget_show_all (offscreen);
415- #endif
416 #ifndef HAVE_WEBKIT2
417 g_signal_connect (web_view, "load-finished",
418 G_CALLBACK (snapshot_load_finished_cb), filename);
419
420=== modified file 'midori/midori-browser.c'
421--- midori/midori-browser.c 2013-06-21 19:21:07 +0000
422+++ midori/midori-browser.c 2013-06-21 20:53:25 +0000
423@@ -997,11 +997,7 @@
424 if (!is_folder)
425 {
426 entry_uri = katze_uri_entry_new (
427- #if GTK_CHECK_VERSION (2, 20, 0)
428 gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT));
429- #else
430- NULL);
431- #endif
432 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
433 gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));
434 gtk_box_pack_start (GTK_BOX (vbox), entry_uri, FALSE, FALSE, 0);
435@@ -4689,32 +4685,6 @@
436 static const gchar* credits_artists[] =
437 { "Nancy Runge <nancy@twotoasts.de>", NULL };
438
439-#if !GTK_CHECK_VERSION (2, 24, 0)
440-static void
441-_action_about_activate_link (GtkAboutDialog* about,
442- const gchar* uri,
443- gpointer user_data)
444-{
445- MidoriBrowser* browser = MIDORI_BROWSER (user_data);
446- GtkWidget* view = midori_browser_add_uri (browser, uri);
447- midori_browser_set_current_tab (browser, view);
448-}
449-
450-static void
451-_action_about_activate_email (GtkAboutDialog* about,
452- const gchar* uri,
453- gpointer user_data)
454-{
455- /* Some email clients need the 'mailto' to function properly */
456- gchar* newuri = NULL;
457- if (!g_str_has_prefix (uri, "mailto:"))
458- newuri = g_strconcat ("mailto:", uri, NULL);
459-
460- sokoke_show_uri (NULL, newuri ? newuri : uri, GDK_CURRENT_TIME, NULL);
461- g_free (newuri);
462-}
463-#endif
464-
465 static gchar*
466 midori_browser_get_docs (gboolean error)
467 {
468@@ -4748,10 +4718,6 @@
469 "License as published by the Free Software Foundation; either "
470 "version 2.1 of the License, or (at your option) any later version.");
471
472-#if !GTK_CHECK_VERSION (2, 24, 0)
473- gtk_about_dialog_set_email_hook (_action_about_activate_email, NULL, NULL);
474- gtk_about_dialog_set_url_hook (_action_about_activate_link, browser, NULL);
475-#endif
476 #ifdef HAVE_GRANITE
477 gchar* docs = midori_browser_get_docs (FALSE);
478 /* Avoid granite_widgets_show_about_dialog for invalid memory and crashes */
479@@ -6358,29 +6324,8 @@
480
481 /* Statusbar */
482 browser->statusbar = gtk_statusbar_new ();
483- #if GTK_CHECK_VERSION (2, 20, 0)
484 browser->statusbar_contents =
485 gtk_statusbar_get_message_area (GTK_STATUSBAR (browser->statusbar));
486- #else
487- /* Rearrange the statusbar packing. This is necessariy to keep
488- themes happy while there is no support from GtkStatusbar. */
489- forward = GTK_STATUSBAR (browser->statusbar)->label;
490- if (GTK_IS_BOX (gtk_widget_get_parent (forward)))
491- browser->statusbar_contents = gtk_widget_get_parent (forward);
492- else
493- {
494- browser->statusbar_contents = gtk_hbox_new (FALSE, 4);
495- gtk_widget_show (browser->statusbar_contents);
496- g_object_ref (GTK_STATUSBAR (browser->statusbar)->label);
497- gtk_container_remove (
498- GTK_CONTAINER (GTK_STATUSBAR (browser->statusbar)->frame), forward);
499- gtk_box_pack_start (GTK_BOX (browser->statusbar_contents),
500- forward, TRUE, TRUE, 0);
501- g_object_unref (forward);
502- gtk_container_add (GTK_CONTAINER (GTK_STATUSBAR (browser->statusbar)->frame),
503- browser->statusbar_contents);
504- }
505- #endif
506 gtk_box_pack_start (GTK_BOX (vbox), browser->statusbar, FALSE, FALSE, 0);
507
508 g_signal_connect (browser->statusbar, "button-press-event",
509
510=== modified file 'midori/midori-locationaction.c'
511--- midori/midori-locationaction.c 2013-05-21 16:08:19 +0000
512+++ midori/midori-locationaction.c 2013-06-21 20:53:25 +0000
513@@ -945,10 +945,10 @@
514 #if GTK_CHECK_VERSION (3, 6, 0)
515 gtk_entry_set_input_purpose (GTK_ENTRY (entry), GTK_INPUT_PURPOSE_URL);
516 #endif
517- gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
518- GTK_ICON_ENTRY_PRIMARY, TRUE);
519- gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
520- GTK_ICON_ENTRY_SECONDARY, TRUE);
521+ gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
522+ GTK_ENTRY_ICON_PRIMARY, TRUE);
523+ gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
524+ GTK_ENTRY_ICON_SECONDARY, TRUE);
525
526 targetlist = gtk_target_list_new (NULL, 0);
527 gtk_target_list_add_uri_targets (targetlist, 0);
528@@ -1235,7 +1235,6 @@
529 return FALSE;
530 }
531
532-#if GTK_CHECK_VERSION (2, 19, 3)
533 static void
534 midori_location_action_preedit_changed_cb (GtkWidget* entry,
535 const gchar* preedit,
536@@ -1245,7 +1244,6 @@
537 gchar* key = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
538 midori_location_action_popup_completion (location_action, entry, key);
539 }
540-#endif
541
542 static gboolean
543 midori_location_action_focus_in_event_cb (GtkWidget* widget,
544@@ -1450,10 +1448,10 @@
545 /* The dialog should "toggle" like a menu, as far as users go
546 FIXME: Half-working: the dialog closes but re-opens */
547 static GtkWidget* dialog = NULL;
548- if (icon_pos == GTK_ICON_ENTRY_PRIMARY && dialog != NULL)
549+ if (icon_pos == GTK_ENTRY_ICON_PRIMARY && dialog != NULL)
550 gtk_widget_destroy (dialog);
551
552- if (icon_pos == GTK_ICON_ENTRY_PRIMARY)
553+ if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
554 {
555 /* No "security" window for blank pages */
556 if (midori_uri_is_blank (MIDORI_LOCATION_ACTION (action)->text))
557@@ -1501,7 +1499,7 @@
558 g_signal_connect (dialog, "destroy", G_CALLBACK (gtk_widget_destroyed), &dialog);
559 gtk_widget_show_all (dialog);
560 }
561- if (icon_pos == GTK_ICON_ENTRY_SECONDARY)
562+ if (icon_pos == GTK_ENTRY_ICON_SECONDARY)
563 {
564 gboolean result;
565 g_signal_emit (action, signals[SECONDARY_ICON_RELEASED], 0,
566@@ -1578,10 +1576,8 @@
567 midori_location_action_button_press_event_cb, action,
568 "signal::key-press-event",
569 midori_location_action_key_press_event_cb, action,
570- #if GTK_CHECK_VERSION (2, 19, 3)
571 "signal-after::preedit-changed",
572 midori_location_action_preedit_changed_cb, action,
573- #endif
574 "signal::focus-in-event",
575 midori_location_action_focus_in_event_cb, action,
576 "signal::focus-out-event",
577@@ -1735,11 +1731,11 @@
578 {
579 GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
580 if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
581- gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
582- GTK_ICON_ENTRY_SECONDARY, stock_id);
583+ gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
584+ GTK_ENTRY_ICON_SECONDARY, stock_id);
585 else
586- gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
587- GTK_ICON_ENTRY_SECONDARY, stock_id);
588+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
589+ GTK_ENTRY_ICON_SECONDARY, stock_id);
590 }
591 }
592
593@@ -1768,8 +1764,8 @@
594 if (GTK_IS_TOOL_ITEM (proxies->data))
595 {
596 GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
597- gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ICON_ENTRY_PRIMARY, icon);
598- gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (entry), GTK_ICON_ENTRY_PRIMARY, tooltip);
599+ gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, icon);
600+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, tooltip);
601 }
602 }
603
604
605=== modified file 'midori/midori-platform.h'
606--- midori/midori-platform.h 2013-05-19 09:33:02 +0000
607+++ midori/midori-platform.h 2013-06-21 20:53:25 +0000
608@@ -14,7 +14,6 @@
609
610 #include "midori/midori-stock.h"
611 #include "katze/gtk3-compat.h"
612-#include "midori/gtkiconentry.h"
613 #include "midori/sokoke.h"
614
615 /* Common behavior modifiers */
616
617=== modified file 'midori/midori-searchaction.c'
618--- midori/midori-searchaction.c 2013-06-19 20:27:53 +0000
619+++ midori/midori-searchaction.c 2013-06-21 20:53:25 +0000
620@@ -312,8 +312,8 @@
621
622 toolitem = GTK_WIDGET (gtk_tool_item_new ());
623 entry = sokoke_search_entry_new (NULL);
624- gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
625- GTK_ICON_ENTRY_PRIMARY, TRUE);
626+ gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
627+ GTK_ENTRY_ICON_PRIMARY, TRUE);
628 alignment = gtk_alignment_new (0, 0.5, 1, 0.1);
629 gtk_container_add (GTK_CONTAINER (alignment), entry);
630 gtk_widget_show (entry);
631@@ -402,7 +402,7 @@
632
633 static void
634 midori_search_action_icon_released_cb (GtkWidget* entry,
635- GtkIconEntryPosition icon_pos,
636+ GtkEntryIconPosition icon_pos,
637 gint button,
638 GtkAction* action)
639 {
640@@ -413,7 +413,7 @@
641 GdkPixbuf* icon;
642 GtkWidget* image;
643
644- if (icon_pos == GTK_ICON_ENTRY_SECONDARY)
645+ if (icon_pos == GTK_ENTRY_ICON_SECONDARY)
646 return;
647
648 search_engines = MIDORI_SEARCH_ACTION (action)->search_engines;
649@@ -502,16 +502,16 @@
650 icon_name = "edit-find-option";
651 else
652 icon_name = STOCK_EDIT_FIND;
653- gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
654- GTK_ICON_ENTRY_PRIMARY, icon_name);
655+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
656+ GTK_ENTRY_ICON_PRIMARY, icon_name);
657 }
658 gtk_entry_set_placeholder_text (GTK_ENTRY (entry),
659 katze_item_get_name (search_action->current_item));
660 }
661 else
662 {
663- gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
664- GTK_ICON_ENTRY_PRIMARY,
665+ gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
666+ GTK_ENTRY_ICON_PRIMARY,
667 GTK_STOCK_FIND);
668 gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "");
669 }
670@@ -1102,11 +1102,7 @@
671 gtk_size_group_add_widget (sizegroup, label);
672 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
673 entry_uri = katze_uri_entry_new (
674- #if GTK_CHECK_VERSION (2, 20, 0)
675 gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT));
676- #else
677- NULL);
678- #endif
679 g_object_set_data (G_OBJECT (entry_uri), "allow_%s", (void*)1);
680 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
681 gtk_entry_set_text (GTK_ENTRY (entry_uri),
682
683=== modified file 'midori/midori-speeddial.vala'
684--- midori/midori-speeddial.vala 2013-05-19 09:33:02 +0000
685+++ midori/midori-speeddial.vala 2013-06-21 20:53:25 +0000
686@@ -339,14 +339,9 @@
687 return;
688
689 return_if_fail (spec != null);
690- #if HAVE_OFFSCREEN
691 var img = (thumb_view.parent as Gtk.OffscreenWindow).get_pixbuf ();
692 var pixbuf_scaled = img.scale_simple (240, 160, Gdk.InterpType.TILES);
693 img = pixbuf_scaled;
694- #else
695- thumb_view.realize ();
696- var img = midori_view_web_view_get_snapshot (thumb_view, 240, 160);
697- #endif
698 unowned string title = thumb_view.get_title ();
699 add_with_id (spec.dial_id, spec.uri, title ?? spec.uri, img);
700
701@@ -373,22 +368,10 @@
702 if (settings.get_class ().find_property ("enable-java-applet") != null)
703 settings.set ("enable-java-applet", false);
704 thumb_view.settings = settings;
705- #if HAVE_OFFSCREEN
706 var offscreen = new Gtk.OffscreenWindow ();
707 offscreen.add (thumb_view);
708 thumb_view.set_size_request (800, 600);
709 offscreen.show_all ();
710- #else
711- /* What we are doing here is a bit of a hack. In order to render a
712- thumbnail we need a new view and load the url in it. But it has
713- to be visible and packed in a container. So we secretly pack it
714- into the notebook of the parent browser. */
715- notebook.add (thumb_view);
716- thumb_view.destroy.connect (Gtk.widget_destroyed);
717- /* We use an empty label. It's not invisible but hard to spot. */
718- notebook.set_tab_label (thumb_view, new Gtk.EventBox ());
719- thumb_view.show ();
720- #endif
721 }
722
723 thumb_queue.append (new Spec (dial_id, uri));
724
725=== modified file 'midori/midori-view.c'
726--- midori/midori-view.c 2013-06-19 21:00:46 +0000
727+++ midori/midori-view.c 2013-06-21 20:53:25 +0000
728@@ -969,9 +969,6 @@
729 }
730 }
731
732-#define HAVE_GTK_INFO_BAR GTK_CHECK_VERSION (2, 18, 0)
733-
734-#if HAVE_GTK_INFO_BAR
735 static void
736 midori_view_infobar_response_cb (GtkWidget* infobar,
737 gint response,
738@@ -983,20 +980,6 @@
739 response_cb (infobar, response, data_object);
740 gtk_widget_destroy (infobar);
741 }
742-#else
743-static void
744-midori_view_info_bar_button_cb (GtkWidget* button,
745- gpointer data_object)
746-{
747- GtkWidget* infobar = gtk_widget_get_parent (gtk_widget_get_parent (button));
748- gint response = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "midori-infobar-response"));
749- void (*response_cb) (GtkWidget*, gint, gpointer);
750- response_cb = g_object_get_data (G_OBJECT (infobar), "midori-infobar-cb");
751- if (response_cb != NULL)
752- response_cb (infobar, response, data_object);
753- gtk_widget_destroy (infobar);
754-}
755-#endif
756
757 /**
758 * midori_view_add_info_bar
759@@ -1037,7 +1020,6 @@
760
761 va_start (args, first_button_text);
762
763- #if HAVE_GTK_INFO_BAR
764 infobar = gtk_info_bar_new ();
765 for (button_text = first_button_text; button_text;
766 button_text = va_arg (args, const gchar*))
767@@ -1053,29 +1035,6 @@
768 GTK_ORIENTATION_HORIZONTAL);
769 g_signal_connect (infobar, "response",
770 G_CALLBACK (midori_view_infobar_response_cb), data_object);
771- #else
772- infobar = gtk_hbox_new (FALSE, 0);
773- gtk_container_set_border_width (GTK_CONTAINER (infobar), 4);
774-
775- content_area = gtk_hbox_new (FALSE, 0);
776- gtk_box_pack_start (GTK_BOX (infobar), content_area, TRUE, TRUE, 0);
777- action_area = gtk_hbutton_box_new ();
778- for (button_text = first_button_text; button_text;
779- button_text = va_arg (args, const gchar*))
780- {
781- gint response_id = va_arg (args, gint);
782- GtkWidget* button = gtk_button_new_with_mnemonic (button_text);
783- g_object_set_data (G_OBJECT (button), "midori-infobar-response",
784- GINT_TO_POINTER (response_id));
785- g_signal_connect (button, "clicked",
786- G_CALLBACK (midori_view_info_bar_button_cb), data_object);
787- gtk_box_pack_start (GTK_BOX (action_area), button, FALSE, FALSE, 0);
788- if (response_id == GTK_RESPONSE_HELP)
789- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (action_area),
790- button, TRUE);
791- }
792- gtk_box_pack_start (GTK_BOX (infobar), action_area, FALSE, FALSE, 0);
793- #endif
794
795 va_end (args);
796 label = gtk_label_new (message);
797@@ -5383,9 +5342,7 @@
798 WebKitWebFrame* frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
799 GtkPrintOperation* operation = gtk_print_operation_new ();
800 gtk_print_operation_set_custom_tab_label (operation, _("Features"));
801- #if GTK_CHECK_VERSION (2, 18, 0)
802 gtk_print_operation_set_embed_page_setup (operation, TRUE);
803- #endif
804 g_signal_connect (operation, "create-custom-widget",
805 G_CALLBACK (midori_view_print_create_custom_widget_cb), view);
806 GError* error = NULL;
807
808=== modified file 'midori/sokoke.c'
809--- midori/sokoke.c 2013-05-27 00:00:58 +0000
810+++ midori/sokoke.c 2013-06-21 20:53:25 +0000
811@@ -1096,9 +1096,8 @@
812 const gchar* text = gtk_entry_get_text (entry);
813 gboolean visible = text && *text
814 && ! sokoke_entry_has_placeholder_text (entry);
815- gtk_icon_entry_set_icon_from_stock (
816- GTK_ICON_ENTRY (entry),
817- GTK_ICON_ENTRY_SECONDARY,
818+ gtk_entry_set_icon_from_stock (
819+ entry, GTK_ENTRY_ICON_SECONDARY,
820 visible ? GTK_STOCK_CLEAR : NULL);
821 }
822
823@@ -1113,11 +1112,11 @@
824
825 static void
826 sokoke_entry_icon_released_cb (GtkEntry* entry,
827- GtkIconEntryPosition icon_pos,
828+ GtkEntryIconPosition icon_pos,
829 GdkEvent* event,
830 gpointer user_data)
831 {
832- if (icon_pos != GTK_ICON_ENTRY_SECONDARY)
833+ if (icon_pos != GTK_ENTRY_ICON_SECONDARY)
834 return;
835
836 gtk_entry_set_text (entry, "");
837@@ -1131,7 +1130,7 @@
838 gtk_entry_set_placeholder_text (GTK_ENTRY (entry), placeholder_text);
839 gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
840 GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND);
841- gtk_icon_entry_set_icon_highlight (GTK_ENTRY (entry),
842+ gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
843 GTK_ENTRY_ICON_SECONDARY, TRUE);
844 {
845 g_object_connect (entry,
846
847=== modified file 'toolbars/midori-findbar.c'
848--- toolbars/midori-findbar.c 2012-10-10 22:25:05 +0000
849+++ toolbars/midori-findbar.c 2013-06-21 20:53:25 +0000
850@@ -46,7 +46,7 @@
851
852 static void
853 midori_findbar_set_icon (MidoriFindbar* findbar,
854- GtkIconEntryPosition icon_pos,
855+ GtkEntryIconPosition icon_pos,
856 const gchar* icon_name)
857 {
858 if (icon_name != NULL)
859@@ -57,7 +57,7 @@
860 g_free (symbolic_icon_name);
861 }
862 else
863- gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (findbar->find_text),
864+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (findbar->find_text),
865 icon_pos, NULL);
866 }
867
868@@ -146,7 +146,7 @@
869 gtk_widget_grab_focus (GTK_WIDGET (findbar->find_text));
870 else
871 {
872- midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_PRIMARY, STOCK_EDIT_FIND);
873+ midori_findbar_set_icon (findbar, GTK_ENTRY_ICON_PRIMARY, STOCK_EDIT_FIND);
874 gtk_widget_show (GTK_WIDGET (findbar->find_case));
875 gtk_widget_show (GTK_WIDGET (findbar->find_close));
876 if (selected_text != NULL)
877@@ -188,11 +188,11 @@
878 if (g_utf8_strlen (preedit, -1) >= 1)
879 {
880 gboolean case_sensitive = midori_findbar_case_sensitive (findbar);
881- midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_SECONDARY, STOCK_EDIT_CLEAR);
882+ midori_findbar_set_icon (findbar, GTK_ENTRY_ICON_SECONDARY, STOCK_EDIT_CLEAR);
883 midori_tab_find (MIDORI_TAB (view), preedit, case_sensitive, TRUE);
884 }
885 else
886- midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_SECONDARY, NULL);
887+ midori_findbar_set_icon (findbar, GTK_ENTRY_ICON_SECONDARY, NULL);
888 }
889
890 static void
891@@ -292,7 +292,7 @@
892 const gchar* text;
893 gboolean case_sensitive;
894
895- midori_findbar_set_icon (findbar, GTK_ICON_ENTRY_PRIMARY, found ? STOCK_EDIT_FIND : STOCK_STOP);
896+ midori_findbar_set_icon (findbar, GTK_ENTRY_ICON_PRIMARY, found ? STOCK_EDIT_FIND : STOCK_STOP);
897
898 if (typing)
899 {
900
901=== modified file 'wscript'
902--- wscript 2013-06-17 17:53:51 +0000
903+++ wscript 2013-06-21 20:53:25 +0000
904@@ -263,7 +263,7 @@
905 conf.env.append_value ('VALAFLAGS', '-D HAVE_OFFSCREEN')
906 conf.env.append_value ('VALAFLAGS', '-D HAVE_DOM')
907 else:
908- check_pkg ('gtk+-2.0', '2.16.0', var='GTK')
909+ check_pkg ('gtk+-2.0', '2.24.0', var='GTK')
910 check_pkg ('webkit-1.0', '1.8.3', args=args)
911 conf.define ('GCR_VERSION', 'No')
912 check_pkg ('javascriptcoregtk-1.0', '1.8.3', args=args)

Subscribers

People subscribed via source and target branches

to all changes: