Commit graph

4669 commits

Author SHA1 Message Date
Felipe Borges
756eb883df printers: Fix visibility guard for the printer "Model" label
This is a typo related to the fix at commit 7d25444.
2017-07-25 14:49:41 +02:00
Georges Basile Stavracas Neto
5bc84ae4e3 info: Make margins consistent with other panels
All the new panels have a standard 24px margin now, so
since we're already splitting the info pages into separate
panels, also fix this minor annoyance.

https://bugzilla.gnome.org/show_bug.cgi?id=779216
2017-07-24 23:33:54 -03:00
Mohammed Sadiq
6cf52ada03 info: Add desktop files for the split panels
This commit shall show the panels separate.

Some panels are hidden in current design, while some other panels
are hidden in new shell design.

https://bugzilla.gnome.org/show_bug.cgi?id=779216
2017-07-24 22:55:27 -03:00
Florian Müllner
796981d390 keyboard: Special-case disabling of multi-bindings shortcuts
For shortcuts that support multiple bindings, the disabled state is
expressed as an empty list rather than a list with a single empty
element. While the latter certainly works as expected as far as the
actual keybinding is concerned, the shortcut will show up as modified
even if it is disabled by default. Explicitly setting bindings to the
empty list when a shortcut is disabled fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784620
2017-07-24 21:43:24 -03:00
Felipe Borges
7d254442a0 printers: Fix visibility guard for the printer "Model" label
We just present the printer "Model" when printer_make_and_model
is different than NULL OR not an empty string.

We were using the wrong logic operator in the conditional that
toggles the visibility of this info.
2017-07-20 13:35:38 +02: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
Jonas Ådahl
c37ce6fcb4 display: Add is_interlaced() D-Bus implementation
Whether a mode is interlaced or not is now exported by adding a
'is-interlaced' (b) value to the mode properties variant. Implement the
is_interlaced() vfunc using this information.
2017-07-14 18:32:55 +02:00
Jonas Ådahl
252fd31762 display: Update to the new D-Bus API mode format
The mode format communicated via the new D-Bus API changed to
specifying modes using a per monitor unique mode ID string. The uint
'flags' was also changed to more flexible a{sv} 'properties' structure.
2017-07-14 18:32:55 +02:00
Marco Trevisan (Treviño)
cca9663d87 display: Adapt to new Mutter interface with scaling per mode
New Mutter GetCurrentState now provides a list of available scales, we
need to use these values in order to define an UI that shows them all.
2017-07-14 18:32:54 +02:00
Carlos Garnacho
a23aa64ec7 common: Update from gnome-settings-daemon 2017-07-13 18:11:01 +02:00
Carlos Garnacho
3b72790b72 common: Add tablet device type to pad GdkDevices
The wacom panel expects all tablet devices to have the "tablet"
device type flag set on the GsdDevice, otherwise devices won't get
recognized and paired with the other devices for the same tablet.
Uncovered now that GTK+ correctly uses GDK_SOURCE_TABLET_PAD for
pad devices on X11.

https://bugzilla.gnome.org/show_bug.cgi?id=784882
2017-07-13 18:11:01 +02:00
Miguel Vaello Martínez
88b6561c8e bluetooth: Center empty states in the panel
For the new or alternative version of Control Center, the Bluetooth
empty state will be vertically alligned to the center for any
app window size. Otherwise when the Bluetooh is powered and available,
the align will be as always.

This changes do not affect to the old version because the windows
size (for the old version) is always the same and small
enought to be in the center in any case.

https://bugzilla.gnome.org/show_bug.cgi?id=784720
2017-07-11 21:02:21 -03:00
Florian Müllner
30c36d476e keyboard: Consider multiple bindings when resetting
While we are now able to find conflicts for a particular key combo in
non-primary bindings, in the case of resetting a shortcut we need to
check all key combos in case the shortcut itself has multiple bindings
by default.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:31:00 +02:00
Florian Müllner
dd024ae722 keyboard: Consider additional bindings in uniqueness checks
We now have everything in place to extend the uniqueness check to
consider all bindings of an item rather than just the first one.
With this it is finally possible to set Alt+Tab as binding for
"Switch windows" without keeping the hidden Alt+Tab binding of the
"Switch applications" shortcut ...

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:31:00 +02:00
Florian Müllner
2e7c9531fa keyboard: Don't handle mask separately
Comparing masks is currently part of the early checks we perform to
determine that two bindings are different. There's some convenience
in that, however logically the mask is part of the binding, and
separating the mask check from comparing the "rest" of the binding
makes it harder to extend the comparison to consider multiple bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:46 +02:00
Florian Müllner
ab353591f8 keyboard: Refactor finding of conflicting items
When comparing keys for uniqueness, we currently apply various tests to
check whether shortcuts are different, until we decide that we found a
conflict if none of the tests passed. That approach is a bit weird for
shortcuts that have a reverse item - when comparing a binding to two
different shortcuts, it should always be different from at least one of
them, so there should never be a conflict for any reversible shortcuts.
The reason it does work anyway is that reverse items usually only differ
in modifiers, which is_shortcut_different() currently doesn't consider at
all. We are about to change that however, so refactor the code to set the
conflicting item as soon as we find a match rather than as fall-through.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
5e4fa7bd39 keyboard: Track all key combos
For shortcuts that support more than one binding, we currently simply
ignore all but the first. This makes some sense as we only expose a
single binding in the UI anyway, however it means that any extra
bindings are not taken into account for conflict resolution. In order
to address this in the future, start tracking all bindings of an item.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
dccf794897 keyboard: Add dedicated key combo type
We currently store keyval, keycode and mask that make up a particular
key combo separately. However as we want to consider multiple bindings
for a single item, it makes more sense to combine them in a dedicated
struct type.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
bd54cd1342 keyboard: Clear additional bindings when changing a shortcut
Some shortcuts allow multiple bindings for the same actions, which
we mainly use to keep supporting old settings when changing defaults.
Multiple bindings are not exposed in the interface though, so when
changing a shortcut with multiple bindings, we previously only updated
the first one and left additional bindings untouched. This is confusing
however, precisely because additional bindings are not shown in the
UI - for instance, this makes it impossible to actually disable
such a shortcut completely. The less confusing option is to clear
any additional bindings when changing a shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Felipe Borges
db551f1c5d region: Make the "Restart" notification persistent
When the Language is changed in the Region panel, a "Restart"
notification is shown, but if the user closes the window without
acting on the restart session notification, there is no way to
get back to it.

This way we create a temporary file in the g_get_user_runtime_dir ()
directory flagging whether we should present the "Restart"
notification.

https://bugzilla.gnome.org/show_bug.cgi?id=702351
2017-07-10 15:27:34 +02:00
Felipe Borges
79295b6260 region: Drop "restart" in-app notification
This changes are based on the mockups available at
https://wiki.gnome.org/Design/SystemSettings/RegionAndLanguage

https://bugzilla.gnome.org/show_bug.cgi?id=702351
2017-07-10 15:27:34 +02:00
Felipe Borges
a739ebf377 region: Embed "Restart session" button below the Language entry
This change is based on the mockups available at
https://wiki.gnome.org/Design/SystemSettings/RegionAndLanguage

https://bugzilla.gnome.org/show_bug.cgi?id=702351
2017-07-10 15:27:34 +02:00
Rui Matos
82546faf24 mouse: Fix synaptics check
It seems like (at least some versions of) gdk don't set
GDK_SOURCE_TOUCHPAD on synaptics devices. In this case though, we
don't need the additional check. Just knowing if there's any device
being driven by this X driver is enough.

https://bugzilla.gnome.org/show_bug.cgi?id=784266
2017-07-07 15:37:25 +02:00
Jason Gerecke
978ccdc9af wacom: Correct order of area calibration values
Commit cf408c27b0 changed how the values stored in the "area" key were
calculated in order be compatible with its updated schema. Unfortunately,
it overlooked the fact that updated schema also changed the order of the
values from "left, top, right, bottom" to "left, right, top, bottom".
Because of this, corrections intended to be applied to the top and right
screen edges were swapped. This can cause a noticible cursor offset to
occur after finishing calibration.

https://bugzilla.gnome.org/show_bug.cgi?id=784009
2017-07-05 23:46:22 +02:00
Jason Gerecke
50b39dc570 wacom: Drop old_axes from calibration API
The calibration utility was modified in cf408c27b0 to return unitless
padding measurements instead of axis values for storage in gsettings.
Unfortunately, the code still assumes in some places that it is working
with axes rather than paddings. This causes subtle math errors that
result in undesired cursor offsets after the calibration is applied.

Fortunately, this can be simplified, since tablet area is always reset
to the default state before starting calibration, we are sure that the
value will remain constant. Since both axes are in the same 0..1 scale,
calibration code doesn't need to swap X/Y back and forth to calculate
each axis scale.

Additionally, the code to get the calibrated axis values has been moved
into its own function along with a new function that returns padding
values suitable for consumption by g-c-c. All calculations are performed
internally in the 0..1 range.

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

Co-Authored-By: Carlos Garnacho <carlosg@gnome.org>
2017-07-05 23:46:22 +02:00
Florian Müllner
84d527645b keyboard: Don't create shortcuts editor twice
We are accidentally creating two editors, leaking the first instance ...

https://bugzilla.gnome.org/show_bug.cgi?id=784391
2017-07-05 09:22:21 -03:00
Florian Müllner
eed74317c4 keyboard: Fix another memory leak
The memory leak fixed in commit 870fb46201 is still present in
a copy-pasted version of the function, apply the same fix there
as well ...

https://bugzilla.gnome.org/show_bug.cgi?id=784356
2017-07-04 22:52:19 -03:00
Carlos Garnacho
42489e2509 wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator
This makes the calibrator only reactive to the tablet being calibrated
again.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 21:11:54 +02:00
Carlos Garnacho
b26d6acb5f wacom: Make calibrator use GDK for button events
This way we can cut down the last step in the mapping across
GUdevDevice->GsdDevice->GdkDevice->ClutterInputDevice.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 21:11:54 +02:00
Florian Müllner
3910b4ac9d keyboard: Follow the usual search pattern for filtering
Filtering on the name currently only matches the string as a whole,
not individual words as expected, for instance "home fo" and "ho fo"
should both match "Home Folder".

https://bugzilla.gnome.org/show_bug.cgi?id=784357
2017-06-29 21:36:30 -03:00
Florian Müllner
870fb46201 keyboard: Fix a memory leak
While the actual strings returned by g_variant_get_strv() are owned
by the variant, we still need to free the container ...

https://bugzilla.gnome.org/show_bug.cgi?id=784356
2017-06-29 21:22:51 -03:00
Mohammed Sadiq
d5110977da printers: Check if printer name is NULL
This was causing a segfault when the user clicks the cancel button
on add new printer dialog (in case when no printers are listed, and no
printers are added).

output from sanitizer:

==22669==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fe1c7a4d409 bp 0x7ffd179f6410 sp 0x7ffd179f6410 T0)
    #0 0x7fe1c7a4d408 in g_str_hash /home/sadiq/jhbuild/checkout/glib/glib/ghash.c:1882
    #1 0x7fe1c7a4c814 in g_hash_table_lookup_node /home/sadiq/jhbuild/checkout/glib/glib/ghash.c:379
    #2 0x7fe1c7a4c814 in g_hash_table_lookup /home/sadiq/jhbuild/checkout/glib/glib/ghash.c:1153
    #3 0x55cef023a121 in new_printer_dialog_response_cb /home/sadiq/jhbuild/checkout/gnome-control-center/panels/printers/cc-printers-panel.c:914

https://bugzilla.gnome.org/show_bug.cgi?id=783406
2017-06-23 13:32:42 +02: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
f32b305a1a search: Fix a GFile leak
https://bugzilla.gnome.org/show_bug.cgi?id=783885
2017-06-19 11:31:06 +02:00
Mohammed Sadiq
38ac1d1d76 search: Fix memory leak
The container returned by g_variant_get_strv() should be
freed with g_free().

https://bugzilla.gnome.org/show_bug.cgi?id=783885
2017-06-19 11:23:42 +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
Felipe Borges
0d0b42eb50 printers: Hide supply level bar when there is no inklevel data
https://bugzilla.gnome.org/show_bug.cgi?id=779702
2017-06-15 15:39:22 +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
Felipe Borges
ee42831fcd printers: Add print "Test Page" button to Options Dialog
https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-06-14 10:45:25 +02:00
Felipe Borges
995d64292d printers: Introduce pp_printer_print_file_async
An asynchronous wrapper to print files.

https://bugzilla.gnome.org/show_bug.cgi?id=779708
2017-06-14 10:45:25 +02:00