Commit graph

690 commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
fcf4e44ebd wifi: Don't access potentially invalid pointer
When the user launches Settings with a panel passed
as argument, the following things happen:

 1. The Wi-Fi panel starts loading.
 2. The command line arguments are passed and the given
    panel is activated.
 3. The Wi-Fi panel cancels the loading routine, and
    rfkill_proxy_acquired_cb() is called with the GError
    set as G_IO_ERROR_CANCELLED.
 4. Crash in rfkill_proxy_acquired_cb().

The crash is caused because, when rfkill_proxy_acquired_cb()
is called, the CcWifiPanel instance isn't valid anymore. And
yet, the code tries to cast 'gpointer user_data' to a
CcWifiPanel pointer.

Fix that by only trying to cast anything after parsing the
GError set by the callback.
2017-08-12 18:58:10 -03:00
Georges Basile Stavracas Neto
5c4f2ff8a6 shell: Hardcode panel list order
Per the latest mockups [1], the panel list must be sorted
by the category, and then follow a manual predefined order.

This commit adds the hardcoded order to the the panel list.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/shell/settings-organization.png
2017-08-12 11:03:17 -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
6bdbf685d9 network: Make widgets cover a third of screen width
Following the design decision on other panels, make the central
column of the Network panel cover at most a third of the window,
or more depending on the width of the window.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
aabc1621b8 network: Update VPN section
The last remaining network device to be updated is
the VPN device, and this patch is the result of this
effort.

The changes were mostly towards cleaning up and
removing unecessary code. By removing the info labels,
many getters were removed as well.

In order to achieve a listbox-like UI, a couple of
UI refactorings.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
bcc8a9ce27 network: Add header to VPN section
Since each VPN will be a row in a listbox, we
can't rely on NetVPN:add_to_stack() to handle
the header.

This header must, then, be handled by the panel
itself. For now, we just open the already available
dialog to add connections, when the ideal approach
(to be implemented yet) is to move the contents
of this dialog in a built-in popover.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
331d7fbf11 network: Prevent compile warning
If we build with strict compile check, the pointer
alignment gets messed up. So just cast to gpointer
to satisfy the compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
b64c605e69 network: Update Proxy section widgets
According to the lastest mockups [1], the Proxy section is now
composed of a row with the state of the proxy, and a settings
button that leads to a dialog where one can configure the different
proxy settings.

This commit ports the current code to do that, and various changes
took place to made this happen. Namely:

 * A new ProxyMode enum was added to improve readability and
   improve the semantic of the code. No more random numbers
   are present.

 * The current widgets for editing proxy settings were repacked
   into a GtkStack (so that we keep an homogeneous sizing), and
   the GtkStack itself was moved into a new dialog. With that,
   we can just set the stack page, rather than controlling the
   visibility of all individual widgets.

 * Many unused widgets were removed.

 * The combo box was replaced by 3 radio buttons. Now, there's
   no need to deal with GtkTreeIters anymore. Another refactoring
   of the code that led to more readable and smaller code.

Overall, these changes made the code be more readable, smaller
codebase with a smaller surface for mistakes.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +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
965ef93143 network: Update "Wired" section UI
The current "Wired" section UI is still optimized for
the old, multi-page panel layout. Recent work [1],
however, suggest that this should change and the standard
widgets be rearranged.

This commit, then, implements this new UI for the wired
devices UI by using a listbox row when there's only one
profile (ditching out the old info labels), and moving
and deleting the bottom action buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
a87d804fa2 network: Wrap panel in a scrolled window
After introducing the new single-column layout,
we can easily hit the case where there are too
many connections and/or devices and the panel
gets way too tall.

To fix that, wrap all the widgets inside a
scrolled window that only scrolls vertically.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
Georges Basile Stavracas Neto
e35ecd5468 network: Add connections and devices to different stack
The current Network panel is composed of a single stack and
a treeview to select the currently visible stack page. Each
stack page represents a connection or device.

The new Network panel, however, has none of the concept of
selectable pages. In the new layout, all connections and
devices appear all at once in a more compact and simpler
fashion.

This commit, then, starts moving towards a unified, pageless
panel by adding all the connections and devices to different
stacks. These different stacks are transient to the network
object, and are added at appropriate boxes, giving the panel
a unified layout.

This has some serious implications in the design of the
current code. Most of the code removals were related to the
treeview and different pages handling. No more tree model
madness is present, and the devices are now stored in a
plain simple GPtrArray.

After this patch, NetObject:add_to_stack isn't a good code
design choice anymore. This will be addressed in a future
patch.

https://bugzilla.gnome.org/show_bug.cgi?id=785581
2017-08-09 19:32:43 +02:00
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