Commit graph

825 commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
e49496048f network: Make it a template class
The current Network panel class relies on GtkBuilder
when it could use a more modern feature that is the
template class.

By making it a template class, not only the Network
panel is slightly more performant, but it's also
simpler and easier to read.

This commit, then, turns the Network panel into a
template class, and cleans up the code to make it
work.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-07 20:23:40 +01:00
Georges Basile Stavracas Neto
71d9e5c5f1 network: Cleanup GtkBuilder file
The Network panel UI file uses deprecated widgets and
has many lines of needless code. This commit just cleans
it up, as a preparation for turning the Network panel
into a template class.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-07 20:23:40 +01:00
Georges Basile Stavracas Neto
29c6bab4d2 network: Remove Wi-Fi related commands
This should be in the Wi-Fi patchset...

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-07 20:23:40 +01:00
Georges Basile Stavracas Neto
09c202528f network: Turn into a final class
The Network panel is not really a deriverable type, and
since after 61d7abe795 we can use the
utility macros.

Thus, this commit removes all the boilerplate code and
turns CcNetworkPanel into a final class.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-07 20:23:40 +01:00
Georges Basile Stavracas Neto
f07c35747c network: Remove Airplane Mode switch
The Network panel does not deal with Wi-Fi devices anymore,
and does not make sense to have the Airplane Mode switch in
there, since it is now available at the Wi-Fi panel.

This commit then removes the Airplane Mode switch from the
Network panel.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-07 20:23:40 +01:00
Georges Basile Stavracas Neto
016efdfac8 wifi: Introduce Wi-Fi panel
The glory moment has come. The new Wi-Fi panel is finally
introduced using a different code style from the rest of
the Network panel, since Control Center itself is written
using the GTK+ C code style.

The Wi-Fi panel uses modern GTK+ features like template
classes and new widgets. The files are stored together
with the Network panel so that we can reuse the abstraction
layer that the Network panel has to manage devices.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-18 13:30:46 -03: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
Bastien Nocera
11c81f1809 network: Simplify the ignored Network interface types
We might want to add more ignored types later on, but this is a simple
cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=783998
2017-06-21 13:24:38 +02:00
Bastien Nocera
b7c4b30f63 network: Fix runtime warning
Create 2 veth interfaces without any names with, as root:
ip link add veth0 type veth peer name veth1
ip link set dev veth0 up
ip link set dev veth1 up

And run:
(gnome-control-center:28176): GLib-CRITICAL **: g_utf8_collate: assertion 'str1 != NULL' failed
(gnome-control-center:28176): GLib-CRITICAL **: g_utf8_collate: assertion 'str2 != NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=783996
2017-06-21 13:24:38 +02:00
Rui Matos
ca667d9928 network: Avoid crashing if the NMDevice doesn't have a hw-address
The property might not exist and we would g_free() an uninitialized
pointer. Using the proper API avoids all that.

https://bugzilla.gnome.org/show_bug.cgi?id=783839
2017-06-16 19:39:39 +02:00
Georges Basile Stavracas Neto
8f78b27299 network: Use radio buttons instead of a combobox in IP pages
Per the latest mockups [1], the IP pages use a set of four radio
buttons to control the method, rather than a switch + a combobox,
which is what the current implementation uses.

This patch, then, adapts the IP pages of the connection editor
dialog to use a set of radio buttons at the top of the page.

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

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-14 16:41:10 -03:00
Georges Basile Stavracas Neto
18a42a00b8 network: Move Security page to the end
Per the mockups at [1], the Security page is the last
visible page.

This patch also adds a small code refactoring to avoid
multiple string comparisons.

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

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-14 16:41:10 -03:00
Georges Basile Stavracas Neto
3458566f7c network: Adapt forget button label according to connection type
Per the mockup [1], the Forget button has different labels depending
on the connection type. For example, when editing a VPN connection,
the Forget button reads "Remove VPN", while when editing a Wi-Fi
connection reads "Forget Connection".

This patch adapts the forget button label according to the connection
type.

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

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-14 16:41:10 -03:00
Georges Basile Stavracas Neto
8137036675 network: Drop Reset page
Following the latest mockups [1], the "Forget" button
is now available in the Details page, and the Reset page
is gone.

This patch then removes the Reset page, and moves the
functionality to the Details page.

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

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-14 16:41:10 -03:00
Georges Basile Stavracas Neto
ce289c3824 network: Move checkboxes to Details page
In the advanced connection editor dialog, currently, the
options to share a connection with all users and to connect
automatically are inside the Identity page.

The redesigned connection editor, however, features these
options in the Details page as per the mockup [1].

Fix this by moving these options to the Details page.

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

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-14 16:40:50 -03:00
Georges Basile Stavracas Neto
10d4eea176 network: Align details page labels at start
Instead of keeping the labels centralized, align them at
the start of the dialog, as the mockup [1] proposes.

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

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-14 16:35:50 -03:00
Georges Basile Stavracas Neto
6da5f2ff58 network: Reduce connection editor dialog width
The current default width is 600px, which is a bit too much
and leaves a lot of blank space.

Fix that by reducing the default width to 500px.

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-06-13 10:40:03 -03:00
Georges Basile Stavracas Neto
b62ed2f87b network: Rely on notebook tabs to switch connection editor pages
Instead of using a sidebar, which is what the current implementation
uses to switch pages, the latest mockups [1] rely on the notebook
tabs.

This patch then updates the connection editor dialog to use the
notebook tabs as the page switcher widget.

[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-06-13 10:40:03 -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
Georges Basile Stavracas Neto
fe2a21e696 network: Make connection editor dialog use a headerbar
In order to start moving towards the new redesigned connection
editor [1], it is necessary to make the dialog use a headerbar.

Currently, however, it doesn't, making the connection editor
dialog inconsistent with the rest of the panels, and the GNOME
desktop as a whole.

Fix that by exporting the buttons as action buttons, and setting
the use-header-bar property to TRUE.

[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-21 10:41:43 -03:00
Rui Matos
585b1fdd9c network: Remove remaining traces of firewalld zones support
These were overlooked in commit
b36924567e.
2017-05-18 18:57:26 +02:00
Benjamin Berg
2c95c6a5d0 network: Include the connection title in the sort string
The list of networks is sorted by connection type. If a user has e.g. a
lot of VPN connections, then the unsorted list is hard to browse.
To fix this, include the title of the connection in the sort order and
ensure the list is kept sorted when a title is changed.

Reported-by: Oliver Haessler <oliver@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=778685
2017-05-17 15:14:10 +02:00
Benjamin Berg
f70ac1d863 network: Re-render connection title whenever it changes
The title of network connections may change if the user edits it or if
it was changed programatically by another program. This worked fine, but
the UI was not updated. This patch ensures the network list in the UI is
updated.

Reported-by: Oliver Haessler <oliver@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=778685
2017-05-17 11:24:39 +02:00
Benjamin Berg
93fc508061 network: Remove unused "title" column from devices liststore
The title column is not used as the title is fetched from the net object
on the fly when it is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=778685
2017-05-17 11:24:39 +02: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
Jonathan Kang
bb8ca23701 network: Fix mobile broadband switch state
The switch was only reflecting the value of the WWAN killswitch instead
of both the WWAN killswitch and the state of the connection itself.

https://bugzilla.gnome.org/show_bug.cgi?id=690361
2017-04-13 15:51:51 +02:00
Bastien Nocera
b36924567e network: Remove support for firewalld zones
Firewalld is a Fedora-only daemon, and it doesn't integrate all that
well with Fedora Workstation, the version of Fedora that uses GNOME, so
remove the support.

In Fedora Workstation, firewalld only ever supports one zone, as the
other ones are badly defined, and not translatable or translated.
2017-04-13 10:23:39 +02:00
Bastien Nocera
6ab5552d59 network: Update wireless-security UI from network-manager-applet 2017-03-13 18:56:57 +01:00
Bastien Nocera
0470c040b1 network: Update wireless-security from network-manager-applet 2017-03-13 18:56:57 +01:00
Bastien Nocera
b4ac30b51e network: Simplify object destruction 2017-03-10 19:17:24 +01: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
Michael Catanzaro
03ebd431b5 network: Fix missing page title on wired panel
The NetDeviceEthernet's title is not set until after the UI is created,
so we have to listen for changes to the title.

https://bugzilla.gnome.org/show_bug.cgi?id=776369
2017-01-04 08:49:45 -06:00
Andreas Henriksson
bb4b83360b network: drop unneeded null-check for ip4 address
The pointer has already been dereferenced. Might have made more sense
to check if it's the empty string and treat that as error, but
nm_utils_ipaddr_valid also returns error on empty string so lets just
rely on the utility function doing the right thing here.

https://bugzilla.gnome.org/show_bug.cgi?id=708500
2016-11-11 17:55:04 +01:00
Andreas Henriksson
898d0aa4e9 network: allow empty ip4 default gateway
Null-checking the text_gateway makes no sense as it has already been
dereferenced earlier. Instead check if it's the empty string and
treat that as not-an-error. Also prevent the empty string from
being set in default_gateway.

https://bugzilla.gnome.org/show_bug.cgi?id=708500
2016-11-11 17:55:04 +01:00
Piotr Drąg
eabc878192 network: use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2016-10-03 15:20:47 +02:00
Piotr Drąg
d791e5b334 Disambiguate "Reset" string with context 2016-09-27 17:36:19 +02:00
Bastien Nocera
7dfc6a6c23 network: Fix application of the default gateway
Now that we ensured that only the first address has a gateway entry,
read it and apply it.

See https://bugzilla.gnome.org/show_bug.cgi?id=765969

https://bugzilla.gnome.org/show_bug.cgi?id=771515
2016-09-20 10:30:27 +02:00
Bastien Nocera
d28ffc9902 network: Fix gateway entry visibility
From https://bugzilla.gnome.org/show_bug.cgi?id=765969 as explained by
Dan Winship:
"
libnm-util/libnm-glib had a buggy data model, which nm-connection-editor
(and then gnome-control-center) copied, in which each manually-configured
IP address has an associated gateway address. In reality, NM always just
took the first non-empty gateway value from the address array, and
completely ignored any other gateway values.
libnm represents this more accurately, by having a single gateway
value which is separate from the address array. Ideally, the editors should
show it this way as well (eg, like nmtui does). Failing that, it would
be nice to at least make it so that only the first row in the address
table can have a non-empty gateway value.
"

We went for the second option, only showing a gateway entry for the
first address in the list.

This isn't related to route-specific gateway addresses.

https://bugzilla.gnome.org/show_bug.cgi?id=765969
2016-09-20 10:30:27 +02:00
Bastien Nocera
ab2b13cacd network: Fix compilation warnings
Those come from the fixes made in commits 981c354 and 7f601cf.

https://bugzilla.gnome.org/show_bug.cgi?id=771538
2016-09-20 10:30:27 +02:00
Bastien Nocera
da7be92093 network: Fix warning when opening IPv4 connection editor
https://bugzilla.gnome.org/show_bug.cgi?id=771515
2016-09-20 10:30:27 +02:00