Commit graph

126 commits

Author SHA1 Message Date
Adrien Plazas
91af270cce connection-editor: Use GtkTemplate 2019-01-27 21:03:13 +00:00
Benjamin Berg
417624cdab wifi: Fix invalid variant unref in connection editor
If the WiFi secret is not set, then a NULL variant is passed back. We
should not free this variant. Fix this by using g_autoptr instead.
2019-01-07 15:28:38 +01:00
Robert Ancell
41e3426873 network: Fix warning about freeing const string
The use of g_clear_pointer (&str, g_free) with str being a const gchar *
caused warning errors.

Instead of using str for both constant and allocated strings use separate
variables. Autofree the allocated strings.
2018-11-14 10:40:10 +00:00
Robert Ancell
bf67ebc34e wifi: Don't translate placeholder text
Placeholder text was marked as translatable, but this is always replaced so
no need to translate it. Remove two unused tabs with translatable labels.
2018-08-27 22:48:05 +00:00
Benjamin Berg
c2f601a9d4 Move common panel code from shell/ to panel/common
This creates a new static library called libwidget which the shell links
against.
2018-04-17 15:26:59 +02:00
Georges Basile Stavracas Neto
5659271ec3 build: Drop remaining libnm-glib usage
This library is deprecated for a long time now, and Fedora Rawhide
removed the package. Since our CI is based on Rawhide, it began
to fail.

In the end, the usage was just legacy code that doesn't exist anymore,
so it's pretty safe to just plain drop it.
2018-03-16 13:03:04 -03:00
Benjamin Berg
72ef675a36 network: Fix warning about missing cast to GtkWidget*
https://bugzilla.gnome.org/show_bug.cgi?id=794171
2018-03-12 16:15:19 +01:00
Bastien Nocera
6df5cc00ce network: Really really fix cloned MAC support
And now that we're reading a text entry, read the correct one 🙄
Follow-up to a2a70c7
2018-02-16 13:26:13 +01:00
Bastien Nocera
9b9e0e076a network: Don't show "Auto-connect" for VPNs
It's not supported for VPNs.

https://bugzilla.gnome.org/show_bug.cgi?id=792365
2018-02-16 10:52:08 +01:00
Bastien Nocera
c50d1adb0f network: Don't warn when setting empty IPv4 gateway
Set an empty string when there's no IPv4 gateway rather than warn.
2018-02-06 11:11:56 +01:00
Bastien Nocera
a2a70c7376 network: Really fix clone MAC support
This isn't a container, but a text entry. Bug introduced in commit
6b043fd.
2018-02-06 11:10:53 +01:00
Bastien Nocera
dd8b63bdeb network: Consider empty IPv6 gateway to be valid
The string we get back from the text entries are never NULL (as long as
the UI isn't broken that is), but can be empty strings. Consider an
empty IPv6 address to be invalid, but an empty gateway to be valid.

See https://bugzilla.redhat.com/show_bug.cgi?id=1467308
2018-02-06 10:46:33 +01:00
Bastien Nocera
6b043fd3dd network: Fix cloned MAC not being saved for Ethernet
We read the MAC as being the cloned MAC, which NM would likely take to
mean that we didn't want a cloned MAC.

See https://bugzilla.redhat.com/show_bug.cgi?id=1467295

https://bugzilla.gnome.org/show_bug.cgi?id=793072
2018-02-06 10:42:18 +01:00
Georges Basile Stavracas Neto
24abbcf303 network: Turn metered data switch into a check button
Per guidance of the design team, since the dialog has not
enough room for switches.
2018-01-18 14:00:23 -02:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Georges Basile Stavracas Neto
a37d04df42 connection-editor: Expose metered connection switch
NetworkManager supports marking a connection as metered, meaning
that connection is e.g. charged by its usage or extremely limited.
When a network is metered, background network usage must cease
and the behavior of the various OS pieces must be adjusted.

This patch adds a switch to set a connection as metered or not.
The property is imediately propagated to NetworkManager.

https://bugzilla.gnome.org/show_bug.cgi?id=792608
2018-01-18 00:37:31 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Scott Cohen
87c69ed955 network: Fix typo in error message
Replaced "conneciton" with "connection" (both without quotes) in
panels/network/connection-editor/net-connection-editor.c:860.

https://bugzilla.gnome.org/show_bug.cgi?id=785100
2017-08-18 11:36:21 -03:00
Georges Basile Stavracas Neto
ae59c77b45 network: Improve alignment and spacing
This patch improves the alignment and spacing of IPv4
and IPv6 widgets so that they look uniform and consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=779841
2017-08-09 19:34:03 +02:00
Georges Basile Stavracas Neto
1d0757d288 network: Use a table-like widget in address editor
According to the latest mockups for the connection editor dialog [1],
the IPv4 and IPv6 pages are supposed to use a table-like editor to
manage the addresses, in a similar fashion of what was done to the
routes editor. This way of editing is not only easier to comprehend,
but also improves the size of the dialog, requiring much less vertical
space to present the routes.

The current implementation, however, uses a vertical layout and a toolbar,
which is inefficient in its usage of space.

Fix that by implementing the table-like editor widget, both in IPv4
and IPv6 pages.

[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-08-09 19:34:03 +02:00
Georges Basile Stavracas Neto
08657fac44 network: Use a table-like widget to edit routes
According to the latest mockups for the connection editor dialog [1],
the IPv4 and IPv6 pages are supposed to use a table-like editor to
manage the routes. This editor is not only easier to comprehend, but
also improves the size of the dialog, requiring much less vertical
space to present the routes.

The current implementation, however, uses a vertical layout and a toolbar,
which is inefficient in its usage of space.

Fix that by implementing the table-like editor widget, both in IPv4
and IPv6 pages.

[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-08-09 19:34:03 +02:00
Georges Basile Stavracas Neto
2e570099f6 network: Simplify DNS management in connection editor
When editing the DNS servers of a given connection, a simple
entry is enough to display and edit the DNS servers. The user
can separate IP addresses with commas. This is exemplified
by the mockup at [1].

This, however, is not the current implementation, which uses
a combination of listbox rows, entries and buttons to manage
that with added complexity.

Fix that by using an entry to handle the DNS servers.

[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-08-09 19:34:03 +02:00
Georges Basile Stavracas Neto
21943a42bf network: Ensure WirelessSecurity type is initialized
When calling for the wireless security widgets, the code
simply assumes that the corresponding GType is initialized.
This may not always be true, which leads to a nasty crash
every time e.g. we open the network connection editor dialog.

This commit fixes that by introducing a new standard macro
wrapping wireless_security_get_type(), and ensuring the type
is initializing when calling wireless_security_init(), thus
protecting every code path from this crash.

This commit also makes CePageSecurity use the new macro for
better legibility.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +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
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
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
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
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
Bastien Nocera
981c354ebb network: Fix crash entering IPv4 routes
The wrong destructor was used for a GPtrArray of NMIPRoute.

See https://bugzilla.gnome.org/show_bug.cgi?id=771251
See https://bugzilla.gnome.org/show_bug.cgi?id=771432
2016-09-14 17:18:32 +02:00
Bastien Nocera
7f601cfed4 network: Fix crash entering IPv4 Gateway
The wrong destructor was used for a GPtrArray of NMIPAddress.

https://bugzilla.gnome.org/show_bug.cgi?id=771432
2016-09-14 17:18:32 +02:00
Bastien Nocera
ca47ff295a network: Fix crash when changing IPv4 DNS
The dns_servers GStrv was not NULL-terminated because we forgot to
append a NULL item to the GPtrArray that we used to construct it.

https://bugzilla.gnome.org/show_bug.cgi?id=771251
2016-09-13 11:45:20 +02:00
Bastien Nocera
2a6706fe4c network: Avoid setting a GError if already set
If the wireless security is invalid, don't try to set the GError if the
ad-hoc mode is invalid as well.

https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00
Bastien Nocera
b0329f8ef6 network: Return better error when 8021x security is invalid
Rather than the generic "Invalid 802.1x security".

https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00
Bastien Nocera
73a8d38946 network: Remove unused ->validate class implementations
The implementation of ->validate in the parent class will return TRUE if
there's no implementation in the child class, so no need to implement
those.

https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00
Bastien Nocera
a90dc605d6 network: Fix IPv6 settings not being applicable when method changes
When changing the method from Manual to Automatic, we need to clear the
gateway setting, otherwise the settings verification will fail:
ipv6.gateway: gateway cannot be set if there are no addresses configured

Another fallout of the libnm 1.2 port

https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00
Bastien Nocera
94e2be8ff6 network: Fix warning if IPv6 gateway is empty
GtkEntry doesn't like NULL text.

https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00
Bastien Nocera
dc14602e55 network: Fix saving of IPv6 gateway
https://bugzilla.gnome.org/show_bug.cgi?id=769230
2016-08-30 17:15:33 +02:00