| 1084 | } |
| 1085 | |
| 1086 | bool MainWindow::PromptCloseCapture() |
| 1087 | { |
| 1088 | if(!m_Ctx.IsCaptureLoaded()) |
| 1089 | return true; |
| 1090 | |
| 1091 | QString deletepath; |
| 1092 | bool caplocal = false; |
| 1093 | |
| 1094 | if(m_OwnTempCapture && m_Ctx.IsCaptureTemporary()) |
| 1095 | { |
| 1096 | QString temppath = m_Ctx.GetCaptureFilename(); |
| 1097 | caplocal = m_Ctx.IsCaptureLocal(); |
| 1098 | |
| 1099 | QMessageBox::StandardButton res = |
| 1100 | RDDialog::question(this, tr("Unsaved capture"), tr("Save this capture?"), |
| 1101 | QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); |
| 1102 | |
| 1103 | if(res == QMessageBox::Cancel) |
| 1104 | return false; |
| 1105 | |
| 1106 | if(res == QMessageBox::Yes) |
| 1107 | { |
| 1108 | bool success = PromptSaveCaptureAs(); |
| 1109 | |
| 1110 | if(!success) |
| 1111 | { |
| 1112 | return false; |
| 1113 | } |
| 1114 | } |
| 1115 | |
| 1116 | if(temppath != m_Ctx.GetCaptureFilename() || res == QMessageBox::No) |
| 1117 | deletepath = temppath; |
| 1118 | m_OwnTempCapture = false; |
| 1119 | } |
| 1120 | else if(m_Ctx.GetCaptureModifications() != CaptureModifications::NoModifications) |
| 1121 | { |
| 1122 | QString text = tr("This capture has the following modifications:\n\n"); |
| 1123 | |
| 1124 | CaptureModifications mods = m_Ctx.GetCaptureModifications(); |
| 1125 | |
| 1126 | if(mods & CaptureModifications::Renames) |
| 1127 | text += tr("Resources have been renamed.\n"); |
| 1128 | if(mods & CaptureModifications::Bookmarks) |
| 1129 | text += tr("Bookmarks have been changed.\n"); |
| 1130 | if(mods & CaptureModifications::Notes) |
| 1131 | text += tr("Capture notes have been changed.\n"); |
| 1132 | if(mods & CaptureModifications::EditedShaders) |
| 1133 | text += tr("Edited shaders have been changed.\n"); |
| 1134 | |
| 1135 | bool saveas = false; |
| 1136 | |
| 1137 | if(m_Ctx.IsCaptureLocal()) |
| 1138 | { |
| 1139 | text += tr("\nWould you like to save those changes to '%1'?").arg(m_Ctx.GetCaptureFilename()); |
| 1140 | } |
| 1141 | else |
| 1142 | { |
| 1143 | saveas = true; |
nothing calls this directly
no test coverage detected