Tools/UIPreviewer.py

changeset 564
b3d966393ba9
parent 545
1538031b5175
child 791
9ec2ac20e54e
equal deleted inserted replaced
563:e35d2cda9a74 564:b3d966393ba9
65 self.styleCombo.setObjectName("styleCombo") 65 self.styleCombo.setObjectName("styleCombo")
66 self.styleCombo.setEditable(False) 66 self.styleCombo.setEditable(False)
67 self.styleCombo.setToolTip(self.trUtf8("Select the GUI Theme")) 67 self.styleCombo.setToolTip(self.trUtf8("Select the GUI Theme"))
68 self.styleLayout.addWidget(self.styleCombo) 68 self.styleLayout.addWidget(self.styleCombo)
69 self.styleCombo.addItems(list(QStyleFactory().keys())) 69 self.styleCombo.addItems(list(QStyleFactory().keys()))
70 self.styleCombo.setCurrentIndex(\ 70 self.styleCombo.setCurrentIndex(
71 int(Preferences.Prefs.settings.value('UIPreviewer/style'))) 71 int(Preferences.Prefs.settings.value('UIPreviewer/style')))
72 72
73 styleSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) 73 styleSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
74 self.styleLayout.addItem(styleSpacer) 74 self.styleLayout.addItem(styleSpacer)
75 self.UIPreviewerLayout.addLayout(self.styleLayout) 75 self.UIPreviewerLayout.addLayout(self.styleLayout)
141 )) 141 ))
142 self.printPreviewAct.triggered[()].connect(self.__printPreviewImage) 142 self.printPreviewAct.triggered[()].connect(self.__printPreviewImage)
143 143
144 self.imageAct = QAction(UI.PixmapCache.getIcon("screenCapture.png"), 144 self.imageAct = QAction(UI.PixmapCache.getIcon("screenCapture.png"),
145 self.trUtf8('&Screen Capture'), self) 145 self.trUtf8('&Screen Capture'), self)
146 self.imageAct.setShortcut(\ 146 self.imageAct.setShortcut(
147 QKeySequence(self.trUtf8("Ctrl+S", "File|Screen Capture"))) 147 QKeySequence(self.trUtf8("Ctrl+S", "File|Screen Capture")))
148 self.imageAct.setStatusTip(self.trUtf8('Save a screen capture to an image file')) 148 self.imageAct.setStatusTip(self.trUtf8('Save a screen capture to an image file'))
149 self.imageAct.setWhatsThis(self.trUtf8( 149 self.imageAct.setWhatsThis(self.trUtf8(
150 """<b>Screen Capture</b>""" 150 """<b>Screen Capture</b>"""
151 """<p>Save a screen capture to an image file.</p>""" 151 """<p>Save a screen capture to an image file.</p>"""
193 """<p>Display some information about this software.</p>""" 193 """<p>Display some information about this software.</p>"""
194 )) 194 ))
195 self.aboutAct.triggered[()].connect(self.__about) 195 self.aboutAct.triggered[()].connect(self.__about)
196 196
197 self.aboutQtAct = QAction(self.trUtf8('About &Qt'), self) 197 self.aboutQtAct = QAction(self.trUtf8('About &Qt'), self)
198 self.aboutQtAct.setStatusTip(\ 198 self.aboutQtAct.setStatusTip(
199 self.trUtf8('Display information about the Qt toolkit')) 199 self.trUtf8('Display information about the Qt toolkit'))
200 self.aboutQtAct.setWhatsThis(self.trUtf8( 200 self.aboutQtAct.setWhatsThis(self.trUtf8(
201 """<b>About Qt</b>""" 201 """<b>About Qt</b>"""
202 """<p>Display some information about the Qt toolkit.</p>""" 202 """<p>Display some information about the Qt toolkit.</p>"""
203 )) 203 ))
423 formats = QImageWriter.supportedImageFormats() 423 formats = QImageWriter.supportedImageFormats()
424 for format in formats: 424 for format in formats:
425 filters = "{0}*.{1} ".format(filters, bytes(format).decode().lower()) 425 filters = "{0}*.{1} ".format(filters, bytes(format).decode().lower())
426 filter = self.trUtf8("Images ({0})").format(filters[:-1]) 426 filter = self.trUtf8("Images ({0})").format(filters[:-1])
427 427
428 fname = QFileDialog.getSaveFileName(\ 428 fname = QFileDialog.getSaveFileName(
429 self, 429 self,
430 self.trUtf8("Save Image"), 430 self.trUtf8("Save Image"),
431 "", 431 "",
432 filter) 432 filter)
433 if not fname: 433 if not fname:

eric ide

mercurial