import gnome-control-center-3.28.2-24.el8
This commit is contained in:
parent
e248b68b06
commit
40f91ae74f
@ -69,7 +69,39 @@
|
||||
G_OBJECT_CLASS (cc_printers_panel_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@@ -793,8 +823,7 @@ on_printer_deleted (PpPrinterEntry *prin
|
||||
@@ -740,13 +770,16 @@ on_printer_deletion_undone (GtkButton *b
|
||||
{
|
||||
CcPrintersPanelPrivate *priv;
|
||||
CcPrintersPanel *self = (CcPrintersPanel*) user_data;
|
||||
+ GtkWidget *widget;
|
||||
|
||||
priv = PRINTERS_PANEL_PRIVATE (self);
|
||||
|
||||
gtk_revealer_set_reveal_child (priv->notification, FALSE);
|
||||
|
||||
g_clear_pointer (&priv->deleted_printer_name, g_free);
|
||||
- actualize_printers_list (self);
|
||||
+
|
||||
+ widget = (GtkWidget*) gtk_builder_get_object (priv->builder, "content");
|
||||
+ gtk_list_box_invalidate_filter (GTK_LIST_BOX (widget));
|
||||
|
||||
cancel_notification_timeout (self);
|
||||
}
|
||||
@@ -768,9 +801,11 @@ on_notification_dismissed (GtkButton *bu
|
||||
pp_printer_delete_async (printer,
|
||||
NULL,
|
||||
printer_removed_cb,
|
||||
- NULL);
|
||||
+ g_object_ref (priv->reference));
|
||||
|
||||
- g_clear_pointer (&priv->deleted_printer_name, g_free);
|
||||
+ priv->deleted_printers = g_list_prepend (priv->deleted_printers, priv->deleted_printer_name);
|
||||
+ priv->deleted_printer_name = NULL;
|
||||
+ g_object_unref (printer);
|
||||
}
|
||||
|
||||
gtk_revealer_set_reveal_child (priv->notification, FALSE);
|
||||
@@ -793,8 +828,7 @@ on_printer_deleted (PpPrinterEntry *prin
|
||||
GtkLabel *label;
|
||||
gchar *notification_message;
|
||||
gchar *printer_name;
|
||||
@ -79,7 +111,7 @@
|
||||
|
||||
priv = PRINTERS_PANEL_PRIVATE (self);
|
||||
|
||||
@@ -816,6 +845,9 @@ on_printer_deleted (PpPrinterEntry *prin
|
||||
@@ -816,6 +850,9 @@ on_printer_deleted (PpPrinterEntry *prin
|
||||
priv->deleted_printer_name = g_strdup (printer_name);
|
||||
g_free (printer_name);
|
||||
|
||||
@ -89,7 +121,7 @@
|
||||
gtk_revealer_set_reveal_child (priv->notification, TRUE);
|
||||
|
||||
priv->remove_printer_timeout_id = g_timeout_add_seconds (10, on_remove_printer_timeout, self);
|
||||
@@ -910,6 +942,36 @@ set_current_page (GObject *source_o
|
||||
@@ -910,6 +947,36 @@ set_current_page (GObject *source_o
|
||||
}
|
||||
|
||||
static void
|
||||
@ -126,7 +158,7 @@
|
||||
actualize_printers_list_cb (GObject *source_object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
@@ -920,6 +982,7 @@ actualize_printers_list_cb (GObject
|
||||
@@ -920,6 +987,7 @@ actualize_printers_list_cb (GObject
|
||||
PpCups *cups = PP_CUPS (source_object);
|
||||
PpCupsDests *cups_dests;
|
||||
gboolean new_printer_available = FALSE;
|
||||
@ -134,7 +166,7 @@
|
||||
GError *error = NULL;
|
||||
int i;
|
||||
|
||||
@@ -950,7 +1013,7 @@ actualize_printers_list_cb (GObject
|
||||
@@ -950,7 +1018,7 @@ actualize_printers_list_cb (GObject
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (widget), "printers-list");
|
||||
|
||||
widget = (GtkWidget*) gtk_builder_get_object (priv->builder, "content");
|
||||
@ -143,7 +175,7 @@
|
||||
|
||||
for (i = 0; i < priv->num_dests; i++)
|
||||
{
|
||||
@@ -961,13 +1024,14 @@ actualize_printers_list_cb (GObject
|
||||
@@ -961,13 +1029,14 @@ actualize_printers_list_cb (GObject
|
||||
|
||||
for (i = 0; i < priv->num_dests; i++)
|
||||
{
|
||||
@ -162,7 +194,7 @@
|
||||
}
|
||||
|
||||
if (!priv->entries_filled)
|
||||
@@ -983,6 +1047,30 @@ actualize_printers_list_cb (GObject
|
||||
@@ -983,6 +1052,30 @@ actualize_printers_list_cb (GObject
|
||||
}
|
||||
|
||||
update_sensitivity (user_data);
|
||||
@ -193,7 +225,7 @@
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1028,10 +1116,6 @@ new_printer_dialog_response_cb (PpNewPri
|
||||
@@ -1028,10 +1121,6 @@ new_printer_dialog_response_cb (PpNewPri
|
||||
{
|
||||
CcPrintersPanelPrivate *priv;
|
||||
CcPrintersPanel *self = (CcPrintersPanel*) user_data;
|
||||
@ -204,7 +236,7 @@
|
||||
|
||||
priv = PRINTERS_PANEL_PRIVATE (self);
|
||||
|
||||
@@ -1059,22 +1143,6 @@ new_printer_dialog_response_cb (PpNewPri
|
||||
@@ -1059,22 +1148,6 @@ new_printer_dialog_response_cb (PpNewPri
|
||||
}
|
||||
|
||||
actualize_printers_list (self);
|
||||
@ -227,7 +259,7 @@
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1288,11 +1356,17 @@ filter_function (GtkListBoxRow *row,
|
||||
@@ -1288,11 +1361,17 @@ filter_function (GtkListBoxRow *row,
|
||||
CcPrintersPanel *self = (CcPrintersPanel*) user_data;
|
||||
GtkWidget *search_entry;
|
||||
gboolean retval;
|
||||
@ -250,7 +282,7 @@
|
||||
|
||||
priv = PRINTERS_PANEL_PRIVATE (self);
|
||||
|
||||
@@ -1300,31 +1374,72 @@ filter_function (GtkListBoxRow *row,
|
||||
@@ -1300,31 +1379,72 @@ filter_function (GtkListBoxRow *row,
|
||||
gtk_builder_get_object (priv->builder, "search-entry");
|
||||
|
||||
if (gtk_entry_get_text_length (GTK_ENTRY (search_entry)) == 0)
|
||||
@ -340,7 +372,7 @@
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1364,6 +1479,8 @@ cc_printers_panel_init (CcPrintersPanel
|
||||
@@ -1364,6 +1484,8 @@ cc_printers_panel_init (CcPrintersPanel
|
||||
priv->renamed_printer_name = NULL;
|
||||
priv->old_printer_name = NULL;
|
||||
priv->deleted_printer_name = NULL;
|
||||
@ -349,16 +381,16 @@
|
||||
|
||||
priv->permission = NULL;
|
||||
priv->lockdown_settings = NULL;
|
||||
@@ -1380,6 +1497,8 @@ cc_printers_panel_init (CcPrintersPanel
|
||||
@@ -1380,6 +1502,8 @@ cc_printers_panel_init (CcPrintersPanel
|
||||
priv->actualize_printers_list_cancellable = g_cancellable_new ();
|
||||
priv->cups_status_check_cancellable = g_cancellable_new ();
|
||||
|
||||
+ g_object_set_data_full (priv->reference, "self", self, g_free);
|
||||
+ g_object_set_data_full (priv->reference, "self", self, NULL);
|
||||
+
|
||||
builder_result = gtk_builder_add_objects_from_resource (priv->builder,
|
||||
"/org/gnome/control-center/printers/printers.ui",
|
||||
objects, &error);
|
||||
@@ -1430,6 +1549,10 @@ cc_printers_panel_init (CcPrintersPanel
|
||||
@@ -1430,6 +1554,10 @@ cc_printers_panel_init (CcPrintersPanel
|
||||
"search-changed",
|
||||
G_CALLBACK (gtk_list_box_invalidate_filter),
|
||||
widget);
|
||||
@ -379,7 +411,78 @@
|
||||
gchar *printer_name;
|
||||
gchar *ppd_file_name;
|
||||
int num_jobs;
|
||||
@@ -727,11 +726,34 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -156,10 +155,27 @@ pp_printer_entry_set_property (GObject
|
||||
}
|
||||
}
|
||||
|
||||
+static InkLevelData *
|
||||
+ink_level_data_new (void)
|
||||
+{
|
||||
+ return g_slice_new0 (InkLevelData);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ink_level_data_free (InkLevelData *data)
|
||||
+{
|
||||
+ g_clear_pointer (&data->marker_names, g_free);
|
||||
+ g_clear_pointer (&data->marker_levels, g_free);
|
||||
+ g_clear_pointer (&data->marker_colors, g_free);
|
||||
+ g_clear_pointer (&data->marker_types, g_free);
|
||||
+ g_slice_free (InkLevelData, data);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
pp_printer_entry_init (PpPrinterEntry *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
+ self->inklevel = ink_level_data_new ();
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -260,9 +276,8 @@ tone_down_color (GdkRGBA *color,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-supply_levels_draw_cb (GtkWidget *widget,
|
||||
- cairo_t *cr,
|
||||
- PpPrinterEntry *self)
|
||||
+supply_levels_draw_cb (PpPrinterEntry *self,
|
||||
+ cairo_t *cr)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
gboolean is_empty = TRUE;
|
||||
@@ -271,10 +286,10 @@ supply_levels_draw_cb (GtkWidget *w
|
||||
gint height;
|
||||
int i;
|
||||
|
||||
- context = gtk_widget_get_style_context (widget);
|
||||
+ context = gtk_widget_get_style_context (GTK_WIDGET (self->supply_drawing_area));
|
||||
|
||||
- width = gtk_widget_get_allocated_width (widget);
|
||||
- height = gtk_widget_get_allocated_height (widget);
|
||||
+ width = gtk_widget_get_allocated_width (GTK_WIDGET (self->supply_drawing_area));
|
||||
+ height = gtk_widget_get_allocated_height (GTK_WIDGET (self->supply_drawing_area));
|
||||
|
||||
gtk_render_background (context, cr, 0, 0, width, height);
|
||||
|
||||
@@ -376,13 +391,13 @@ supply_levels_draw_cb (GtkWidget *w
|
||||
|
||||
if (tooltip_text)
|
||||
{
|
||||
- gtk_widget_set_tooltip_text (widget, tooltip_text);
|
||||
+ gtk_widget_set_tooltip_text (GTK_WIDGET (self->supply_drawing_area), tooltip_text);
|
||||
g_free (tooltip_text);
|
||||
}
|
||||
else
|
||||
{
|
||||
- gtk_widget_set_tooltip_text (widget, NULL);
|
||||
- gtk_widget_set_has_tooltip (widget, FALSE);
|
||||
+ gtk_widget_set_tooltip_text (GTK_WIDGET (self->supply_drawing_area), NULL);
|
||||
+ gtk_widget_set_has_tooltip (GTK_WIDGET (self->supply_drawing_area), FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,11 +742,34 @@ pp_printer_entry_new (cups_dest_t print
|
||||
gboolean is_authorized)
|
||||
{
|
||||
PpPrinterEntry *self;
|
||||
@ -415,16 +518,18 @@
|
||||
gchar *location = NULL;
|
||||
gchar *printer_icon_name = NULL;
|
||||
gchar *default_icon_name = NULL;
|
||||
@@ -798,8 +820,6 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -798,10 +836,6 @@ pp_printer_entry_new (cups_dest_t print
|
||||
N_("The optical photo conductor is no longer functioning")
|
||||
};
|
||||
|
||||
- self = g_object_new (PP_PRINTER_ENTRY_TYPE, "printer-name", printer.name, NULL);
|
||||
-
|
||||
self->inklevel = g_slice_new0 (InkLevelData);
|
||||
|
||||
- self->inklevel = g_slice_new0 (InkLevelData);
|
||||
-
|
||||
if (printer.instance)
|
||||
@@ -816,7 +836,7 @@ pp_printer_entry_new (cups_dest_t print
|
||||
{
|
||||
instance = g_strdup_printf ("%s / %s", printer.name, printer.instance);
|
||||
@@ -816,7 +850,7 @@ pp_printer_entry_new (cups_dest_t print
|
||||
for (i = 0; i < printer.num_options; i++)
|
||||
{
|
||||
if (g_strcmp0 (printer.options[i].name, "device-uri") == 0)
|
||||
@ -433,7 +538,7 @@
|
||||
else if (g_strcmp0 (printer.options[i].name, "printer-uri-supported") == 0)
|
||||
printer_uri = printer.options[i].value;
|
||||
else if (g_strcmp0 (printer.options[i].name, "printer-type") == 0)
|
||||
@@ -826,13 +846,25 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -826,13 +860,25 @@ pp_printer_entry_new (cups_dest_t print
|
||||
else if (g_strcmp0 (printer.options[i].name, "printer-state-reasons") == 0)
|
||||
reason = printer.options[i].value;
|
||||
else if (g_strcmp0 (printer.options[i].name, "marker-names") == 0)
|
||||
@ -463,7 +568,7 @@
|
||||
else if (g_strcmp0 (printer.options[i].name, "printer-make-and-model") == 0)
|
||||
printer_make_and_model = printer.options[i].value;
|
||||
else if (g_strcmp0 (printer.options[i].name, "printer-state") == 0)
|
||||
@@ -896,6 +928,11 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -896,6 +942,11 @@ pp_printer_entry_new (cups_dest_t print
|
||||
gtk_label_set_label (self->error_status, status);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->printer_error), TRUE);
|
||||
}
|
||||
@ -475,7 +580,7 @@
|
||||
|
||||
switch (self->printer_state)
|
||||
{
|
||||
@@ -921,7 +958,7 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -921,7 +972,7 @@ pp_printer_entry_new (cups_dest_t print
|
||||
break;
|
||||
}
|
||||
|
||||
@ -484,7 +589,7 @@
|
||||
printer_icon_name = g_strdup ("printer");
|
||||
else
|
||||
printer_icon_name = g_strdup ("printer-network");
|
||||
@@ -931,14 +968,8 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -931,14 +982,8 @@ pp_printer_entry_new (cups_dest_t print
|
||||
self->is_accepting_jobs = is_accepting_jobs;
|
||||
self->is_authorized = is_authorized;
|
||||
|
||||
@ -501,7 +606,7 @@
|
||||
|
||||
gtk_image_set_from_icon_name (self->printer_icon, printer_icon_name, GTK_ICON_SIZE_DIALOG);
|
||||
gtk_label_set_text (self->printer_status, printer_status);
|
||||
@@ -970,7 +1001,6 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -970,7 +1015,6 @@ pp_printer_entry_new (cups_dest_t print
|
||||
gtk_label_set_text (self->printer_location_address_label, location);
|
||||
}
|
||||
|
||||
@ -509,7 +614,7 @@
|
||||
ink_supply_is_empty = supply_level_is_empty (self);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->printer_inklevel_label), !ink_supply_is_empty);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->supply_frame), !ink_supply_is_empty);
|
||||
@@ -983,8 +1013,6 @@ pp_printer_entry_new (cups_dest_t print
|
||||
@@ -983,8 +1027,6 @@ pp_printer_entry_new (cups_dest_t print
|
||||
g_free (instance);
|
||||
g_free (printer_icon_name);
|
||||
g_free (default_icon_name);
|
||||
@ -518,6 +623,14 @@
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1008,6 +1050,7 @@ pp_printer_entry_dispose (GObject *objec
|
||||
g_clear_pointer (&self->printer_location, g_free);
|
||||
g_clear_pointer (&self->printer_make_and_model, g_free);
|
||||
g_clear_pointer (&self->printer_hostname, g_free);
|
||||
+ g_clear_pointer (&self->inklevel, ink_level_data_free);
|
||||
|
||||
if (self->get_jobs_cancellable != NULL)
|
||||
{
|
||||
--- gnome-control-center-3.28.2/panels/printers/pp-printer-entry.h
|
||||
+++ gnome-control-center-3.28.2/panels/printers/pp-printer-entry.h
|
||||
@@ -42,4 +42,8 @@ void pp_printer_entry_show_jo
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
Name: gnome-control-center
|
||||
Version: 3.28.2
|
||||
Release: 23%{?dist}
|
||||
Release: 24%{?dist}
|
||||
Summary: Utilities to configure the GNOME desktop
|
||||
|
||||
License: GPLv2+ and CC-BY-SA
|
||||
@ -228,6 +228,11 @@ chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gnome-control-center
|
||||
%dir %{_datadir}/gnome/wm-properties
|
||||
|
||||
%changelog
|
||||
* Wed Dec 02 2020 Marek Kasik <mkasik@redhat.com> - 3.28.2-24
|
||||
- Fix crashes when updating printer entries
|
||||
- Related: #1700002
|
||||
- Resolves: #1903043
|
||||
|
||||
* Tue Nov 24 2020 Marek Kasik <mkasik@redhat.com> - 3.28.2-23
|
||||
- Update list of printers instead of regenerating it
|
||||
- Resolves: #1700002
|
||||
|
Loading…
Reference in New Issue
Block a user