Buggy but tolerable
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Sun, 30 Jan 2011 12:50:04 +0000 (14:50 +0200)
committerHeli Hyvättinen <heli@pantteri.(none)>
Sun, 30 Jan 2011 12:50:04 +0000 (14:50 +0200)
src/alertsound.cpp
src/currentalertstablemodel.cpp
src/kitchenalertmainwindow.cpp
src/kitchenalertmainwindow.h
src/selectsounddialog.cpp
src/timer.cpp

index 8fd54b7..b53541f 100644 (file)
@@ -43,7 +43,7 @@ AlertSound::AlertSound(QObject *parent) :
    // settings.clear(); //REMOVE THIS AFTER TESTING!!!!!!
 
     bool useDefaultSound = settings.value("UseDefaultSound",true).toBool();
-    qDebug() << "In AlertSound constructor UseDefaultSound is " << useDefaultSound;
+//    qDebug() << "In AlertSound constructor UseDefaultSound is " << useDefaultSound;
     if (useDefaultSound == true)
     {
         filename = defaultsound_;
@@ -66,7 +66,7 @@ AlertSound::~AlertSound()
 
 void AlertSound::play()
 {
-    pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound
+    pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound (only partially, but since it helped some, keeping it even if the problem was solved otherwise)
     pSound_->play();
     qDebug() << "Sound should be played now";
 }
@@ -75,6 +75,8 @@ void AlertSound::stop()
 {
 
     pSound_->stop();
+    qDebug() << pSound_->state();
+    qDebug() << "Sound stopped by AlertSound.";
 }
 
 
index 7631630..b7afc18 100644 (file)
@@ -295,7 +295,7 @@ void CurrentAlertsTableModel::setUpdateViewOnChanges(bool update)
     if (update == true)
     {
         refreshTimeAndStatusColumns(); //Refresh to catch up with past changes
-        qDebug() << "Just refreshed time and status colums after returning to the app";
+//        qDebug() << "Just refreshed time and status colums after returning to the app";
     }
     }
 
index 3d9a8dc..5d60117 100644 (file)
@@ -137,7 +137,7 @@ void KitchenAlertMainWindow::newTimerSequence()
 
        connect(timer1,SIGNAL(alert(QModelIndex)),this,SLOT(alert(QModelIndex)));
 
-       //TODO: FIND A WAY TO INFORM THE TIMERS' ALERTSOUND'S OF A CHANGE OF THE SOUND FILE THEY SHOULD USE!!!!
+
 
        connect(this,SIGNAL(defaultSoundEnabled()),timer1,SLOT(enableDefaultSound()));
        connect(this,SIGNAL(soundChanged(QString)),timer1,SLOT(changeAlertSound(QString)));
@@ -175,7 +175,10 @@ void KitchenAlertMainWindow::alert(QModelIndex indexOfAlerter)
 
 
     activateWindow();
-    raise();
+
+// removing everything below does not solve the bug #6752!
+
+    raise();  //this may be unnecessary
 
     // The alerting timer is selected
     ui->ComingAlertsTableView->selectionModel()->select(QItemSelection(indexOfAlerter,indexOfAlerter),QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows );
@@ -190,17 +193,7 @@ void KitchenAlertMainWindow::alert(QModelIndex indexOfAlerter)
 
 
     ui->SnoozeButton->setEnabled(true);
-
-    //Debug message
-
-
-
-    ui->debugLabel->setText(tr("Alert received from row %1").arg(indexOfAlerter.row()));
-    qDebug() << "Wrote the debug message";
-
-    //The alert sound is played
-   //TESTING TO MOVE THIS OPERATION TO THE TIMER ITSELF
-//    alertSound_.play();
+qDebug ("Snooze päälle hälytyksessä");
 
 }
 
@@ -222,8 +215,13 @@ void KitchenAlertMainWindow::timerSelected(QItemSelection selected,QItemSelectio
         if (model_.isThisTimerAlerting(index) == true)
         {
              ui->SnoozeButton->setEnabled(true);
+qDebug() << "Snooze päälle";
+        }
+        else
+        {
+            ui->SnoozeButton->setDisabled(true);
+qDebug() << "Snooze pois päältä";
         }
-        else ui->SnoozeButton->setDisabled(true);
     }
 
 }
@@ -248,7 +246,10 @@ void KitchenAlertMainWindow::restart()
 
         model_.startTimer(row);
     }
+
+
     ui->SnoozeButton->setDisabled(true);
+    qDebug () << "disabled snooze because of restart";
  //   alertSound_.stop();
 
 }
@@ -308,12 +309,12 @@ bool KitchenAlertMainWindow::event(QEvent *event)
         case QEvent::WindowActivate:
 
             model_.setUpdateViewOnChanges(true);
-            ui->debugLabel->setText("Returned to the application!");
+//            ui->debugLabel->setText("Returned to the application!");
             break;
 
        case QEvent::WindowDeactivate:
             model_.setUpdateViewOnChanges(false);
-            ui->debugLabel->setText("");
+//            ui->debugLabel->setText("");
             break;
 
        default:
index c2045e4..67a90f6 100644 (file)
@@ -40,7 +40,7 @@ namespace Ui {
 /*! The main window class of KitchenAlert'
 
   @author Heli Hyvättinen
-  @date 2010-09-27
+  @date 2010-11-24
   @version 0.2.0
 
 Operates the UI.
index 539796e..01896e0 100644 (file)
@@ -49,7 +49,7 @@ SelectSoundDialog::SelectSoundDialog(QWidget *parent) :
         ui->lineEdit->setDisabled(true);
     }
     else ui->CustomSoundRadioButton->setChecked(true);
-    qDebug() << "UseDefaultSoundfile is " << useDefaultSoundFile;
+//    qDebug() << "UseDefaultSoundfile is " << useDefaultSoundFile;
 }
 
 SelectSoundDialog::~SelectSoundDialog()
index 6aff3f5..0b801a1 100644 (file)
@@ -93,7 +93,7 @@ void Timer::start()
         alerting_  = true;
         alertSound_.play();
         emit alert(whereAmI());
-        qDebug () << "Alerting 00:00:00 from row: " << whereAmI().row();
+//        qDebug () << "Alerting 00:00:00 from row: " << whereAmI().row();
     }
 
     else