[no subject]
=
NMDeviceState state,<br>
=
NMDeviceStateReason reason):<br><br>g_signal_emit_by_n=
ame (device, "state-changed", state, old_state, 0);<br><br>=
but not<br><br>g_signal_emit_by_name (device, "state-changed", st=
ate, old_state, reason);<br>
<br>Then the reason "NM_DEVICE_STATE_REASON_USER_REQUESTED" can&#=
39;t be received by <br>related device_state_changed() function. <br>The re=
ason always is 0(NM_DEVICE_STATE_REASON_NONE).<br><br>Think MobileBroad ban=
d, it has a "Disconnect" item in nm-applet menu. When click it,&n=
bsp; nm_client_deactivate_connection() will be called, if the user(programe=
r) want to check the disconnect reason to do something, e.g. user disconnec=
ted, do not auto connect again. They seems can not. <br>
<br>Thanks!<br> <br><div class=3D"gmail_quote">2009/5/12 Dan Williams =
<span dir=3D"ltr"><<a href=3D"mailto:dcbw redhat com">dcbw redhat com</a=
>></span><br><blockquote class=3D"gmail_quote" style=3D"border-left: 1px=
solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class=3D"im">On Wed, 2009-05-06 at 11:40 +0800, =B4=FA=B6=FB=D0=C0 wro=
te:<br>
> Hi all,<br>
> I have a question about the NetworkManager-0.7.1 c=
odes.<br>
> In NetworkManager-0.7.1/src/nm-device.c:<br>
><br>
> void nm_device_state_changed (NMDevice *device,<br>
> =
NMDeviceState state,<br>
> =
NMDeviceStateReason reason)<br>
> {<br>
> ...<br>
> // Here the fifth parameter is set to 0. I think it shou=
ld be set<br>
> to "reason" so that the receiver of the signal "state-c=
hanged" can<br>
> do<br>
<br>
</div>The question is what event is causing the reason to be 0. Was i=
t a<br>
user-requested disconnection? Was it something else? There may<=
br>
definitely be some places in NM that don't set the code correctly, but<=
br>
we need to identify which scenario you've hit here.<br>
<div class=3D"im"><br>
> // something special base on the "state change reas=
on". e.g. When<br>
> "NM_DEVICE_STATE_DISCONNECTED" state signaled, if<br>
> // the reason is "NM_DEVICE_STATE_REASON_USER_REQUE=
STED" then we<br>
> do not schedule auto connect in<br>
> // NetworkManagerPolicy.c device_state_changed() or<br>
> // set a flag in device-related device_state_changed() a=
nd reload<br>
> the can_activate() function to check this flag.<br>
> g_signal_emit_by_name (device, "state-changed"=
, state, old_state,<br>
> 0);<br>
> ...<br>
<br>
</div>The reason we probably don't schedule autoconnection on disconnec=
t is<br>
precisely because the user chose to manually disconnect. If we did<br=
>
reschedule the autoconnect, then NM would simply reconnect the<br>
connection the user just disconnected.<br>
<br>
Dan<br>
<div class=3D"im"><br>
> }<br>
><br>
> If I'm wrong, please point out. Thanks!<br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> NetworkManager-list mailing list<br>
> <a href=3D"mailto:NetworkManager-list gnome org">NetworkManager-list g=
nome.org</a><br>
> <a href=3D"http://mail.gnome.org/mailman/listinfo/networkmanager-list"=
target=3D"_blank">http://mail.gnome.org/mailman/listinfo/networkmanager-li=
st</a><br>
<br>
</blockquote></div><br>
--00163646d97fdea3810469b7bf44--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]