Compare commits

..

No commits in common. 'i9' and 'c9' have entirely different histories.
i9 ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/system-config-printer-1.5.18.tar.xz
SOURCES/system-config-printer-1.5.15.tar.xz

@ -1 +1 @@
ac248b688ab103da7f034bd0d913e4e299206f4b SOURCES/system-config-printer-1.5.18.tar.xz
766ffe01642cbc959ea34ee01cbe4e7116a514ed SOURCES/system-config-printer-1.5.15.tar.xz

@ -1,26 +0,0 @@
From 399b3334d6519639cfe7f1c0457e2475b8ee5230 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Thu, 13 Oct 2022 14:03:37 +0200
Subject: [PATCH] Fix debugprint() in options.py (fixes #291)
---
NEWS | 4 ++++
options.py | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/options.py b/options.py
index d756f98d..d7c236de 100644
--- a/options.py
+++ b/options.py
@@ -423,7 +423,7 @@ class OptionSelectOne(Option):
debugprint("Unknown value for %s: %s" % (name, value))
debugprint("Choices: %s" % (supported))
if len(supported) > 0:
- debugprint("Selecting from choices:", supported[0])
+ debugprint("Selecting from choices: %s" % supported[0])
self.selector.set_active(0)
self.selector.connect("changed", self.changed)
--
2.39.2

@ -1,731 +0,0 @@
From d408d372d2e1f378f52f52a46ec2f2089f46ced2 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere.ru>
Date: Thu, 24 Aug 2023 15:27:46 +0300
Subject: [PATCH] Fixed text in python files for translation
---
applet.py | 43 ++++++++++-----
authconn.py | 13 +++--
jobviewer.py | 116 ++++++++++++++++++++++++++-------------
newprinter.py | 66 ++++++++++++----------
ppdsloader.py | 7 ++-
printerproperties.py | 61 +++++++++++---------
pysmb.py | 24 +++++---
system-config-printer.py | 8 ++-
8 files changed, 214 insertions(+), 124 deletions(-)
diff --git a/applet.py b/applet.py
index 704249e..832ee6c 100644
--- a/applet.py
+++ b/applet.py
@@ -55,6 +55,21 @@ from gi.repository import Notify
APPDIR="/usr/share/system-config-printer"
ICON="printer"
+# MSVSphere
+TEXT_missing_drv = _("Missing printer driver")
+TEXT_no_drv_for = _("No printer driver for %s.")
+TEXT_no_drv = _("No driver for this printer.")
+TEXT_search = _("Search")
+TEXT_printer_added = _("Printer added")
+TEXT_install_drv = _("Install printer driver")
+TEXT_reg_drv_inst = _("`%s' requires driver installation: %s.")
+TEXT_is_ready = _("`%s' is ready for printing.")
+TEXT_test_page = _("Print Test Page")
+TEXT_configure = _("Configure")
+TEXT_has_been_added = _("`%s' has been added, using the `%s' driver.")
+TEXT_find_drv = _("Find driver")
+
+
# We need to call Notify.init before we can check the server for caps
Notify.init('System Config Printer Notification')
@@ -119,21 +134,21 @@ class NewPrinterNotification(dbus.service.Object):
if name.find("/") >= 0:
# name is a URI, no queue was generated, because no suitable
# driver was found
- title = _("Missing printer driver")
+ title = TEXT_missing_drv
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
if (mfg and mdl) or des:
if (mfg and mdl):
device = "%s %s" % (mfg, mdl)
else:
device = des
- text = _("No printer driver for %s.") % device
+ text = TEXT_no_drv_for % device
else:
- text = _("No driver for this printer.")
+ text = TEXT_no_drv
n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
n.set_urgency (Notify.Urgency.CRITICAL)
n.set_timeout (Notify.EXPIRES_NEVER)
- n.add_action ("setup-printer", _("Search"),
+ n.add_action ("setup-printer", TEXT_search,
lambda x, y:
self.setup_printer (x, y, name, devid))
else:
@@ -170,14 +185,14 @@ class NewPrinterNotification(dbus.service.Object):
(make, model) = ppdMakeModelSplit (printer['printer-make-and-model'])
driver = make + " " + model
if status < self.STATUS_GENERIC_DRIVER:
- title = _("Printer added")
+ title = TEXT_printer_added
else:
- title = _("Missing printer driver")
+ title = TEXT_missing_drv
if len (missing_pkgs) > 0:
pkgs = reduce (lambda x,y: x + ", " + y, missing_pkgs)
- title = _("Install printer driver")
- text = (_("`%s' requires driver installation: %s.") %
+ title = TEXT_install_drv
+ text = ( TEXT_reg_drv_inst %
(name, pkgs))
n = Notify.Notification.new (title, text, 'printer')
import installpackage
@@ -201,26 +216,26 @@ class NewPrinterNotification(dbus.service.Object):
elif status == self.STATUS_SUCCESS:
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
- text = _("`%s' is ready for printing.") % name
+ text = TEXT_is_ready % name
n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
n.set_urgency (Notify.Urgency.NORMAL)
- n.add_action ("test-page", _("Print test page"),
+ n.add_action ("test-page", TEXT_test_page,
lambda x, y:
self.print_test_page (x, y, name))
- n.add_action ("configure", _("Configure"),
+ n.add_action ("configure", TEXT_configure,
lambda x, y: self.configure (x, y, name))
else: # Model mismatch
devid = "MFG:%s;MDL:%s;DES:%s;CMD:%s;" % (mfg, mdl, des, cmd)
- text = (_("`%s' has been added, using the `%s' driver.") %
+ text = ( TEXT_has_been_added %
(name, driver))
n = Notify.Notification.new (title, text, 'printer')
if "actions" in Notify.get_server_caps():
n.set_urgency (Notify.Urgency.CRITICAL)
- n.add_action ("test-page", _("Print test page"),
+ n.add_action ("test-page", TEXT_test_page,
lambda x, y:
self.print_test_page (x, y, name, devid))
- n.add_action ("find-driver", _("Find driver"),
+ n.add_action ("find-driver", TEXT_find_drv,
lambda x, y:
self.find_driver (x, y, name, devid))
n.set_timeout (Notify.EXPIRES_NEVER)
diff --git a/authconn.py b/authconn.py
index 37ff2fc..771c8a2 100644
--- a/authconn.py
+++ b/authconn.py
@@ -34,11 +34,16 @@ import gettext
gettext.install(domain=config.PACKAGE, localedir=config.localedir)
N_ = lambda x: x
+TEXT_user = _("Username:")
+TEXT_domain = _("Domain:")
+TEXT_password = _("Password:")
+TEXT_auth = _("Authentication")
+
cups.require("1.9.60")
class AuthDialog(Gtk.Dialog):
- AUTH_FIELD={'username': N_("Username:"),
- 'password': N_("Password:"),
- 'domain': N_("Domain:")}
+ AUTH_FIELD={'username': N_(TEXT_user),
+ 'password': N_(TEXT_password),
+ 'domain': N_(TEXT_domain)}
def __init__ (self, title=None, parent=None,
flags=Gtk.DialogFlags.MODAL,
@@ -47,7 +52,7 @@ class AuthDialog(Gtk.Dialog):
auth_info_required=None,
allow_remember=False):
if title is None:
- title = _("Authentication")
+ title = TEXT_auth
if auth_info_required is None:
auth_info_required = ['username', 'password']
Gtk.Dialog.__init__ (self, title, parent, flags, buttons)
diff --git a/jobviewer.py b/jobviewer.py
index 5376a7e..ac8a5f3 100644
--- a/jobviewer.py
+++ b/jobviewer.py
@@ -70,6 +70,46 @@ ICON="printer"
ICON_SIZE=22
SEARCHING_ICON="document-print-preview"
+# MSVSphere
+TEXT_my_jobs_on = _("my jobs on %s")
+TEXT_my_jobs = _("my jobs")
+TEXT_all_jobs = _("all jobs")
+TEXT_doc_prn_status = _("Document Print Status (%s)")
+TEXT_job = _("Job")
+TEXT_user = _("User")
+TEXT_doc = _("Document")
+TEXT_prn = _("Printer")
+TEXT_size = _("Size")
+TEXT_time_subm = _("Time submitted")
+TEXT_status = _("Status")
+TEXT_cancel = _("_Cancel")
+TEXT_del = _("_Delete")
+TEXT_hold = _("_Hold")
+TEXT_release = _("_Release")
+TEXT_reprint = _("Re_print")
+TEXT_retrieve = _("Re_trieve")
+TEXT_move_to = _("_Move To")
+TEXT_auth = _("_Authenticate")
+TEXT_view_attr = _("_View Attributes")
+TEXT_close_wnd = _("Close this window")
+TEXT_del_jobs = _("Delete Jobs")
+TEXT_del_jobs_ask = _("Do you really want to delete these jobs?")
+TEXT_del_job = _("Delete Job")
+TEXT_del_job_ask = _("Do you really want to delete this job?")
+TEXT_cancel_jobs = _("Cancel Jobs")
+TEXT_cancel_jobs_ask = _("Do you really want to cancel these jobs?")
+TEXT_cancel_job = _("Cancel Job")
+TEXT_cancel_job_ask = _("Do you really want to cancel this job?")
+TEXT_keep_prn = _("Keep Printing")
+TEXT_deleting = _("deleting job")
+TEXT_canceling = _("canceling job")
+TEXT_cancel_selected = _("Cancel selected jobs")
+TEXT_delete_selected = _("Delete selected jobs")
+TEXT_hold_selected = _("Hold selected jobs")
+TEXT_release_selected = _("Release selected jobs")
+TEXT_reprint_selected = _("Reprint selected jobs")
+TEXT_retrieve_selected = _("Retrieve selected jobs")
+
# We need to call Notify.init before we can check the server for caps
Notify.init('System Config Printer Notification')
@@ -243,22 +283,22 @@ class CancelJobsOperation(GObject.GObject):
self.encryption = encryption
if purge_job:
if len(self.jobids) > 1:
- dialog_title = _("Delete Jobs")
- dialog_label = _("Do you really want to delete these jobs?")
+ dialog_title = TEXT_del_jobs
+ dialog_label = TEXT_del_jobs_ask
else:
- dialog_title = _("Delete Job")
- dialog_label = _("Do you really want to delete this job?")
+ dialog_title = TEXT_del_job
+ dialog_label = TEXT_del_job_ask
else:
if len(self.jobids) > 1:
- dialog_title = _("Cancel Jobs")
- dialog_label = _("Do you really want to cancel these jobs?")
+ dialog_title = TEXT_cancel_jobs
+ dialog_label = TEXT_cancel_jobs_ask
else:
- dialog_title = _("Cancel Job")
- dialog_label = _("Do you really want to cancel this job?")
+ dialog_title = TEXT_cancel_job
+ dialog_label = TEXT_cancel_job_ask
dialog = Gtk.Dialog (title=dialog_title, transient_for=parent,
modal=True, destroy_with_parent=True)
- dialog.add_buttons (_("Keep Printing"), Gtk.ResponseType.NO,
+ dialog.add_buttons (TEXT_keep_prn, Gtk.ResponseType.NO,
dialog_title, Gtk.ResponseType.YES)
dialog.set_default_response (Gtk.ResponseType.NO)
dialog.set_border_width (6)
@@ -325,9 +365,9 @@ class CancelJobsOperation(GObject.GObject):
self.connection = connection
if self.purge_job:
- operation = _("deleting job")
+ operation = TEXT_deleting
else:
- operation = _("canceling job")
+ operation = TEXT_canceling
self.connection._begin_operation (operation)
self.connection.cancelJob (self.jobids[0], self.purge_job,
@@ -425,25 +465,25 @@ class JobViewer (GtkGUI):
job_action_group = Gtk.ActionGroup (name="JobActionGroup")
job_action_group.add_actions ([
- ("cancel-job", Gtk.STOCK_CANCEL, _("_Cancel"), None,
- _("Cancel selected jobs"), self.on_job_cancel_activate),
- ("delete-job", Gtk.STOCK_DELETE, _("_Delete"), None,
- _("Delete selected jobs"), self.on_job_delete_activate),
- ("hold-job", Gtk.STOCK_MEDIA_PAUSE, _("_Hold"), None,
- _("Hold selected jobs"), self.on_job_hold_activate),
- ("release-job", Gtk.STOCK_MEDIA_PLAY, _("_Release"), None,
- _("Release selected jobs"), self.on_job_release_activate),
- ("reprint-job", Gtk.STOCK_REDO, _("Re_print"), None,
- _("Reprint selected jobs"), self.on_job_reprint_activate),
- ("retrieve-job", Gtk.STOCK_SAVE_AS, _("Re_trieve"), None,
- _("Retrieve selected jobs"), self.on_job_retrieve_activate),
- ("move-job", None, _("_Move To"), None, None, None),
- ("authenticate-job", None, _("_Authenticate"), None, None,
+ ("cancel-job", Gtk.STOCK_CANCEL, TEXT_cancel, None,
+ TEXT_cancel_selected, self.on_job_cancel_activate),
+ ("delete-job", Gtk.STOCK_DELETE, TEXT_del, None,
+ TEXT_delete_selected, self.on_job_delete_activate),
+ ("hold-job", Gtk.STOCK_MEDIA_PAUSE, TEXT_hold, None,
+ TEXT_hold_selected, self.on_job_hold_activate),
+ ("release-job", Gtk.STOCK_MEDIA_PLAY, TEXT_release, None,
+ TEXT_release_selected, self.on_job_release_activate),
+ ("reprint-job", Gtk.STOCK_REDO, TEXT_reprint, None,
+ TEXT_reprint_selected, self.on_job_reprint_activate),
+ ("retrieve-job", Gtk.STOCK_SAVE_AS, TEXT_retrieve, None,
+ TEXT_retrieve_selected, self.on_job_retrieve_activate),
+ ("move-job", None, TEXT_move_to, None, None, None),
+ ("authenticate-job", None, TEXT_auth, None, None,
self.on_job_authenticate_activate),
- ("job-attributes", None, _("_View Attributes"), None, None,
+ ("job-attributes", None, TEXT_view_attr, None, None,
self.on_job_attributes_activate),
("close", Gtk.STOCK_CLOSE, None, "<ctrl>w",
- _("Close this window"), self.on_delete_event)
+ TEXT_close_wnd, self.on_delete_event)
])
self.job_ui_manager = Gtk.UIManager ()
self.job_ui_manager.insert_action_group (job_action_group, -1)
@@ -506,11 +546,11 @@ class JobViewer (GtkGUI):
self.toolbar.insert (item, -1)
for skip, ellipsize, name, setter in \
- [(False, False, _("Job"), self._set_job_job_number_text),
- (True, False, _("User"), self._set_job_user_text),
- (False, True, _("Document"), self._set_job_document_text),
- (False, True, _("Printer"), self._set_job_printer_text),
- (False, False, _("Size"), self._set_job_size_text)]:
+ [(False, False, TEXT_job, self._set_job_job_number_text),
+ (True, False, TEXT_user, self._set_job_user_text),
+ (False, True, TEXT_doc, self._set_job_document_text),
+ (False, True, TEXT_prn, self._set_job_printer_text),
+ (False, False, TEXT_size, self._set_job_size_text)]:
if applet and skip:
# Skip the user column when running as applet.
continue
@@ -526,11 +566,11 @@ class JobViewer (GtkGUI):
self.treeview.append_column(column)
cell = Gtk.CellRendererText ()
- column = Gtk.TreeViewColumn (_("Time submitted"), cell, text=1)
+ column = Gtk.TreeViewColumn (TEXT_time_subm, cell, text=1)
column.set_resizable (True)
self.treeview.append_column (column)
- column = Gtk.TreeViewColumn (_("Status"))
+ column = Gtk.TreeViewColumn (TEXT_status)
icon = Gtk.CellRendererPixbuf ()
column.pack_start (icon, False)
text = Gtk.CellRendererText ()
@@ -560,15 +600,15 @@ class JobViewer (GtkGUI):
if my_jobs:
if specific_dests:
- title = _("my jobs on %s") % the_dests
+ title = TEXT_my_jobs_on % the_dests
else:
- title = _("my jobs")
+ title = TEXT_my_jobs
else:
if specific_dests:
title = "%s" % the_dests
else:
- title = _("all jobs")
- self.JobsWindow.set_title (_("Document Print Status (%s)") % title)
+ title = TEXT_all_jobs
+ self.JobsWindow.set_title (TEXT_doc_prn_status % title)
if parent:
self.JobsWindow.set_transient_for (parent)
diff --git a/newprinter.py b/newprinter.py
index eee8b55..b476323 100644
--- a/newprinter.py
+++ b/newprinter.py
@@ -72,6 +72,25 @@ HTTPS_TIMEOUT = 15.0
TEXT_adjust_firewall = _("The firewall may need adjusting in order to "
"detect network printers. Adjust the "
"firewall now?")
+# MSVSphere
+TEXT_adjust_firewall_header = _("Adjust Firewall")
+TEXT_adjust_firewall_NO_button = _("Do It Later")
+TEXT_adjust_firewall_YES_button = _("Adjust Firewall")
+TEXT_secondary_text_IPP = _("Allow all incoming IPP Browse packets")
+TEXT_secondary_text_mDNS = _("Allow all incoming mDNS traffic")
+TEXT_secondary_text_SMB = _("Allow all incoming SMB/CIFS browse packets")
+TEXT_show_info_dialog_header = _("No Print Shares")
+TEXT_show_info_dialog_body = _("There were no print shares found. "
+ "Please check that the Samba service is "
+ "marked as trusted in your firewall "
+ "configuration.")
+TEXT_searching = _("Searching")
+TEXT_searching_for_drivers = _("Searching for drivers")
+TEXT_share_verified = _("Print Share Verified")
+TEXT_share_verified_text = _("This print share is accessible.")
+TEXT_share_inaccessible = _("Print Share Inaccessible")
+TEXT_share_inaccessible_text = _("This print share is not accessible.")
+TEXT_no_printer_was_found_at = _("No printer was found at that address.")
def validDeviceURI (uri):
"""Returns True is the provided URI is valid."""
@@ -1666,7 +1685,7 @@ class NewPrinterGUI(GtkGUI):
self.searchedfordriverpackages = True
self._searchdialog_canceled = False
- fmt = _("Searching")
+ fmt = TEXT_searching
self._searchdialog = Gtk.MessageDialog (
parent=self.NewPrinterWindow,
modal=True,
@@ -1675,8 +1694,7 @@ class NewPrinterGUI(GtkGUI):
buttons=Gtk.ButtonsType.CANCEL,
text=fmt)
- self._searchdialog.format_secondary_text (
- _("Searching for drivers"))
+ self._searchdialog.format_secondary_text (TEXT_searching_for_drivers)
self.opreq = OpenPrintingRequest ()
self._searchdialog.connect (
@@ -2266,13 +2284,10 @@ class NewPrinterGUI(GtkGUI):
secondary_text = TEXT_adjust_firewall + "\n\n"
if not ipp_allowed:
- secondary_text += ("- " +
- _("Allow all incoming IPP Browse packets") +
- "\n")
+ secondary_text += "- " + TEXT_secondary_text_IPP + "\n"
f.add_service (firewallsettings.IPP_CLIENT_SERVICE)
if not mdns_allowed:
- secondary_text += ("- " +
- _("Allow all incoming mDNS traffic") + "\n")
+ secondary_text += "- " + TEXT_secondary_text_mDNS + "\n"
f.add_service (firewallsettings.MDNS_SERVICE)
if not allowed:
@@ -2282,10 +2297,10 @@ class NewPrinterGUI(GtkGUI):
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE,
- text= _("Adjust Firewall"))
+ text= TEXT_adjust_firewall_header)
dialog.format_secondary_markup (secondary_text)
- dialog.add_buttons (_("Do It Later"), Gtk.ResponseType.NO,
- _("Adjust Firewall"), Gtk.ResponseType.YES)
+ dialog.add_buttons (TEXT_adjust_firewall_NO_button, Gtk.ResponseType.NO,
+ TEXT_adjust_firewall_YES_button, Gtk.ResponseType.YES)
dialog.connect ('response', self.adjust_firewall_response)
dialog.show ()
except (dbus.DBusException, Exception):
@@ -2571,11 +2586,7 @@ class NewPrinterGUI(GtkGUI):
if store.get_iter_first () is None:
self.SMBBrowseDialog.hide ()
- show_info_dialog (_("No Print Shares"),
- _("There were no print shares found. "
- "Please check that the Samba service is "
- "marked as trusted in your firewall "
- "configuration."),
+ show_info_dialog (TEXT_show_info_dialog_header, TEXT_show_info_dialog_body,
parent=self.NewPrinterWindow)
def smb_select_function (self, selection, model, path, path_selected, data):
@@ -2770,13 +2781,11 @@ class NewPrinterGUI(GtkGUI):
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE,
- text=_("Adjust Firewall"))
- secondary_text += ("- " +
- _("Allow all incoming SMB/CIFS "
- "browse packets"))
+ text=TEXT_adjust_firewall_header)
+ secondary_text += "- " + TEXT_secondary_text_SMB
dialog.format_secondary_markup (secondary_text)
- dialog.add_buttons (_("Do It Later"), Gtk.ResponseType.NO,
- _("Adjust Firewall"), Gtk.ResponseType.YES)
+ dialog.add_buttons (TEXT_adjust_firewall_NO_button, Gtk.ResponseType.NO,
+ TEXT_adjust_firewall_YES_button, Gtk.ResponseType.YES)
response = dialog.run ()
dialog.destroy ()
@@ -2893,16 +2902,16 @@ class NewPrinterGUI(GtkGUI):
ready (self.NewPrinterWindow)
if accessible:
- show_info_dialog (_("Print Share Verified"),
- _("This print share is accessible."),
+ show_info_dialog (TEXT_share_verified,
+ TEXT_share_verified_text,
parent=self.NewPrinterWindow)
return
if not canceled:
- text = _("This print share is not accessible.")
+ text = TEXT_share_inaccessible_text
if reason:
text = reason
- show_error_dialog (_("Print Share Inaccessible"), text,
+ show_error_dialog (TEXT_share_inaccessible, text,
parent=self.NewPrinterWindow)
def entry_changed(self, entry, allowed_chars):
@@ -3509,10 +3518,7 @@ class NewPrinterGUI(GtkGUI):
self.entNPTNetworkHostname.set_sensitive (True)
self.btnNetworkFind.set_sensitive (True)
if self.network_found == 0:
- self.lblNetworkFindNotFound.set_markup ('<i>' +
- _("No printer was "
- "found at that "
- "address.") + '</i>')
+ self.lblNetworkFindNotFound.set_markup ('<i>' + TEXT_no_printer_was_found_at + '</i>')
self.lblNetworkFindNotFound.show ()
Gdk.threads_leave ()
diff --git a/ppdsloader.py b/ppdsloader.py
index 7be92ee..d56a2b7 100644
--- a/ppdsloader.py
+++ b/ppdsloader.py
@@ -33,6 +33,9 @@ import config
import gettext
gettext.install(domain=config.PACKAGE, localedir=config.localedir)
+TEXT_searching = _("Searching")
+TEXT_searching_for_drivers = _("Searching for drivers")
+
class PPDsLoader(GObject.GObject):
"""
1. If PackageKit support is available, and this is a local server,
@@ -83,14 +86,14 @@ class PPDsLoader(GObject.GObject):
debugprint ("Failed to get session bus")
self._bus = None
- fmt = _("Searching")
+ fmt = TEXT_searching
self._dialog = Gtk.MessageDialog (parent=parent,
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.CANCEL,
text=fmt)
- self._dialog.format_secondary_text (_("Searching for drivers"))
+ self._dialog.format_secondary_text (TEXT_searching_for_drivers)
self._dialog.connect ("response", self._dialog_response)
diff --git a/printerproperties.py b/printerproperties.py
index ca43c25..7becd6f 100755
--- a/printerproperties.py
+++ b/printerproperties.py
@@ -49,6 +49,25 @@ from newprinter import busy, ready
import ppdippstr
pkgdata = config.pkgdatadir
+# MSVSphere
+TEXT_inst_opts = _("Installable Options")
+TEXT_prn_opts = _("Printer Options")
+TEXT_submitted = _("Submitted")
+TEXT_test_page_submitted = _("Test page submitted as job %d")
+TEXT_maintenance_cmd_submitted = _("Maintenance command submitted as job %d")
+TEXT_not_possible = _("Not possible")
+TEXT_remote_srv_not_accept = _("The remote server did not accept "
+ "the print job, most likely "
+ "because the printer is not "
+ "shared.")
+TEXT_raw_queue = _("Raw Queue")
+TEXT_unable_get_queue = _("Unable to get queue details. Treating queue "
+ "as raw.")
+TEXT_error = _("Error")
+TEXT_ppd_file_damaged = _("The PPD file for this queue "
+ "is damaged.")
+TEXT_problem_connect = _("There was a problem connecting to "
+ "the CUPS server.")
def CUPS_server_hostname ():
host = cups.getServer ()
@@ -954,8 +973,8 @@ class PrinterPropertiesDialog(GtkGUI):
optionsbold = True
else:
self.btnConflict.hide()
- installabletext = _("Installable Options")
- optionstext = _("Printer Options")
+ installabletext = TEXT_inst_opts
+ optionstext = TEXT_prn_opts
if installablebold:
installabletext = "<b>%s</b>" % installabletext
if optionsbold:
@@ -1200,11 +1219,8 @@ class PrinterPropertiesDialog(GtkGUI):
if (e == cups.IPP_NOT_AUTHORIZED and
self._host != 'localhost' and
self._host[0] != '/'):
- show_error_dialog (_("Not possible"),
- _("The remote server did not accept "
- "the print job, most likely "
- "because the printer is not "
- "shared."),
+ show_error_dialog (TEXT_not_possible,
+ TEXT_remote_srv_not_accept,
self.parent)
else:
show_IPP_Error(e, msg, self.parent)
@@ -1213,8 +1229,8 @@ class PrinterPropertiesDialog(GtkGUI):
cups.setUser (user)
if job_id is not None:
- show_info_dialog (_("Submitted"),
- _("Test page submitted as job %d") % job_id,
+ show_info_dialog (TEXT_submitted,
+ TEXT_test_page_submitted % job_id,
parent=self.parent)
def maintenance_command (self, command):
@@ -1233,19 +1249,15 @@ class PrinterPropertiesDialog(GtkGUI):
format=format,
file=tmpfile.name,
user=cups.getUser ())
- show_info_dialog (_("Submitted"),
- _("Maintenance command submitted as "
- "job %d") % job_id,
+ show_info_dialog (TEXT_submitted,
+ TEXT_maintenance_cmd_submitted % job_id,
parent=self.parent)
except cups.IPPError as e:
(e, msg) = e.args
if (e == cups.IPP_NOT_AUTHORIZED and
self.printer.name != 'localhost'):
- show_error_dialog (_("Not possible"),
- _("The remote server did not accept "
- "the print job, most likely "
- "because the printer is not "
- "shared."),
+ show_error_dialog (TEXT_not_possible,
+ TEXT_remote_srv_not_accept,
self.parent)
else:
show_IPP_Error(e, msg, self.parent)
@@ -1315,9 +1327,8 @@ class PrinterPropertiesDialog(GtkGUI):
if e in [cups.IPP_SERVICE_UNAVAILABLE,
cups.IPP_INTERNAL_ERROR]:
- show_dialog(_("Raw Queue"),
- _("Unable to get queue details. Treating queue "
- "as raw."),
+ show_dialog(TEXT_raw_queue,
+ TEXT_unable_get_queue,
Gtk.MessageType.ERROR,
self.parent)
@@ -1328,14 +1339,12 @@ class PrinterPropertiesDialog(GtkGUI):
# NULL without setting an IPP error (so it'll be something
# like a failed connection), or the PPD could not be parsed.
if str (e).startswith ("ppd"):
- show_error_dialog (_("Error"),
- _("The PPD file for this queue "
- "is damaged."),
+ show_error_dialog (TEXT_error,
+ TEXT_ppd_file_damaged,
self.parent)
else:
- show_error_dialog (_("Error"),
- _("There was a problem connecting to "
- "the CUPS server."),
+ show_error_dialog (TEXT_error,
+ TEXT_problem_connect,
self.parent)
raise
diff --git a/pysmb.py b/pysmb.py
index b9afe62..d373dd3 100644
--- a/pysmb.py
+++ b/pysmb.py
@@ -31,6 +31,14 @@ import pwd
import smbc
from debug import *
+TEXT_not_authorized = _("Not authorized")
+TEXT_password_incorrect = _("The password may be incorrect.")
+TEXT_autch = _("Authentication")
+TEXT_autch_header = _("You must log in to access %s.")
+TEXT_user = _("Username:")
+TEXT_domain = _("Domain:")
+TEXT_password = _("Password:")
+
class _None(RuntimeError):
pass
@@ -87,15 +95,15 @@ class AuthContext:
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.CLOSE)
- d.set_title (_("Not authorized"))
+ d.set_title (TEXT_not_authorized)
d.set_markup ('<span weight="bold" size="larger">' +
- _("Not authorized") + '</span>\n\n' +
- _("The password may be incorrect."))
+ TEXT_not_authorized + '</span>\n\n' +
+ TEXT_password_incorrect)
d.run ()
d.destroy ()
# After that, prompt
- d = Gtk.Dialog (title=_("Authentication"),
+ d = Gtk.Dialog (title=TEXT_autch,
transient_for=self.parent,
modal=True)
d.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
@@ -111,7 +119,7 @@ class AuthContext:
hbox.pack_start (image, False, False, 0)
vbox = Gtk.VBox (False, 12)
label = Gtk.Label(label='<span weight="bold" size="larger">' +
- _("You must log in to access %s.")
+ TEXT_autch_header
% self.for_server +
'</span>')
label.set_use_markup (True)
@@ -122,13 +130,13 @@ class AuthContext:
grid = Gtk.Grid()
grid.set_row_spacing (6)
grid.set_column_spacing (6)
- grid.attach (Gtk.Label(label=_("Username:")), 0, 0, 1, 1)
+ grid.attach (Gtk.Label(label=TEXT_user), 0, 0, 1, 1)
username_entry = Gtk.Entry ()
grid.attach (username_entry, 1, 0, 1, 1)
- grid.attach (Gtk.Label(label=_("Domain:")), 0, 1, 1, 1)
+ grid.attach (Gtk.Label(label=TEXT_domain), 0, 1, 1, 1)
domain_entry = Gtk.Entry ()
grid.attach (domain_entry, 1, 1, 1, 1)
- grid.attach (Gtk.Label(label=_("Password:")), 0, 2, 1, 1)
+ grid.attach (Gtk.Label(label=TEXT_password), 0, 2, 1, 1)
password_entry = Gtk.Entry ()
password_entry.set_activates_default (True)
password_entry.set_visibility (False)
diff --git a/system-config-printer.py b/system-config-printer.py
index c9689de..46e9141 100755
--- a/system-config-printer.py
+++ b/system-config-printer.py
@@ -114,6 +114,10 @@ sys.path.append (pkgdata)
PlugWindow = None
PlugWindowId = None
+# MSVSphere
+TEXT_test_page = _("Print Test Page")
+TEXT_test_page_ask = _("Would you like to print a test page?")
+
#set program name
GLib.set_prgname("system-config-printer")
@@ -2045,9 +2049,9 @@ class GUI(GtkGUI):
modal=True, destroy_with_parent=True,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.NONE,
- text=_("Would you like to print a test page?"))
+ text=TEXT_test_page_ask)
q.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.NO,
- _("Print Test Page"), Gtk.ResponseType.YES)
+ TEXT_test_page, Gtk.ResponseType.YES)
response = q.run ()
q.destroy ()
if response == Gtk.ResponseType.YES:
--
2.39.2

@ -1,72 +0,0 @@
From cfe0fe14d49cdb7e741c940597ebc2f8d34f1260 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere.ru>
Date: Mon, 28 Aug 2023 14:51:02 +0300
Subject: [PATCH 2/2] reordering username and password in newprinter dlg
---
ui/NewPrinterWindow.ui | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ui/NewPrinterWindow.ui b/ui/NewPrinterWindow.ui
index ed6103d..25cd6cc 100644
--- a/ui/NewPrinterWindow.ui
+++ b/ui/NewPrinterWindow.ui
@@ -1098,9 +1098,9 @@ ipp://printer.mydomain/ipp</property>
<property name="margin_right">12</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
- <property name="label" translatable="yes">Password:</property>
+ <property name="label" translatable="yes">Username:</property>
<accessibility>
- <relation type="label-for" target="entSMBPassword"/>
+ <relation type="label-for" target="entSMBUsername"/>
</accessibility>
</object>
<packing>
@@ -1117,9 +1117,9 @@ ipp://printer.mydomain/ipp</property>
<property name="margin_right">12</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
- <property name="label" translatable="yes">Username:</property>
+ <property name="label" translatable="yes">Password:</property>
<accessibility>
- <relation type="label-for" target="entSMBUsername"/>
+ <relation type="label-for" target="entSMBPassword"/>
</accessibility>
</object>
<packing>
@@ -1128,14 +1128,13 @@ ipp://printer.mydomain/ipp</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="entSMBPassword">
+ <object class="GtkEntry" id="entSMBUsername">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
- <property name="visibility">False</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<accessibility>
@@ -1148,13 +1147,14 @@ ipp://printer.mydomain/ipp</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="entSMBUsername">
+ <object class="GtkEntry" id="entSMBPassword">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
+ <property name="visibility">False</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<accessibility>
--
2.39.2

@ -8,76 +8,46 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.5.18
Release: 5%{?dist}.inferit.2
Version: 1.5.15
Release: 4%{?dist}
License: GPLv2+
URL: https://github.com/%{username}/%{name}
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz
# all upstream patches, remove with new release
Patch0001: 0001-Fix-debugprint-in-options.py-fixes-291.patch
# MSVSphere
Patch1000: 0001-Fixed-text-in-python-files-for-translation.patch
Patch1001: 0002-reordering-username-and-password-in-newprinter-dlg.patch
# needed for macro AM_GNU_GETTEXT in configure.ac
BuildRequires: autoconf-archive
# uses CUPS API functions
BuildRequires: cups-devel >= 1.2
# we install a desktop file
BuildRequires: desktop-file-utils >= 0.2.92
# gcc is no longer in buildroot by default
# gcc is needed for udev-configure-printer.c
BuildRequires: gcc
# for translations
BuildRequires: gettext-devel
# for autosetup
BuildRequires: git-core
# for translations
BuildRequires: intltool
# automatic printer setup tool, which uses udev, is only for USB printers
# we need libusb API to communicate
BuildRequires: libusb1-devel
# uses make
BuildRequires: make
# GNOME library for GUI
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
BuildRequires: gettext-devel
BuildRequires: intltool
BuildRequires: libusb1-devel
BuildRequires: pkgconfig(glib-2.0)
# for python3 API
BuildRequires: python3-devel
#BuildRequires: python3-setuptools
# for automatic USB printer setup tool - udev-configure-printer
BuildRequires: xmlto
BuildRequires: systemd
BuildRequires: systemd-devel
# for generating manual
BuildRequires: xmlto
BuildRequires: python3-devel
# for dBUS support in scp-dbus-service
Requires: dbus-x11
# for desktop file
Requires: python3-gobject%{?_isa}
Requires: gtk3%{?_isa}
Requires: desktop-file-utils >= 0.2.92
# for system notifications
Requires: dbus-x11
Requires: python3-dbus%{?_isa}
Requires: system-config-printer-libs = %{version}-%{release}
Requires: desktop-notification-daemon
# for GUI, the app is written in gtk3
Requires: gtk3%{?_isa}
# for GUI to prevent warning during the startup
Requires: libcanberra-gtk3
# for notifications
Requires: libnotify%{?_isa}
# for GUI
Requires: python3-cairo%{?_isa}
# for dBUS python API
Requires: python3-dbus%{?_isa}
# the app can adjust firewalld, so we need firewall API in Python
Requires: python3-firewall
# for GUI
Requires: python3-gobject%{?_isa}
# runtime systemd requires for udev-configure-printer service
Requires: libcanberra-gtk3
%{?systemd_requires}
# we use classes define in our library
Requires: system-config-printer-libs = %{version}-%{release}
# require python3-smbc for SMB printers
Requires: python3-smbc
%description
system-config-printer is a graphical user interface that allows
@ -85,27 +55,14 @@ the user to configure a CUPS print server.
%package libs
Summary: Libraries and shared code for printer administration tool
# PackageKit can bring you a popup window if some package in the repo provides a driver
# for your printer
Recommends: PackageKit
Recommends: PackageKit-glib
# for GUI
Requires: gobject-introspection
# written in GTK3
Requires: gtk3
# for notifications
Requires: libnotify
# s-c-p classes uses Python CUPS API
Requires: python3-cups >= 1.9.60
# the libs subpackage contains scp-dbus-service, so we need dBUS API in Python here
Requires: python3-dbus
# for GUI
Requires: python3-gobject
# the app can download printer data from database with CURL
Requires: python3-pycurl
# s-c-p has a plug-in support for Samba, if the relevant package is installed
Requires: gobject-introspection
Requires: python3-gobject
Requires: gtk3
Requires: python3-dbus
Requires: python3-requests
Suggests: python3-smbc
BuildArch: noarch
@ -113,7 +70,7 @@ BuildArch: noarch
The common code used by both the graphical and non-graphical parts of
the configuration tool.
%if 0%{?rhel} <= 9 || 0%{?fedora}
%if 0%{?rhel} <= 8 || 0%{?fedora}
%package applet
Summary: Print job notification applet
Requires: %{name}-libs
@ -132,11 +89,9 @@ printers.
%prep
%autosetup -S git
# workaround https://github.com/pypa/setuptools/issues/3143
sed -i 's/setup.py install --prefix=$(DESTDIR)$(prefix)/setup.py install --root $(DESTDIR) --prefix=$(prefix)/' Makefile*
%build
%configure --with-udev-rules --with-cups-serverbin-dir=%{_prefix}/lib/cups
%configure --with-udev-rules
%make_build
%install
@ -151,7 +106,7 @@ touch %buildroot%{_localstatedir}/run/udev-configure-printer/usb-uris
%find_lang system-config-printer
%if 0%{?rhel} > 9
%if 0%{?rhel} > 8
rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{buildroot}%{_datadir}/%{name}/__pycache__/applet* \
%{buildroot}%{_datadir}/%{name}/applet.py* \
@ -243,7 +198,7 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%{python3_sitelib}/cupshelpers
%{python3_sitelib}/*.egg-info
%if 0%{?rhel} <= 9 || 0%{?fedora}
%if 0%{?rhel} <= 8 || 0%{?fedora}
%files applet
%{_bindir}/%{name}-applet
%{_datadir}/%{name}/__pycache__/applet*
@ -259,7 +214,7 @@ rm -rf %{buildroot}%{_bindir}/%{name}-applet \
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) %attr(0644,root,root) %{_localstatedir}/run/udev-configure-printer/usb-uris
%{_unitdir}/configure-printer@.service
%if 0%{?rhel} <= 9 || 0%{?fedora}
%if 0%{?rhel} <= 8 || 0%{?fedora}
%files
%doc ChangeLog NEWS ABOUT-NLS AUTHORS ChangeLog-OLD
%license COPYING
@ -298,53 +253,12 @@ exit 0
%endif
%changelog
* Fri Sep 01 2023 Sergey Cherevko <s.cherevko@msvsphere.ru> - 1.5.18-5.inferit.2
- Reordering username and password in newprinter dialog
- Rebuilt for MSVSphere 9.2
* Thu Aug 24 2023 Sergey Cherevko <s.cherevko@msvsphere.ru> - 1.5.18-5.inferit.1
- Fixed text in python files for translation
- Rebuilt for MSVSphere 9.2
* Sat Aug 19 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 1.5.18-5.inferit
- Rebuilt for MSVSphere 9.2
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.18-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 1.5.18-4
- Rebuilt for Python 3.12
* Tue Mar 14 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.18-3
- 2178027 - fix crash in options.py
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.18-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Sep 06 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.18-1
- 1.5.18
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.16-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.5.16-2
- Rebuilt for Python 3.11
* Mon May 23 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.16-1
- 1.5.16
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.15-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Sep 06 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.5.15-5
- fix issues reported by Coverity scan
- add a weak dependency on PackageKit for scp-libs
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.15-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.15-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.5.15-3
- Rebuilt for Python 3.10
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.15-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save