9953fab789f770dbf63199606334e21628743205
[gentoo.git] /
1 From 4ede66364b6987cb3013fa447fcdec09b3a638cb Mon Sep 17 00:00:00 2001
2 From: Tim Waugh <twaugh@redhat.com>
3 Date: Mon, 1 Aug 2011 14:04:49 +0100
4 Subject: [PATCH 3/4] Properties dialog: make OK button sensitive even when no changes to save (Ubuntu #444280).
5
6 Only becomes insensitive when there are conflicts.
7 ---
8  printerproperties.py |    8 +++++---
9  1 files changed, 5 insertions(+), 3 deletions(-)
10
11 diff --git a/printerproperties.py b/printerproperties.py
12 index ca40f31..9c055f9 100755
13 --- a/printerproperties.py
14 +++ b/printerproperties.py
15 @@ -619,7 +619,10 @@ class PrinterPropertiesDialog(GtkGUI):
16  
17          if (response == gtk.RESPONSE_OK or
18              response == gtk.RESPONSE_APPLY):
19 -            failed = self.save_printer (self.printer)
20 +            if (response == gtk.RESPONSE_OK and len (self.changed) == 0):
21 +                failed = False
22 +            else:
23 +                failed = self.save_printer (self.printer)
24  
25          if response == gtk.RESPONSE_APPLY and not failed:
26              try:
27 @@ -957,8 +960,7 @@ class PrinterPropertiesDialog(GtkGUI):
28  
29          self.btnPrinterPropertiesApply.set_sensitive (len (self.changed) > 0 and
30                                                        not self.conflicts)
31 -        self.btnPrinterPropertiesOK.set_sensitive (len (self.changed) > 0 and
32 -                                                   not self.conflicts)
33 +        self.btnPrinterPropertiesOK.set_sensitive (not self.conflicts)
34  
35      def save_printer(self, printer, saveall=False, parent=None):
36          if parent == None:
37 -- 
38 1.7.3.4
39