eric6/Snapshot/SnapWidget.py

branch
without_py2_and_pyqt4
changeset 7201
6b42677d7043
parent 6942
2602857055c5
child 7229
53054eb5b15a
equal deleted inserted replaced
7200:ebab8ba287e6 7201:6b42677d7043
14 # 14 #
15 15
16 import os 16 import os
17 17
18 from PyQt5.QtCore import pyqtSlot, QFile, QFileInfo, QTimer, QPoint, \ 18 from PyQt5.QtCore import pyqtSlot, QFile, QFileInfo, QTimer, QPoint, \
19 QMimeData, Qt, QRegExp, QLocale, PYQT_VERSION_STR 19 QMimeData, Qt, QRegExp, QLocale, QStandardPaths
20 from PyQt5.QtGui import QImageWriter, QPixmap, QDrag, QKeySequence 20 from PyQt5.QtGui import QImageWriter, QPixmap, QDrag, QKeySequence
21 from PyQt5.QtWidgets import QWidget, QApplication, QShortcut 21 from PyQt5.QtWidgets import QWidget, QApplication, QShortcut
22 22
23 from E5Gui import E5FileDialog, E5MessageBox 23 from E5Gui import E5FileDialog, E5MessageBox
24 24
92 self.modeCombo.setCurrentIndex(index) 92 self.modeCombo.setCurrentIndex(index)
93 93
94 delay = int(Preferences.Prefs.settings.value("Snapshot/Delay", 0)) 94 delay = int(Preferences.Prefs.settings.value("Snapshot/Delay", 0))
95 self.delaySpin.setValue(delay) 95 self.delaySpin.setValue(delay)
96 96
97 if PYQT_VERSION_STR >= "5.0.0": 97 picturesLocation = QStandardPaths.writableLocation(
98 from PyQt5.QtCore import QStandardPaths 98 QStandardPaths.PicturesLocation)
99 picturesLocation = QStandardPaths.writableLocation(
100 QStandardPaths.PicturesLocation)
101 else:
102 from PyQt5.QtGui import QDesktopServices
103 picturesLocation = QDesktopServices.storageLocation(
104 QDesktopServices.PicturesLocation)
105 self.__filename = Preferences.Prefs.settings.value( 99 self.__filename = Preferences.Prefs.settings.value(
106 "Snapshot/Filename", 100 "Snapshot/Filename",
107 os.path.join(picturesLocation, 101 os.path.join(picturesLocation,
108 self.tr("snapshot") + "1.png")) 102 self.tr("snapshot") + "1.png"))
109 103

eric ide

mercurial