コード例 #1
0
ファイル: upgradeform.py プロジェクト: csteacherd22/hplip
    def NextButton_clicked (self):
        if self.dontRemindRadioBtton.isChecked():
            log.debug("HPLIP Upgrade, selected Don't remind again radiobutton")
            user_conf.set('upgrade', 'notify_upgrade', 'false')
            msg= "Check for HPLIP updates is disabled. To Upgrade again, check it in 'HP-toolbox' "
            self.SuccessUI( self.__tr(msg))
        elif self.remindRadioBtton.isChecked():
            schedule_days = str(self.daysSpinBox.value())
            log.debug("HPLIP Upgrade, selected remind later radiobutton  days= %d" %(int(schedule_days)))
            next_time = time.time() + (int(schedule_days) *24 * 60 *60)
            user_conf.set('upgrade', 'pending_upgrade_time', str(int(next_time)))
        else:
            log.debug("HPLIP Upgrade, selected Install radiobutton  distro_type=%d" %self.distro_type)
            self.NextButton.setEnabled(False)
            if self.distro_type != 1:     # not tier 1 distro
                utils.openURL(MANUAL_INSTALL_LINK)
            else:
                terminal_cmd = utils.get_terminal()
                if terminal_cmd is not None and utils.which("hp-upgrade"):
                    cmd = terminal_cmd + " 'hp-upgrade -w'"
                    os_utils.execute(cmd)
                    self.result = True
                else:
                    log.error("Failed to run hp-upgrade command from terminal =%s "%terminal_cmd)
                    self.FailureUI( self.__tr("Failed to run hp-upgrade"))

        self.close()
コード例 #2
0
    def NextButton_clicked (self):
        if self.dontRemindRadioBtton.isChecked():
            log.debug("HPLIP Upgrade, selected Don't remind again radiobutton")
            user_conf.set('upgrade', 'notify_upgrade', 'false')
            msg= "Check for HPLIP updates is disabled. To enable it again, change 'Settings' in 'HP systemtray' "
            SuccessUI(self, self.__tr(msg))

        elif self.remindRadioBtton.isChecked():
            schedule_days = str(self.daysSpinBox.value())
            log.debug("HPLIP Upgrade, selected remind later radiobutton  days= %d" %(int(schedule_days)))
            next_time = time.time() + (int(schedule_days) *24 * 60 *60) 
            user_conf.set('upgrade', 'pending_upgrade_time', str(int(next_time)))
        else:
            log.debug("HPLIP Upgrade, selected Install radiobutton  distro_type=%d" %self.distro_tier)
            self.NextButton.setEnabled(False)
            if self.distro_tier != 1:		# not tier 1 distro
                log.debug("OK pressed for tier 2 distro pressed")
                utils.openURL(MANUAL_INSTALL_LINK)
                
                ## TBD::open browser
            else:
                terminal_cmd = utils.get_terminal()
                if terminal_cmd is not None and utils.which("hp-upgrade"):
                    cmd = terminal_cmd + " 'hp-upgrade'"
                    log.debug("cmd = %s " %cmd)
                    os.system(cmd)
                    self.result = True
                else:
                    log.error("Failed to run hp-upgrade command from terminal =%s "%terminal_cmd)
                    ErrorUI(self, self.__tr("Failed to run hp-upgrade"))

        self.close()
コード例 #3
0
    def NextButton_clicked (self):
        if self.dontRemindRadioBtton.isChecked():
            log.debug("HPLIP Upgrade, selected Don't remind again radiobutton")
            user_conf.set('upgrade', 'notify_upgrade', 'false')
            msg= "Check for HPLIP updates is disabled. To enable it again, change 'Settings' in 'HP systemtray' "
            SuccessUI(self, self.__tr(msg))

        elif self.remindRadioBtton.isChecked():
            schedule_days = str(self.daysSpinBox.value())
            log.debug("HPLIP Upgrade, selected remind later radiobutton  days= %d" %(int(schedule_days)))
            next_time = time.time() + (int(schedule_days) *24 * 60 *60) 
            user_conf.set('upgrade', 'pending_upgrade_time', str(int(next_time)))
        else:
            log.debug("HPLIP Upgrade, selected Install radiobutton  distro_type=%d" %self.distro_tier)
            self.NextButton.setEnabled(False)
            if self.distro_tier != 1:		# not tier 1 distro
                log.debug("OK pressed for tier 2 distro pressed")
                utils.openURL(MANUAL_INSTALL_LINK)
                
                ## TBD::open browser
            else:
                terminal_cmd = utils.get_terminal()
                if terminal_cmd is not None and utils.which("hp-upgrade"):
                    cmd = terminal_cmd + " 'hp-upgrade -w'"
                    log.debug("cmd = %s " %cmd)
                    os.system(cmd)
                    self.result = True
                else:
                    log.error("Failed to run hp-upgrade command from terminal =%s "%terminal_cmd)
                    ErrorUI(self, self.__tr("Failed to run hp-upgrade"))

        self.close()