| 1042 | } |
| 1043 | |
| 1044 | void MainWindow::updateMovieLoadedState(bool movieLoaded) |
| 1045 | { |
| 1046 | if (movieLoaded) { |
| 1047 | |
| 1048 | authorField->setReadOnly(true); |
| 1049 | |
| 1050 | /* Format movie length */ |
| 1051 | double msec = gameLoop->movie.header->length_sec + ((double)gameLoop->movie.header->length_nsec)/1000000000.0; |
| 1052 | int immin = (int)(msec/60); |
| 1053 | double dmsec = msec - 60*immin; |
| 1054 | movieLength->setText(QString("Movie length: %1m %2s").arg(immin).arg(dmsec, 0, 'f', 2)); |
| 1055 | |
| 1056 | /* If movie exists, default to read mode except in non-interactive mode */ |
| 1057 | if (context->interactive) { |
| 1058 | moviePlayback->setChecked(true); |
| 1059 | context->config.sc.recording = SharedConfig::RECORDING_READ; |
| 1060 | context->config.sc_modified = true; |
| 1061 | } |
| 1062 | else { |
| 1063 | if (context->config.sc.recording == SharedConfig::RECORDING_READ) |
| 1064 | moviePlayback->setChecked(true); |
| 1065 | else |
| 1066 | movieRecording->setChecked(true); |
| 1067 | } |
| 1068 | |
| 1069 | windowManager->refreshMovieLoadedWindows(); |
| 1070 | saveMovieAction->setEnabled(true); |
| 1071 | exportMovieAction->setEnabled(true); |
| 1072 | settingsMovieAction->setEnabled(true); |
| 1073 | } |
| 1074 | else { |
| 1075 | context->config.sc.movie_framecount = 0; |
| 1076 | context->rerecord_count = 0; |
| 1077 | gameLoop->movie.header->authors = ""; |
| 1078 | authorField->setReadOnly(false); |
| 1079 | movieLength->setText("Movie length: -"); |
| 1080 | movieRecording->setChecked(true); |
| 1081 | if (context->config.sc.recording != SharedConfig::NO_RECORDING) { |
| 1082 | context->config.sc.recording = SharedConfig::RECORDING_WRITE; |
| 1083 | context->config.sc_modified = true; |
| 1084 | } |
| 1085 | windowManager->refreshMovieUnloadedWindows(); |
| 1086 | |
| 1087 | saveMovieAction->setEnabled(false); |
| 1088 | exportMovieAction->setEnabled(false); |
| 1089 | settingsMovieAction->setEnabled(false); |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | void MainWindow::updateUIFromConfig() |
| 1094 | { |
nothing calls this directly
no test coverage detected