home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / hplip / ui / settingsdialog.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  3.9 KB  |  91 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  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.ScanCommand.setText(cmd_scan)
  46.         self.AccessPCardCommand.setText(cmd_pcard)
  47.         self.SendFaxCommand.setText(cmd_fax)
  48.         self.MakeCopiesCommand.setText(cmd_copy)
  49.  
  50.     
  51.     def TabWidget_currentChanged(self, a0):
  52.         name = str(a0.name())
  53.         if name == 'FunctionCommands':
  54.             self.DefaultsButton.setEnabled(True)
  55.         else:
  56.             self.DefaultsButton.setEnabled(False)
  57.  
  58.     
  59.     def EmailTestButton_clicked(self):
  60.         email_to_addresses = str(self.EmailAddress.text())
  61.         email_from_address = str(self.senderLineEdit.text())
  62.         if not email_to_addresses or not email_from_address:
  63.             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)
  64.             return None
  65.         
  66.         user_cfg.alerts.email_to_addresses = email_to_addresses
  67.         user_cfg.alerts.email_from_address = email_from_address
  68.         user_cfg.alerts.email_alerts = True
  69.         service.setAlerts(self.hpssd_sock, True, email_from_address, email_to_addresses)
  70.         result_code = service.testEmail(self.hpssd_sock, prop.username)
  71.         log.debug(result_code)
  72.         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)
  73.  
  74.     
  75.     def autoRefreshCheckBox_clicked(self):
  76.         pass
  77.  
  78.     
  79.     def CleaningLevel_clicked(self, a0):
  80.         pass
  81.  
  82.     
  83.     def refreshScopeButtonGroup_clicked(self, a0):
  84.         self.auto_refresh_type = int(a0)
  85.  
  86.     
  87.     def __tr(self, s, c = None):
  88.         return qApp.translate('SettingsDialog', s, c)
  89.  
  90.  
  91.