Commit graph

604 commits

Author SHA1 Message Date
sunflowerskater
c95dcf2a9a general: Add placeholder text to various search entries
Acc. HIG, "text fields should have placeholder text or a label".

https://developer.gnome.org/hig/patterns/controls/text-fields.html

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2190
2023-04-21 12:40:42 +00:00
Christopher Davis
d25c0e345d general: Use AdwBanner in CcPermissionInfobar
AdwBanner is a new adaptive widget that replaces GtkInfoBar.
AdwBanner adapts better to mobile sizes and has an API
that fits with how we use infobars.

This commit changes CcPermissionInfobar to use an AdwBanner
internally instead of a GtkInfoBar. It also re-implements
part of GtkLockButton, as AdwBanner does not support adding
arbitrary widgets.
2023-04-11 12:23:16 +00:00
Maksym Hazevych
08c2e69851 Resolving suggestions 2023-03-29 14:26:55 +13:00
Maksym Hazevych
e00f773b2f Remove unnecessary visibility change 2023-03-29 14:26:55 +13:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
Zdenek Dohnal
fb07b65cee printers: Use CUPS dest API for printing test page instead CUPS IPP API
The current usage of CUPS IPP API does not work for temporary queues, because the g-c-c sends the request without creating a local printer first, so the request is sent to non-existing printer.
If you use the destination from cupsGetNamedDest() for printing, CUPS library does the local printer creation internally and printing test page will work even for temporary queues.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2148481
2023-02-16 15:12:27 +00:00
Marek Kasik
092cef515d printers: Fix deleting of printers when exiting
Call sync method to remove a printer when exiting Printers panel.
The deletion could not pass otherwise.

Fixes #2174
2023-01-16 14:32:01 +00:00
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
Eric Daigle
2c68c0064a printers: Set search button/entry as sensitive when printers list is empty
Currently, the search function is available when there are no printers. However, it does nothing.

This commit set the search button and entry as sensitive.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2021
2023-01-02 12:29:15 +00:00
Felipe Borges
d36f795dd4 printers: Use AdwStatusPage in the "Add Printer" dialog
For when we show the "No Printers Found" page.

This has no impact but allow us to be consistent with the empty-state
styling as it changes and evolves in AdwStatusPage.

Fixes #2197
2022-12-13 14:22:40 +00:00
Hendrik Müller
7e0357cae3 printers: Improved empty state of printer panel
The empty state of the printer panel is not consistent with other panels
of the GNOME Settings app.
There are two empty states, either the system cannot connect to the
printer service or there are no printers registered yet.

To fix this issue, AdwStatusPage has been introduced for both cases,
which takes care of the layout and reduces the amount of code needed to
create these two pages. With this change, both empty states of the
printer panel have the same look as other panels in their empty state.
2022-12-01 01:29:10 +00:00
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Felipe Borges
12bbd3ea0c printers: Set "use-underline" for Authenticate button in Jobs dialog
The label of the button indicates a mnemonic (_Authenticate).

Fixes #2062
2022-09-19 15:01:05 +02:00
sunflowerskater
53ff717b4d printers: Use the same sentence for "Add Printer" in button and empty-state
Change the add printer button text, from the empty state section, to "Add Printer..."
(previously was "Add a Printer...") so it gets consistent with the add printer button
from the headerbar (in Printers panel) and with other buttons in Settings that end with
ellipsis, such as the "Add Picture..." from the Appearance panel, which doesn't have the
article also.
2022-08-24 08:46:55 +00:00
Marek Kasik
5ceabcb5c7 printers: Show empty-state after removal of the last printer
Check whether the currently removed printer was last. Also
check whether there are other printer being removed by CUPS
right now (their amount is still part of self->num_dests).

Do this check also in actualize_printers_list_cb() to catch
corner cases from timing point of view. This will handle them
with some delay if they show up.

When undone, just check whether the number of printers is higher
than 0 and show the printers-list page.

Fixes #2023
2022-08-18 17:01:02 +02:00
Felipe Borges
4ea4f41e20 printers: Pass correct argument to gtk_builder_add_objects_from_resource
This is detectable with -Wincompatible-pointer-types and warns with
[1/7] Compiling C object panels/printers/libprinters.a.p/cc-printers-panel.c.o
../panels/printers/cc-printers-panel.c: In function ‘cc_printers_panel_init’:
../panels/printers/cc-printers-panel.c:1228:59: warning: passing argument 3 of ‘gtk_builder_add_objects_from_resource’ from incompatible pointer type [-Wincompatible-pointer-types]
 1228 |                                                           objects, &error);
      |                                                           ^~~~~~~
      |                                                           |
      |                                                           gchar ** {aka char **}
In file included from /usr/include/gtk-4.0/gtk/gtkbuildable.h:26,
                 from /usr/include/gtk-4.0/gtk/gtk.h:56,
                 from /usr/local/include/libadwaita-1/adwaita.h:9,
                 from ../shell/cc-panel.h:25,
                 from ../panels/printers/cc-printers-panel.h:21,
                 from ../panels/printers/cc-printers-panel.c:23:
/usr/include/gtk-4.0/gtk/gtkbuilder.h:122:66: note: expected ‘const char **’ but argument is of type ‘gchar **’ {aka ‘char **’}
  122 |                                                   const char   **object_ids,
      |                                                   ~~~~~~~~~~~~~~~^~~~~~~~~~
[7/7] Linking target tests/network/test-wifi-panel-text
2022-08-18 15:33:38 +02:00
Eric Daigle
a71c3ac3c3 cc-printers-panel: don't show two Add Printer buttons at once
As described in #1976, the printers panel shows two Add Printer buttons when the
printers list is empty. Adds a check that sets the Add Printer button in the toolbar
to be invisible when the empty-state page is shown (and thus the other Add Printer
button is visible), creating a less confusing UI.

Closes #1976
2022-08-11 13:08:02 +00:00
Bilal Elmoussaoui
bb86c36147 panels: Use icon-name property instead
Don't embed a custom GtkImage as that would lack the appropriate style
classes
that GtkButton/GtkMenuButton would automatically add for us
2022-07-20 14:15:57 +02:00
Lukáš Tyrychtr
e39de651a2 Fix formatting 2022-06-20 23:04:56 +00:00
Lukáš Tyrychtr
bd74296222 We don't need the declaration after all 2022-06-20 23:04:56 +00:00
Lukáš Tyrychtr
2148e23d97 Printer panel a11y fixes 2022-06-20 23:04:56 +00:00
Robert Ancell
f9fd2587ca printers: Fix missing const on string parameter 2022-05-11 12:16:25 +12:00
Corey Berla
df51bed16c printers: Check for invalid characters in printer names
Currently when you rename a printer through the print details page
there is no indication of errors produced by CUPS, most notable
about any invalid characters used. Adds a function to check
for invalid characters and shows a warning to users.  No
attempt will be made to rename the printer if it contains an
invalid character.  Users are currently shown an elevation prompt
before this fix
https://www.cups.org/doc/man-lpstat.html

Partially addresses #1008
2022-05-10 05:11:51 +00:00
Corey Berla
54341cae07 printers: Add label for invalid characters in printer name
Add a label immediately below the printer name entry in printer
details that warns the user if the printer name contains
invalid characters (or other errors) per the CUPS spec.
2022-05-10 05:11:51 +00:00
Pablo Correa Gómez
b7c545a1e7 printers: Wrap job dialog GtkInfoBar label to fit in narrower screens 2022-05-10 04:37:42 +00:00
Brandon Nielsen
7c5beecc97 printers: Use a GtkDropDown in PpOptionsDialog
PpPpdOptionWidget and PpIppOptionWidget both use combo boxes for
certain types of selections. With GTK4, combo boxes no longer
support scrolling[0], which in turn causes problems setting some
things in the PpOptionsDialog[1].

This replaces instances of GtkComboBox with GtkDropDown which do
support scrolling. This change was applied to both PpIppOptionWidget
and PpPpdOptionWidget as both are used in PpOptions dialog.

Since the configuration values passed to CUPS can no longer be stored
in a GtkTreeModel alongside the displayed values, some logic changes
to update_widget_real in PpPpdOptionWidget to maintain the reference
to the ppd_option_t so the selected index can be mapped to the
configuration value.

[0] - https://gitlab.gnome.org/GNOME/gtk/-/issues/3674
[1] - https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1704
2022-04-05 11:52:00 -03:00
Marek Kasik
9f0733182a printers: Destroy ppd selection dialog explicitly
Destroy PpPPDSelectionDialog in dispose method of PpNewPrinterDialog
as its transient-for property was unset by previous commit
and the dialog is not destroyed automatically now.
2022-03-02 11:03:59 +00:00
Marek Kasik
e81651873c printers: Unset transient-for
Unset transient-for for PpPPDSelectionDialog in its responce callback
since due some reason its parent PpNewPrinterDialog is destroyed first
and once the PpPPDSelectionDialog is being destroyed it tries to
unset the transient-for but unsuccesfully resulting in warnings like:

"instance with invalid (NULL) class pointer"
"g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed"
2022-03-02 11:03:59 +00:00
Brandon Nielsen
18b7f6f026 Simplify callback logic in ppd_selection_cb.
This ensures user_callback does not get called twice when cancelling out
of the ppd selection dialog. Fixes #1599, introduced with 179bda1b / MR: 1011.
2022-02-25 11:44:14 +00:00
Marek Kasik
f7bd51e812 printers: Remove authentication-dialog.ui
The dialog was removed in 2016 but we forgot to remove the UI file.

Fixes #1650
2022-02-22 12:44:12 +01:00
Marek Kasik
8fe87ac6ef printers: Use bold font for title of details dialog
All other dialogs have bold titles, this should too.

Issue #1587
2022-02-11 13:18:15 +01:00
Marek Kasik
2a2d7ec111 printers: Make search entry symetric
Allow search entry of new printer dialog to expand so that it fills
the available area. It does not fill it now so there is more free
space on the right than on the left.

Issue #1587
2022-02-11 13:18:15 +01:00
Marek Kasik
cc75a07a69 printers: Fix blurred icons of printers
Change align of the printers icons to CENTER from FILL so that the icons
are not stretched.

Issue #1587
2022-02-11 13:18:15 +01:00
Sam Hewitt
65b109763b Cleanup private use symbolics
- remove references to deprecated app symbolics
- reduce file size of private-use icons
- update dated icons
2022-02-04 18:12:41 +00:00
Marek Kasik
20adb5632f printers: Remove redundant UI properties
Remove redundant UI properties from PPDSelectionDialog's UI file.
2022-02-04 17:50:04 +01:00
Marek Kasik
613a2d8b5b printers: Fix UI file of PPDSelectionDialog
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Marek Kasik
52fdf0435e printers: Expand PpPrinterEntry when window resizes
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Marek Kasik
e7a1501d13 printers: Do not ellipsize title of details dialog
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Marek Kasik
634d622c7a printers: Show file chooser dialog when selecting PPD
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Georges Basile Stavracas Neto
4300a4a290 panels: Use new CcPanel helpers for title widgets
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Georges Basile Stavracas Neto
8141af469c printers: Port to GTK4
Fortunately for us GtkTreeView still operates pretty
much exactly like in GTK3. Other than that, it's a
dense junction of all that we've done so far to port
other panels.
2021-12-14 22:34:21 -03:00
zhuyaliang
51760441b3 printers: Add adjust printer task priority button
Add a new  button to the 'PpJobRow',This button can adjust the priority of tasks in the print queue to the highest
2021-11-10 15:10:20 +00:00
Brandon Nielsen
c3c58aae38 Code cleanup based on feedback. 2021-07-26 16:03:05 +00:00
Brandon Nielsen
a73a095d76 ppd_list is not a copy, don't free it.
Both consumers of PpPPDSelectionDialog (PpNewPrinterDialog,
PpDetailsDialog) free the PPDList they pass to
pp_ppd_selection_dialog_set_ppd_list and they do not pass a copy, so
PpPPDSelectionDialog should not free the pointer on dispose.

This fixes a racy segfault when closing a PpDetailsDialog after PPD
selection (introduced with this series), did not appear with
PpNewPrinterDialog for some reason.
2021-07-26 16:03:05 +00:00
Brandon Nielsen
b19325167d gtk_widget_show over gtk_widget_show_all. 2021-07-26 16:03:05 +00:00
Brandon Nielsen
6223858c5e Formatting cleanup. 2021-07-26 16:03:05 +00:00