home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / hplip / ui / settingsdialog.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2007-04-29  |  5.3 KB  |  116 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.5)
  3.  
  4. from base.g import *
  5. from base.codes import *
  6. from base import utils, service
  7. from qt import *
  8. from settingsdialog_base import SettingsDialog_base
  9.  
  10. class SettingsDialog(SettingsDialog_base):
  11.     
  12.     def __init__(self, hpssd_sock, parent = None, name = None, modal = 0, fl = 0):
  13.         SettingsDialog_base.__init__(self, parent, name, modal, fl)
  14.         self.DefaultsButton.setEnabled(False)
  15.         self.hpssd_sock = hpssd_sock
  16.         self.sendmail = utils.which('sendmail')
  17.         if not self.sendmail:
  18.             self.EmailTestButton.setEnabled(False)
  19.         
  20.  
  21.     
  22.     def PrintCmdChangeButton_clicked(self):
  23.         pass
  24.  
  25.     
  26.     def ScanCmdChangeButton_clicked(self):
  27.         pass
  28.  
  29.     
  30.     def AccessPCardCmdChangeButton_clicked(self):
  31.         pass
  32.  
  33.     
  34.     def SendFaxCmdChangeButton_clicked(self):
  35.         pass
  36.  
  37.     
  38.     def MakeCopiesCmdChangeButton_clicked(self):
  39.         pass
  40.  
  41.     
  42.     def DefaultsButton_clicked(self):
  43.         (cmd_print, cmd_scan, cmd_pcard, cmd_copy, cmd_fax, cmd_fab) = utils.deviceDefaultFunctions()
  44.         self.PrintCommand.setText(cmd_print)
  45.         self.printButtonGroup.setButton(0)
  46.         self.ScanCommand.setText(cmd_scan)
  47.         self.scanButtonGroup.setButton(1)
  48.         self.AccessPCardCommand.setText(cmd_pcard)
  49.         self.pcardButtonGroup.setButton(1)
  50.         self.SendFaxCommand.setText(cmd_fax)
  51.         self.faxButtonGroup.setButton(1)
  52.         self.MakeCopiesCommand.setText(cmd_copy)
  53.         self.copyButtonGroup.setButton(1)
  54.  
  55.     
  56.     def TabWidget_currentChanged(self, a0):
  57.         name = str(a0.name())
  58.         if name == 'FunctionCommands':
  59.             self.DefaultsButton.setEnabled(True)
  60.         else:
  61.             self.DefaultsButton.setEnabled(False)
  62.  
  63.     
  64.     def EmailTestButton_clicked(self):
  65.         email_to_addresses = str(self.EmailAddress.text())
  66.         email_from_address = str(self.senderLineEdit.text())
  67.         if not email_to_addresses or not email_from_address:
  68.             QMessageBox.warning(self, self.caption(), self._SettingsDialog__tr('<b>One or more email addresses are missing.</b><p>Please enter this information and try again.'), QMessageBox.Ok, QMessageBox.NoButton, QMessageBox.NoButton)
  69.             return None
  70.         
  71.         user_cfg.alerts.email_to_addresses = email_to_addresses
  72.         user_cfg.alerts.email_from_address = email_from_address
  73.         user_cfg.alerts.email_alerts = True
  74.         service.setAlerts(self.hpssd_sock, True, email_from_address, email_to_addresses)
  75.         result_code = service.testEmail(self.hpssd_sock, prop.username)
  76.         log.debug(result_code)
  77.         QMessageBox.information(self, self.caption(), self._SettingsDialog__tr("<p><b>Please check your email for a test message.</b><p>If the message doesn't arrive, please check your settings and try again."), QMessageBox.Ok, QMessageBox.NoButton, QMessageBox.NoButton)
  78.  
  79.     
  80.     def autoRefreshCheckBox_clicked(self):
  81.         pass
  82.  
  83.     
  84.     def CleaningLevel_clicked(self, a0):
  85.         pass
  86.  
  87.     
  88.     def refreshScopeButtonGroup_clicked(self, a0):
  89.         self.auto_refresh_type = int(a0)
  90.  
  91.     
  92.     def printButtonGroup_clicked(self, a0):
  93.         self.PrintCommand.setEnabled(a0)
  94.  
  95.     
  96.     def scanButtonGroup_clicked(self, a0):
  97.         self.ScanCommand.setEnabled(a0)
  98.  
  99.     
  100.     def faxButtonGroup_clicked(self, a0):
  101.         self.SendFaxCommand.setEnabled(a0)
  102.  
  103.     
  104.     def pcardButtonGroup_clicked(self, a0):
  105.         self.AccessPCardCommand.setEnabled(a0)
  106.  
  107.     
  108.     def copyButtonGroup_clicked(self, a0):
  109.         self.MakeCopiesCommand.setEnabled(a0)
  110.  
  111.     
  112.     def __tr(self, s, c = None):
  113.         return qApp.translate('SettingsDialog', s, c)
  114.  
  115.  
  116.