| 174 | } |
| 175 | |
| 176 | void LightscreenWindow::cleanup(const Screenshot::Options &options) |
| 177 | { |
| 178 | // Reversing settings |
| 179 | if (settings()->value("options/hide").toBool()) { |
| 180 | #ifndef Q_OS_LINUX // X is not quick enough and the notification ends up everywhere but in the icon |
| 181 | if (settings()->value("options/tray").toBool() && mTrayIcon) { |
| 182 | mTrayIcon->show(); |
| 183 | } |
| 184 | #endif |
| 185 | |
| 186 | if (mPreviewDialog) { |
| 187 | if (mPreviewDialog->count() <= 1 && mWasVisible) { |
| 188 | show(); |
| 189 | } |
| 190 | |
| 191 | mPreviewDialog->show(); |
| 192 | } else if (mWasVisible) { |
| 193 | show(); |
| 194 | } |
| 195 | |
| 196 | mHideTrigger = false; |
| 197 | } |
| 198 | |
| 199 | if (settings()->value("options/tray").toBool() && mTrayIcon) { |
| 200 | notify(options.result); |
| 201 | |
| 202 | if (settings()->value("options/message").toBool() && options.file && !options.upload) { |
| 203 | // This message wll get shown only when messages are enabled and the file won't get another upload pop-up soon. |
| 204 | showScreenshotMessage(options.result, options.fileName); |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | if (settings()->value("options/playSound", false).toBool()) { |
| 209 | if (options.result == Screenshot::Success) { |
| 210 | QSound::play("sounds/ls.screenshot.wav"); |
| 211 | } else { |
| 212 | #ifdef Q_OS_WIN |
| 213 | QSound::play("afakepathtomakewindowsplaythedefaultsoundtheresprobablyabetterwaybuticantbebothered"); |
| 214 | #else |
| 215 | QSound::play("sound/ls.error.wav"); |
| 216 | #endif |
| 217 | } |
| 218 | |
| 219 | } |
| 220 | |
| 221 | updateStatus(); |
| 222 | |
| 223 | if (options.result != Screenshot::Success) { |
| 224 | return; |
| 225 | } |
| 226 | |
| 227 | mLastScreenshot = options.fileName; |
| 228 | } |
| 229 | |
| 230 | void LightscreenWindow::closeToTrayWarning() |
| 231 | { |