Commit graph

155 commits

Author SHA1 Message Date
Jeremy Bicha
a9d6ed149b online-accounts: Set label relationship for listboxes
Set the label relationships so that screen readers
read the headers for the listboxes.
2019-01-10 11:53:00 +00:00
Adrien Plazas
e76fca5e6e online-accounts: Ellipsize the labels
This will help the window to fit narrow screens even with long
application names.
2018-11-29 00:48:16 +00:00
Adrien Plazas
851cdc8eb3 online-accounts: Wrap the header label
This will help the window to fit narrow screens.
2018-11-29 00:48:16 +00:00
Adrien Plazas
0d901e086d online-accounts: Remove a hardcoded minimum width
This will help the window to fit narrow screens.
2018-11-29 00:48:16 +00:00
Adrien Plazas
8c92368e7c online-accounts: Use a HdyColumn
This better adapts the panel's size to the window's size, allowing it to
look good on both large and narrow windows.
2018-11-29 00:48:16 +00:00
Robert Ancell
39e0396fd6 online-accounts: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-18 01:18:57 +00:00
Debarshi Ray
5579314a38 online-accounts: Track the lifecycle of CcGoaPanel across async calls
Due to an API bug in GNOME Online Accounts, the asynchronous
goa_provider_get_all method doesn't accept a GCancellable argument.
This makes it difficult to cancel an ongoing call when the CcGoaPanel
gets destroyed.

Prior to commit c26f8ae018, this was hacked around by taking a
reference on the panel for the duration of the call. Instead of
cancelling a pending call on destruction, it would keep the panel alive
until the call was over. However, that was lost during commit
c26f8ae018.

One thing to bear in mind is that GtkWidgets, CcGoaPanel is one, can
be destroyed by a gtk_widget_destroy call, which is subtly different
than a simple sequence of g_object_unref calls. When gtk_widget_destroy
is used, it invokes the GObject::dispose virtual method of the widget.
It is expected this will cause anything holding a reference to this
widget to drop their references, leading to GObject::finalize being
called. However, there is no guarantee that this will happen in the
same iteration of the GMainLoop. Therefore, it is possible that when
the goa_provider_get_all call finishes, the CcGoaPanel might be in a
disposed, but not yet finalized state.

When a GObject is in a disposed-but-not-finalized state, only a very
limited number of operations can be performed on it. Its reference
count can be altered, the memory used by the instance struct can be
accessed, but none of the member GObjects can be assumed to be valid.
eg., it's definitely illegal to add new rows to the member GtkListBox.
Hence a boolean flag is used to mark the destroyed state of the panel.

This second part is a small improvement over the earlier hack.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/208
2018-10-05 11:20:37 +02: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
Andrea Azzarone
d918b02c1f online-accounts: Complete account removal in cc_goa_panel_finalize()
When removing an online account, gnome-control-center gives the user
the possibility to undo the action showing an "undo notification".
Right now if you close the gnome-control-center window, without dismissing
the notification, the online account will not be properly removed.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/25
2018-03-27 21:09:46 +00:00
Georges Basile Stavracas Neto
a1bace4683 build: Drop libgd
Settings does not use libgd.
2018-03-16 15:55:10 -03:00
Andrea Azzarone
3aa89a836a online-accounts: Restore the "add" command
This reverts parts of commit 5a04e40fef
that don't use goa_provider_set_preseed_data.

https://bugzilla.gnome.org/show_bug.cgi?id=794012
2018-03-05 17:48:26 +01:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01: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
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -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
Iñigo Martínez
d7012d0337 build: Move libgd and gvc modules to subprojects
In order to share the libgd and gvc modules between autotools and
meson, this patch moves their directories to subprojects
directory and updates autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 19:02:57 -02:00
Georges Basile Stavracas Neto
b23ef59926 shell-model: Remove old categories
Since we don't maintain two different shells anymore, there
is no need to maintain the two different sets of categories
in the desktop files.

This commit also drops the "#ifdef CC_ENABLE_ALT_CATEGORIES"
blocks, since the previous commit removed that define.

https://bugzilla.gnome.org/show_bug.cgi?id=790923
2017-11-28 17:03:51 -02:00
Debarshi Ray
5a04e40fef Revert "online-accounts: Accept requests for account creation on ..."
It's been more than four years and nobody ended up using this feature.
However, the extra cookie management that's necessary to implement this
feature has now exposed code, which people actually use, to a
WebKitGTK+ bug that's taking quite some time to be fixed. Therefore,
this is a good an excuse as any to remove this code.

This reverts commit 8762e2f8dc

https://bugzilla.gnome.org/show_bug.cgi?id=789469
2017-10-25 12:34:45 +02:00
Allan Day
8a8e53ab8a Standardize vertical spacing of panels
Ensure that the vertical spacing inside each panel is similar.
This makes the transition between each panel smoother and makes
the control center feel more cohesive.

Settings panels are given 32px above and below their content
and 32px vertical space between major sections. 12px space is
placed below headings.

Bluetooth, displays and printers are not addressed.

https://bugzilla.gnome.org/show_bug.cgi?id=786384
2017-08-20 18:38:42 +02:00
Georges Basile Stavracas Neto
a9bf8b5b04 online-accounts: Fix parameter parsing
The Online Accounts panel supports two commands: 'add'
and 'show-account'. The 'add' command must receive an
additional parameter, the 'provider' name, and an
optional 'preseed' parameter.

In the past, Settings would just push all the parameters
to a GVariant and pass to the panels. Now, however, it
skips the first one, making the parameter parsing code
in Online Accounts panel wrong.

This patch fix that by refactoring add_account() code,
and fixing the GVariant parameter parsing.
2017-08-19 11:31:18 -03:00
Georges Basile Stavracas Neto
7ccfa25b47 online-accounts: Fix crash after aborting web view and changing panels
The panel owns both the GtkDialog, and the GoaProvider that is used
with the dialog during goa_provider_add_account. When the panel is
destroyed, it drops its references to the provider but not the dialog,
which is a separate top-level widget. Therefore, if the panel is
switched while the WebKitWebView inside the dialog was still
navigating across pages, then WebKitWebView::decide-policy will be
called with an invalid provider.

To avoid this, and a memory leak, the panel should also destroy the
dialog when it is itself getting destructed.

Note that since the GtkDialog is a template child, it must be
destroyed in dispose. GtkWidget's (ie. the panel's) default default
destroy signal handler NULLifies all template children pointers, so
finalize is too late.

https://bugzilla.gnome.org/show_bug.cgi?id=782043
2017-08-17 21:29:15 +02:00
Debarshi Ray
115a1323b4 Revert "online-accounts: Fix crash after aborting web view ..."
I pushed it by mistake. The GtkDialog needs to be destroyed in
dispose, not finalize.

This reverts commit 60cf7f6b27.

https://bugzilla.gnome.org/show_bug.cgi?id=782043
2017-08-17 21:28:59 +02:00
Georges Basile Stavracas Neto
60cf7f6b27 online-accounts: Fix crash after aborting web view and changing panels
The panel owns both the GtkDialog, and the GoaProvider that is used
with the dialog during goa_provider_add_account. When the panel is
destroyed, it drops its references to the provider but not the dialog,
which is a separate top-level widget. Therefore, if the panel is
switched while the WebKitWebView inside the dialog was still
navigating across pages, then WebKitWebView::decide-policy will be
called with an invalid provider.

To avoid this, and a memory leak, the panel should also destroy the
dialog when it is itself getting destructed.

https://bugzilla.gnome.org/show_bug.cgi?id=782043
2017-08-17 20:05:16 +02:00
Debarshi Ray
ebdaa85ba4 online-accounts: Increase the spacing above the "Remove Account" button
https://bugzilla.gnome.org/show_bug.cgi?id=779368
2017-05-31 16:38:16 +02:00
Georges Basile Stavracas Neto
e63accbf82 online-accounts: Move the margins and spacing lower down the hierarchy
The expired credentials GtkButton is going to be replaced with a
GtkInfoBar touching the top, start and end edges of the GtkDialog.
Therefore, the margins around the account details and GtkSwitches
cannot be set on the higher level GtkBoxes. Instead, they need to be
set lower down the hierarchy closer to the actual widgets that need
them.

Bump required GOA version for the new goa_provider_show_account
behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=779368
2017-05-30 17:06:44 +02:00
Piotr Drąg
55b31ba967 online-accounts: Fix grammar in a new string
Since there weren’t any translation updates yet, fix grammar
in the newly added string — “setup” is a noun, “set up” is the verb.
2017-02-23 05:36:09 +01:00
Georges Basile Stavracas Neto
bd527d44c1 online-accounts: Improve dialog content margins
More alignment issues.
2017-02-22 23:13:00 -03:00
Allan Day
2e6d07cb01 online-accounts: Fix account dialog layout
More spacing needed everywhere. This is a partial fix - some other
adjustments are necessary.
2017-02-22 23:12:57 -03:00
Allan Day
432d55b30e online-accounts: Improve panel layout
Ensure sufficient spacing within and around rows. Increase panel
height to make it easier to view the list.
2017-02-22 23:12:52 -03:00
Georges Basile Stavracas Neto
4662c5be58 online-accounts: Make the account editor box vertical
When credentials expire, they're being added horizontally since
this is the default value of the GtkOrientable:orientation property.

Fix that by making the account editor box vertical, and adding some
spacing.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Georges Basile Stavracas Neto
fa81d1679a online-accounts: Only show the accounts list when there are accounts
When the user has no account set, the current implementation of the
Online Accounts panel shows a weird 1px line that is the empty list.

Fix that by only showing the list when there are accounts available.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Debarshi Ray
af7c214aaf online-accounts: Consolidate the row modification code a bit
We have different variants of the same code that iterates over all the
rows in a GtkListBox to find the one that corresponds to a given
account. Some action is then performed on the row, depending on the use
case at hand. In future we might want to look at the other rows in the
list to decide whether to hide the entire GtkFrame or not.

Let's consolidate this to reduce some duplication.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Debarshi Ray
25f97f15ce online-accounts: Shuffle some code around
This will make the subsequent commits easier to read.

We are going to change get_row_for_account to be more generic. Moving
this code higher up will let us use it from a few more call sites.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Georges Basile Stavracas Neto
1594d8c7a1 online-accounts: Align the panel widgets in the middle
The current implementation of the Online Accounts panel allows
2 states: either the widgets of the panel fill the whole horizontal
space, or they shrink and fill only the absolutely minimum. The
ideal solution, however, is to make them grow with the panel.

Fix that by turn the main box into a GtkGrid, and adding stub widgets
that expand horizontally and pull the main widgets to the middle,
allowing them to cover at most 1/3 of the screen. The widgets themselves
are inside a GtkBox, so that hiding them automatically removes the
spacing in between.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Georges Basile Stavracas Neto
1e580c679b online-accounts: Add an offline message label
When offline, we currently block the new accounts listbox
so that users can't add new accounts. There is, however,
no visual indication that we're offline, besides the listbox.

Fix that by adding a descriptive label that's only visible
when offline.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Georges Basile Stavracas Neto
e9198bdb4d online-accounts: Add a bottom row to display non-branded providers
As per the mockups, and mimicking the dialog behavior, add a bottom
row that shows non-branded providers.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00
Georges Basile Stavracas Neto
13da84e451 online-accounts: Add margins to the rows' icons
Per Allan's request, add more margin to the rows' icons.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-17 17:23:59 +01:00
Georges Basile Stavracas Neto
1f1f2e2b1f online-accounts: Always keep editor dialog size the minimum
When adding and editing accounts, the different options that Online
Accounts provides may require different sizes of the dialog. There is,
however, a specific issue where the dialog can't resize because a
provider widget is interefering with the others.

Fix that by making the dialog's stack non-homogeneous, and making sure
to always reset the dialog size before showing it.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-17 17:19:45 +01:00
Georges Basile Stavracas Neto
6c633621a4 online-accounts: Drop GoaAddAccountDialog
The dialog is not used anymore, and can be safely removed.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-13 16:00:53 +01:00
Georges Basile Stavracas Neto
a6858fff62 online-accounts: Hide remove button when account is locked
https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-13 15:09:26 +01:00
Georges Basile Stavracas Neto
5807bb4cc3 online-accounts: Add separators between listbox rows
https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-13 14:59:14 +01:00
Georges Basile Stavracas Neto
7d852bfab0 online-accounts: Small UI improvement
Add more margin to the lists.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-13 14:56:31 +01:00
Georges Basile Stavracas Neto
14d0988208 online-accounts: Bring back account removal
Following the previous commit, this commit effectively brings
back the account removal feature that was temporarily removed
by 4e197b491f.

This is now reimplemented as an in-app notification, and users
now have the option to undo an accidentally removed account.

Some changes by Debarshi Ray.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-13 14:37:08 +01:00
Georges Basile Stavracas Neto
20216c09f9 online-accounts: Add a remove button to the account dialog
After temporarily removing the ability to delete accounts in
4e197b491f, let's start bringing it back again by adding a Remove
Account button to the account editor dialog, as per the recent mockups.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-08 18:28:00 +01:00
Georges Basile Stavracas Neto
4f1e27e3ba online-accounts: Explicitly remove the dialog's border width
Looks like Gtk+ assumes all dialogs' internal-vbox widgets have a
2px border, so explicitly set it to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-08 17:33:46 +01:00
Georges Basile Stavracas Neto
d50a07da56 online-accounts: Make adding an account inline to the edit dialog
When adding an account, the old proccess was: use the (removed) toolbar
to open the New Account dialog, select a provider in that dialog, add
the account and see the newly created account in the panel itself.

That approach had issues, e.g. the user would have to close the dialog
if she mistakenly selected a provider. After moving the provider list
to the panel itself, it doesn't make sense anymore to have another
provider list inside the dialog.

Fix this by moving the new account view to the accounts dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-08 17:33:46 +01:00
Georges Basile Stavracas Neto
6f60e64075 online-accounts: Fix typo
This was introduced while rebasing
c26f8ae018

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-08 16:26:09 +01:00
Georges Basile Stavracas Neto
76062e1106 online-accounts: Add a stack to the account dialog
This will be used to unify the account creation proccess and the
account editor.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-01-03 18:50:23 +01:00
Georges Basile Stavracas Neto
dce3e168d2 online-accounts: Remove unused widgets
These widgets are not used anymore, and they're not present in the
latest designs.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-01-03 18:36:41 +01:00