After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624421 - Port EphyNetMonitor to GDBus
Port EphyNetMonitor to GDBus
Status: RESOLVED OBSOLETE
Product: epiphany
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 646675 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-07-15 06:28 UTC by Diego Escalante Urrelo (not reading bugmail)
Modified: 2011-09-04 19:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adapt to GtkNotebook signal signature changes (2.23 KB, patch)
2010-07-15 06:28 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review
ephy-net-monitor: port to GDBus (9.70 KB, patch)
2010-07-15 06:28 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
ephy-embed-single: set_network_status needs to notify (815 bytes, patch)
2010-10-11 01:34 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review
ephy-net-monitor: port to GDBus (9.82 KB, patch)
2010-10-11 01:36 UTC, Diego Escalante Urrelo (not reading bugmail)
reviewed Details | Review
Apply your comments and also take care of getting a decent initial state from NM service. (12.65 KB, patch)
2011-05-29 23:21 UTC, Diego Escalante Urrelo (not reading bugmail)
reviewed Details | Review

Description Diego Escalante Urrelo (not reading bugmail) 2010-07-15 06:28:08 UTC
Bug to hold patches for such noble task.
Comment 1 Diego Escalante Urrelo (not reading bugmail) 2010-07-15 06:28:11 UTC
Created attachment 165942 [details] [review]
Adapt to GtkNotebook signal signature changes

Bug #624421
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2010-07-15 06:28:15 UTC
Created attachment 165943 [details] [review]
ephy-net-monitor: port to GDBus

Bug #624421
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2010-07-15 06:29:56 UTC
(In reply to comment #1)
> Created an attachment (id=165942) [details] [review]
> Adapt to GtkNotebook signal signature changes
> 
> Bug #624421

Worth saying that epiphany builds with non-master GTK+ with this patch. It fixes the build with gtk+ master without breaking it for older ones.
Comment 4 Xan Lopez 2010-07-15 15:03:55 UTC
Comment on attachment 165942 [details] [review]
Adapt to GtkNotebook signal signature changes

OK.
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2010-07-15 17:15:49 UTC
Comment on attachment 165942 [details] [review]
Adapt to GtkNotebook signal signature changes

Attachment 165942 [details] pushed as 4098085 - Adapt to GtkNotebook signal signature changes
Comment 6 Diego Escalante Urrelo (not reading bugmail) 2010-10-11 01:34:32 UTC
Created attachment 172080 [details] [review]
ephy-embed-single: set_network_status needs to notify

Otherwise ephy-window never finds out that the network-status has changed.

Bug #624421
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2010-10-11 01:36:25 UTC
Created attachment 172081 [details] [review]
ephy-net-monitor: port to GDBus

An updated patch, considering the GSettings migration and some minor changes.
Bonus documentation of get_net_status.

To do: get an initial value of the State property of NM, instead of just defaulting to "true"
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2011-05-07 21:22:56 UTC
*** Bug 646675 has been marked as a duplicate of this bug. ***
Comment 9 Xan Lopez 2011-05-20 09:30:00 UTC
Review of attachment 172080 [details] [review]:

OK to go!
Comment 10 Xan Lopez 2011-05-20 09:39:30 UTC
Review of attachment 172081 [details] [review]:

Patch looks fine in general.

::: src/ephy-net-monitor.c
@@ +39,2 @@
 	guint active : 1;
+	gboolean status;

I think NETWORK_UP/NETWORK_DOWN is more clear than having a boolean, to be honest.

@@ +104,3 @@
+	g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+				  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+				   G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,

Indentation a bit off?

@@ +204,2 @@
 gboolean
+ephy_net_monitor_get_net_status (EphyNetMonitor *monitor)

This should probably be is_active or something, if it's going to return a boolean.
Comment 11 Diego Escalante Urrelo (not reading bugmail) 2011-05-29 23:21:47 UTC
Created attachment 188851 [details] [review]
Apply your comments and also take care of getting a decent initial state from NM service.

The point about a proper UI for the different NM states is in another bug, we can do it this cycle I think, shouldn't be too hard.

Anyway, what do you think, should we commit this?

--

ephy-net-monitor: port to GDBus

Also sporting some improvements:
- Getting a proper initial state from NM when starting up.
- Making sure is_active() always query NM for the current state.
- Consider the new NM states: anything equal or better than LAN is considered
  online. Can be detailed in a further patch with proper UI.

Bug #624421
Comment 12 Diego Escalante Urrelo (not reading bugmail) 2011-06-04 19:38:32 UTC
Comment on attachment 172080 [details] [review]
ephy-embed-single: set_network_status needs to notify

Attachment 172080 [details] pushed as dff30b7 - ephy-embed-single: set_network_status needs to notify
Comment 13 Xan Lopez 2011-06-07 12:25:49 UTC
Review of attachment 188851 [details] [review]:

::: src/ephy-net-monitor.c
@@ +1,3 @@
 /*
  *  Copyright © 2005, 2006 Jean-François Rameau
+ *  Copyright © 2010 Igalia S.L.

Wrong year!

@@ +36,3 @@
 {
+	NETWORK_DOWN,
+	NETWORK_UP

This seems a bit gratuitous? :)

Not that it's important anyway...

@@ +251,3 @@
+			managed, (priv->status == NETWORK_UP));
+
+	return (managed || (priv->status == NETWORK_UP));

I don't think this is logically equivalent to what we had before.

Before: TRUE if net is not managed OR if it is managed and it's UP.

Now: TRUE if it's managed OR if it's UP => it will be TRUE for managed && DOWN, which is wrong. Or it will be FALSE if it's not managed but it happens to be UP, which is also wrong.

Is the change intentional? I'm not sure it makes sense, but maybe it just lacks an explanation.

How can we test this btw?
Comment 14 Diego Escalante Urrelo (not reading bugmail) 2011-09-04 19:38:41 UTC
Done by Claudio.