Snapshot/SnapWidget.py

changeset 3030
4a0a82ddd9d2
parent 3020
542e97d4ecb3
child 3034
7ce719013078
child 3058
0a02c433f52d
equal deleted inserted replaced
3029:4055a15ce0f2 3030:4a0a82ddd9d2
70 70
71 self.__delay = int( 71 self.__delay = int(
72 Preferences.Prefs.settings.value("Snapshot/Delay", 0)) 72 Preferences.Prefs.settings.value("Snapshot/Delay", 0))
73 self.delaySpin.setValue(self.__delay) 73 self.delaySpin.setValue(self.__delay)
74 74
75 self.__filename = Preferences.Prefs.settings.value("Snapshot/Filename", 75 self.__filename = Preferences.Prefs.settings.value(
76 "Snapshot/Filename",
76 os.path.join( 77 os.path.join(
77 QDesktopServices.storageLocation( 78 QDesktopServices.storageLocation(
78 QDesktopServices.PicturesLocation), 79 QDesktopServices.PicturesLocation),
79 self.trUtf8("snapshot") + "1.png")) 80 self.trUtf8("snapshot") + "1.png"))
80 81
143 Private method to initialize the keyboard shortcuts. 144 Private method to initialize the keyboard shortcuts.
144 """ 145 """
145 self.__quitShortcut = QShortcut( 146 self.__quitShortcut = QShortcut(
146 QKeySequence(QKeySequence.Quit), self, self.close) 147 QKeySequence(QKeySequence.Quit), self, self.close)
147 148
148 self.__copyShortcut = QShortcut(QKeySequence(QKeySequence.Copy), self, 149 self.__copyShortcut = QShortcut(
150 QKeySequence(QKeySequence.Copy), self,
149 self.copyButton.animateClick) 151 self.copyButton.animateClick)
150 152
151 self.__quickSaveShortcut = QShortcut(QKeySequence(Qt.Key_Q), self, 153 self.__quickSaveShortcut = QShortcut(
152 self.__quickSave) 154 QKeySequence(Qt.Key_Q), self, self.__quickSave)
153 155
154 self.__save1Shortcut = QShortcut(QKeySequence(QKeySequence.Save), self, 156 self.__save1Shortcut = QShortcut(
157 QKeySequence(QKeySequence.Save), self,
155 self.saveButton.animateClick) 158 self.saveButton.animateClick)
156 self.__save2Shortcut = QShortcut(QKeySequence(Qt.Key_S), self, 159 self.__save2Shortcut = QShortcut(
157 self.saveButton.animateClick) 160 QKeySequence(Qt.Key_S), self, self.saveButton.animateClick)
158 161
159 self.__grab1Shortcut = QShortcut(QKeySequence(QKeySequence.New), self, 162 self.__grab1Shortcut = QShortcut(
160 self.takeButton.animateClick) 163 QKeySequence(QKeySequence.New), self, self.takeButton.animateClick)
161 self.__grab2Shortcut = QShortcut(QKeySequence(Qt.Key_N), self, 164 self.__grab2Shortcut = QShortcut(
162 self.takeButton.animateClick) 165 QKeySequence(Qt.Key_N), self, self.takeButton.animateClick)
163 self.__grab3Shortcut = QShortcut(QKeySequence(Qt.Key_Space), self, 166 self.__grab3Shortcut = QShortcut(
164 self.takeButton.animateClick) 167 QKeySequence(Qt.Key_Space), self, self.takeButton.animateClick)
165 168
166 def __quickSave(self): 169 def __quickSave(self):
167 """ 170 """
168 Private slot to save the snapshot bypassing the file selection dialog. 171 Private slot to save the snapshot bypassing the file selection dialog.
169 """ 172 """

eric ide

mercurial