Merge lp:~midori/midori/alcoPops into lp:midori

Proposed by Cris Dywan
Status: Work in progress
Proposed branch: lp:~midori/midori/alcoPops
Merge into: lp:midori
Diff against target: 76 lines (+11/-15)
1 file modified
midori/midori-locationaction.c (+11/-15)
To merge this branch: bzr merge lp:~midori/midori/alcoPops
Reviewer Review Type Date Requested Status
Midori Devs Pending
Review via email: mp+211205@code.launchpad.net

Commit message

Port location action from Granite.PopOver to Gtk.Popover

Description of the change

TODO: Port security buttons
Error: Gdk-CRITICAL **: gdk_window_get_scale_factor: assertion 'GDK_IS_WINDOW (window)' failed

To post a comment you must log in.

Unmerged revisions

6602. By Cris Dywan

Port location action from Granite.PopOver to Gtk.Popover

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-locationaction.c'
2--- midori/midori-locationaction.c 2014-02-23 11:30:04 +0000
3+++ midori/midori-locationaction.c 2014-03-16 13:03:22 +0000
4@@ -1332,6 +1332,7 @@
5 MIDORI_CERT_EXPORT,
6 } MidoriCertTrust;
7
8+#if !GTK_CHECK_VERSION (3, 11, 8)
9 static void
10 midori_location_action_cert_response_cb (GtkWidget* dialog,
11 gint response,
12@@ -1373,6 +1374,7 @@
13 gtk_widget_destroy (dialog);
14 }
15 #endif
16+#endif
17
18 const gchar*
19 midori_location_action_tls_flags_to_string (GTlsCertificateFlags tls_flags)
20@@ -1434,6 +1436,7 @@
21 details = (GtkWidget*)gcr_certificate_details_widget_new (gcr_cert);
22 gtk_widget_show (details);
23 gtk_container_add (GTK_CONTAINER (box), details);
24+ #if !GTK_CHECK_VERSION (3, 11, 8)
25 if (gcr_trust_is_certificate_pinned (gcr_cert, GCR_PURPOSE_SERVER_AUTH, hostname, NULL, NULL))
26 gtk_dialog_add_buttons (GTK_DIALOG (dialog),
27 ("_Don't trust this website"), MIDORI_CERT_REVOKE, NULL);
28@@ -1443,11 +1446,12 @@
29 gtk_container_child_set (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))),
30 gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Export certificate"), MIDORI_CERT_EXPORT),
31 "secondary", TRUE, NULL);
32+ g_signal_connect (dialog, "response",
33+ G_CALLBACK (midori_location_action_cert_response_cb), gcr_cert);
34+ #endif
35
36 g_object_set_data_full (G_OBJECT (gcr_cert), "peer", hostname, (GDestroyNotify)g_free);
37 g_object_set_data_full (G_OBJECT (dialog), "gcr-cert", gcr_cert, (GDestroyNotify)g_object_unref);
38- g_signal_connect (dialog, "response",
39- G_CALLBACK (midori_location_action_cert_response_cb), gcr_cert);
40 /* With GTK+2 the scrolled contents can't communicate a natural size to the window */
41 #if !GTK_CHECK_VERSION (3, 0, 0)
42 gtk_window_set_default_size (GTK_WINDOW (dialog), 250, 200);
43@@ -1490,28 +1494,20 @@
44 const gchar* title = _("Security details");
45 GtkWidget* content_area;
46 GtkWidget* hbox;
47- #ifdef HAVE_GRANITE
48- gint wx, wy;
49- GtkAllocation allocation;
50+ #if GTK_CHECK_VERSION (3, 11, 8)
51 GdkRectangle icon_rect;
52
53- /* FIXME: granite: should return GtkWidget* like GTK+ */
54- dialog = (GtkWidget*)granite_widgets_pop_over_new ();
55+ dialog = gtk_popover_new (widget);
56 gchar* markup = g_strdup_printf ("<b>%s</b>", title);
57 GtkWidget* label = gtk_label_new (markup);
58- content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
59+ content_area = gtk_vbox_new (FALSE, 0);
60+ gtk_container_add (GTK_CONTAINER (dialog), content_area);
61 g_free (markup);
62 gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
63 gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 0);
64
65- gtk_widget_get_allocation (widget, &allocation);
66- gdk_window_get_origin (gtk_widget_get_window (widget), &wx, &wy);
67- wx += allocation.x;
68 gtk_entry_get_icon_area (GTK_ENTRY (widget), icon_pos, &icon_rect);
69- wx += (icon_rect.x + icon_rect.width / 2);
70- wy += (icon_rect.y + icon_rect.height);
71- granite_widgets_pop_over_move_to_coords (GRANITE_WIDGETS_POP_OVER (dialog),
72- wx, wy, TRUE);
73+ gtk_popover_set_pointing_to (GTK_POPOVER (dialog), &icon_rect);
74 #else
75 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (gtk_widget_get_toplevel (widget)),
76 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, NULL, NULL);

Subscribers

People subscribed via source and target branches

to all changes: