Commit graph

592 commits

Author SHA1 Message Date
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
Brandon Nielsen
16aa95bdc8 Return a PpNewPrinter instead of PpPrintDevice, use gtk_show_all
pp_new_printer_dialog_get_new_print_device is replaced with
pp_new_printer_dialog_get_new_printer which returns a PpNewPrinter.

gtk_show_all is used instead of gtk_dialog_run for PpNewPrinterDialog
and PpPPDSelectionDialog.

This is in response to feedback:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/930#note_1202114
2021-07-26 16:03:05 +00:00
Brandon Nielsen
179bda1b64 Make PpNewPrinterDialog a GtkDialog instead of GObject
This is accomplished by moving the calls to pp_printer_add_async
directly to CcPrintersPanel. pp_printer_delete_async calls are already
done directly in the CcPrintersPanel so there is consistency gained by
this implementation in addition to PpNewPrinterDialog actually being a
GtkDialog.

A pp_new_printer_dialog_get_new_print_device method has been added to
PpNewPrinterDialog to allow getting the PpPrintDevice selected by the
user to add. This can be called anytime after a response callback
with a GTK_RESPONSE_OK reponse_id.

PpNewPrinterDialog still does asynchronous operations to populate the
dialog, but the create dialog -> receive signal -> destroy dialog flow
can all be handled like a traditional GtkDialog without additional
callbacks or signalling.
2021-07-26 16:03:05 +00:00
Eric
1fc8b772a4 printers: Make "Add…" button consistent with user accounts panel
The "Add..." toolbar button on the printers panel is currently hidden until the panel is unlocked.
This commit makes the button visible but insensitive when the panel is locked (becoming sensitive when unlocked),
as suggested in #1213. It also changes the text from "Add..." to "Add Printer..."
and updates the subtitle in the infobar to "Unlock to Add Printers and Change Settings."
These changes make the button's UI consistent with the Accounts panel's "Add User..." toolbar button.

Closes #1213
2021-06-09 13:34:01 +00:00
Robert Ancell
2ee5f1422a printers: Ensure PPD copy is always deleted 2021-02-15 10:34:32 +13:00
Robert Ancell
81392210f2 printers: Add note about callback that passed ownership 2021-02-15 10:34:32 +13:00
Robert Ancell
797c36dc0a printers: Improve memory management of backend list 2021-02-15 10:34:32 +13:00
Robert Ancell
5b086c44e8 printers: Don't pass ownership in get_all_ppds_async callback 2021-02-15 10:34:32 +13:00
Robert Ancell
98fd38278a printers: Don't pass ownership in get_ipp_attributes_async callback 2021-02-15 10:34:32 +13:00
Robert Ancell
d970ae48b4 printers: Don't pass ownership in get_ppd_names_async callback 2021-02-15 10:34:32 +13:00
Robert Ancell
0d913f7283 printers: Remove use of goto 2021-02-15 10:34:32 +13:00
Robert Ancell
cede2f5a81 printers: Use g_autoptr for utility functions 2021-02-15 10:34:32 +13:00
Robert Ancell
005b18f2f1 printers: Make helper functions for callback data 2021-02-15 10:34:32 +13:00