rpms/system-config-printer/F-9 system-config-printer-1.0.x.patch, 1.2, 1.3 system-config-printer.spec, 1.196, 1.197

Tim Waugh twaugh at fedoraproject.org
Mon Nov 3 18:05:04 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15746

Modified Files:
	system-config-printer-1.0.x.patch system-config-printer.spec 
Log Message:
* Mon Nov  3 2008 Tim Waugh <twaugh at redhat.com> 1.0.9-3
- Updated patch for 1.0.x changes:
  - More job monitoring fixes.


system-config-printer-1.0.x.patch:

Index: system-config-printer-1.0.x.patch
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-9/system-config-printer-1.0.x.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- system-config-printer-1.0.x.patch	3 Nov 2008 15:09:14 -0000	1.2
+++ system-config-printer-1.0.x.patch	3 Nov 2008 18:04:59 -0000	1.3
@@ -1,7 +1,28 @@
 diff -U0 system-config-printer-1.0.9/ChangeLog.1.0.x system-config-printer-1.0.9/ChangeLog
 --- system-config-printer-1.0.9/ChangeLog.1.0.x	2008-10-21 17:26:45.000000000 +0100
-+++ system-config-printer-1.0.9/ChangeLog	2008-11-03 14:06:35.000000000 +0000
-@@ -0,0 +1,109 @@
++++ system-config-printer-1.0.9/ChangeLog	2008-11-03 18:00:50.000000000 +0000
+@@ -0,0 +1,130 @@
++2008-11-03  Tim Waugh  <twaugh at redhat.com>
++
++	* jobviewer.py (JobViewer.current_printers_and_jobs): Don't
++	process pending events while processing new jobs list.
++
++2008-11-03  Tim Waugh  <twaugh at redhat.com>
++
++	* jobviewer.py (JobViewer.set_process_pending): Control whether
++	pending events may be processed.
++	(JobViewer.__init__): Initially they can.
++	(JobViewer.set_statusicon_visibility): Only process pending events
++	if allowed to.
++
++2008-11-03  Tim Waugh  <twaugh at redhat.com>
++
++	* jobviewer.py (JobViewer.update_job): Make sure the notification
++	is still valid after letting the status icon show itself.
++	(JobViewer.on_auth_notification_closed): Mark notification as
++	closed.
++	(JobViewer.job_removed): Likewise.
++
 +2008-11-03  Tim Waugh  <twaugh at redhat.com>
 +
 +	* jobviewer.py (JobViewer.update_job): Restored compatibility code
@@ -113,7 +134,7 @@
 +
 diff -up system-config-printer-1.0.9/cupshelpers/ppds.py.1.0.x system-config-printer-1.0.9/cupshelpers/ppds.py
 --- system-config-printer-1.0.9/cupshelpers/ppds.py.1.0.x	2008-10-21 17:21:24.000000000 +0100
-+++ system-config-printer-1.0.9/cupshelpers/ppds.py	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/cupshelpers/ppds.py	2008-11-03 18:00:50.000000000 +0000
 @@ -327,7 +327,7 @@ class PPDs:
          particular printer model, given its make and model name.
  
@@ -125,8 +146,16 @@
          try:
 diff -up system-config-printer-1.0.9/jobviewer.py.1.0.x system-config-printer-1.0.9/jobviewer.py
 --- system-config-printer-1.0.9/jobviewer.py.1.0.x	2008-10-21 10:02:45.000000000 +0100
-+++ system-config-printer-1.0.9/jobviewer.py	2008-11-03 14:06:35.000000000 +0000
-@@ -309,6 +309,16 @@ class JobViewer (monitor.Watcher):
++++ system-config-printer-1.0.9/jobviewer.py	2008-11-03 18:00:50.000000000 +0000
+@@ -296,6 +296,7 @@ class JobViewer (monitor.Watcher):
+         if bus == None:
+             bus = dbus.SystemBus ()
+ 
++        self.set_process_pending (True)
+         self.host = cups.getServer ()
+         self.port = cups.getPort ()
+         self.encryption = cups.getEncryption ()
+@@ -309,9 +310,22 @@ class JobViewer (monitor.Watcher):
  
      def cleanup (self):
          self.monitor.cleanup ()
@@ -143,7 +172,13 @@
          if self.exit_handler:
              self.exit_handler (self)
  
-@@ -328,9 +338,6 @@ class JobViewer (monitor.Watcher):
++    def set_process_pending (self, whether):
++        self.process_pending_events = whether
++
+     # Handle "special" status icon
+     def set_special_statusicon (self, iconname):
+         self.special_status_icon = True
+@@ -328,9 +342,6 @@ class JobViewer (monitor.Watcher):
          notification.set_data ('printer-name', printer)
          notification.connect ('closed', self.on_new_printer_notification_closed)
          self.set_statusicon_visibility ()
@@ -153,7 +188,7 @@
          notification.attach_to_status_icon (self.statusicon)
          notification.show ()
  
-@@ -460,18 +467,55 @@ class JobViewer (monitor.Watcher):
+@@ -460,18 +471,55 @@ class JobViewer (monitor.Watcher):
      def on_troubleshoot_quit(self, troubleshooter):
          del self.troubleshooter
  
@@ -212,28 +247,40 @@
          store = self.store
          iter = self.jobiters[job]
          self.jobs[job] = data
-@@ -532,15 +576,18 @@ class JobViewer (monitor.Watcher):
+@@ -532,19 +580,29 @@ class JobViewer (monitor.Watcher):
                  notification.set_timeout (pynotify.EXPIRES_NEVER)
                  notification.connect ('closed',
                                        self.on_auth_notification_closed)
 -                self.set_statusicon_visibility ()
-                 notification.attach_to_status_icon (self.statusicon)
+-                notification.attach_to_status_icon (self.statusicon)
                  notification.add_action ("authenticate", _("Authenticate"),
                                           self.on_auth_notification_authenticate)
 -                notification.show ()
                  self.auth_notifications[job] = notification
 +                debugprint ("auth notification opened for job %s" % job)
 +                self.set_statusicon_visibility ()
-+                notification.show ()
++
++                # In set_statusicon_visibility we process pending
++                # events, so we need to check that we still have a
++                # notification to show.
++                if notification.get_data ('closed') != True:
++                    notification.attach_to_status_icon (self.statusicon)
++                    notification.show ()
              elif (not job_requires_auth and
                    self.auth_notifications.has_key (job)):
 +                debugprint ("job %s no longer requires auth" % job)
                  self.auth_notifications[job].close ()
++                self.auth_notifications[job].set_data ('closed', True)
 +                del self.auth_notifications[job]
  
      def on_auth_notification_closed (self, notification, reason=None):
          job = notification.get_data ('job-id')
-@@ -661,7 +708,10 @@ class JobViewer (monitor.Watcher):
+         debugprint ("auth notification closed for job %s" % job)
++        self.auth_notifications[job].set_data ('closed', True)
+         del self.auth_notifications[job]
+ 
+     def on_auth_notification_authenticate (self, notification, action):
+@@ -661,7 +719,10 @@ class JobViewer (monitor.Watcher):
              return
  
          open_notifications = len (self.new_printer_notifications.keys ())
@@ -245,18 +292,18 @@
          num_jobs = len (self.jobs.keys ())
  
          debugprint ("open notifications: %d" % open_notifications)
-@@ -672,6 +722,10 @@ class JobViewer (monitor.Watcher):
+@@ -672,6 +733,10 @@ class JobViewer (monitor.Watcher):
                                       open_notifications > 0 or
                                       num_jobs > self.num_jobs_when_hidden)
  
 +        # Let the icon show/hide itself before continuing.
-+        while gtk.events_pending ():
++        while self.process_pending_events and gtk.events_pending ():
 +            gtk.main_iteration ()
 +
      def on_treeview_popup_menu (self, treeview):
          event = gtk.gdk.Event (gtk.gdk.NOTHING)
          self.show_treeview_popup_menu (treeview, event, 0)
-@@ -943,32 +997,24 @@ class JobViewer (monitor.Watcher):
+@@ -943,32 +1008,25 @@ class JobViewer (monitor.Watcher):
          (title, text) = reason.get_description ()
          notification = pynotify.Notification (title, text, 'printer')
          reason.user_notified = True
@@ -290,10 +337,11 @@
      ## monitor.Watcher interface
      def current_printers_and_jobs (self, mon, printers, jobs):
 +        monitor.Watcher.current_printers_and_jobs (self, mon, printers, jobs)
++        self.set_process_pending (False)
          self.store.clear ()
          self.jobs = {}
          self.jobiters = {}
-@@ -983,47 +1029,7 @@ class JobViewer (monitor.Watcher):
+@@ -983,47 +1041,7 @@ class JobViewer (monitor.Watcher):
                  printer = uri
              jobdata['job-printer-name'] = printer
  
@@ -342,7 +390,15 @@
  
          self.jobs = jobs
          self.active_jobs = set()
-@@ -1073,6 +1079,12 @@ class JobViewer (monitor.Watcher):
+@@ -1031,6 +1049,7 @@ class JobViewer (monitor.Watcher):
+             if self.job_is_active (jobdata):
+                 self.active_jobs.add (jobid)
+ 
++        self.set_process_pending (True)
+         self.update_status ()
+ 
+     def job_added (self, mon, jobid, eventname, event, jobdata):
+@@ -1073,6 +1092,12 @@ class JobViewer (monitor.Watcher):
          elif jobid in self.active_jobs:
              self.active_jobs.remove (jobid)
  
@@ -355,7 +411,7 @@
          # Look out for stopped jobs.
          if (self.trayicon and eventname == 'job-stopped' and
              not jobid in self.stopped_job_prompts):
-@@ -1080,45 +1092,12 @@ class JobViewer (monitor.Watcher):
+@@ -1080,45 +1105,12 @@ class JobViewer (monitor.Watcher):
              # of some sort, or it might be that the backend requires
              # authentication.  If the latter, the job will be held not
              # stopped, and the job-hold-until attribute will be
@@ -403,7 +459,7 @@
                  may_be_problem = False
              else:
                  # Other than that, unfortunately the only
-@@ -1159,6 +1138,7 @@ class JobViewer (monitor.Watcher):
+@@ -1159,6 +1151,7 @@ class JobViewer (monitor.Watcher):
                                                        notify_text)
  
              if may_be_problem:
@@ -411,7 +467,7 @@
                  self.toggle_window_display (self.statusicon, force_show=True)
                  dialog = gtk.Dialog (_("Print Error"), self.MainWindow, 0,
                                       (_("_Diagnose"), gtk.RESPONSE_NO,
-@@ -1199,8 +1179,6 @@ class JobViewer (monitor.Watcher):
+@@ -1199,8 +1192,6 @@ class JobViewer (monitor.Watcher):
                  self.stopped_job_prompts.add (jobid)
                  dialog.show_all ()
  
@@ -420,18 +476,19 @@
      def job_removed (self, mon, jobid, eventname, event):
          monitor.Watcher.job_removed (self, mon, jobid, eventname, event)
          if self.jobiters.has_key (jobid):
-@@ -1211,6 +1189,10 @@ class JobViewer (monitor.Watcher):
+@@ -1211,6 +1202,11 @@ class JobViewer (monitor.Watcher):
          if jobid in self.active_jobs:
              self.active_jobs.remove (jobid)
  
 +        if self.auth_notifications.has_key (jobid):
 +            self.auth_notifications[jobid].close ()
++            self.auth_notifications[jobid].set_data ('closed', True)
 +            del self.auth_notifications[jobid]
 +
          self.update_status ()
  
      def state_reason_added (self, mon, reason):
-@@ -1278,7 +1260,10 @@ class JobViewer (monitor.Watcher):
+@@ -1278,7 +1274,10 @@ class JobViewer (monitor.Watcher):
          tuple = reason.get_tuple ()
          try:
              notification = self.state_reason_notifications[tuple]
@@ -445,7 +502,7 @@
  
 diff -up system-config-printer-1.0.9/monitor.py.1.0.x system-config-printer-1.0.9/monitor.py
 --- system-config-printer-1.0.9/monitor.py.1.0.x	2008-10-21 10:02:45.000000000 +0100
-+++ system-config-printer-1.0.9/monitor.py	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/monitor.py	2008-11-03 18:00:50.000000000 +0000
 @@ -559,11 +559,10 @@ class Monitor:
                  if printer not in self.specific_dests:
                      del jobs[jobid]
@@ -483,7 +540,7 @@
  
 diff -up system-config-printer-1.0.9/my-default-printer.py.1.0.x system-config-printer-1.0.9/my-default-printer.py
 --- system-config-printer-1.0.9/my-default-printer.py.1.0.x	2008-10-21 10:02:45.000000000 +0100
-+++ system-config-printer-1.0.9/my-default-printer.py	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/my-default-printer.py	2008-11-03 18:00:50.000000000 +0000
 @@ -138,6 +138,7 @@ class Server:
  
  class Dialog:
@@ -494,7 +551,7 @@
                                    gtk.DIALOG_MODAL | gtk.DIALOG_NO_SEPARATOR,
 diff -up system-config-printer-1.0.9/po/pt_BR.po.1.0.x system-config-printer-1.0.9/po/pt_BR.po
 --- system-config-printer-1.0.9/po/pt_BR.po.1.0.x	2008-10-21 10:02:45.000000000 +0100
-+++ system-config-printer-1.0.9/po/pt_BR.po	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/po/pt_BR.po	2008-11-03 18:00:50.000000000 +0000
 @@ -17,7 +17,7 @@ msgstr ""
  "Project-Id-Version: system-config-printer\n"
  "Report-Msgid-Bugs-To: https://bugzilla.redhat.com/bugzilla\n"
@@ -2074,7 +2131,7 @@
 +
 diff -up system-config-printer-1.0.9/po/sr at latin.po.1.0.x system-config-printer-1.0.9/po/sr at latin.po
 --- system-config-printer-1.0.9/po/sr at latin.po.1.0.x	2008-10-21 10:02:45.000000000 +0100
-+++ system-config-printer-1.0.9/po/sr at latin.po	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/po/sr at latin.po	2008-11-03 18:00:50.000000000 +0000
 @@ -1,61 +1,62 @@
  # translation of system-config-printer.0.7.82.x.sr.po to Serbian
 -# Serbian(Latin) translations for system-config-printer
@@ -3051,7 +3108,7 @@
  #~ msgstr "Lozinka je neophodna"
 diff -up system-config-printer-1.0.9/po/sr.po.1.0.x system-config-printer-1.0.9/po/sr.po
 --- system-config-printer-1.0.9/po/sr.po.1.0.x	2008-10-21 10:02:52.000000000 +0100
-+++ system-config-printer-1.0.9/po/sr.po	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/po/sr.po	2008-11-03 18:00:50.000000000 +0000
 @@ -11,7 +11,7 @@ msgstr ""
  "Project-Id-Version: system-config-printer.0.7.82.x.sr\n"
  "Report-Msgid-Bugs-To: https://bugzilla.redhat.com/bugzilla\n"
@@ -3123,7 +3180,7 @@
  msgid "Provide PPD file"
 diff -up system-config-printer-1.0.9/system-config-printer.py.1.0.x system-config-printer-1.0.9/system-config-printer.py
 --- system-config-printer-1.0.9/system-config-printer.py.1.0.x	2008-10-21 10:02:45.000000000 +0100
-+++ system-config-printer-1.0.9/system-config-printer.py	2008-11-03 14:06:35.000000000 +0000
++++ system-config-printer-1.0.9/system-config-printer.py	2008-11-03 18:00:50.000000000 +0000
 @@ -3410,9 +3410,12 @@ class NewPrinterGUI(GtkGUI):
          if step > 0 and next_page_nr == 0: # About to choose a name.
              # Suggest an appropriate name.


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-9/system-config-printer.spec,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -r1.196 -r1.197
--- system-config-printer.spec	3 Nov 2008 15:09:14 -0000	1.196
+++ system-config-printer.spec	3 Nov 2008 18:05:04 -0000	1.197
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.0.9
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -151,6 +151,10 @@
 exit 0
 
 %changelog
+* Mon Nov  3 2008 Tim Waugh <twaugh at redhat.com> 1.0.9-3
+- Updated patch for 1.0.x changes:
+  - More job monitoring fixes.
+
 * Mon Nov  3 2008 Tim Waugh <twaugh at redhat.com> 1.0.9-2
 - Added patch for 1.0.x changes since 1.0.9:
   - Set default window icon for my-default-printer (Ubuntu #290469).




More information about the scm-commits mailing list