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.
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.
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
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
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
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
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.
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
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.
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"
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
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
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.
[...]
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.
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.
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
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.
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