Merge lp:~ivaldi/midori/about-content-signal into lp:midori

Proposed by André Stösel
Status: Merged
Approved by: Cris Dywan
Approved revision: 6357
Merged at revision: 6368
Proposed branch: lp:~ivaldi/midori/about-content-signal
Merge into: lp:midori
Diff against target: 78 lines (+32/-0)
3 files modified
midori/marshal.list (+1/-0)
midori/midori-view.c (+30/-0)
midori/midori.vapi (+1/-0)
To merge this branch: bzr merge lp:~ivaldi/midori/about-content-signal
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+180990@code.launchpad.net

Commit message

New signal about-content to provide content for about uris

Description of the change

This is a part of the tabby branch but it's needed for other extensions as well.

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

Looks appealingly simple.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/marshal.list'
2--- midori/marshal.list 2012-09-14 23:19:58 +0000
3+++ midori/marshal.list 2013-08-20 08:29:20 +0000
4@@ -2,6 +2,7 @@
5 BOOLEAN:OBJECT,OBJECT
6 BOOLEAN:OBJECT,UINT
7 BOOLEAN:VOID
8+BOOLEAN:STRING
9 OBJECT:OBJECT
10 VOID:BOOLEAN,STRING
11 VOID:OBJECT,ENUM,BOOLEAN
12
13=== modified file 'midori/midori-view.c'
14--- midori/midori-view.c 2013-08-15 11:55:34 +0000
15+++ midori/midori-view.c 2013-08-20 08:29:20 +0000
16@@ -160,6 +160,7 @@
17 NEW_VIEW,
18 DOWNLOAD_REQUESTED,
19 ADD_BOOKMARK,
20+ ABOUT_CONTENT,
21
22 LAST_SIGNAL
23 };
24@@ -303,6 +304,28 @@
25 G_TYPE_NONE, 1,
26 G_TYPE_STRING);
27
28+ /**
29+ * MidoriView::about-content:
30+ * @view: the object on which the signal is emitted
31+ * @uri: the about URI
32+ *
33+ * Emitted when loading the about content
34+ *
35+ * Return value: the view content as string
36+ *
37+ * Since: 0.5.5
38+ */
39+ signals[ABOUT_CONTENT] = g_signal_new (
40+ "about-content",
41+ G_TYPE_FROM_CLASS (class),
42+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
43+ 0,
44+ g_signal_accumulator_true_handled,
45+ NULL,
46+ midori_cclosure_marshal_BOOLEAN__STRING,
47+ G_TYPE_BOOLEAN, 1,
48+ G_TYPE_STRING);
49+
50 gobject_class = G_OBJECT_CLASS (class);
51 gobject_class->constructor = midori_view_constructor;
52 gobject_class->finalize = midori_view_finalize;
53@@ -3819,7 +3842,14 @@
54
55 if (!midori_debug ("unarmed"))
56 {
57+ gboolean handled = FALSE;
58 gchar* temporary_uri = NULL;
59+ if (g_str_has_prefix (uri, "about:"))
60+ g_signal_emit (view, signals[ABOUT_CONTENT], 0, uri, &handled);
61+
62+ if (handled)
63+ return;
64+
65 if (!strcmp (uri, "about:new"))
66 uri = midori_settings_get_tabhome (MIDORI_SETTINGS (view->settings));
67 if (!strcmp (uri, "about:home"))
68
69=== modified file 'midori/midori.vapi'
70--- midori/midori.vapi 2013-08-04 12:00:43 +0000
71+++ midori/midori.vapi 2013-08-20 08:29:20 +0000
72@@ -203,6 +203,7 @@
73
74 [HasEmitter]
75 public signal bool download_requested (WebKit.Download download);
76+ public signal bool about_content (string uri);
77
78 }
79

Subscribers

People subscribed via source and target branches

to all changes: