~ubuntu-branches/ubuntu/precise/hplip/precise-updates

« back to all changes in this revision

Viewing changes to ui4/printsettingstoolbox.py

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2011-10-29 10:02:57 UTC
  • mfrom: (2.1.177 precise)
  • Revision ID: package-import@ubuntu.com-20111029100257-dp1w2nvpohhpvuel
Tags: 3.11.10-1
* New Upstream Release
* Switch to dh_bugfiles - fixes reportbug script

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18
18
#
19
 
# Authors: Don Welch, Yashwant Kumar Sahu
 
19
# Authors: Don Welch, Yashwant Kumar Sahu, Sanjay Kumar Sharma
20
20
#
21
21
 
22
22
# Std Lib
1704
1704
 
1705
1705
 
1706
1706
    def PageRangeEdit_editingFinished(self):
1707
 
        sender, x = self.sender(), []
1708
 
        t, ok = unicode(sender.text()), True
 
1707
        sender = self.sender()
 
1708
        t, ok, x = self.job_options['pagerange'], True, []
 
1709
 
 
1710
        #[Sanjay]Start Range Validation here as the editing is finished
1709
1711
        try:
1710
 
            x = utils.expand_range(t)
 
1712
            x = utils.expand_range(t)   
1711
1713
        except ValueError:
1712
1714
            ok = False
1713
1715
 
 
1716
        if t == '':
 
1717
            ok = False
 
1718
 
1714
1719
        if ok:
1715
1720
            if 0 in x:
1716
1721
                ok = False
1721
1726
                        ok = False
1722
1727
                        break
1723
1728
 
1724
 
        if ok:
1725
 
            t = utils.collapse_range(x)
1726
 
            sender.setText(QString(t))
1727
 
            self.job_options['pagerange'] = t
1728
 
 
1729
 
        else:
 
1729
        if not ok:
1730
1730
            self.job_options['pagerange'] = ''
1731
1731
            log.error("Invalid page range: %s" % t)
1732
1732
            FailureUI(self, self.__tr("<b>Invalid page range.</b><p>Please enter a range using page numbers (1-999), dashes, and commas. For example: 1-2,3,5-7</p>"))
1734
1734
 
1735
1735
 
1736
1736
    def PageRangeEdit_textChanged(self, t):
1737
 
        sender, x, t = self.sender(), [], unicode(t)
1738
 
        try:
1739
 
            x = utils.expand_range(t)
1740
 
        except ValueError:
1741
 
            self.job_options['pagerange'] = ''
1742
 
            log.error("Invalid page range: %s" % t)
1743
 
        else:
1744
 
            self.job_options['pagerange'] = t
1745
 
 
 
1737
        self.job_options['pagerange'] = unicode(t) # Do range validation only in PageRangeEdit_editingFinished method
1746
1738
 
1747
1739
    #
1748
1740
    # Job Storage