@@ -241,22 +241,22 @@ void ScmConstellationDialog::triggerUndo()
241241
242242void ScmConstellationDialog::triggerUploadImage ()
243243{
244- QString filePath = QFileDialog::getOpenFileName (ui->artworkTab , " Open Artwork" , lastUsedImageDirectory,
245- " Images (*.png *.jpg *.jpeg)" );
244+ QString filePath = QFileDialog::getOpenFileName (ui->artworkTab , q_ ( " Open Artwork" ) , lastUsedImageDirectory,
245+ q_ ( " Images (*.png *.jpg *.jpeg)" ) );
246246 QFileInfo fileInfo (filePath);
247247 lastUsedImageDirectory = fileInfo.absolutePath ();
248248
249249 if (!fileInfo.isFile ())
250250 {
251- ui->infoLbl ->setText (" Choosen path is not a valid file:\n " + filePath);
251+ ui->infoLbl ->setText (q_ ( " Choosen path is not a valid file:\n " ) + filePath);
252252 return ;
253253 }
254254
255255 if (!(fileInfo.suffix ().compare (" PNG" , Qt::CaseInsensitive) == 0 ||
256256 fileInfo.suffix ().compare (" JPG" , Qt::CaseInsensitive) == 0 ||
257257 fileInfo.suffix ().compare (" JPEG" , Qt::CaseInsensitive) == 0 ))
258258 {
259- ui->infoLbl ->setText (" Chosen file is not a PNG, JPG or JPEG image:\n " + filePath);
259+ ui->infoLbl ->setText (q_ ( " Chosen file is not a PNG, JPG or JPEG image:\n " ) + filePath);
260260 return ;
261261 }
262262
@@ -285,7 +285,7 @@ void ScmConstellationDialog::bindSelectedStar()
285285{
286286 if (!imageItem->hasAnchorSelection ())
287287 {
288- ui->infoLbl ->setText (" WARNING: Select an anchor to bind to." );
288+ ui->infoLbl ->setText (q_ ( " WARNING: Select an anchor to bind to." ) );
289289 qDebug () << " SkyCultureMaker: No anchor was selected." ;
290290 return ;
291291 }
@@ -295,7 +295,7 @@ void ScmConstellationDialog::bindSelectedStar()
295295
296296 if (!objectMgr.getWasSelected ())
297297 {
298- ui->infoLbl ->setText (" WARNING: Select a star to bind to the current selected anchor." );
298+ ui->infoLbl ->setText (q_ ( " WARNING: Select a star to bind to the current selected anchor." ) );
299299 qDebug () << " SkyCultureMaker: No star was selected to bind to." ;
300300 return ;
301301 }
@@ -304,23 +304,23 @@ void ScmConstellationDialog::bindSelectedStar()
304304 assert (stelObj != nullptr ); // Checked through getWasSelected
305305 if (stelObj->getType ().compare (" star" , Qt::CaseInsensitive) != 0 )
306306 {
307- ui->infoLbl ->setText (" WARNING: The selected object must be of type star." );
307+ ui->infoLbl ->setText (q_ ( " WARNING: The selected object must be of type star." ) );
308308 qDebug () << " SkyCultureMaker: The selected object is not of type start, got " << stelObj->getType ();
309309 return ;
310310 }
311311
312312 ScmConstellationImageAnchor *anchor = imageItem->getSelectedAnchor ();
313313 if (anchor == nullptr )
314314 {
315- ui->infoLbl ->setText (" WARNING: No anchor is selected." );
315+ ui->infoLbl ->setText (q_ ( " WARNING: No anchor is selected." ) );
316316 qDebug () << " SkyCultureMaker: No anchor is selected" ;
317317 return ;
318318 }
319319
320320 bool success = anchor->trySetStarHip (stelObj->getID ());
321321 if (success == false )
322322 {
323- ui->infoLbl ->setText (" WARNING: The selected object must contain a HIP number." );
323+ ui->infoLbl ->setText (q_ ( " WARNING: The selected object must contain a HIP number." ) );
324324 qDebug () << " SkyCultureMaker: The object does not contain a HIP, id = " << stelObj->getID ();
325325 return ;
326326 }
@@ -344,14 +344,14 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
344344 scm::ScmSkyCulture *currentSkyCulture = maker->getCurrentSkyCulture ();
345345 if (currentSkyCulture == nullptr )
346346 {
347- ui->infoLbl ->setText (" WARNING: Could not save: Sky Culture is not set" );
347+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: Sky Culture is not set" ) );
348348 qDebug () << " SkyCultureMaker: Could not save: Sky Culture is not set" ;
349349 return false ;
350350 }
351351
352352 if (constellationEnglishName.isEmpty ())
353353 {
354- ui->infoLbl ->setText (" WARNING: Could not save: English name is empty" );
354+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: English name is empty" ) );
355355 qDebug () << " SkyCultureMaker: Could not save: English name is empty" ;
356356 return false ;
357357 }
@@ -360,15 +360,15 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
360360 QString finalId = constellationId.isEmpty () ? constellationPlaceholderId : constellationId;
361361 if (finalId.isEmpty ())
362362 {
363- ui->infoLbl ->setText (" WARNING: Could not save: Constellation ID is empty" );
363+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: Constellation ID is empty" ) );
364364 qDebug () << " SkyCultureMaker: Could not save: Constellation ID is empty" ;
365365 return false ;
366366 }
367367
368368 // Not editing a constellation, but the ID already exists
369369 if (constellationBeingEdited == nullptr && currentSkyCulture->getConstellation (finalId) != nullptr )
370370 {
371- ui->infoLbl ->setText (" WARNING: Could not save: Constellation with this ID already exists" );
371+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: Constellation with this ID already exists" ) );
372372 qDebug () << " SkyCultureMaker: Could not save: Constellation with this ID already exists, id = "
373373 << finalId;
374374 return false ;
@@ -377,7 +377,7 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
377377 else if (constellationBeingEdited != nullptr && constellationBeingEdited->getId () != finalId &&
378378 currentSkyCulture->getConstellation (finalId) != nullptr )
379379 {
380- ui->infoLbl ->setText (" WARNING: Could not save: Constellation with this ID already exists" );
380+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: Constellation with this ID already exists" ) );
381381 qDebug () << " SkyCultureMaker: Could not save: Constellation with this ID already exists, id = "
382382 << finalId;
383383 return false ;
@@ -387,7 +387,7 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
387387 auto drawnConstellation = maker->getScmDraw ()->getCoordinates ();
388388 if (drawnConstellation.empty ())
389389 {
390- ui->infoLbl ->setText (" WARNING: Could not save: The constellation does not contain any drawings" );
390+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: The constellation does not contain any drawings" ) );
391391 qDebug () << " SkyCultureMaker: Could not save: The constellation does not contain any drawings" ;
392392 return false ;
393393 }
@@ -397,8 +397,8 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
397397 {
398398 if (!imageItem->isImageAnchored ())
399399 {
400- ui->infoLbl ->setText (" WARNING: Could not save: An artwork is attached, but not all "
401- " anchors have a star bound." );
400+ ui->infoLbl ->setText (q_ ( " WARNING: Could not save: An artwork is attached, but not all "
401+ " anchors have a star bound." )) ;
402402 qDebug () << " SkyCultureMaker: Could not save: An artwork is attached, but not all "
403403 " anchors have a star bound." ;
404404 return false ;
0 commit comments