~ubuntu-branches/ubuntu/saucy/hplip/saucy-proposed

« back to all changes in this revision

Viewing changes to ui4/printsettingstoolbox.py

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-05-26 13:33:18 UTC
  • mfrom: (1.5.1 upstream) (23 sid)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: james.westby@ubuntu.com-20110526133318-prm4m56loh0i11vv
Tags: 3.11.5-0ubuntu1
* New upstream release
   o Added LEDM ADF Scan support
   o Added LEDM Wireless support
   o "/cupsInteger0 <PCL page size number>" is added to the PageSize option
     of the hpcups driver, not only in PageRegion (Upstream fix for Debian
     bug #518227, LP: #405116, Red Hat bug #518756).
   o Fixed HP Laserjet 1020 printing negative images and photos (LP: #754383).
   o ADF now recognised on HP Officejet Pro 8500 A910a (LP: #776509).
   o Added new option "Installed Cartridges" to enable users to select
     correct installed cartridges for printing (Partial upstream fix for
     LP: #235399, currently only applied to the hpcups driver, for the hpijs
     driver we continue with the Debian/Ubuntu patch).
   o Margin issues fixed on HP OfficeJet 7500 E910, 6500 e710n-z, LaserJet
     m1319f MFP
   o Removed scan icon in toolbox for HP Color LaserJet CM4540 MFP (scanner
     is network-only).
   o Fixed "Download Firmware" link in Action tab with HP LaserJet P1566.
   o Redundant PostScript PPDs are removed.
   o Added support for: HP Designjet T790ps 24in/44in, T1300 Postscript,
     LaserJet M4555 MFP, LaserJet Professional m1214nfh MFP
* debian/patches/add-lidil-two-cartridge-modes.dpatch: Adapted to the partial
  upstream fix.
* debian/patches/workaround-sf-server-bug-for-plugin-index-download.dpatch:
  Removed, fixed upstream.
* debian/rules: Removed modification of the PPD generator for hpcups, as
  the missing "/cupsInteger0 <PCL page size number>" in the PostScript code
  of the PageSize option is fixed upstream.
* debian/patches/large-sizes-borderless-on-photosmart-pro-b-series.dpatch:
  The HP PhotoSmart Pro B 8xxx printers are capable of borderless printing
  on all paper sizes including the large formats. The HPLIP-supplied PPD
  allowed borderless only up to Legal size (LP: #787580).
* debian/patches/more-user-friendly-choice-names-for-installed-cartridges.dpatch:
  Make the menu entry strings for the "Installed Cartridges" option (on LIDIL
  printers) more user-friendly.

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
 
19
# Authors: Don Welch, Yashwant Kumar Sahu
20
20
#
21
21
 
22
22
# Std Lib
320
320
        #print "updateUi(%s, %s)" % (cur_device, cur_printer)
321
321
        self.cur_device = cur_device
322
322
        self.cur_printer = cur_printer
323
 
 
 
323
        
324
324
        while self.count():
325
325
            self.removeItem(0)
326
326
 
327
327
        self.loading = True
328
328
        cups.resetOptions()
329
329
        cups.openPPD(self.cur_printer)
 
330
        cur_outputmode = ""
330
331
 
331
332
        try:
332
333
            if 1:
355
356
                    self.job_options['pagerange'] = current
356
357
 
357
358
                    # page set (COMBO/PICKONE)
358
 
                    current = current_options.get('pageset', '')
 
359
                    current = current_options.get('pageset', 'all')
359
360
                    self.addControlRow("pageset", self.__tr("Page Set"),
360
361
                        cups.PPD_UI_PICKONE, current,
361
 
                        [('all', self.__tr("All pages")),
362
 
                         ('even', self.__tr("Even pages")),
363
 
                         ('odd', self.__tr("Odd pages"))], 'all', job_option=True)
 
362
                        [('all', self.__tr("AllPages")),
 
363
                         ('even', self.__tr("Even")),
 
364
                         ('odd', self.__tr("Odd"))], 'all', job_option=True)
364
365
 
365
366
                    self.job_options['pageset'] = current
366
367
#                    if current == u'even':
516
517
 
517
518
                            choice_data.append((c, choice_text))
518
519
 
 
520
                        if o.lower() == 'outputmode':
 
521
                            if value is not None:
 
522
                                cur_outputmode = value
 
523
                            else:
 
524
                                cur_outputmode = defchoice                                
 
525
 
519
526
                        self.addControlRow(o, option_text, ui, value, choice_data, defchoice, read_only)
520
527
 
521
528
                    self.endControlGroup()
769
776
                log.debug("  Current value: %s" % current)
770
777
 
771
778
                self.endControlGroup()
 
779
                
 
780
                #Summary
 
781
                    #color input
 
782
                    #quality
 
783
                quality_attr_name = "OutputModeDPI"
 
784
                cur_outputmode_dpi = cups.findPPDAttribute(quality_attr_name, cur_outputmode)
 
785
                if cur_outputmode_dpi is not None:
 
786
                    log.debug("Adding Group: Summary outputmode is : %s" % cur_outputmode)
 
787
                    log.debug("Adding Group: Summary outputmode dpi is : %s" % unicode (cur_outputmode_dpi))                                    
 
788
                    self.beginControlGroup("sumry", self.__tr("Summary"))
 
789
                    self.addControlRow("colorinput", self.__tr('Color Input / Black Render'),
 
790
                        cups.UI_INFO, unicode (cur_outputmode_dpi), [], read_only)
 
791
                    self.addControlRow("quality", self.__tr('Print Quality'),
 
792
                        cups.UI_INFO, cur_outputmode, [], read_only)
 
793
                    self.endControlGroup()
 
794
                    log.debug("End adding Group: Summary")
 
795
                   
772
796
 
773
797
                self.job_storage_enable = self.cur_device.mq.get('job-storage', JOB_STORAGE_DISABLE) == JOB_STORAGE_ENABLE
774
798
 
985
1009
#
986
1010
 
987
1011
            self.connect(DefaultButton, SIGNAL("clicked()"), self.DefaultButton_clicked)
 
1012
            self.connect(ComboBox, SIGNAL("currentIndexChanged(const QString &)"), self.ComboBox_indexChanged)            
988
1013
            self.connect(ComboBox, SIGNAL("highlighted(const QString &)"), self.ComboBox_highlighted)
989
1014
 
990
1015
            control = ComboBox
1394
1419
 
1395
1420
            self.connect(self.JobStorageExistingDefaultButton, SIGNAL("clicked()"),
1396
1421
                        self.JobStorageExistingDefaultButton_clicked)
 
1422
                        
 
1423
        elif typ == cups.UI_INFO:
 
1424
            HBoxLayout = QHBoxLayout()
 
1425
            HBoxLayout.setObjectName("HBoxLayout")
 
1426
 
 
1427
            OptionName = QLabel(self.widget)
 
1428
            OptionName.setObjectName("OptionLabel")
 
1429
            HBoxLayout.addWidget(OptionName)
 
1430
            OptionName.setText(text)
 
1431
 
 
1432
            SpacerItem = QSpacerItem(20, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
 
1433
            HBoxLayout.addItem(SpacerItem)
 
1434
            
 
1435
            if text == 'Print Quality':
 
1436
                self.PQValueLabel = QLabel(self.widget)
 
1437
                self.PQValueLabel.setObjectName("PQValueLabel")
 
1438
                HBoxLayout.addWidget(self.PQValueLabel)
 
1439
                self.PQValueLabel.setText(value)
 
1440
            elif text == 'Color Input / Black Render':
 
1441
                self.PQColorInputLabel = QLabel(self.widget)
 
1442
                self.PQColorInputLabel.setObjectName("PQColorInputLabel")
 
1443
                HBoxLayout.addWidget(self.PQColorInputLabel)
 
1444
                self.PQColorInputLabel.setText(value)
 
1445
            else:
 
1446
                OptionValue = QLabel(self.widget)
 
1447
                OptionValue.setObjectName("OptionValue")
 
1448
                HBoxLayout.addWidget(OptionValue)
 
1449
                OptionValue.setText(value)
 
1450
                
 
1451
            self.gridlayout.addLayout(HBoxLayout, self.row, 0, 1, 1)
1397
1452
 
1398
1453
        else:
1399
1454
            log.error("Invalid UI value: %s/%s" % (self.group, option))
1539
1594
            else:
1540
1595
                self.setPrinterOption(sender.option, "false")
1541
1596
 
 
1597
    def ComboBox_indexChanged(self, currentItem):
 
1598
        sender = self.sender()
 
1599
        currentItem = unicode(currentItem)
 
1600
        # Checking for summary control
 
1601
        labelPQValaue = getattr(self, 'PQValueLabel', None)
 
1602
        labelPQColorInput = getattr(self, 'PQColorInputLabel', None)
 
1603
        # When output mode combo item is changed, we need to update the summary information      
 
1604
        if currentItem is not None and sender.option == 'OutputMode' and labelPQValaue is not None and labelPQColorInput is not None:
 
1605
            # Setting output mode
 
1606
            self.PQValueLabel.setText(currentItem)
 
1607
            
 
1608
            # Getting DPI custom attributefrom the PPD
 
1609
            # Setting color input
 
1610
            quality_attr_name = "OutputModeDPI"
 
1611
            cups.openPPD(self.cur_printer)
 
1612
            outputmode_dpi = cups.findPPDAttribute(quality_attr_name, currentItem)
 
1613
            log.debug("Outputmode changed, setting outputmode_dpi: %s" % outputmode_dpi)
 
1614
            cups.closePPD()            
 
1615
            self.PQColorInputLabel.setText(outputmode_dpi)
 
1616
            
 
1617
            log.debug("Outputmode changed, setting value outputmode: %s" % currentItem)            
1542
1618
 
1543
1619
    def DefaultButton_clicked(self):
1544
1620
        sender = self.sender()
1942
2018
 
1943
2019
    def __tr(self,s,c = None):
1944
2020
        return qApp.translate("PrintSettingsToolbox",s,c)
 
2021