Commit graph

24 commits

Author SHA1 Message Date
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
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
Brandon Nielsen
c239521e9d Change PpPPDSelectionDialog to GtkDialog
The dialog is now displayed by calling gtk_dialog_run and
gtk_window_set_transient_for in the window displaying the dialog.
Cleanup is handled using gtk_widget_destroy.

Destructors in the windows using the dialog no longer cleanup the dialog
as it is assumed it will be either cleaned up after the response
callback, or handled by the destroy_with_parent property set on the
dialog itself.
2021-01-08 02:49:32 +00:00
Robert Ancell
ae1a37b009 printers: Remove use of gtk_widget_show_all
It is removed in GTK 4.
2020-11-26 16:02:57 +00:00
Brandon Nielsen
9364deba3e Code cleanup as per HACKING. 2020-09-25 01:59:57 +00:00
Brandon Nielsen
68dca0e748 Consumers clean up the PPD list, not the dialog itself. 2020-09-25 01:59:57 +00:00
Brandon Nielsen
bee87f1b0a Spaces over tabs. 2020-09-25 01:59:57 +00:00
Brandon Nielsen
26e8f11566 component: PpPPDSelectionDialog
G_IS_OBJECT checks fail when calling g_signal_connect_object because
PpPPDSelectionDialog is a struct, not a type descending from G_OBJECT.

This makes the changes required for PpPPDSelectionDialog to be a
GObject, and defines PpPPDSelectionDialog as a GObject. It also updates
consumers of PpPPDSelectionDialog to destroy created PpPPDSelectionDialogs as GObjects.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1126
2020-09-25 01:59:57 +00:00
Robert Ancell
b2c5056031 printers: Use g_autoptr 2020-09-22 21:23:04 +00:00
Robert Ancell
ec23d22ada printers: Use g_clear_object 2020-09-22 21:23:04 +00:00
Robert Ancell
b994237acd printers: Remove unused class members 2020-07-02 16:20:25 +00:00
Robert Ancell
4502673b6c printers: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:50 +13:00
Robert Ancell
47cd15d911 printers: Use self variable to match coding style 2019-01-30 11:33:28 +13:00
Robert Ancell
877445cbaf printers: Use g_autoptr for GError handling 2018-09-17 15:19:21 +00:00
Robert Ancell
09465579b7 printers: Use const for manufacturer string 2018-08-02 10:02:15 +00:00
Michael Catanzaro
22cb7ccedb printers: Avoid warning about unparented ppd selection dialog
Just need to call gtk_window_set_transient_for() a bit earlier.

https://bugzilla.gnome.org/show_bug.cgi?id=755713
2015-10-07 21:37:43 -05:00
Marek Kasik
66eb1c9164 printers: Don't use methods of deprecated GtkMisc
Use GtkWidget's methods for settings of halign, valign and margin-start
instead of GtkMisc's methods for settings of xalign, yalign and xpad.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
15b5045ed3 printers: Don't update alignment padding for dialogs
The update of alignment padding is not needed since gtk+ 3.14.
It was needed for proper alignment of widgets of action area
with those from content area.

https://bugzilla.gnome.org/show_bug.cgi?id=739737
2014-11-25 12:01:17 +01:00
Marek Kasik
8331c88bcd printers: Export name of selected PPD from PPD dialog
Add pp_ppd_selection_dialog_get_ppd_display_name() function
which returns human-readable name of selected PPD.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Marek Kasik
27aa41f5c1 printers: Visual improvements of driver selection dialog
Make the dialog bigger (600x400). Add padding between list of manufacturers
and the list of drivers. Add padding to manufacturers and drivers lists.
Change Manufacturers and Drivers to singular. Trigger resizing of treeview
when list has changed so it has optimal width.

https://bugzilla.gnome.org/show_bug.cgi?id=690448
2013-02-15 16:07:39 +01:00
Cosimo Cecchi
3064425711 printers: use a GResource for GtkBuilder UI definition
https://bugzilla.gnome.org/show_bug.cgi?id=691132
2013-01-07 10:57:15 +01:00
Marek Kasik
1eb906515f printers: Use GPLv2+ for files created by Marek Kasik
This commit is related to the bug #683420.
2012-09-11 15:02:26 +02:00
Marek Kasik
dd7479caea printers: Allow users to change printer's PPD file
This commit adds popup window which when activated allows
user to select PPD from local database of installed PPDs,
select directly PPD from filesystem or select one from 3
recommended PPDs (#678637).
The popup is activated by clicking on model field (the panel
has to be unlocked). It starts to search for the best PPDs
available immediately after its popup.
All operations are asynchronous.
2012-07-16 13:53:40 +02:00