Ticket #3044: 3304.diff
File 3304.diff, 4.1 KB (added by , 15 years ago) |
---|
-
jpeg/JPEGTranslator.cpp
131 131 } 132 132 133 133 134 //! Return true if settings were run, false if not135 bool136 SettingsChangedAlert()137 {138 // If settings view wasn't already initialized (settings not running)139 // and user wants to run settings140 if (!gAreSettingsRunning141 && (new BAlert("Different settings file",142 "JPEG settings were set to default because of incompatible settings file.",143 "Configure settings", "OK", NULL, B_WIDTH_AS_USUAL,144 B_WARNING_ALERT))->Go() == 0) {145 // Create settings window (with no quit on close!), launch146 // it and wait until it's closed147 TranslatorWindow *window = new TranslatorWindow(false);148 window->Show();149 150 status_t err;151 wait_for_thread(window->Thread(), &err);152 return true;153 }154 155 return false;156 }157 158 159 134 /*! 160 135 Load settings from config file 161 136 If can't find it make them default and try to save … … 181 156 fclose(file); 182 157 LoadDefaultSettings(settings); 183 158 SaveSettings(settings); 184 // Tell user settings were changed to default, and ask to run settings panel or not185 if (SettingsChangedAlert())186 // User configured settings, load them again187 LoadSettings(settings);188 159 } else 189 160 fclose(file); 190 161 } else if ((file = fopen(path.Path(), "wb+")) != NULL) { -
jpeg2000/JPEG2000Translator.cpp
115 115 } 116 116 117 117 118 //! Return true if settings were run, false if not119 bool120 SettingsChangedAlert()121 {122 // If settings view wasn't already initialized (settings not running)123 // and user wants to run settings124 if (!gAreSettingsRunning && (new BAlert("Different settings file", "JPEG2000 settings were set to default because of incompatible settings file.", "Configure settings", "OK", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 0) {125 // Create settings window (with no quit on close!), launch it and wait until it's closed126 status_t err;127 TranslatorWindow *window = new TranslatorWindow(false);128 window->Show();129 wait_for_thread(window->Thread(), &err);130 return true;131 }132 133 return false;134 }135 136 137 118 /*! 138 119 Load settings from config file 139 120 If can't find it make them default and try to save … … 159 140 fclose(file); 160 141 LoadDefaultSettings(settings); 161 142 SaveSettings(settings); 162 // Tell user settings were changed to default, and ask to run settings panel or not163 if (SettingsChangedAlert())164 // User configured settings, load them again165 LoadSettings(settings);166 143 } else 167 144 fclose(file); 168 145 } else if ((file = fopen(path.Path(), "wb+"))) { 169 146 LoadDefaultSettings(settings); 170 147 fwrite(settings, sizeof(jpeg_settings), 1, file); 171 148 fclose(file); 172 // Tell user settings were changed to default, and ask to run settings panel or not173 if (SettingsChangedAlert())174 // User configured settings, load them again175 LoadSettings(settings);176 149 } 177 150 } 178 151 … … 1300 1273 break; 1301 1274 1302 1275 default: 1303 (new BAlert("Error", "Unknown color space.", "Quit"))->Go();1276 fprintf(stderr, "Unknown color space.\n"); 1304 1277 return B_ERROR; 1305 1278 } 1306 1279 … … 1419 1392 out_color_space = B_RGBA32; 1420 1393 converter = read_rgba32; 1421 1394 } else { 1422 (new BAlert("Error", "Other than RGB with 3 or 4 color " 1423 "components not implemented.", "Quit"))->Go(); 1395 fprintf(stderr, "Other than RGB with 3 or 4 color components not implemented.\n"); 1424 1396 return Error(ins, image, NULL, 0, NULL, B_ERROR); 1425 1397 } 1426 1398 break; … … 1436 1408 } 1437 1409 break; 1438 1410 case JAS_IMAGE_CS_YCBCR: 1439 (new BAlert("Error", "color space YCBCR not implemented yet.", 1440 "Quit"))->Go(); 1411 fprintf(stderr, "Color space YCBCR not implemented yet.\n"); 1441 1412 return Error(ins, image, NULL, 0, NULL, B_ERROR); 1442 1413 break; 1443 1414 case JAS_IMAGE_CS_UNKNOWN: 1444 1415 default: 1445 (new BAlert("Error", "color space unknown.", "Quit"))->Go();1416 fprintf(stderr, "Color space unkown. \n"); 1446 1417 return Error(ins, image, NULL, 0, NULL, B_ERROR); 1447 1418 break; 1448 1419 }