Hello community, here is the log from the commit of package system-config-printer checked in at Mon Oct 27 17:16:45 CET 2008. -------- --- GNOME/system-config-printer/system-config-printer.changes 2008-10-24 00:17:34.000000000 +0200 +++ /mounts/work_src_done/STABLE/system-config-printer/system-config-printer.changes 2008-10-27 15:41:41.000000000 +0100 @@ -1,0 +2,16 @@ +Mon Oct 27 14:48:16 CET 2008 - vuntz@novell.com + +- Add cups-pk-helper-acceptjobs.patch to make cups-pk-helper + correctly handle AcceptJobs requests. This is essential to have + new printers configured with system-config-printer working. + Fix bnc#433634. +- Add system-config-printer-hide-my-default-printer.patch to hide + my-default-printer from the menus. Note that + system-config-printer already provides this functionality. +- Update system-config-printer-policykit.patch so that we don't + show the old password prompt after changing something in a + printer. +- Obsoletes gnome-cups-manager. No Provides, since it's not the + same application... + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- cups-pk-helper-acceptjobs.patch system-config-printer-hide-my-default-printer.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ system-config-printer.spec ++++++ --- /var/tmp/diff_new_pack.SS5445/_old 2008-10-27 17:16:20.000000000 +0100 +++ /var/tmp/diff_new_pack.SS5445/_new 2008-10-27 17:16:20.000000000 +0100 @@ -22,7 +22,7 @@ License: GPL v2 or later Group: Hardware/Printing Version: 1.0.8 -Release: 2 +Release: 3 %define pycups_version 1.9.42 %define pysmbc_version 1.0.5 %define cups_pk_helper_version 0.0.1 @@ -48,7 +48,12 @@ Patch15: system-config-printer-policykit.patch # PATCH-FIX-OPENSUSE system-config-printer-cups-autoconfig-notifications.patch vuntz@novell.com -- Integration with cups-autoconfig. This will be removed after 11.1, since we'll move to hal-cups-utils. Patch16: system-config-printer-cups-autoconfig-notifications.patch +# PATCH-FIX-OPENSUSE system-config-printer-hide-my-default-printer.patch vuntz@novell.com -- Hide my-default-printer in the menus +Patch17: system-config-printer-hide-my-default-printer.patch +# PATCH-FIX-OPENSUSE cups-pk-helper-acceptjobs.patch vuntz@novell.com -- Make cups-pk-helper correctly handle AcceptJobs requests. +Patch18: cups-pk-helper-acceptjobs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +Obsoletes: gnome-cups-manager <= 0.33 # For cups-pk-helper: BuildRequires: PolicyKit-devel BuildRequires: cups-devel @@ -103,6 +108,10 @@ %patch13 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 +pushd cups-pk-helper-%{cups_pk_helper_version} +%patch18 -p1 +popd %build autoreconf -f -i @@ -175,6 +184,19 @@ %files lang -f %{name}.lang %changelog +* Mon Oct 27 2008 vuntz@novell.com +- Add cups-pk-helper-acceptjobs.patch to make cups-pk-helper + correctly handle AcceptJobs requests. This is essential to have + new printers configured with system-config-printer working. + Fix bnc#433634. +- Add system-config-printer-hide-my-default-printer.patch to hide + my-default-printer from the menus. Note that + system-config-printer already provides this functionality. +- Update system-config-printer-policykit.patch so that we don't + show the old password prompt after changing something in a + printer. +- Obsoletes gnome-cups-manager. No Provides, since it's not the + same application... * Fri Oct 24 2008 vuntz@novell.com - Add system-config-printer-cups-autoconfig-notifications.patch. We display notifications for printers automatically configured ++++++ cups-pk-helper-acceptjobs.patch ++++++ diff --git a/src/cups-pk-helper-mechanism.c b/src/cups-pk-helper-mechanism.c index 45c5fd9..c31e567 100644 --- a/src/cups-pk-helper-mechanism.c +++ b/src/cups-pk-helper-mechanism.c @@ -678,6 +678,9 @@ cph_mechanism_printer_set_accept_jobs (CphMechanism *mechanism, if (!_check_polkit_for_action (mechanism, context, "printeraddremove")) return FALSE; + if (reason && reason[0] == '\0') + reason = NULL; + ret = cph_cups_printer_set_accept_jobs (mechanism->priv->cups, name, enabled, reason); _cph_mechanism_return_error (mechanism, context, !ret); diff --git a/src/cups.c b/src/cups.c index f8b2b9e..ea387a9 100644 --- a/src/cups.c +++ b/src/cups.c @@ -97,6 +97,13 @@ printFiles */ +typedef enum +{ + CPH_RESOURCE_ROOT, + CPH_RESOURCE_ADMIN, + CPH_RESOURCE_JOBS +} CphResource; + G_DEFINE_TYPE (CphCups, cph_cups, G_TYPE_OBJECT) #define CPH_CUPS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CPH_TYPE_CUPS, CphCupsPrivate)) @@ -256,25 +263,51 @@ _cph_cups_handle_reply (CphCups *cups, return retval; } +static const char * +_cph_cups_get_resource (CphResource resource) +{ + switch (resource) + { + case CPH_RESOURCE_ROOT: + return "/"; + case CPH_RESOURCE_ADMIN: + return "/admin/"; + case CPH_RESOURCE_JOBS: + return "/jobs/"; + default: + /* that's a fallback -- we don't use + * g_assert_not_reached() to avoir crashing. */ + g_critical ("Asking for a resource with no match."); + return "/"; + } +} + static gboolean -_cph_cups_send_request (CphCups *cups, - ipp_t *request) +_cph_cups_send_request (CphCups *cups, + ipp_t *request, + CphResource resource) { - ipp_t *reply; + ipp_t *reply; + const char *resource_char; - reply = cupsDoRequest (cups->priv->connection, request, "/"); + resource_char = _cph_cups_get_resource (resource); + reply = cupsDoRequest (cups->priv->connection, request, resource_char); return _cph_cups_handle_reply (cups, reply); } static gboolean -_cph_cups_post_request (CphCups *cups, - ipp_t *request, - const char *file) +_cph_cups_post_request (CphCups *cups, + ipp_t *request, + const char *file, + CphResource resource) { ipp_t *reply; + const char *resource_char; - reply = cupsDoFileRequest (cups->priv->connection, request, "/", file); + resource_char = _cph_cups_get_resource (resource); + reply = cupsDoFileRequest (cups->priv->connection, request, + resource_char, file); return _cph_cups_handle_reply (cups, reply); } @@ -282,7 +315,8 @@ _cph_cups_post_request (CphCups *cups, static gboolean _cph_cups_send_new_simple_request (CphCups *cups, ipp_op_t op, - const char *printer_name) + const char *printer_name, + CphResource resource) { ipp_t *request; @@ -293,7 +327,7 @@ _cph_cups_send_new_simple_request (CphCups *cups, request = ippNewRequest (op); _cph_cups_add_printer_uri (request, printer_name); - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, resource); } static gboolean @@ -310,7 +344,7 @@ _cph_cups_send_new_printer_class_request (CphCups *cups, _cph_cups_add_printer_uri (request, printer_name); ippAddString (request, group, type, name, NULL, value); - if (_cph_cups_send_request (cups, request)) + if (_cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN)) return TRUE; /* it failed, maybe it was a class? */ @@ -321,7 +355,7 @@ _cph_cups_send_new_printer_class_request (CphCups *cups, _cph_cups_add_class_uri (request, printer_name); ippAddString (request, group, type, name, NULL, value); - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); } /****************************************************** @@ -369,7 +403,7 @@ cph_cups_printer_add (CphCups *cups, "printer-location", NULL, location); } - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); } gboolean @@ -403,7 +437,8 @@ cph_cups_printer_add_with_ppd_file (CphCups *cups, "printer-location", NULL, location); } - return _cph_cups_post_request (cups, request, ppd_filename); + return _cph_cups_post_request (cups, request, ppd_filename, + CPH_RESOURCE_ADMIN); } gboolean @@ -413,7 +448,8 @@ cph_cups_printer_delete (CphCups *cups, g_return_val_if_fail (CPH_IS_CUPS (cups), FALSE); return _cph_cups_send_new_simple_request (cups, CUPS_DELETE_PRINTER, - printer_name); + printer_name, + CPH_RESOURCE_ADMIN); } gboolean @@ -423,7 +459,8 @@ cph_cups_printer_set_default (CphCups *cups, g_return_val_if_fail (CPH_IS_CUPS (cups), FALSE); return _cph_cups_send_new_simple_request (cups, CUPS_SET_DEFAULT, - printer_name); + printer_name, + CPH_RESOURCE_ADMIN); } gboolean @@ -437,7 +474,8 @@ cph_cups_printer_set_enabled (CphCups *cups, op = enabled ? IPP_RESUME_PRINTER : IPP_PAUSE_PRINTER; - return _cph_cups_send_new_simple_request (cups, op, printer_name); + return _cph_cups_send_new_simple_request (cups, op, printer_name, + CPH_RESOURCE_ADMIN); } gboolean @@ -457,7 +495,7 @@ cph_cups_printer_set_uri (CphCups *cups, ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL, printer_uri); - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); } /* reason must be NULL if accept is TRUE */ @@ -477,7 +515,8 @@ cph_cups_printer_set_accept_jobs (CphCups *cups, if (accept) return _cph_cups_send_new_simple_request (cups, CUPS_ACCEPT_JOBS, - printer_name); + printer_name, + CPH_RESOURCE_ADMIN); /* !accept */ request = ippNewRequest (CUPS_REJECT_JOBS); @@ -487,7 +526,7 @@ cph_cups_printer_set_accept_jobs (CphCups *cups, ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "printer-state-message", NULL, reason); - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); } /* Functions that can work on printer and class */ @@ -540,7 +579,7 @@ cph_cups_printer_class_set_shared (CphCups *cups, ippAddBoolean (request, IPP_TAG_OPERATION, "printer-is-shared", shared ? 1 : 0); - if (_cph_cups_send_request (cups, request)) + if (_cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN)) return TRUE; /* it failed, maybe it was a class? */ @@ -552,7 +591,7 @@ cph_cups_printer_class_set_shared (CphCups *cups, ippAddBoolean (request, IPP_TAG_OPERATION, "printer-is-shared", shared ? 1 : 0); - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); } gboolean @@ -573,7 +612,7 @@ cph_cups_printer_class_set_job_sheets (CphCups *cups, ippAddStrings (request, IPP_TAG_PRINTER, IPP_TAG_NAME, "job-sheets-default", 2, NULL, values); - if (_cph_cups_send_request (cups, request)) + if (_cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN)) return TRUE; /* it failed, maybe it was a class? */ @@ -585,7 +624,7 @@ cph_cups_printer_class_set_job_sheets (CphCups *cups, ippAddStrings (request, IPP_TAG_PRINTER, IPP_TAG_NAME, "job-sheets-default", 2, NULL, values); - return _cph_cups_send_request (cups, request); + return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); } gboolean @@ -695,7 +734,7 @@ cph_cups_printer_class_set_option_default (CphCups *cups, } } - if (_cph_cups_send_request (cups, request)) { + if (_cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN)) { retval = TRUE; goto out; } @@ -726,7 +765,7 @@ cph_cups_printer_class_set_option_default (CphCups *cups, } } - retval = _cph_cups_send_request (cups, request); + retval = _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN); out: g_free (option_name); ++++++ system-config-printer-hide-my-default-printer.patch ++++++ Index: system-config-printer-1.0.8/my-default-printer.desktop.in =================================================================== --- system-config-printer-1.0.8.orig/my-default-printer.desktop.in +++ system-config-printer-1.0.8/my-default-printer.desktop.in @@ -6,3 +6,4 @@ Exec=my-default-printer Terminal=false Type=Application Icon=system-config-printer +Hidden=true ++++++ system-config-printer-policykit.patch ++++++ --- /var/tmp/diff_new_pack.SS5445/_old 2008-10-27 17:16:20.000000000 +0100 +++ /var/tmp/diff_new_pack.SS5445/_new 2008-10-27 17:16:21.000000000 +0100 @@ -11,7 +11,7 @@ errordialogs.py \ jobviewer.py \ diff --git a/authconn.py b/authconn.py -index 6244eee..ad3bfb0 100644 +index eb2dd23..3795c3b 100644 --- a/authconn.py +++ b/authconn.py @@ -18,6 +18,7 @@ @@ -532,3 +532,16 @@ +# renewSubscription +# printFile +# printFiles +diff --git a/system-config-printer.py b/system-config-printer.py +index 9b5830e..3587e75 100755 +--- a/system-config-printer.py ++++ b/system-config-printer.py +@@ -1537,7 +1537,7 @@ class GUI(GtkGUI, monitor.Watcher): + return True + self.changed = set() # of options + +- if not self.__dict__.has_key ("server_settings"): ++ if not self.cups._use_pk and not self.__dict__.has_key ("server_settings"): + # We can authenticate with the server correctly at this point, + # but we have never fetched the server settings to see whether + # the server is publishing shared printers. Fetch the settings ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de