timer.cpp \
currentalertstablemodel.cpp \
alertsound.cpp \
- selectsounddialog.cpp \
- savedtimers.cpp
+ selectsounddialog.cpp
HEADERS += kitchenalertmainwindow.h \
createtimersequencedialog.h \
timer.h \
currentalertstablemodel.h \
alertsound.h \
- selectsounddialog.h \
- savedtimers.h
+ selectsounddialog.h
FORMS += kitchenalertmainwindow.ui \
createtimersequencedialog.ui \
selectsounddialog.ui \
- kitchenalertmainwindow.ui \
- choosetimersequencedialog.ui
-
-CONFIG += mobility
-MOBILITY =
-
+ kitchenalertmainwindow.ui
symbian {
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">2</value>
+ <value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
- <value key="EditorConfiguration.Codec" type="QByteArray">System</value>
+ <value key="EditorConfiguration.Codec" type="QByteArray">UTF-8</value>
</valuemap>
</data>
<data>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
- <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">1</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
- <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
<data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Qt Simulator</value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.QtSimulatorTarget</value>
- <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">1</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Maemo</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.MaemoDeviceTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.2" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoPackageCreationStep</value>
+ <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.LocalFiles" type="QVariantList"/>
+ <value key="Qt4ProjectManager.BuildStep.MaemoPackage.Modified" type="bool">false</value>
+ <value key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteExe" type="QString">/usr/local/bin/KitchenAlert</value>
+ <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteFiles" type="QVariantList"/>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">3</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-simulator</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-maemo</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">8</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.2" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoPackageCreationStep</value>
+ <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.LocalFiles" type="QVariantList"/>
+ <value key="Qt4ProjectManager.BuildStep.MaemoPackage.Modified" type="bool">true</value>
+ <value key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteExe" type="QString"></value>
+ <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteFiles" type="QVariantList"/>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">3</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-simulator</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-maemo</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">8</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">KitchenAlert</value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
- <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">KitchenAlert.pro</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
- <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
- <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+ <value key=".ProFile" type="QString">KitchenAlert.pro</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">New Maemo Run Configuration</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoRunConfiguration</value>
+ <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.Arguments" type="QVariantList"/>
+ <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.DebuggingHelpersLastDeployed" type="QVariantMap"/>
+ <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">17</value>
+ <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
+ <value key="192.168.2.15" type="QDateTime">2010-09-08T15:52:20</value>
+ </valuemap>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
<data>
<variable>ProjectExplorer.Project.Target.2</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Maemo</value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.MaemoDeviceTarget</value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Qt Simulator</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.QtSimulatorTarget</value>
<value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.2" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoPackageCreationStep</value>
- <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.LocalFiles" type="QVariantList"/>
- <value key="Qt4ProjectManager.BuildStep.MaemoPackage.Modified" type="bool">false</value>
- <value key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteExe" type="QString">/usr/local/bin/KitchenAlert</value>
- <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteFiles" type="QVariantList"/>
- </valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">3</value>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-maemo</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">8</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-simulator</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
<valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
<value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
</valuemap>
- <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.2" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoPackageCreationStep</value>
- <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.LocalFiles" type="QVariantList"/>
- <value key="Qt4ProjectManager.BuildStep.MaemoPackage.Modified" type="bool">true</value>
- <value key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteExe" type="QString"></value>
- <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteFiles" type="QVariantList"/>
- </valuemap>
- <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">3</value>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
<valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-maemo</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">8</value>
- <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/holvi/heli/ohjelmointi/KitchenAlert-build-simulator</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
</valuemap>
<value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
<valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
- <value key=".ProFile" type="QString">KitchenAlert.pro</value>
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">New Maemo Run Configuration</value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoRunConfiguration</value>
- <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.Arguments" type="QVariantList"/>
- <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.DebuggingHelpersLastDeployed" type="QVariantMap"/>
- <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">17</value>
- <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
- <value key="192.168.2.15" type="QDateTime">2010-08-16T21:04:14</value>
- </valuemap>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">KitchenAlert</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">KitchenAlert.pro</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
#include <QDebug>
#include <QSettings>
-#include <QList>
-
filename = settings.value("soundfile",defaultsound_).toString();
}
pSound_ = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(filename));
-
-
- //TESTCODE!!!
-
- QList<Phonon::AudioOutputDevice> audioOutputDevices =
- Phonon::BackendCapabilities::availableAudioOutputDevices();
-
- foreach (Phonon::AudioOutputDevice device, audioOutputDevices)
- {
- qDebug() << device.name() << device.description();
- }
}
void AlertSound::play()
{
-
- //TESTCODE
-
- Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
-
- Phonon::Path path = Phonon::createPath(pSound_, audioOutput);
-
- audioOutput->setVolumeDecibel(0);
-
- //TESTCODE ENDS
-
+ pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound
pSound_->play();
qDebug() << "Sound should be played now";
}
ui(new Ui::CreateTimerSequenceDialog)
{
ui->setupUi(this);
- // ui->timer1AlertText->setMaxLength(40); //needed only with fixed cell height
}
CreateTimerSequenceDialog::~CreateTimerSequenceDialog()
/*! Class for the dialog for creating timers'
@author Heli Hyvättinen
- @date 2010-08-12
- @version 0.1.1
+ @date 2010-07-20
+ @version 0.1
Class for the dialog for creating timers
// qDebug () << timeAsText;
- return timeAsText;
+ return timeAsText;
case statusColumnNumber_:
- case Qt::BackgroundRole :
+// case Qt::BackgroundRole :
- //For some reason, these have no effect at all!!! They are asked by the view though.
+// //For some reason, these have no effect at all!!! They are asked by the view though.
- //No need to care for the column number, all have the same color
+// //No need to care for the column number, all have the same color
// qDebug() << "BackgroundRole asked";
- if (currentTimers_.at(index.row())->isAlerting())
- {
+// if (currentTimers_.at(index.row())->isAlerting())
+// {
// qDebug() << "black background";
- return QBrush (QColor(Qt::black));
- }
- else
- {
+// return QBrush (QColor(Qt::black));
+// }
+// else
+// {
// qDebug() << "red background";
- return QBrush (QColor(Qt::red));
- }
+// return QBrush (QColor(Qt::red));
+// }
default:
return QVariant();
-void CurrentAlertsTableModel::addTimers(QList <Timer *> timers)
+void CurrentAlertsTableModel::addTimers(QList <Timer *> timers, bool startImmediately)
{
+
+//preparatory work
foreach (Timer* timer, timers)
{
connect (timer,SIGNAL(remainingTimeChanged()),this,SLOT(refreshTimeColumn()));
timer->setParent(this); //The model becomes the timers parent giving the timer access to model
}
- int nextRow = rowCount(QModelIndex()); //As row numbering starts from zero, number of the rows is the row number of the row after current ones
- int lastRow = nextRow + timers.length()-1;
- beginInsertRows(QModelIndex(),nextRow,lastRow);
+
+//Add the timers
+
+ beginResetModel();
currentTimers_.append(timers);
- endInsertRows();
-// qDebug() << "Timers should be appended";
-// reset();
+ endResetModel();
+
+ //start the timers if requested
+
+ if (startImmediately)
+ {
+ foreach (Timer* timer, timers)
+ {
+ timer->start();
+ }
+ }
+
}
{
updateViewOnChanges_ = update;
if (update == true)
- reset(); //Refresh view to catch up with past changes
+ refreshTimeColumn(); //Refresh to catch up with past changes
}
bool CurrentAlertsTableModel::isThisTimerAlerting(QModelIndex index)
}
return false;
}
-
-void CurrentAlertsTableModel::removeTimer(QModelIndex index)
-{
- if (index.isValid())
- {
- int row = index.row();
- beginRemoveRows(QModelIndex(),row,row);
- Timer* p_timer = currentTimers_.takeAt(row);
- endRemoveRows();
- delete p_timer;
- }
-}
-
-bool CurrentAlertsTableModel::saveTimer(QModelIndex index, QString filename)
-{
- return currentTimers_.at(index.row())->save(filename);
-}
/*! Class that contains the model that holds the timers'
@author Heli Hyvättinen
- @date 2010-08-08
+ @date 2010-09-08
@version 0.1.1
Class that contains the model that holds the timers
public:
explicit CurrentAlertsTableModel(QObject *parent = 0);
+ /*!
+ Returns the number of rows in the model.
+ Used by the view.
+ */
int rowCount(const QModelIndex &parent) const;
+ /*!
+ Returns the (fixed) number of columns in the model.
+ Used by the view.
+ */
int columnCount(const QModelIndex &parent) const;
+ /*!
+ Returns the queried contents of the cell
+ Used by the view.
+ */
QVariant data(const QModelIndex &index, int role) const;
+ /*!
+ Returns the queried header data.
+ As no headers are wanted, it always returns an empty QVariant.
+ Used by the view.
+ */
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+ /*!
+ Returns the index in the model of the given timer
+ */
QModelIndex giveIndexForTimer(Timer * ptimer);
+ /*!
+ Returns whether the timer in the given position is currently alerting.
+ @param index Any cell from the row of the alert is good here.
+ */
bool isThisTimerAlerting(QModelIndex index);
- bool saveTimer(QModelIndex index,QString filename);
-
signals:
public slots:
- void addTimers(QList <Timer *> timers);
+ /*!
+ Adds the timers to the model
+ @param timers List of timers to be added
+ @param startImmediately If true, the timers will be started after adding to the model.
+ */
+ void addTimers(QList <Timer *> timers, bool startImmediately = true);
+ /*!
+ Tells the view to refresh all information in the time column.
+ */
void refreshTimeColumn ();
+ /*!
+ Passes the start command to the timer in the given index.
+ @param index Any cell from the row of the alert is good here.
+ */
void startTimer(QModelIndex index);
+
+ /*!
+ Passes the snooze command to the timer in the given index.
+ @param index Any cell from the row of the alert is good here.
+ */
void snoozeTimer(QModelIndex index);
- void stopTimer(QModelIndex index);
- void setUpdateViewOnChanges(bool update);
+ /*!
+ Passes the stop command to the timer in the given index.
+ @param index Any cell from the row of the alert is good here.
+ */
+ void stopTimer(QModelIndex index);
- void removeTimer(QModelIndex index);
+/*!
+Sets whether the view should be kept up to date.
+*/
+ void setUpdateViewOnChanges(bool update);
private:
- QList <Timer * > currentTimers_;
+ QList <Timer * > currentTimers_; /*! Holds the timers */
- static const int numberOfColumns_ = 3;
- static const int alertTextColumnNumber_ = 0;
- static const int timeRemainingColumnNumber_ = 1;
- static const int statusColumnNumber_ = 2;
+ static const int numberOfColumns_ = 3; /*! The fixed number of columns in the model */
+ static const int alertTextColumnNumber_ = 0; /*! Tells which column contains the alert text */
+ static const int timeRemainingColumnNumber_ = 1; /*! Tells which column contains the time remaining until alert */
+ static const int statusColumnNumber_ = 2; /*! Tells which column contains status information, such as that the timer is alerting */
- bool updateViewOnChanges_;
+ bool updateViewOnChanges_; /*! Keeps track on whether the view should be kept up to date. */
};
<RCC>
<qresource prefix="/">
- <file>icon64.png</file>
+ <file>kitchenalert.png</file>
</qresource>
</RCC>
#include <QAction>
#include <QMenuBar>
#include <QMessageBox>
-#include <QFileDialog>
-#include <QFile>
-#include <QIcon>
+#include <QSettings>
{
ui->setupUi(this);
- setWindowIcon(QIcon(":/icon64.png"));
+ setWindowIcon(QIcon(":/kitchenalert.png"));
- //load sticky alerts to the model here...
+ connect(ui->CreateNewScheduleButton, SIGNAL (pressed()), this, SLOT (newTimerSequence()));
+
+
//alerts' tableview setup
ui->ComingAlertsTableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->ComingAlertsTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ ui->ComingAlertsTableView->horizontalHeader()->hide();
+// ui->ComingAlertsTableView->verticalHeader()->setVisible(true);
- //Commented out for testing their potebtial effect for slowdown:
-
- // ui->ComingAlertsTableView->horizontalHeader()->setResizeMode(QHeaderView::Fixed);
-// ui->ComingAlertsTableView->horizontalHeader()->resizeSection(0,460);
-// ui->ComingAlertsTableView->horizontalHeader()->resizeSection(1,140);
-// ui->ComingAlertsTableView->horizontalHeader()->resizeSection(2,100);
-
-// ui->ComingAlertsTableView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
-
-
-
-
-// ui->ComingAlertsTableView->verticalHeader()->setDefaultSectionSize(40); //Needed with fixed cell height only
-
-
-
+ ui->ComingAlertsTableView->horizontalHeader()->setResizeMode(QHeaderView::Fixed);
+ ui->ComingAlertsTableView->horizontalHeader()->resizeSection(0,535);
+ ui->ComingAlertsTableView->horizontalHeader()->resizeSection(1,140);
+ ui->ComingAlertsTableView->horizontalHeader()->resizeSection(2,100);
- ui->ComingAlertsTableView->horizontalHeader()->hide();
- ui->ComingAlertsTableView->setWordWrap(true);
+ ui->ComingAlertsTableView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
- //Buttons used when a timer is selected are disabled by default and enabled upon selection
+ //Buttons used to reacting an alarm are hidden by default
disableSelectionDependentButtons();
+
connect(ui->ComingAlertsTableView->selectionModel(),SIGNAL(selectionChanged(QItemSelection,QItemSelection)),this,SLOT(timerSelected(QItemSelection,QItemSelection)));
- //connect buttons to respective functions
- connect(ui->CreateNewScheduleButton, SIGNAL (pressed()), this, SLOT (newTimerSequence()));
connect(ui->DoneButton,SIGNAL(clicked()),this,SLOT(stop()));
connect(ui->RestartButton,SIGNAL(clicked()),this,SLOT(restart()));
connect(ui->SnoozeButton,SIGNAL(clicked()),this, SLOT(snooze()));
- connect(ui->RemoveButton,SIGNAL(clicked()),this,SLOT(remove()));
- connect(ui->SaveButton,SIGNAL(clicked()),this,SLOT(saveTimer()));
- connect(ui->loadButton,SIGNAL(clicked()),this,SLOT(loadTimer()));
// menu setup
if (createdialog.exec() == QDialog::Accepted) //if user pressed OK
{
- //get user input from the dialog
-
-
- QList<Timer *> alltimers = createdialog.getTimers();
- // take first timer (currently the only one!)
+ QList<Timer *> alltimers = createdialog.getTimers(); //get user input from the dialog
+ Timer* timer1 = alltimers.at(0); // take first timer (currently the only one!)
- Timer* timer1 = alltimers.at(0);
-
-
- //connect alert
connect(timer1,SIGNAL(alert(QModelIndex)),this,SLOT(alert(QModelIndex)));
- //Disable buttons, as selection is cleared when view is refreshed to show the new timer
-
- disableSelectionDependentButtons();
+ model_.addTimers(alltimers); // give timers to the model, they are started automatically by default
- // give timers to the model
+ // ui->ComingAlertsTableView->resizeColumnsToContents();
- model_.addTimers(alltimers);
+ //Disable buttons, as selection is cleared when view is refreshed to show the new timer
+ //But only if the timer has not already alerted and thus been selected
- //start the timer when it's safely in the model (consider moving this to the model's addTimers function)
+ if (!selectedRow().isValid())
+ disableSelectionDependentButtons();
- timer1->start();
-
}
// if cancelled, do nothing
// The alerting timer is selected
ui->ComingAlertsTableView->selectionModel()->select(QItemSelection(indexOfAlerter,indexOfAlerter),QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows );
-// qDebug() << "Should be selected now";
+ qDebug() << "Should be selected now";
//Snooze button is enabled
ui->SnoozeButton->setEnabled(true);
- //The alert sound is played (consider moving this operation inside timer, as now stopping one alert will silence all alerting alerts)
+ //Debug message
+
- alertSound_.play();
+
+ 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();
}
-void KitchenAlertMainWindow::timerSelected(QItemSelection selected,QItemSelection deselected)
+void KitchenAlertMainWindow::timerSelected(QItemSelection selected,QItemSelection)
{
ui->DoneButton->setEnabled(true);
ui->RestartButton->setEnabled(true);
- ui->RemoveButton->setEnabled(true);
- ui->SaveButton->setEnabled(true);
- //enabled only when alerting
+ //snooze button enabled only when alerting
QModelIndexList indexes = selected.indexes();
//the selection model only allows selecting one row at the time & we only need to know the row, so we can just take the first one
model_.snoozeTimer(row);
}
ui->SnoozeButton->setDisabled(true);
- alertSound_.stop();
+ // alertSound_.stop();
}
model_.startTimer(row);
}
ui->SnoozeButton->setDisabled(true);
- alertSound_.stop();
+ // alertSound_.stop();
}
model_.stopTimer(row);
}
ui->SnoozeButton->setDisabled(true);
- alertSound_.stop();
- qDebug() << "Stopped.";
+// alertSound_.stop();
}
QModelIndex KitchenAlertMainWindow::selectedRow()
void KitchenAlertMainWindow::openSelectSoundDialog()
{
+ //THIS CEASED TO WORK WHEN SOUND WAS MOVED TO TIMERS THEMSELVES
SelectSoundDialog dialog;
if ( dialog.exec() == QDialog::Accepted) //if user pressed OK
{
if (dialog.isDefaultSoundChecked() == true)
alertSound_.setDefaultSound();
else
- alertSound_.setSound(dialog.getSoundFileName());
-
- //opening a dialog clears the selection so the selection dependen buttons must be disabled
+ alertSound_.setSound(dialog.getSoundFileName());
}
- disableSelectionDependentButtons();
+
}
void KitchenAlertMainWindow::openAbout()
QMessageBox::about(this,tr("About KitchenAlert"),tr("<p>Version %1"
"<p>Copyright © Heli Hyvättinen 2010"
"<p>License: General Public License v3"
- "<p>Bugtracker and project page: https://garage.maemo.org/projects/kitchenalert/").arg(QApplication::applicationVersion()));
+ "<p>Web page: http://kitchenalert.garage.maemo.org/"
+ "<p>Bugtracker: https://garage.maemo.org/projects/kitchenalert/").arg(QApplication::applicationVersion()));
}
bool KitchenAlertMainWindow::event(QEvent *event)
{
QMainWindow::event(event);
+
+
switch (event->type())
{
case QEvent::WindowActivate:
model_.setUpdateViewOnChanges(true);
+
+
break;
case QEvent::WindowDeactivate:
default:
break;
+
+
}
}
ui->DoneButton->setDisabled(true);
ui->SnoozeButton->setDisabled(true);
ui->RestartButton->setDisabled(true);
- ui->RemoveButton->setDisabled(true);
- ui->SaveButton->setDisabled(true);
-}
-void KitchenAlertMainWindow::remove()
-{
- QModelIndex row = selectedRow();
- if (row.isValid())
- {
- model_.removeTimer(row);
- alertSound_.stop();
- ui->ComingAlertsTableView->clearSelection();
- disableSelectionDependentButtons();
- }
}
-void KitchenAlertMainWindow::saveTimer()
+void KitchenAlertMainWindow::initializeAlertSound()
{
+ QSettings settings;
- QModelIndex row = selectedRow();
-
- if (row.isValid() == false) //If there was no row selected invalid row was returned
- return;
-
-
- //file name is asked. As the filename will be appended, there's no point in confirming owerwrite here
- QString filename = QFileDialog::getSaveFileName(this, "", "", "*.kitchenalert",NULL,QFileDialog::DontConfirmOverwrite);
+ bool useDefaultSound = settings.value("UseDefaultSound",true).toBool();
+ QString filename = settings.value("soundfile","").toString();
- disableSelectionDependentButtons();
-
- qDebug() << filename;
-
- if (filename.isEmpty()) //user cancelled the dialog (or gave an empty name)
+ if (useDefaultSound == true)
{
- return;
+ openSelectSoundDialog();
}
-
- if (!filename.endsWith(".kitchenalert"))
+ else if (filename.isEmpty())
{
- filename.append(".kitchenalert");
-
+ openSelectSoundDialog();
}
- qDebug() << "filename appended to " << filename;
-
+ QString currentFilename = settings.value("soundfile","").toString();
- //MANUAL CONFIRMATION OF OWERWRITE
-
- if ( QFile::exists(filename))
- {
- //ASK FOR CONFIRMATION
-
- QString overwriteQuestion ("File ");
- overwriteQuestion.append(filename);
- overwriteQuestion.append(" already exists. Do you want to overwrite it?");
- if (QMessageBox::question(this,"Confirm overwrite?", overwriteQuestion,QMessageBox::Yes | QMessageBox::No,QMessageBox::No) != QMessageBox::Yes)
- {
- return;
- }
- }
-
-
-
-
-
- QString errorMessage(tr("Cannot write to file "));
- errorMessage.append(filename);
-
- if (!model_.saveTimer(row,filename)) //Save the file, if not successful give an error message
- {
- QMessageBox::critical(this,tr("Save timer failed!"), errorMessage);
- }
-
-
-}
-
-void KitchenAlertMainWindow::loadTimer()
-{
- QString filename = QFileDialog::getOpenFileName(this,"","",tr("KitchenAlert timer files (*.kitchenalert)"));
- if (!filename.isEmpty())
- {
-
-// if (!filename.endsWith(".kitchenalert")) //not needed, the dialog won't let the user to select files not ending with ".kitchenalert"
-// {
-// filename.append(".kitchenalert");
-// }
-
- QString errorTitle(tr("Failed to load file "));
- errorTitle.append(filename);
-
- Timer * p_timer = new Timer();
- if (!p_timer->load(filename))
- {
- QMessageBox::critical(this,errorTitle,tr("Unable to open file or not a valid KitchenAlert timer file."));
- delete p_timer;
- return;
- }
-
- initializeTimer(p_timer);
- }
-}
-
-
-void KitchenAlertMainWindow::initializeTimer(Timer *p_timer)
-{
-
-//connect alert
-
-
-connect(p_timer,SIGNAL(alert(QModelIndex)),this,SLOT(alert(QModelIndex)));
-
-
-//Disable buttons, as selection is cleared when view is refreshed to show the new timer
-
-disableSelectionDependentButtons();
-
-
-// give timers to the model (model wants list of timers now..)
-
-QList<Timer *> timerList;
-
-timerList.append(p_timer);
-model_.addTimers(timerList);
-
-
-//start the timer when it's safely in the model (consider moving this to the model's addTimers function)
+ if (currentFilename.isEmpty())
+ {
+ ui->debugLabel->setText("<FONT color=red>No alert sound file set. Alert sound will not be played!</FONT>");
+ }
-p_timer->start();
}
/*! The main window class of KitchenAlert'
@author Heli Hyvättinen
- @date 2010-08-08
+ @date 2010-09-08
@version 0.1.1
Operates the UI.
public slots:
- void newTimerSequence();
- void openSelectSoundDialog();
+ /*!
+ Opens a dialog for creating a new timer
+ Connects the new timer's alert and adds it to the model, starting the timer
+ */
+ void newTimerSequence();
+
+ /*!
+ Opens a dialog for choosing the alert sound
+ Gives the sound filename to AlertSound
+ */
+ void openSelectSoundDialog();
+
+ /*!
+ Shows the application's about box
+ */
void openAbout();
+/*! Sounds the alert sound and selects the alarming timer
+ Also bring the application to top and activates it
+ Used by connecting it to the timer's alert signal
+ @param indexOfAlerted The index of the alerting timer in the model.
+ */
void alert(QModelIndex indexOfAlerted);
- void timerSelected(QItemSelection selected,QItemSelection deselected);
+
+/*!
+ Reacts to selecting of timer in the view.
+ Needs to be connected to the corresponding signal.
+ Sets enabling of buttons as necessary.
+ Does not receive information of clearing the selection (because no signal is sent).
+ Disabling selection dependent buttons must be done manually by everything that clears the selection.
+ It cannot be cleared by the user with the selection policy used.
+
+ @param selected Selection that contains all selected cells (all cells of the row selected).
+*/
+ void timerSelected(QItemSelection selected,QItemSelection);
+
+ /*! Snoozes the timer that is currently selected.
+ Needs to be connected to the associated button.
+ */
void snooze();
+
+ /*! Restarts the timer selected.
+ Needs to be connected to the associated button.
+ */
void restart();
- void stop();
- void remove();
- void saveTimer();
- void loadTimer();
+ /*! Stops the timer selected.
+ Needs to be connected to the associated button.
+ */
+ void stop();
protected:
void changeEvent(QEvent *e);
+
+ /*!
+ Reimplemented to catch WindowActivate and WindowDeactivate events.
+ Stops refreshing the view when the window is deactivated and resumes it when reactivated.
+ */
bool event(QEvent *event);
+ /*!
+ Disables all buttons that should only be enabled when a timer is selected.
+ */
void disableSelectionDependentButtons();
private:
Ui::KitchenAlertMainWindow *ui;
- QList <Timer *> currentTimers_;
-
- CurrentAlertsTableModel model_;
+ CurrentAlertsTableModel model_; /*! The model that stores the alerts */
+ /*!
+ Returns a QMoldelIndex pointing to a cell in the row that is currently selected.
+ */
QModelIndex selectedRow();
- AlertSound alertSound_;
+ AlertSound alertSound_; /*! Takes care of alert sound */ //This has been moved to the timers themselves
- void initializeTimer(Timer * p_timer);
+ /*!
+ Not used. Would allow getting rid of the default sound if used.
+ */
+ void initializeAlertSound();
};
<rect>
<x>0</x>
<y>0</y>
- <width>736</width>
- <height>403</height>
+ <width>785</width>
+ <height>413</height>
</rect>
</property>
<property name="windowTitle">
<rect>
<x>0</x>
<y>0</y>
- <width>1445</width>
- <height>585</height>
+ <width>1447</width>
+ <height>587</height>
</rect>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<rect>
<x>350</x>
<y>0</y>
- <width>721</width>
- <height>391</height>
+ <width>791</width>
+ <height>411</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<widget class="QTableView" name="ComingAlertsTableView"/>
</item>
<item>
+ <widget class="QLabel" name="debugLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="SnoozeButton">
</widget>
</item>
<item>
- <widget class="QPushButton" name="RemoveButton">
- <property name="text">
- <string>Remove</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="SaveButton">
- <property name="text">
- <string>Save</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="loadButton">
- <property name="text">
- <string>Load</string>
- </property>
- </widget>
- </item>
- <item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
- a.setApplicationName("KitchenAlert"); //a name required by phonon
- a.setApplicationVersion("0.2");
-
+ a.setApplicationName("KitchenAlert"); //a name is required by phonon
+ a.setApplicationVersion("0.1.1");
+ a.setOrganizationName("KitchenAlert");
KitchenAlertMainWindow w;
#if defined(Q_WS_S60)
w.showMaximized();
#include <QFileDialog>
#include <QSettings>
#include <QDebug>
-#include <Phonon>
SelectSoundDialog::SelectSoundDialog(QWidget *parent) :
QDialog(parent),
}
else ui->CustomSoundRadioButton->setChecked(true);
qDebug() << "UseDefaultSoundfile is " << useDefaultSoundFile;
-
- connect(ui->testButton,SIGNAL(clicked()),this,SLOT(testSound()));
- pSound_ = Phonon::createPlayer(Phonon::NoCategory, Phonon::MediaSource(ui->lineEdit->displayText()));
-
-
}
SelectSoundDialog::~SelectSoundDialog()
{
return ui->DefaultSoundRadioButton->isChecked();
}
-
-void SelectSoundDialog::testSound( )
-{
- pSound_->setCurrentSource(ui->lineEdit->displayText());
- pSound_->play();
-}
#define SELECTSOUNDDIALOG_H
#include <QDialog>
-#include <Phonon>
namespace Ui {
class SelectSoundDialog;
public slots:
void browse();
- void testSound();
private:
Ui::SelectSoundDialog *ui;
- Phonon::MediaObject* pSound_;
-
};
#endif // SELECTSOUNDDIALOG_H
</spacer>
</item>
<item>
- <widget class="QPushButton" name="testButton">
- <property name="text">
- <string>Test sound</string>
- </property>
- </widget>
- </item>
- <item>
<widget class="QPushButton" name="OKButton">
<property name="text">
<string>Done</string>
#include "timer.h"
#include "currentalertstablemodel.h"
#include <qdebug.h>
-#include <QFile>
-#include <QXmlStreamWriter>
-#include <QXmlStreamReader>
Timer::Timer(QObject *parent) :
QObject(parent)
}
-
int Timer::getOriginalTimeInSeconds()
{
return _originalTime;
if (_remainingTime == 0)
{
alerting_ = true;
+ alertSound_.play();
emit alert(whereAmI());
- qDebug() << "alerted";
+// qDebug() << "alerting";
}
emit remainingTimeChanged(); //after alerting in case of alert so that status gets updated immediately
_remainingTime = _originalTime;
_actualTimer.start();
- alerting_ = false;
- if (_originalTime == 0) //has to be checked here, since 00:00:00 alert will already be negative when checked next time
- //THIS ALERTS EVERY SECOND TIME THE TIMER IS STARTED! //This bug disappeared without explanation...
+
+ if (_originalTime == 0) //a 00:00:00 alert has to be checked here, since it's already negative when checked for the next time
{
- alerting_ = true;
+ alerting_ = true;
+ alertSound_.play();
emit alert(whereAmI());
- qDebug () << "Alerted for 00:00:00 alert";
+ qDebug () << "Alerting 00:00:00 from row: " << whereAmI().row();
}
+
+ else
+ {
+ alerting_ = false;
+ alertSound_.stop();
+ }
+
}
void Timer::stop()
{
_actualTimer.stop();
- _remainingTime = 0; //Stopped timer shows 00:00:00
+ _remainingTime = 0; //Stopped timer shows 00:00:00 (which unfortunately makes it red...)
alerting_ = false;
+ alertSound_.stop();
}
void Timer::snooze()
_remainingTime = 120;
alerting_ = false;
+ alertSound_.stop();
}
}
-bool Timer::save(QString filename)
-{
- QFile file(filename);
-
- if (!file.open(QFile::WriteOnly | QFile::Text))
- {
- return false;
- }
-
- QXmlStreamWriter xmlWriter(&file);
- xmlWriter.setAutoFormatting(true);
- xmlWriter.writeStartDocument();
- xmlWriter.writeStartElement("kitchenalert");
- xmlWriter.writeStartElement("timer");
- xmlWriter.writeAttribute("alert_text",_alertText);
- xmlWriter.writeAttribute("time_in_seconds", QString().setNum(_originalTime));
- xmlWriter.writeEndDocument(); //this should close all open elements
-
- return true;
-}
-
-bool Timer::load(QString filename)
-{
- QFile file (filename);
- if (!file.open(QFile::ReadOnly | QFile::Text))
- {
- return false;
- }
-
- QXmlStreamReader reader;
- reader.setDevice(&file);
-
- reader.readNextStartElement();
-
- if (reader.name() != "kitchenalert")
- return false;
-
- reader.readNextStartElement();
- if (reader.name() != "timer")
- return false;
-
-
- _alertText = reader.attributes().value("alert_text").toString();
- _originalTime = reader.attributes().value("time_in_seconds").toString().toInt();
- return true;
-
-
-
-
-}
-
#include <QModelIndex>
-
+#include "alertsound.h"
/*! The timer class of KitchenAlert'
@author Heli Hyvättinen
- @date 2010-08-12
+ @date 2010-09-08
@version 0.1.1
The timer class of KitchenAlert.
public:
explicit Timer(QObject *parent = 0);
+ /*! Returns the original time in seconds
+ When the alert restarts, it is set to this time.
+ */
+ int getOriginalTimeInSeconds();
- int getOriginalTimeInSeconds();
+ /*! Sets the original time in seconds */
void setOriginalTimeInSeconds(int seconds);
+ /*! Returns the time remaining before the alert in seconds */
int getRemainingTimeInSeconds();
QString getAlertText();
void setAlertText(QString text);
bool isAlerting();
- bool save(QString filename);
- bool load(QString filename);
signals:
-
private:
int _originalTime; //seconds!
int _remainingTime; //seconds!
QModelIndex whereAmI();
+ AlertSound alertSound_;
+
};
#endif // TIMER_H