// 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_;
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";
}
{
pSound_->stop();
+ qDebug() << pSound_->state();
+ qDebug() << "Sound stopped by AlertSound.";
}
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)));
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 );
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ä");
}
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);
}
}
model_.startTimer(row);
}
+
+
ui->SnoozeButton->setDisabled(true);
+ qDebug () << "disabled snooze because of restart";
// alertSound_.stop();
}
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: