Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 299792 | Differences between
and this patch

Collapse All | Expand All

(-)a/configure.ac (-1 / +1 lines)
Lines 173-179 AC_MSG_CHECKING([which extensions to build]) Link Here
173
173
174
ALL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui gestures greasemonkey java-console livehttpheaders page-info permissions push-scroller rss sample select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states"
174
ALL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui gestures greasemonkey java-console livehttpheaders page-info permissions push-scroller rss sample select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states"
175
USEFUL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui java-console page-info push-scroller select-stylesheet smart-bookmarks soup-fly tab-groups tab-states"
175
USEFUL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui java-console page-info push-scroller select-stylesheet smart-bookmarks soup-fly tab-groups tab-states"
176
DEFAULT_EXTENSIONS="actions adblock auto-scroller certificates error-viewer extensions-manager-ui java-console page-info push-scroller select-stylesheet smart-bookmarks soup-fly tab-groups tab-states greasemonkey"
176
DEFAULT_EXTENSIONS="actions adblock auto-scroller certificates error-viewer extensions-manager-ui java-console page-info push-scroller select-stylesheet smart-bookmarks soup-fly tab-groups tab-states greasemonkey rss"
177
177
178
MOZILLA_ALL_EXTENSIONS="error-viewer java-console livehttpheaders page-info select-stylesheet smart-bookmarks"
178
MOZILLA_ALL_EXTENSIONS="error-viewer java-console livehttpheaders page-info select-stylesheet smart-bookmarks"
179
179
(-)a/extensions/rss/Makefile.am (-3 / +3 lines)
Lines 25-32 librssextension_la_LDFLAGS = \ Link Here
25
	-export-symbols $(top_srcdir)/ephy-extension.symbols \
25
	-export-symbols $(top_srcdir)/ephy-extension.symbols \
26
	$(AM_LDFLAGS)
26
	$(AM_LDFLAGS)
27
27
28
gladedir = $(pkgdatadir)/glade
28
uidir = $(pkgdatadir)/ui
29
glade_DATA = rss-ui.glade
29
ui_DATA = rss-ui.ui
30
30
31
extensioninidir = $(extensiondir)
31
extensioninidir = $(extensiondir)
32
extensionini_in_files = rss.ephy-extension.in.in
32
extensionini_in_files = rss.ephy-extension.in.in
Lines 44-47 DISTCLEANFILES = $(extensionini_DATA) Link Here
44
44
45
EXTRA_DIST = \
45
EXTRA_DIST = \
46
	$(extensionini_in_files)	\
46
	$(extensionini_in_files)	\
47
	$(glade_DATA)
47
	$(ui_DATA)
(-)a/extensions/rss/ephy-rss-extension.c (-16 / +28 lines)
Lines 92-98 static const GtkActionEntry action_entries [] = Link Here
92
92
93
/* We got an rss feed from a tab */
93
/* We got an rss feed from a tab */
94
static void
94
static void
95
ephy_rss_ge_feed_cb (EphyEmbed *embed,
95
ephy_rss_ge_feed_cb (EphyWebView *view,
96
		     const char *type,
96
		     const char *type,
97
		     const char *title,
97
		     const char *title,
98
		     const char *address,
98
		     const char *address,
Lines 100-108 ephy_rss_ge_feed_cb (EphyEmbed *embed, Link Here
100
{
100
{
101
	FeedList *list;
101
	FeedList *list;
102
102
103
	list = (FeedList *) g_object_steal_data (G_OBJECT (embed), FEEDLIST_DATA_KEY);
103
	list = (FeedList *) g_object_steal_data (G_OBJECT (view), FEEDLIST_DATA_KEY);
104
	list = rss_feedlist_add (list, type, title, address);
104
	list = rss_feedlist_add (list, type, title, address);
105
	g_object_set_data_full (G_OBJECT (embed), FEEDLIST_DATA_KEY, list,
105
	g_object_set_data_full (G_OBJECT (view), FEEDLIST_DATA_KEY, list,
106
				(GDestroyNotify) rss_feedlist_free);
106
				(GDestroyNotify) rss_feedlist_free);
107
107
108
	LOG ("Got a new feed for the site: type=%s, title=%s, address=%s\nWe now have %d feeds", type, title, address, rss_feedlist_length (list));
108
	LOG ("Got a new feed for the site: type=%s, title=%s, address=%s\nWe now have %d feeds", type, title, address, rss_feedlist_length (list));
Lines 114-120 static void Link Here
114
ephy_rss_feed_subscribe_cb (GtkAction *action,
114
ephy_rss_feed_subscribe_cb (GtkAction *action,
115
			    EphyWindow *window)
115
			    EphyWindow *window)
116
{
116
{
117
	const GValue *value;
117
	GValue value = { 0, };
118
	GError *error = NULL;
118
	GError *error = NULL;
119
	EphyEmbedEvent *event;
119
	EphyEmbedEvent *event;
120
	gboolean success;
120
	gboolean success;
Lines 127-136 ephy_rss_feed_subscribe_cb (GtkAction *action, Link Here
127
	event = ephy_window_get_context_event (window);
127
	event = ephy_window_get_context_event (window);
128
	if (event == NULL) return;
128
	if (event == NULL) return;
129
129
130
	value = ephy_embed_event_get_property (event, "link");
130
	ephy_embed_event_get_property (event, "link", &value);
131
131
132
	if (!dbus_g_proxy_call (extension->priv->proxy, RSS_DBUS_SUBSCRIBE, &error,
132
	if (!dbus_g_proxy_call (extension->priv->proxy, RSS_DBUS_SUBSCRIBE, &error,
133
		G_TYPE_STRING, g_value_get_string (value),
133
		G_TYPE_STRING, g_value_get_string (&value),
134
		G_TYPE_INVALID,
134
		G_TYPE_INVALID,
135
		G_TYPE_BOOLEAN, &success,
135
		G_TYPE_BOOLEAN, &success,
136
		G_TYPE_INVALID))
136
		G_TYPE_INVALID))
Lines 140-166 ephy_rss_feed_subscribe_cb (GtkAction *action, Link Here
140
	}
140
	}
141
141
142
	g_object_set(action, "sensitive", FALSE, "visible", FALSE, NULL);
142
	g_object_set(action, "sensitive", FALSE, "visible", FALSE, NULL);
143
	g_value_unset (&value);
143
}
144
}
144
145
145
static gboolean
146
static gboolean
146
ephy_rss_ge_context_cb	(EphyEmbed *embed,
147
ephy_rss_ge_context_cb	(EphyWebView *view,
147
			EphyEmbedEvent *event,
148
			 EphyEmbedEvent *event,
148
			EphyWindow *window)
149
			 EphyWindow *window)
149
{
150
{
150
	WindowData *data;
151
	WindowData *data;
151
	const GValue *value;
152
	GValue *value = NULL;
152
	const char *address;
153
	const char *address;
153
	FeedList *list;
154
	FeedList *list;
154
	gboolean active = FALSE;
155
	gboolean active = FALSE;
155
156
156
	list = (FeedList *) g_object_get_data (G_OBJECT (embed), FEEDLIST_DATA_KEY);
157
	list = (FeedList *) g_object_get_data (G_OBJECT (view), FEEDLIST_DATA_KEY);
157
	if ((ephy_embed_event_get_context (event) & EPHY_EMBED_CONTEXT_LINK) && (list != NULL))
158
	if ((ephy_embed_event_get_context (event) & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK) && (list != NULL))
158
	{
159
	{
159
		LOG ("Context menu on a link");
160
		LOG ("Context menu on a link");
160
		data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
161
		data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
161
		g_return_val_if_fail (data != NULL, FALSE);
162
		g_return_val_if_fail (data != NULL, FALSE);
162
163
163
		value = ephy_embed_event_get_property (event, "link");
164
		ephy_embed_event_get_property (event, "link", value);
164
		address = g_value_get_string (value);
165
		address = g_value_get_string (value);
165
166
166
		active = rss_feedlist_contains (list, address);
167
		active = rss_feedlist_contains (list, address);
Lines 177-182 ephy_rss_dialog_display (EphyWindow *window) Link Here
177
{
178
{
178
	EphyRssExtensionPrivate *priv;
179
	EphyRssExtensionPrivate *priv;
179
	EphyEmbed *embed;
180
	EphyEmbed *embed;
181
	EphyWebView *view;
180
	FeedList *list;
182
	FeedList *list;
181
	WindowData *data;
183
	WindowData *data;
182
184
Lines 187-194 ephy_rss_dialog_display (EphyWindow *window) Link Here
187
189
188
	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
190
	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
189
	g_return_if_fail (embed != NULL);
191
	g_return_if_fail (embed != NULL);
192
	view = ephy_embed_get_web_view (embed);
193
	g_return_if_fail (view != NULL);
190
194
191
	list = (FeedList *) g_object_get_data (G_OBJECT (embed), FEEDLIST_DATA_KEY);
195
	list = (FeedList *) g_object_get_data (G_OBJECT (view), FEEDLIST_DATA_KEY);
192
	if (list == NULL)
196
	if (list == NULL)
193
		return;
197
		return;
194
198
Lines 253-263 ephy_rss_update_action (EphyWindow *window) Link Here
253
	FeedList *list;
257
	FeedList *list;
254
	gboolean show = TRUE;
258
	gboolean show = TRUE;
255
	EphyEmbed *embed;
259
	EphyEmbed *embed;
260
	EphyWebView *view;
256
261
257
	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
262
	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
263
	g_return_if_fail (embed != NULL);
264
	view = ephy_embed_get_web_view (embed);
265
	g_return_if_fail (view != NULL);
258
266
259
	/* The page is loaded, do we have a feed ? */
267
	/* The page is loaded, do we have a feed ? */
260
	list = (FeedList *) g_object_get_data (G_OBJECT (embed), FEEDLIST_DATA_KEY);
268
	list = (FeedList *) g_object_get_data (G_OBJECT (view), FEEDLIST_DATA_KEY);
261
269
262
	show = rss_feedlist_length (list) > 0;
270
	show = rss_feedlist_length (list) > 0;
263
271
Lines 295-309 impl_attach_tab (EphyExtension *extension, Link Here
295
303
296
	g_return_if_fail (EPHY_IS_EMBED (embed));
304
	g_return_if_fail (EPHY_IS_EMBED (embed));
297
305
298
	view = EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed);
306
	view = ephy_embed_get_web_view (embed);
299
307
300
	/* Notify when a new rss feed is parsed */
308
	/* Notify when a new rss feed is parsed */
301
	g_signal_connect_after (view, "new-document-now",
309
	g_signal_connect_after (view, "new-document-now",
302
				G_CALLBACK (ephy_rss_ge_content_cb), window);
310
				G_CALLBACK (ephy_rss_ge_content_cb), window);
303
	g_signal_connect_after (view, "ge-feed-link",
311
	g_signal_connect_after (view, "ge-feed-link",
304
			    G_CALLBACK (ephy_rss_ge_feed_cb), window);
312
			    G_CALLBACK (ephy_rss_ge_feed_cb), window);
313
	/*
305
	g_signal_connect (view, "ge-context-menu",
314
	g_signal_connect (view, "ge-context-menu",
306
			    G_CALLBACK (ephy_rss_ge_context_cb), window);
315
			    G_CALLBACK (ephy_rss_ge_context_cb), window);
316
	*/
307
}
317
}
308
318
309
/* Stop listening for the detached tab rss feeds */
319
/* Stop listening for the detached tab rss feeds */
Lines 323-330 impl_detach_tab (EphyExtension *extension, Link Here
323
	g_signal_handlers_disconnect_by_func
333
	g_signal_handlers_disconnect_by_func
324
		(embed, G_CALLBACK (ephy_rss_ge_content_cb), window);
334
		(embed, G_CALLBACK (ephy_rss_ge_content_cb), window);
325
335
336
	/*
326
	g_signal_handlers_disconnect_by_func
337
	g_signal_handlers_disconnect_by_func
327
		(embed, G_CALLBACK (ephy_rss_ge_context_cb), window);
338
		(embed, G_CALLBACK (ephy_rss_ge_context_cb), window);
339
	*/
328
340
329
	/* destroy data */
341
	/* destroy data */
330
	g_object_set_data (G_OBJECT (embed), FEEDLIST_DATA_KEY, NULL);
342
	g_object_set_data (G_OBJECT (embed), FEEDLIST_DATA_KEY, NULL);
(-)a/extensions/rss/rss-ui.c (-2 / +2 lines)
Lines 475-481 rss_ui_populate_store (RssUI *dialog) Link Here
475
	 * avoiding duplicate feeds
475
	 * avoiding duplicate feeds
476
	 */
476
	 */
477
	location = ephy_web_view_get_location
477
	location = ephy_web_view_get_location
478
			(EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (priv->embed), TRUE);
478
			(ephy_embed_get_web_view (priv->embed), TRUE);
479
	decision.hostname = g_strdup (ephy_string_get_host_name (location));
479
	decision.hostname = g_strdup (ephy_string_get_host_name (location));
480
480
481
	/* Fill the store, and select the appropriate feeds */
481
	/* Fill the store, and select the appropriate feeds */
Lines 532-538 rss_ui_constructor (GType type, Link Here
532
532
533
	ephy_dialog_construct (EPHY_DIALOG (edialog),
533
	ephy_dialog_construct (EPHY_DIALOG (edialog),
534
			       properties,
534
			       properties,
535
			       SHARE_DIR "/glade/rss-ui.glade",
535
			       SHARE_DIR "/ui/rss-ui.ui",
536
			       "rss_ui",
536
			       "rss_ui",
537
			       GETTEXT_PACKAGE);
537
			       GETTEXT_PACKAGE);
538
538
(-)a/extensions/rss/rss-ui.ui (+149 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<interface>
3
  <!-- interface-requires gtk+ 2.6 -->
4
  <!-- interface-naming-policy toplevel-contextual -->
5
  <object class="GtkDialog" id="rss_ui">
6
    <property name="border_width">5</property>
7
    <property name="title" translatable="yes">News Feed Subscription</property>
8
    <property name="window_position">center-on-parent</property>
9
    <property name="destroy_with_parent">True</property>
10
    <property name="type_hint">dialog</property>
11
    <property name="skip_taskbar_hint">True</property>
12
    <property name="skip_pager_hint">True</property>
13
    <property name="has_separator">False</property>
14
    <child internal-child="vbox">
15
      <object class="GtkVBox" id="dialog-vbox1">
16
        <property name="visible">True</property>
17
        <property name="orientation">vertical</property>
18
        <child>
19
          <object class="GtkVBox" id="vbox1">
20
            <property name="visible">True</property>
21
            <property name="border_width">5</property>
22
            <property name="orientation">vertical</property>
23
            <property name="spacing">6</property>
24
            <child>
25
              <object class="GtkLabel" id="title">
26
                <property name="visible">True</property>
27
                <property name="xalign">0</property>
28
                <property name="label" translatable="yes">&lt;b&gt;Select Interesting Feeds&lt;/b&gt;</property>
29
                <property name="use_markup">True</property>
30
              </object>
31
              <packing>
32
                <property name="expand">False</property>
33
                <property name="fill">False</property>
34
                <property name="position">0</property>
35
              </packing>
36
            </child>
37
            <child>
38
              <object class="GtkAlignment" id="alignment1">
39
                <property name="visible">True</property>
40
                <property name="left_padding">12</property>
41
                <child>
42
                  <object class="GtkScrolledWindow" id="scrolledwindow1">
43
                    <property name="visible">True</property>
44
                    <property name="can_focus">True</property>
45
                    <property name="hscrollbar_policy">never</property>
46
                    <property name="vscrollbar_policy">automatic</property>
47
                    <property name="shadow_type">etched-in</property>
48
                    <child>
49
                      <object class="GtkTreeView" id="feeds">
50
                        <property name="visible">True</property>
51
                        <property name="can_focus">True</property>
52
                        <property name="headers_visible">False</property>
53
                      </object>
54
                    </child>
55
                  </object>
56
                </child>
57
              </object>
58
              <packing>
59
                <property name="position">1</property>
60
              </packing>
61
            </child>
62
          </object>
63
          <packing>
64
            <property name="position">1</property>
65
          </packing>
66
        </child>
67
        <child internal-child="action_area">
68
          <object class="GtkHButtonBox" id="dialog-action_area1">
69
            <property name="visible">True</property>
70
            <property name="layout_style">end</property>
71
            <child>
72
              <object class="GtkButton" id="close">
73
                <property name="label">gtk-close</property>
74
                <property name="visible">True</property>
75
                <property name="can_focus">True</property>
76
                <property name="can_default">True</property>
77
                <property name="receives_default">False</property>
78
                <property name="use_stock">True</property>
79
              </object>
80
              <packing>
81
                <property name="expand">False</property>
82
                <property name="fill">False</property>
83
                <property name="position">0</property>
84
              </packing>
85
            </child>
86
            <child>
87
              <object class="GtkButton" id="subscribe">
88
                <property name="visible">True</property>
89
                <property name="can_focus">True</property>
90
                <property name="can_default">True</property>
91
                <property name="receives_default">False</property>
92
                <child>
93
                  <object class="GtkAlignment" id="alignment2">
94
                    <property name="visible">True</property>
95
                    <property name="xscale">0</property>
96
                    <property name="yscale">0</property>
97
                    <child>
98
                      <object class="GtkHBox" id="hbox1">
99
                        <property name="visible">True</property>
100
                        <property name="spacing">2</property>
101
                        <child>
102
                          <object class="GtkImage" id="image1">
103
                            <property name="visible">True</property>
104
                            <property name="stock">gtk-ok</property>
105
                          </object>
106
                          <packing>
107
                            <property name="expand">False</property>
108
                            <property name="fill">False</property>
109
                            <property name="position">0</property>
110
                          </packing>
111
                        </child>
112
                        <child>
113
                          <object class="GtkLabel" id="label2">
114
                            <property name="visible">True</property>
115
                            <property name="label" translatable="yes">_Subscribe</property>
116
                            <property name="use_underline">True</property>
117
                          </object>
118
                          <packing>
119
                            <property name="expand">False</property>
120
                            <property name="fill">False</property>
121
                            <property name="position">1</property>
122
                          </packing>
123
                        </child>
124
                      </object>
125
                    </child>
126
                  </object>
127
                </child>
128
              </object>
129
              <packing>
130
                <property name="expand">False</property>
131
                <property name="fill">False</property>
132
                <property name="position">1</property>
133
              </packing>
134
            </child>
135
          </object>
136
          <packing>
137
            <property name="expand">False</property>
138
            <property name="pack_type">end</property>
139
            <property name="position">0</property>
140
          </packing>
141
        </child>
142
      </object>
143
    </child>
144
    <action-widgets>
145
      <action-widget response="-7">close</action-widget>
146
      <action-widget response="-5">subscribe</action-widget>
147
    </action-widgets>
148
  </object>
149
</interface>

Return to bug 299792