1111
1212#include " mainwindow.h"
1313#include " ui_mainwindow.h"
14- #include < QDebug >
14+ #include " logging.h "
1515
1616MainWindow::MainWindow (QString inputFilenameParam, QWidget *parent) :
1717 QMainWindow(parent),
@@ -754,7 +754,7 @@ void MainWindow::sanitizeCurrentPosition()
754754
755755void MainWindow::on_actionExit_triggered ()
756756{
757- qDebug () << " MainWindow::on_actionExit_triggered(): Called" ;
757+ tbcDebugStream () << " MainWindow::on_actionExit_triggered(): Called" ;
758758
759759 // Quit the application
760760 qApp->quit ();
@@ -763,7 +763,7 @@ void MainWindow::on_actionExit_triggered()
763763// Load a TBC file based on the file selection from the GUI
764764void MainWindow::on_actionOpen_TBC_file_triggered ()
765765{
766- qDebug () << " MainWindow::on_actionOpen_TBC_file_triggered(): Called" ;
766+ tbcDebugStream () << " MainWindow::on_actionOpen_TBC_file_triggered(): Called" ;
767767
768768 QString inputFileName = QFileDialog::getOpenFileName (this ,
769769 tr (" Open TBC file" ),
@@ -860,7 +860,7 @@ void MainWindow::on_actionWhite_SNR_analysis_triggered()
860860// Save current frame as PNG
861861void MainWindow::on_actionSave_frame_as_PNG_triggered ()
862862{
863- qDebug () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Called" ;
863+ tbcDebugStream () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Called" ;
864864
865865 // Create a suggestion for the filename
866866 QString filenameSuggestion = configuration.getPngDirectory ();
@@ -907,7 +907,7 @@ void MainWindow::on_actionSave_frame_as_PNG_triggered()
907907 // Was a filename specified?
908908 if (!pngFilename.isEmpty () && !pngFilename.isNull ()) {
909909 // Save the current frame as a PNG
910- qDebug () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Saving current frame as" << pngFilename;
910+ tbcDebugStream () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Saving current frame as" << pngFilename;
911911
912912 // Generate QImage for the current frame
913913 QImage imageToSave = tbcSource.getImage ();
@@ -922,7 +922,7 @@ void MainWindow::on_actionSave_frame_as_PNG_triggered()
922922
923923 // Save the QImage as PNG
924924 if (!imageToSave.save (pngFilename)) {
925- qDebug () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Failed to save file as" << pngFilename;
925+ tbcDebugStream () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Failed to save file as" << pngFilename;
926926
927927 QMessageBox messageBox;
928928 messageBox.warning (this , tr (" Warning" ),tr (" Could not save a PNG using the specified filename!" ));
@@ -931,7 +931,7 @@ void MainWindow::on_actionSave_frame_as_PNG_triggered()
931931 // Update the configuration for the PNG directory
932932 QFileInfo pngFileInfo (pngFilename);
933933 configuration.setPngDirectory (pngFileInfo.absolutePath ());
934- qDebug () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Setting PNG directory to:" << pngFileInfo.absolutePath ();
934+ tbcDebugStream () << " MainWindow::on_actionSave_frame_as_PNG_triggered(): Setting PNG directory to:" << pngFileInfo.absolutePath ();
935935 configuration.writeConfiguration ();
936936 }
937937}
@@ -1393,14 +1393,14 @@ void MainWindow::on_viewPushButton_clicked()
13931393{
13941394 switch (tbcSource.getViewMode ()) {
13951395 case TbcSource::ViewMode::FRAME_VIEW:
1396- qDebug () << " Changing to SPLIT_VIEW mode" ;
1396+ tbcDebugStream () << " Changing to SPLIT_VIEW mode" ;
13971397
13981398 // Set split mode
13991399 tbcSource.setViewMode (TbcSource::ViewMode::SPLIT_VIEW);
14001400 break ;
14011401
14021402 case TbcSource::ViewMode::SPLIT_VIEW:
1403- qDebug () << " Changing to FIELD_VIEW mode (1:1)" ;
1403+ tbcDebugStream () << " Changing to FIELD_VIEW mode (1:1)" ;
14041404
14051405 // Set field mode with 1:1 aspect
14061406 tbcSource.setViewMode (TbcSource::ViewMode::FIELD_VIEW);
@@ -1409,12 +1409,12 @@ void MainWindow::on_viewPushButton_clicked()
14091409
14101410 case TbcSource::ViewMode::FIELD_VIEW:
14111411 if (!tbcSource.getStretchField ()) {
1412- qDebug () << " Changing to FIELD_VIEW mode (2:1)" ;
1412+ tbcDebugStream () << " Changing to FIELD_VIEW mode (2:1)" ;
14131413
14141414 // Set field mode with 2:1 aspect
14151415 tbcSource.setStretchField (true );
14161416 } else {
1417- qDebug () << " Changing to FRAME_VIEW mode" ;
1417+ tbcDebugStream () << " Changing to FRAME_VIEW mode" ;
14181418
14191419 // Set frame mode
14201420 tbcSource.setViewMode (TbcSource::ViewMode::FRAME_VIEW);
@@ -1537,7 +1537,7 @@ void MainWindow::on_mouseModePushButton_clicked()
15371537// Handler called when another class changes the currently selected scan line
15381538void MainWindow::scopeCoordsChangedSignalHandler (qint32 xCoord, qint32 yCoord)
15391539{
1540- qDebug () << " MainWindow::scanLineChangedSignalHandler(): Called with xCoord =" << xCoord << " and yCoord =" << yCoord;
1540+ tbcDebugStream () << " MainWindow::scanLineChangedSignalHandler(): Called with xCoord =" << xCoord << " and yCoord =" << yCoord;
15411541
15421542 if (tbcSource.getIsSourceLoaded ()) {
15431543 // Show the oscilloscope dialogue for the selected scan-line
@@ -1554,7 +1554,7 @@ void MainWindow::scopeCoordsChangedSignalHandler(qint32 xCoord, qint32 yCoord)
15541554// Handler called when vectorscope settings are changed
15551555void MainWindow::vectorscopeChangedSignalHandler ()
15561556{
1557- qDebug () << " MainWindow::vectorscopeChangedSignalHandler(): Called" ;
1557+ tbcDebugStream () << " MainWindow::vectorscopeChangedSignalHandler(): Called" ;
15581558
15591559 if (tbcSource.getIsSourceLoaded ()) {
15601560 // Update the vectorscope
@@ -1684,7 +1684,7 @@ void MainWindow::chromaDecoderConfigChangedSignalHandler()
16841684// Signal handler for busy signal from TbcSource class
16851685void MainWindow::on_busy (QString infoMessage)
16861686{
1687- qDebug () << " MainWindow::on_busy(): Got signal with message" << infoMessage;
1687+ tbcDebugStream () << " MainWindow::on_busy(): Got signal with message" << infoMessage;
16881688 // Set the busy message and centre the dialog in the parent window
16891689 busyDialog->setMessage (infoMessage);
16901690 busyDialog->move (this ->geometry ().center () - busyDialog->rect ().center ());
@@ -1701,7 +1701,7 @@ void MainWindow::on_busy(QString infoMessage)
17011701// Signal handler for finishedLoading signal from TbcSource class
17021702void MainWindow::on_finishedLoading (bool success)
17031703{
1704- qDebug () << " MainWindow::on_finishedLoading(): Called" ;
1704+ tbcDebugStream () << " MainWindow::on_finishedLoading(): Called" ;
17051705
17061706 // Hide the busy dialogue
17071707 busyDialog->hide ();
@@ -1741,7 +1741,7 @@ void MainWindow::on_finishedLoading(bool success)
17411741 // Update the configuration for the source directory
17421742 QFileInfo inFileInfo (tbcSource.getCurrentSourceFilename ());
17431743 configuration.setSourceDirectory (inFileInfo.absolutePath ());
1744- qDebug () << " MainWindow::loadTbcFile(): Setting source directory to:" << inFileInfo.absolutePath ();
1744+ tbcDebugStream () << " MainWindow::loadTbcFile(): Setting source directory to:" << inFileInfo.absolutePath ();
17451745 configuration.writeConfiguration ();
17461746 } else {
17471747 // Load failed
@@ -1759,7 +1759,7 @@ void MainWindow::on_finishedLoading(bool success)
17591759// Signal handler for finishedSaving signal from TbcSource class
17601760void MainWindow::on_finishedSaving (bool success)
17611761{
1762- qDebug () << " MainWindow::on_finishedSaving(): Called" ;
1762+ tbcDebugStream () << " MainWindow::on_finishedSaving(): Called" ;
17631763
17641764 // Hide the busy dialogue
17651765 busyDialog->hide ();
0 commit comments