| 3081 | } |
| 3082 | |
| 3083 | void MainWindow::closeEvent(QCloseEvent *event) |
| 3084 | { |
| 3085 | if(RENDERDOC_IsGlobalHookActive()) |
| 3086 | { |
| 3087 | RDDialog::critical(this, tr("Global hook active"), |
| 3088 | tr("Cannot close RenderDoc while global hook is active.")); |
| 3089 | event->ignore(); |
| 3090 | return; |
| 3091 | } |
| 3092 | |
| 3093 | if(!PromptCloseCapture()) |
| 3094 | { |
| 3095 | event->ignore(); |
| 3096 | return; |
| 3097 | } |
| 3098 | |
| 3099 | bool noToAll = false; |
| 3100 | |
| 3101 | QList<QPointer<LiveCapture>> liveCaptures; |
| 3102 | |
| 3103 | int unsavedCaps = 0; |
| 3104 | for(QPointer<LiveCapture> live : m_LiveCaptures) |
| 3105 | { |
| 3106 | unsavedCaps += live->unsavedCaptureCount(); |
| 3107 | liveCaptures.append(live); |
| 3108 | } |
| 3109 | |
| 3110 | for(QPointer<LiveCapture> live : liveCaptures) |
| 3111 | { |
| 3112 | // The live capture could be deleted during this loop via the save capture modal message box |
| 3113 | // message pump of an earlier live capture |
| 3114 | if(live.isNull()) |
| 3115 | continue; |
| 3116 | |
| 3117 | // if the user previously selected 'no to all' in the save prompts below, apply that to all |
| 3118 | // subsequent live captures by skipping the check and unconditionally cleaning all captures |
| 3119 | if(!noToAll) |
| 3120 | { |
| 3121 | if(!live->checkAllowClose(unsavedCaps, noToAll)) |
| 3122 | { |
| 3123 | event->ignore(); |
| 3124 | return; |
| 3125 | } |
| 3126 | } |
| 3127 | |
| 3128 | live->cleanItems(); |
| 3129 | delete live; |
| 3130 | } |
| 3131 | |
| 3132 | SaveLayout(0); |
| 3133 | } |
| 3134 | |
| 3135 | void MainWindow::changeEvent(QEvent *event) |
| 3136 | { |
nothing calls this directly
no test coverage detected