Commit graph

52 commits

Author SHA1 Message Date
Felipe Borges
294156c0f9 Drop most uses of deprecated gtk_style_context_add/remove_class
GtkStyleContext will be deprecated in gtk 4.10.
https://docs.gtk.org/gtk4/class.StyleContext.html

This preserves code blocks where additional GtkStyleContext operations
were used, such as gtk_style_context_save/restore.
2023-01-05 18:55:51 +00:00
Marco Melorio
d39f9e5efc notifications: Remove usage of deprecated gtk_widget_show 2023-01-02 22:10:39 +00:00
Andy Holmes
3d5be3b1fd
notifications: fix potential null dereference in app_info_get_id()
Although apparently unlikely, `strlen()` is called on the return value
of `desktop_id` instead of `ret`, which may result in a null
dereference.
2022-06-30 11:11:06 -07:00
Christopher Davis
17d3a297ae notifications: Handle keynav-failed on app list
Fixes keyboard navigation with arrow keys
2022-02-09 14:33:17 +00:00
Christopher Davis
2f00725af8 notifications: Remove options_listbox
Since CcListRow is now an AdwActionRow subclass,
we don't need to have a custom listbox for the top
group.
2022-02-09 14:33:17 +00:00
Georges Basile Stavracas Neto
ca7ba70047 notifications: Add go-next-symbolic icon to rows
As per design feedback.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Christopher Davis
161e096667 cc-notifications-panel: Use AdwActionRow
AdwActionRow handles most of what we were building
a custom row for, and what it doesn't handle we
can simply use its API for.
2022-01-06 00:51:36 +00:00
Christopher Davis
d61b5bb0b0 cc-notifications-panel: Use AdwPreferences{Page,Group}
libadwaita provides nice pre-built widgets for preferences
pages and groups. We should use them where possible.
2022-01-06 00:51:36 +00:00
Georges Basile Stavracas Neto
75f6566a91 notifications: Port to GTK4
This one was relatively easy, since most of the brokenness came
from using deprecated properties that can just be dropped, and
packaging that can also just be dropped.
2021-12-14 22:34:21 -03:00
Mohammed Sadiq
7f4703d7ad notifications: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Robert Ancell
ba80822797 notifications: Move adjustment widget into GtkBuilder file 2020-12-11 18:41:22 +00:00
Robert Ancell
1306a73e8b notifications: Remove thread loading applications
Stop the app list being loaded in a thread. This is complicated and dangerous as
it accesses a hash table that can also be accessed from the main thread. The
operation is not expensive enough to warrant a thread, and similar code in the
application panel doesn't use one here.
2020-11-03 18:14:00 +00:00
Mohammed Sadiq
70ded401b0 notifications: Use CcListRow for list box rows
This will reduce the amount of code used and let the user change
the item value clicking on the row.
2020-05-12 22:24:00 +00:00
Felipe Borges
36db009819 notifications: Invert the "Do not disturb" switch
The switch is binded to the "show-banners" gsetting. When DnD is
ON, users don't want banners, therefore "show-banners" is OFF.

For this reason we need to invert the switch.

Fixes #878
2020-02-20 15:05:09 +00:00
Robert Ancell
93b14a4339 panel: Move shared GCancellable code into panel class
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
2020-02-03 09:36:24 +13:00
Allan Day
90e0774a19 notifications: Change switch label to Do Not Disturb
!97 added a do not disturb switch to GNOME Shell. This works by
changing the org.gnome.desktop.notifications.show-banners setting.
The switch that controls this setting in the control center should
therefore use the same Do Not Disturb label as the switch in the
shell.
2020-01-27 17:58:17 +00:00
Felipe Borges
7e17e308af notifications: Add shadow to application icons
The new GNOME application icons need a shadow when placed on top
of a light background.

See https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-03-13 13:46:23 +01:00
Adrien Plazas
587ca5ce98 notifications: 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
Robert Ancell
9fa1e73da8 notifications: Use GtkTemplate
Switch from GtkBuilder to using GtkTemplate.
Rename widget IDs to be more readable.
Drop widget IDs that are not used.
Move code into the .ui file that can be.
Connect signals in swapped form.
2018-10-15 20:42:45 +00:00
Robert Ancell
2a6c151483 notifications: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-11 22:21:34 +00:00
Georges Basile Stavracas Neto
a2e166d0d6 Revert "notification: Cache D-Bus proxy"
This reverts commit 77ac09aa04.
2018-08-27 12:56:20 +00:00
Robert Ancell
17dbce362e notifications: Refactor app notifications dialog
The current widget has a very generic name "EditDialog" - rename it to something
that reflects better what it is for.

Implement it is as a full GtkWidget using GtkTemplate.

Move some of the logic from inside the dialog to the code that creates the dialog
so less data is passed around.

Store properties using functions instead of g_object_set_data - that passes
everything as a gpointer which is easy to make a mistake with.
2018-07-16 19:36:19 +00:00
Robert Ancell
b3ea72735a notifications: Use g_signal_connect_object to ensure handlers are not run after object destroyed
Fixes specific crash:
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/75
2018-07-03 11:42:00 +12:00
Robert Ancell
7e4c1e3eae nofications: Use g_auto for variables 2018-05-29 18:29:45 +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
77ac09aa04 notification: Cache D-Bus proxy 2018-04-06 22:23:39 -03:00
Jeremy Bicha
eefc10dbe5 notifications: Add help link
https://bugzilla.gnome.org/show_bug.cgi?id=789321
2017-10-24 11:42:31 -04:00
Allan Day
c7fea8894f Give search and notifications consistent row layouts
The search and notification panels have similar list rows,
as they both list applications. This gives the list rows more
consistent layouts - application icons are made to be 32px
throughout and row heights are made to be the same.

Note that the row widths are unfortunately still different.

https://bugzilla.gnome.org/show_bug.cgi?id=786384
2017-08-20 18:38:23 +02:00
Matthias Clasen
8b9be45cba notifications: Forward notification settings to portal
The flatpak notification portal reads permissions out
of the permission store, so forward the notification
permissions there in order to prevent sandboxed
applications from sending notifications.

The difference is a bit cosmetic, since the shell would
not show the notification anyway in this case, but it
is nicer to just cut off the calls and not let them
through the portal in the first place.

https://bugzilla.gnome.org/show_bug.cgi?id=778851
2017-03-02 16:40:33 -05:00
Marek Kasik
087c4ff208 notifications: Don't crash because of zero-length string
Check whether given application child is at least 1 character
long to avoid crash which can happen as a result of creating
of GDesktopAppInfo with NULL desktop file id.
To reproduce this run "gnome-control-center notifications" and
"gsettings set org.gnome.desktop.notifications application-children "['']"".

https://bugzilla.gnome.org/show_bug.cgi?id=752525
2015-07-27 16:23:19 +02:00
Martin Hatina
75df3ebe87 notifications: Align icons
Icons are now aligned even when they don't have same size.

https://bugzilla.gnome.org/show_bug.cgi?id=711389
2015-05-11 18:30:18 +02:00
Martin Hatina
ed37aa2cae notifications: Do not show nameless apps
Apps with no name are not added to list.

https://bugzilla.gnome.org/show_bug.cgi?id=693622
2015-05-11 18:05:39 +02:00
Martin Hatina
3c710f1f32 notifications: Make section headings accessible
The section headings are useful to understand the content of this panel.

https://bugzilla.gnome.org/show_bug.cgi?id=746757
2015-05-11 17:23:10 +02:00
Marek Kasik
e923c5d5c7 notifications: Shrink application icons
Shrink application icons and add some margin to them so
the overall size is the same.

https://bugzilla.gnome.org/show_bug.cgi?id=742522
2015-01-20 15:17:20 +01:00
Marek Kasik
9407015730 notifications: Place switches into GtkListBox
Place panel switches into GtkListBox and change their
behaviour so that:

When "Notifications" switch is off, all other switches in the dialog are
insensitive.
"Notifications Banners" switch is off and insensitive when corresponding
panel switch is off.
"Show Message Content in Banners" switch is off and insensitive when switch
above is off.
"Lock Screen Notifications" switch is off and insensitive when corresponding
panel switch is off.
"Show Message Content on Lock Screen" switch is off and insensitive when switch
above is off.

https://bugzilla.gnome.org/show_bug.cgi?id=742521
2015-01-20 15:17:20 +01:00
Marek Kasik
1a4fdd47dc notifications: Move switches to a GtkListBox
Place the "Show Pop Up Banners" and "Show in Lock Screen" labels
in a list. This makes the UI easier to read.
Add frame around the list box.

https://bugzilla.gnome.org/show_bug.cgi?id=742521
2015-01-20 15:17:20 +01:00
Marek Kasik
5641299a2a notifications: Scroll the view not just the list
Scrolling the view gives more room for viewing the list and
provides a larger scroll area, making the list easier to use.
Set height of content of the panel to 400 pixels.
Add frame around the list box.

https://bugzilla.gnome.org/show_bug.cgi?id=742520
2015-01-20 15:17:20 +01:00
Bastien Nocera
db756d7b58 notifications: Force smaller icons
To work-around application icons that would be too big.

https://bugzilla.gnome.org/show_bug.cgi?id=742116
2015-01-07 19:03:11 +01:00
Bastien Nocera
ea66f828eb notifications: Fix duplicates in application list
When saving applications in the "application-children" list, gnome-shell
will lower-case the whole canonical application ID in _canonicalizeId().

Match _canonicalizeId()'s behaviour, and lower-case the canonical
application ID so we don't try to load "org-gnome-Software" from
GNOME-Software's desktop file in addition to the already saved
"org-gnome-software".

https://bugzilla.gnome.org/show_bug.cgi?id=729447
2014-07-01 16:26:25 +02:00
Bastien Nocera
45183a89b5 notifications: Add better debug for saved apps
So we can see the apps for which there already are saved settings.
2014-07-01 16:26:24 +02:00
Bastien Nocera
3f75672f2d notifications: Use new listbox helpers
https://bugzilla.gnome.org/show_bug.cgi?id=732106
2014-06-24 11:35:31 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Michael Catanzaro
1a1b1a5c6f notifications: fix invalid format string
GLib-GIO-CRITICAL **: g_settings_get: the format string may not contain
'&' (key 'application-children' from schema
'org.gnome.desktop.notifications'). This call will probably stop working
with a future version of glib.

This is fallout from https://bugzilla.gnome.org/show_bug.cgi?id=719979

https://bugzilla.gnome.org/show_bug.cgi?id=721430
2014-01-07 09:39:19 -06:00
Yosef Or Boczko
a9829a11cf notifications: Use margin-start/end instead of margin-left/right
https://bugzilla.gnome.org/show_bug.cgi?id=712661
2013-11-19 22:27:57 +02:00
Rui Matos
f83c66154e notifications: Remove unused toplevel window from .ui file
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:03 +02:00
Alexander Larsson
41b04d551f notifications: Convert to GtkListBox
https://bugzilla.gnome.org/show_bug.cgi?id=702164
2013-07-02 16:19:09 +01:00
Giovanni Campagna
e6e35a2cc9 notifications: don't fail if a referenced application does not exist
If we have settings for an app, but we don't have a desktop file, it
is likely the app was uninstalled, so just ignore it and avoid the
criticals.

https://bugzilla.gnome.org/show_bug.cgi?id=696665
2013-03-27 14:53:32 +01:00
William Jon McCann
5eb05d153a Fix spacing
https://bugzilla.gnome.org/show_bug.cgi?id=693985
2013-02-16 15:45:23 -05:00
Cosimo Cecchi
5975b1773a notifications: use a GResource for GtkBuilder UI definition
https://bugzilla.gnome.org/show_bug.cgi?id=691132
2013-01-07 10:57:06 +01:00
Bastien Nocera
2c4210c1be notifications: Add some debug to the app processing 2013-01-04 15:22:46 +01:00