65 self.styleCombo = QComboBox(self.cw) |
65 self.styleCombo = QComboBox(self.cw) |
66 self.styleCombo.setObjectName("styleCombo") |
66 self.styleCombo.setObjectName("styleCombo") |
67 self.styleCombo.setEditable(False) |
67 self.styleCombo.setEditable(False) |
68 self.styleCombo.setToolTip(self.trUtf8("Select the GUI Theme")) |
68 self.styleCombo.setToolTip(self.trUtf8("Select the GUI Theme")) |
69 self.styleLayout.addWidget(self.styleCombo) |
69 self.styleLayout.addWidget(self.styleCombo) |
70 self.styleCombo.addItems(QStyleFactory().keys()) |
70 self.styleCombo.addItems(list(QStyleFactory().keys())) |
71 self.styleCombo.setCurrentIndex(\ |
71 self.styleCombo.setCurrentIndex(\ |
72 int(Preferences.Prefs.settings.value('UIPreviewer/style'))) |
72 int(Preferences.Prefs.settings.value('UIPreviewer/style'))) |
73 |
73 |
74 styleSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) |
74 styleSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) |
75 self.styleLayout.addItem(styleSpacer) |
75 self.styleLayout.addItem(styleSpacer) |
424 |
424 |
425 defaultExt = "PNG" |
425 defaultExt = "PNG" |
426 filters = "" |
426 filters = "" |
427 formats = QImageWriter.supportedImageFormats() |
427 formats = QImageWriter.supportedImageFormats() |
428 for format in formats: |
428 for format in formats: |
429 filters = "%s*.%s " % (filters, unicode(format).lower()) |
429 filters = "%s*.%s " % (filters, str(format).lower()) |
430 filter = self.trUtf8("Images ({0})").format(filters[:-1]) |
430 filter = self.trUtf8("Images ({0})").format(filters[:-1]) |
431 |
431 |
432 fname = QFileDialog.getSaveFileName(\ |
432 fname = QFileDialog.getSaveFileName(\ |
433 self, |
433 self, |
434 self.trUtf8("Save Image"), |
434 self.trUtf8("Save Image"), |
536 Private slot to the actual printing. |
536 Private slot to the actual printing. |
537 |
537 |
538 @param printer reference to the printer object (QPrinter) |
538 @param printer reference to the printer object (QPrinter) |
539 """ |
539 """ |
540 p = QPainter(printer) |
540 p = QPainter(printer) |
541 marginX = (printer.pageRect().x() - printer.paperRect().x()) / 2 |
541 marginX = (printer.pageRect().x() - printer.paperRect().x()) // 2 |
542 marginY = (printer.pageRect().y() - printer.paperRect().y()) / 2 |
542 marginY = (printer.pageRect().y() - printer.paperRect().y()) // 2 |
543 |
543 |
544 # double the margin on bottom of page |
544 # double the margin on bottom of page |
545 if printer.orientation() == QPrinter.Portrait: |
545 if printer.orientation() == QPrinter.Portrait: |
546 width = printer.width() - marginX * 2 |
546 width = printer.width() - marginX * 2 |
547 height = printer.height() - marginY * 3 |
547 height = printer.height() - marginY * 3 |