Blob Blame History Raw
diff -up system-config-printer-1.4.1/newprinter.py.warning-no-pysmbc system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.warning-no-pysmbc	2017-11-02 18:49:34.869174804 +0100
+++ system-config-printer-1.4.1/newprinter.py	2017-11-02 18:50:49.676599558 +0100
@@ -2334,6 +2334,12 @@ class NewPrinterGUI(GtkGUI):
             del self.expanding_row
             ready (self.SMBBrowseDialog)
 
+    def set_btnSMBVerify_sensitivity (self, on):
+        self.btnSMBVerify.set_sensitive (PYSMB_AVAILABLE and on)
+        if not PYSMB_AVAILABLE or not on:
+            self.btnSMBVerify.set_tooltip_text (_("Verification requires the "
+                                                  "%s module") % "pysmbc")
+
     def on_entSMBURI_changed (self, ent):
         allowed_chars = string.letters+string.digits+'_-./:@%'
         self.entry_changed(ent, allowed_chars)
@@ -2350,7 +2356,7 @@ class NewPrinterGUI(GtkGUI):
         elif self.entSMBUsername.get_text () == '':
             self.rbtnSMBAuthPrompt.set_active(True)
 
-        self.btnSMBVerify.set_sensitive(bool(uri))
+        self.set_btnSMBVerify_sensitivity (bool(uri))
         self.setNPButtons ()
 
     def on_tvSMBBrowser_cursor_changed(self, widget):
@@ -2894,7 +2900,7 @@ class NewPrinterGUI(GtkGUI):
             self.entSMBUsername.set_text ('')
             self.entSMBPassword.set_text ('')
             self.entSMBURI.set_text(device.uri[6:])
-            self.btnSMBVerify.set_sensitive(True)
+            self.set_btnSMBVerify_sensitivity (True)
         else:
             if device.uri:
                 self.entNPTDevice.set_text(device.uri)