Commit Graph

195 Commits

Author SHA1 Message Date
Giovanni Campagna
a6fb3acb42 NetworkMenu: hide the "Turn On" item when the rfkill is hardware blocked
If wifi is disabled in hardware, there is nothing we can do at
the sw level, so hide the menu item.

https://bugzilla.gnome.org/show_bug.cgi?id=709635
2013-10-08 22:20:27 +02:00
Giovanni Campagna
8a8b3bf96e NetworkMenu: fix wireless-enabled property notifications
The property is on the NMClient, not NMDevice. Also, make sure
we disconnect the signal when the item is destroyed.
Also, connect to wireless-hardware-enabled, which we'll use soon.

https://bugzilla.gnome.org/show_bug.cgi?id=709635
2013-10-08 22:20:27 +02:00
Dan Winship
f7624e5f05 network: make the icon visible again when going from ethernet to nothing
https://bugzilla.gnome.org/show_bug.cgi?id=709638
2013-10-08 14:26:38 -04:00
Giovanni Campagna
e898e29910 NetworkMenu/NMConnectionDevice: grab the connection before using it
If the active connection for the device is not the primary or
activating globally, it won't have the _connection and _primaryDevice
expando properties, so grab them from the settings object.

https://bugzilla.gnome.org/show_bug.cgi?id=709043
2013-10-03 16:03:41 +02:00
Giovanni Campagna
843f076225 NetworkMenu/NMDeviceWireless: use the device state instead of active connection state
Since we connect to signals for that, we need to sync on that, or
we can miss a notification.

https://bugzilla.gnome.org/show_bug.cgi?id=709043
2013-10-03 16:01:27 +02:00
Aleksander Morgado
33896a4e8f network: fix NMConnectionSection destruction
The patch fixes the following warning, and along with it, the proper
destruction of the NMConnectionSection is performed so that items get
correctly removed from the menu.

(gnome-shell:24528): Gjs-WARNING **: JS ERROR: TypeError:
this.statusItem is undefined
NMConnectionSection<.destroy@/home/aleksander/gnome/install/share/gnome-shell/js/ui/status/network.js:173
wrapper@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:213
_parent@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:175
NMConnectionDevice<.destroy@/home/aleksander/gnome/install/share/gnome-shell/js/ui/status/network.js:292
wrapper@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:213
_parent@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:175
NMDeviceModem<.destroy@/home/aleksander/gnome/install/share/gnome-shell/js/ui/status/network.js:448
wrapper@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:213
NMApplet<._removeDeviceWrapper@/home/aleksander/gnome/install/share/gnome-shell/js/ui/status/network.js:1421
wrapper@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:213
NMApplet<._deviceRemoved@/home/aleksander/gnome/install/share/gnome-shell/js/ui/status/network.js:1416
wrapper@/home/aleksander/gnome/install/share/gjs-1.0/lang.js:213

https://bugzilla.gnome.org/show_bug.cgi?id=709248
2013-10-03 00:50:02 +02:00
Jasper St. Pierre
8380c79875 network: Update the network indicator when the VPN state changes 2013-10-01 10:25:46 -04:00
Jasper St. Pierre
fb561f10a7 network: Make sure to set the signal icon at dialog item construction time
We forgot to set it here; it would be updated if there was changes in the
signal, but not when it was created.

https://bugzilla.gnome.org/show_bug.cgi?id=708442
2013-09-26 11:06:42 -04:00
Jasper St. Pierre
2c00dad211 network: Make sure to resync when the activating connection changes
Otherwise, we may be left with a stale activating connection if a
connection is activating, but doesn't fully activate for whatever
reason.

https://bugzilla.gnome.org/show_bug.cgi?id=708322
2013-09-18 17:15:01 -04:00
Jasper St. Pierre
2d8ed4c77f Bind "this" for various methods
For extremely silly reasons with how the class framework works, the wrapper
method requires "this" to be bound in order for it to work, or else we'll
emit errors in strict mode.

https://bugzilla.gnome.org/show_bug.cgi?id=707892
2013-09-11 15:02:32 -04:00
Jasper St. Pierre
1d26161d23 network: Adapt to the new NetworkManager API names
"physical connection" has been replaced with "primary connection"
2013-08-31 22:33:16 -04:00
Giovanni Campagna
6fbe765636 network: allow disconnecting while activation is in progress
While connecting, the item should read "Turn Off", not "Connect".
To do so, change the meaning of isActive() to be really "not isOff()"

https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-31 18:52:01 +02:00
Giovanni Campagna
22b2ccd83d network: fix signal name
There is no state-changed signal on NMActiveConnection

https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-31 18:52:01 +02:00
Giovanni Campagna
fc5aadd6dd network: use the VPN state to compute the icon for VPN items
We watch changes in the VPN state, not the active connection state,
so if we use the active connection state, we might miss an update
(because the VPN property is notified before the other one)

https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-31 18:52:01 +02:00
Giovanni Campagna
5a9f0c24b4 network: don't return null from NMConnectionDevice._getStatus()
StLabel complains set you set the text to NULL

https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-31 18:52:01 +02:00
Giovanni Campagna
0c12c072fa NMConnectionItem: fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-31 18:52:01 +02:00
Giovanni Campagna
f7284caefd network: don't crash because a device doesn't have a description yet
Descriptions are only added after all devices are read (thanks
to the disambiguation in libnm-gtk), but we use them immediately
when we call _sync() in various points (such as checkConnection())

https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-31 18:52:01 +02:00
Jasper St. Pierre
3f15a41006 network: Use one notification globally for connection status
Rather than one per device.

https://bugzilla.gnome.org/show_bug.cgi?id=706098
2013-08-29 12:10:32 -04:00
Jasper St. Pierre
e1c4cfd7eb network: Update for new APIs
New network manager APIs mean we don't have to do any scanning
through the active networks and synchronize state ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=706098
2013-08-29 12:10:32 -04:00
Jasper St. Pierre
8460aa7d6a network: Make the Connect button insensitive when on the current network
https://bugzilla.gnome.org/show_bug.cgi?id=706136
2013-08-19 11:24:55 -04:00
Jasper St. Pierre
64efbe703a network: Add a selected indicator to the current access point
https://bugzilla.gnome.org/show_bug.cgi?id=706136
2013-08-19 11:24:55 -04:00
Giovanni Campagna
1b03e55cc3 network: fix iterating connections in NMConnectionSection
Must compare the length of the array, not the array itself.

https://bugzilla.gnome.org/show_bug.cgi?id=706262
2013-08-18 22:05:45 +02:00
Jasper St. Pierre
156be19c2d network: Update the icon even if we don't have a connection
If we don't have a connection at startup or we transition from
having a connection to not having a connection, we need to make
sure we hide the correct indicators.
2013-08-16 19:34:56 -04:00
Jasper St. Pierre
362e0bf1ec network: Add an empty state to the wifi dialog and adjust the sizing
https://bugzilla.gnome.org/show_bug.cgi?id=705916
2013-08-14 20:39:07 -04:00
Jasper St. Pierre
73e1f238cf panelMenu: Remove the gicon parameter from addIndicator, and make private
There's only two uses of the parameter left, which can easily be added as a
separate line below. Since it's really a private interface meant for the
indicators, make it private as well so external users are less likely to
use it.

https://bugzilla.gnome.org/show_bug.cgi?id=705845
2013-08-13 06:50:24 -04:00
Jasper St. Pierre
c05627a49e network: Remove superfluous intermediate section
Now that we're guaranteed this.menu is a section, this is
excessive and unnecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=705845
2013-08-13 06:50:24 -04:00
Jasper St. Pierre
5cca26a565 status: Port to a new SystemIndicator framework
We can't silently replace the old behavior of separate status
icons into a new system. Replace SystemStatusButton with a new
SystemIndicator class which will allow for the flexibility we
need. For now, make it a subclass of Button so that it mostly
feels the same, but we'll soon be swapping it out with a dummy
implementation that the aggregate menu will use.

I think the code cleanup here is worth it.

https://bugzilla.gnome.org/show_bug.cgi?id=705845
2013-08-13 06:50:24 -04:00
Jasper St. Pierre
f74567fbab network: Make sure not to checkConnection on the wireless section
As the wireless section does not contain checkConnection.
2013-08-12 10:08:18 -04:00
Jasper St. Pierre
4d34abeeef network: Prioritize active / default connections over activating ones
https://bugzilla.gnome.org/show_bug.cgi?id=702536
2013-08-05 15:19:40 -04:00
Jasper St. Pierre
621810c409 network: Fix visibility of the VPN icon
This is a regression from e6c239d0f3,
where we removed the calls to hide()/show() when we had a VPN device
vs. not.

https://bugzilla.gnome.org/show_bug.cgi?id=702536
2013-08-05 15:19:40 -04:00
Jasper St. Pierre
728c3a72ad network: Introduce a new, rewritten Wi-Fi section
Remove the Wi-Fi chooser from the menu and put it in a dialog instead.
This frees up the submenu to simply have three items: an rfkill toggle,
a button to show the dialog, and a button to show network settings.

Ideally, we'd autodetect the "needs network" case by user initiation
and automatically show the dialog if needed, but lower-level plumbing
is neccessary, so the menu item to show the dialog is an acceptable
compromise instead.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:52:33 -04:00
Jasper St. Pierre
c8c839a569 network: Make sure that the network menu is insensitive when in the lock screen
Since the network section of the aggregate menu will be shown in the lock
screen, we need to ensure that users can't tweak with network settings or
anything like that.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:24 -04:00
Jasper St. Pierre
6827dacb4b network: Remove syncDescription
Replace it with setDeviceDescription, which gives device wrappers
more control about how to handle description changes.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:24 -04:00
Jasper St. Pierre
246271fd9d network: Implement new designs for VPN/modem submenus
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:24 -04:00
Jasper St. Pierre
4305ebc5b0 network: Rework the VPN rewrite to work for modem and bluetooth as well
Replace NMNetworkMenuItem with NMConnectionItem, based on
NMVPNConnectionItem, and replace NMDevice with NMConnectionSection
and NMConnectionDevice.

Since this rips apart NMDevice, and since wi-fi should not be
connection-based, we'll temporarily remove NMDeviceWireless. We'll
add it back in a later commit, along with the new Wi-Fi dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:23 -04:00
Jasper St. Pierre
39bff8bfbc network: Don't pass a list of connections to the devices
Instead, just add them after they're constructed. This allows us to
not have to pass the connections to each device, and prevents issues
with having to enumerate the connections in the middle of construction.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
fc6a0c1006 network: Remove the Wired section
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

Note that this does have an interesting side effect of not showing
network connectivity status on wired. This is intentional, and error
states will still be shown in the top bar when they happen.

This also means that if you're connected to both wired and wireless,
even though wired is the default route, we'll first notice the wireless
active connection, and we'll show that in the top bar. New NM API that
will help figuring out the active connection of the default device is
being implemented to stop this from happening.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
d6dc9af5ff network: Remove overflow implementation
The code is complicated by requiring overflow, and in order to incrementally
improve the code to match the designs, remove overflow.

In the new design, we'll have a fixed number of menu items, and Wi-Fi
will be done by a separate design, so we can't be too concerned with
the menu not fitting on the screen.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
e62045eb7f network: Remove the enable networking item
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

Additionally, with this gone, we can clean up how we handle menu
item visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
bda3e53511 network: Remove the global wireless killswitch
"Airplane Mode" is able to be turned on in gnome-control-center,
and it will replace the killswitch UI we have in the menu right
now.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
6295d0fc6c network: Make the device section headers not bold
The new device section headers will be simple text strings
in the new designs.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
3271e65d56 network: Remove separators between device sections
This is not needed in the new design. Doing this allows us to
remove some complex section visibility tracking, also.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
f8225141dc network: Remove the firmware changed signal
According to Dan Williams, if firmware is installed the device
will disappear and reappear, and this is unlikely to change any
time soon. Just make our lives easier by removing the tracking.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
8e9e583b79 network: Fix the AP strength indicator never getting updated
I intended to make a few code cleanups, but I apparently forgot
to hook up _updateAccessPoint. Merge it with _activeApChanged,
which is where the notify::active-access-point signal is actually
hooked up to.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
2cd41773ba status: Remove settings actions
These aren't used in the new system status designs.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
ccba18aa8f network: Fix a recursion issue when updating VPN
_updateIcon should not attempt to sync any active connections, as the
icon-changed signal can be emitted in response to something done during
_syncActiveConnection. In the case of VPN, removeActiveConnection would
cause an icon-changed signal to be emitted immediately, but the state
would not be updated, causing us to call removeActiveConnection over and
over.

Explicitly sync all active connections when we know it needs to be done,
and simply make _updateIcon synchronize with the current device's icon.

https://bugzilla.gnome.org/show_bug.cgi?id=703565
2013-07-03 13:55:08 -04:00
Giovanni Campagna
013b6aa44a network: don't fail if we can't read a connection associated with an active
It can happen in legitimate cases, such as a version incompatibility
between NetworkManager and libnm-glib or a restricted permission.

https://bugzilla.gnome.org/show_bug.cgi?id=701849
2013-06-14 20:38:54 +02:00
Jasper St. Pierre
0e7d3a7558 network: Remove support for virtual networking
This isn't in the new design, and no good can come from this.
Just allow people to use the control center to configure virtual
networking.

https://bugzilla.gnome.org/show_bug.cgi?id=701954
2013-06-14 14:15:17 -04:00
Jasper St. Pierre
8bd4895538 network: Simplify connections to the firmware signal
The status item will go away soon, so make sure the one-time
fire is given its own function. At the same time, only connect
to the signal when the situation actually matters.

https://bugzilla.gnome.org/show_bug.cgi?id=701954
2013-06-14 14:15:17 -04:00
Jasper St. Pierre
465c77ddcf network: Make the device field private
With getIndicatorIcon() replacing the main use of the .device
field, we can make this a private API.

https://bugzilla.gnome.org/show_bug.cgi?id=701954
2013-06-14 14:15:17 -04:00