Commit graph

135 commits

Author SHA1 Message Date
Rui Matos
338719a876 network/wifi: Use cancellables for NM async operations
Our NM async callbacks already handle being cancelled and we already
have a cancellable in the base NetObject class, we just weren't wiring
it up to the async calls. Do that to prevent use after free crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=787010
2017-10-03 19:18:59 +02:00
Georges Basile Stavracas Neto
b12a56d97c network: Add Wi-Fi widgets using device product as title
When there are multiple Wi-Fi devices, we must show a stack
switcher in the header of the Wi-Fi panel with the name of
the device.

The problem is that, currently, NetDeviceWifi does not add
its widgets to the main stack setting a stack title, and so
the stack switcher is empty.

Fix that by always adding the widgets to the stack using the
device product name as title.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-17 23:41:36 -03:00
Georges Basile Stavracas Neto
cf62c0abb7 network: Rework NetDeviceWifi interface
The UI definitions of the Wi-Fi devices currently contain many
widgets in the stack, such as the tower icon, the enable/disable
switch and the status.

In the new Wi-Fi panel, all those widgets will clutter the
interface and break the entire UI.

Fix that by splitting those widgets in two different containers:

  1. The header_box container, with the menu button and the
     enable/disable switch.
  2. The center_box widget, with the title and status labels,
     which will be consumed by the Wi-Fi panel to be the center
     widget of the headerbar.

This commit also introduces two getters that expose those two
containers. With that, another load of code could be simplified.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-17 23:41:25 -03:00
Georges Basile Stavracas Neto
3317e88de8 network: Don't manage Wi-Fi devices
The Wi-Fi devices are going to be managed with the
to-be-introduced Wi-Fi panel, and don't need to
be available in the Network panel anymore.

This patch then blacklists Wi-Fi devices and doesn't
let the Network panel manage them.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-17 23:41:08 -03:00
Georges Basile Stavracas Neto
158591a346 network: Replace the notebook with a stack
The Network panel uses a GtkNotebook internally to manage
the different setup pages of the network devices. While it
does the job, we now have a modern widget for that: GtkStack.

With GtkStack, managing the pages becomes a lot easier and
we gain almost for free the nice transition between pages,
besides of course being a widget that consumes slightly less
resources.

Besides all these gains, using a GtkStack will allow us to
implement the new Wi-Fi panel in a more cohesive manner,
sharing large portions of code and avoiding copy pasta.

This commit then turns the GtkNotebook into a GtkStack, and
renames and adapts the code to reflect that. Fortunately,
the code got actually simpler with the move.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-17 23:40:58 -03:00
Georges Basile Stavracas Neto
4ac4f4a04e network: Make the history dialog use a headerbar
In order to start moving towards the new redesigned Network
panel [1], it is necessary to make the dialogs use a headerbar.

Currently, however, they don't, making the dialog sinconsistent
with the rest of the panels, and the GNOME desktop as a whole.

Fix that by setting the headerbar to the History dialog, and
adjusting the elements so hat they match the "Known Wi-Fi Networks"
dialog in the mockup [1].

[1] https://github.com/gnome-design-team/gnome-mockups/blob/master/system-settings/network/aday2/network-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-05-22 12:40:13 -03:00
Jonathan Kang
9cc065bb04 network: Update the hotspot dialog
Update the hotspot dialog according to the new redesigned Network
panel[1].

[1] https://github.com/gnome-design-team/gnome-mockups/blob/master/system-settings/network/aday2/network-wires.png

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-05-22 12:28:32 -03:00
Bastien Nocera
4ee2055027 network: Better debug when creating a hotspot 2017-05-05 19:05:45 +02:00
Bastien Nocera
87928a5d6f network: Add hotspot setup debug 2017-04-29 14:11:22 +02:00
Bastien Nocera
937a518889 network: Fix return value type
We're supposed to return a pointer to GBytes, not a boolean.
2017-04-27 19:44:05 +02:00
Bastien Nocera
c7800dd22f network: Fix initial state of Wi-Fi device
This ensures that:
- the AP list shown on startup when the Hotspot is disabled on
  startup, or when disabling it at run-time
- the hotspot page is shown on startup when the Hotspot is enabled,
  or when it gets enabled at runtime

https://bugzilla.gnome.org/show_bug.cgi?id=705546
2017-03-10 19:17:19 +01:00
Bastien Nocera
7fbb1435a9 network: Remove use of temporary variable 2017-03-10 19:17:17 +01:00
Bastien Nocera
fe6e71198c network: Add checks for cancelled calls 2017-03-10 19:17:13 +01:00
Bastien Nocera
700e5e544c network: Save new SSID to disk before enabling the hotspot
Commit e824868 was supposed to do this, but needed to write the changes
out to disk before activating the hotspot.

https://bugzilla.gnome.org/show_bug.cgi?id=705546
2017-03-10 19:17:12 +01:00
Bastien Nocera
277ac7de02 network: Move hotspot connection search into a helper function
https://bugzilla.gnome.org/show_bug.cgi?id=705546
2017-03-10 19:17:08 +01:00
Bastien Nocera
e824868976 network: Re-set the SSID when enabling the Hotspot
Instead of expecting the hostname to stay the same.

https://bugzilla.gnome.org/show_bug.cgi?id=705546
2016-08-30 17:17:27 +02:00
Bastien Nocera
cdb6a6c682 network: Fix warning when enabling hotspot
GLib-GObject-WARNING **: g_object_set_valist: object class 'NMSettingWireless' has no property named 'security'

https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00
Bastien Nocera
44c16fc6ff network: Use the correct type for the "ssid" property
Set the Hotspot SSID property correctly for libnm 1.2.
2016-06-10 17:21:40 +02:00
Bastien Nocera
e66941753b network: Fix hotspot silently failing with long hostname
By truncating the SSID to 32 bytes.

network-cc-panel-WARNING **: Failed to add new connection: (32) 802-11-wireless.ssid: SSID length is out of range <1-32> bytes

See https://bugzilla.redhat.com/show_bug.cgi?id=1309331
2016-06-10 17:10:35 +02:00
Bastien Nocera
7250d49513 network: Fix warning when Wi-Fi connections are removed
Bug introduced with the fix from 199bd2c. For Wi-Fi, a row might not
have an associated connection.
2016-06-07 18:50:38 +02:00
Dan Williams
1428912da0 network: fix some SSID escaping issues
nm_utils_escape_ssid() should only be used for debugging purposes,
but was used in one place for UI display and another place
for doing actual AP comparison.  Instead, the comparison should
just operate on the SSID bytes, and the UI display should use
nm_utils_ssid_to_utf8() which tries to interpret non-ASCII
characters for better display.

https://bugzilla.gnome.org/show_bug.cgi?id=767205
https://bugzilla.redhat.com/show_bug.cgi?id=1336714
2016-06-07 10:53:40 -05:00
Bastien Nocera
199bd2c343 network: Fix removed connections not disappearing
A regression introduced in commit 9183d34, when we ported to libnm 1.2.
2016-06-07 13:10:09 +02:00
Bastien Nocera
9183d34947 network: Port to libnm 1.2
We also remove support for WiMAX (now unsupported by NetworkManager),
and InfiniBand (Enterprise feature), and the use of
the deprecated NM_SETTING_WIRELESS_SEC property.

With help from network-manager-applet patches by Jiří Klimeš and
Dan Winship.

https://bugzilla.gnome.org/show_bug.cgi?id=765910
2016-05-27 18:23:33 +02:00
Jonathan Kang
28c54f3d55 network: Fix empty Wifi list
Add a callback function for signals "access-point-added" and
"access-point-removed" to update the Wifi list.

https://bugzilla.gnome.org/show_bug.cgi?id=709641
2016-04-05 14:15:20 +08:00
Rui Matos
d8d0c71318 network/device-wifi: Silence a critical when creating a connection 2016-04-01 16:08:28 +02:00
Mathieu Bridon
df54973136 network: Only share a new wifi connection if the user is allowed to
Making a new connection available to other users requires being an
admin, or entering an admin password.

If we enable that option by default for new connections, we effectively
prevent non-admin users from connecting to new networks when they go to
the coffee shop without their laptop admin.

https://bugzilla.gnome.org/show_bug.cgi?id=751378
2015-06-29 17:49:04 +02:00
Bastien Nocera
99d675856a network: Fix all Wi-Fi networks having gear buttons
Only the networks with existing connection should have gear buttons.
This is a regression from 9ffaff7472.

If the widget we add as a stack page isn't visible, the page will not be
shown. As we later add another page with that button, we'd end up
showing that by default.

https://bugzilla.gnome.org/show_bug.cgi?id=750841
2015-06-12 15:40:48 +02:00
Matthias Clasen
0622883025 network: Follow through on the original design
GTK+ can now do circular buttons with ease, so make
this page a little more fancy by following the original
design.

https://bugzilla.gnome.org/show_bug.cgi?id=745703
2015-05-23 11:57:30 -04:00
Timm Bäder
9ffaff7472 wifi: Use a GtkStack to switch between button/spinner
Instead of only adding a button and/or spinner when constructing the
row, always add both to a GtkStack and only show that stack when
necessary. This also removes the need for a GtkSizeGroup and the big
spinner caused by it.

https://bugzilla.gnome.org/show_bug.cgi?id=742853
2015-01-20 20:19:39 +01:00
Owen W. Taylor
8629632c4d network: Fix build
Last patch refers to nm_device instead of the actual variable device.

https://bugzilla.gnome.org/show_bug.cgi?id=723643
2014-09-04 13:13:32 -04:00
Michael Catanzaro
aa421e09d0 network: report hotspot is running only if device is active
https://bugzilla.gnome.org/show_bug.cgi?id=723643
2014-09-04 18:42:37 +02:00
Bastien Nocera
a19c7ec977 network: Fix possible crash when wireless-enabled changes
The device we're handling might have disappeared already, but we're
listening on the NMClient object, which is still alive.

https://bugzilla.gnome.org/show_bug.cgi?id=735932
2014-09-03 18:04:58 +02:00
Bastien Nocera
15a98c3fd8 network: Show an error when we fail to turn off hotspot
And reset the switch as well. I don't know in which circumstance it
could happen, but it's all we can do for now.

https://bugzilla.gnome.org/show_bug.cgi?id=723643
2014-09-02 19:17:43 +02:00
Bastien Nocera
b108dedde6 network: Add hotspot_switch struct member
So we can access it directly when needed.
2014-09-02 19:17:43 +02:00
Bastien Nocera
cb93ad9782 network: Fix warning on startup with hotspot enabled
There's no back button anymore, so we shouldn't try to focus it.

Gtk-CRITICAL **: gtk_widget_grab_focus: assertion 'GTK_IS_WIDGET (widget)' failed
2014-09-02 19:11:43 +02:00
Bastien Nocera
e397a8ab4e network: Build fixes
The WPA key size was missing, and we were comparing strings by pointer
address.
2014-08-15 16:18:47 +02:00
Stanislaw Gruszka
03bacf6f2c network: Create WPA protected AP hotspot if supported
Check if device supports AP mode hotspot with WPA/RSN (WPA2)
ciphers and set such mode and encryption if so.

http://bugzilla.gnome.org/show_bug.cgi?id=719852
2014-08-15 15:57:20 +02:00
Bastien Nocera
55fe239e99 network: Use new listbox helpers
https://bugzilla.gnome.org/show_bug.cgi?id=732106
2014-06-24 11:35:31 +02:00
Frédéric Péters
5e35864e28 network: hide hotspot dialog on Escape
https://bugzilla.gnome.org/show_bug.cgi?id=721163
2014-01-08 14:23:02 +01:00
Yosef Or Boczko
d4ef801743 network: Use margin-start/end instead of margin-left/right
https://bugzilla.gnome.org/show_bug.cgi?id=712661
2013-11-19 22:26:49 +02:00
Bastien Nocera
b921ce215f network: Only start the spinner when we can stop it
https://bugzilla.gnome.org/show_bug.cgi?id=709555
2013-10-07 18:31:59 +02:00
Bastien Nocera
57b64368ef network: Merge two similar functions
Merge connection_add_activate_cb() and connection_activate_cb(),
the code is too similar.

https://bugzilla.gnome.org/show_bug.cgi?id=709555
2013-10-07 16:58:19 +02:00
Bastien Nocera
3c1b58ab2a network: Fix warnings when clicking Wi-Fi network
Those 2 widgets (the edit page, and the spinner) might be available
but we need to read about them from the correct widget, eg. the
GtkListBoxRow, not the GtkBox it contains.

https://bugzilla.gnome.org/show_bug.cgi?id=709555
2013-10-07 16:51:03 +02:00
Bastien Nocera
ce8c2eb6f6 network: Fix run-time warning
The "edit" widget is only set as data when there is a connection
(in make_row) so only hide it when there is a connection.

https://bugzilla.gnome.org/show_bug.cgi?id=709555
2013-10-07 16:51:03 +02:00
Gary Ching-Pang Lin
fc181a2d64 network: Use the parameters property for 8021x
The argv property was deprecated. This commit converts the 8021x
settings to the parameters property so that the user is able to
setup the 8021x connections.

https://bugzilla.gnome.org/show_bug.cgi?id=709545
2013-10-07 16:50:13 +02:00
Rui Matos
fb9d98bff1 network: Update forget button sensitivity when rows are destroyed
Doesn't make sense to keep it sensitive after the dialog returns OK.

This also avoids using finalized objects if the forget button is
clicked after some previously checked rows were destroyed because
their connection got removed elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=709118
2013-10-01 15:09:38 +02:00
Rui Matos
22ff598b78 network: Destroy connection row widget when connection is removed
Otherwise all sorts of crashes may happen if it's interacted with.

https://bugzilla.gnome.org/show_bug.cgi?id=709104
2013-10-01 15:09:37 +02:00
Rui Matos
1650293719 network: Get the correct widget holding the "connection" object data
The check button isn't a direct child of the GtkListBoxRow instance
that contains the "connection" object data so we are adding the wrong
widget to the "rows" list which then gives us a NULL for "connection"
in really_forget() and making us fail to remove the connection.

https://bugzilla.gnome.org/show_bug.cgi?id=709091
2013-10-01 15:09:36 +02:00
Rui Matos
b68f7421c6 network: Just dismiss forget dialog if response is not OK
If the dialog is deleted, for instance, we don't want to take that as
OK.

https://bugzilla.gnome.org/show_bug.cgi?id=709091
2013-10-01 15:09:34 +02:00
Rui Matos
db62c4f8e6 network: Don't leak a couple of dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:03 +02:00