+++ /dev/null
-<!DOCTYPE QtCreatorProject>
-<qtcreator>
- <data>
- <variable>RunConfiguration0-BaseEnvironmentBase</variable>
- <value type="int">2</value>
- </data>
- <data>
- <variable>RunConfiguration0-CommandLineArguments</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-ProFile</variable>
- <value type="QString">KitchenAlert.pro</value>
- </data>
- <data>
- <variable>RunConfiguration0-RunConfiguration.name</variable>
- <value type="QString">KitchenAlert</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseDyldImageSuffix</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseTerminal</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserEnvironmentChanges</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetName</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserWorkingDirectory</variable>
- <value type="QString"></value>
- </data>
- <data>
- <variable>RunConfiguration0-type</variable>
- <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- </data>
- <data>
- <variable>activeRunConfiguration</variable>
- <value type="int">0</value>
- </data>
- <data>
- <variable>activebuildconfiguration</variable>
- <value type="QString">Debug</value>
- </data>
- <data>
- <variable>buildConfiguration-Debug</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="ToolChain" type="int">0</value>
- <value key="buildConfiguration" type="int">2</value>
- </valuemap>
- </data>
- <data>
- <variable>buildConfiguration-Release</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="buildConfiguration" type="int">0</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- <value key="cleanConfig" type="bool">true</value>
- <valuelist key="makeargs" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfigurations</variable>
- <valuelist type="QVariantList">
- <value type="QString">Debug</value>
- <value type="QString">Release</value>
- </valuelist>
- </data>
- <data>
- <variable>buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- <value key="mkspec" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildsteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.qmake</value>
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- <value key="clean" type="bool">true</value>
- </valuemap>
- </data>
- <data>
- <variable>cleansteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>defaultFileEncoding</variable>
- <value type="QByteArray">System</value>
- </data>
- <data>
- <variable>project</variable>
- <valuemap type="QVariantMap"/>
- </data>
-</qtcreator>
#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_->play();
qDebug() << "Sound should be played now";
}
ui(new Ui::CreateTimerSequenceDialog)
{
ui->setupUi(this);
- ui->timer1AlertText->setMaxLength(40);
+ // ui->timer1AlertText->setMaxLength(40); //needed only with fixed cell height
}
CreateTimerSequenceDialog::~CreateTimerSequenceDialog()
delete p_timer;
}
}
+
+bool CurrentAlertsTableModel::saveTimer(QModelIndex index, QString filename)
+{
+ return currentTimers_.at(index.row())->save(filename);
+}
bool isThisTimerAlerting(QModelIndex index);
+ bool saveTimer(QModelIndex index,QString filename);
+
signals:
public slots:
<RCC>
- <qresource prefix="/"/>
+ <qresource prefix="/">
+ <file>icon64.png</file>
+ </qresource>
</RCC>
#include <QMessageBox>
#include <QFileDialog>
#include <QFile>
+#include <QIcon>
{
ui->setupUi(this);
+ setWindowIcon(QIcon(":/icon64.png"));
+
+ //load sticky alerts to the model here...
+
+
//alerts' tableview setup
ui->ComingAlertsTableView->setModel(&model_);
ui->ComingAlertsTableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->ComingAlertsTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
- 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 heght only
+
+ //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
void KitchenAlertMainWindow::openAbout()
{
- QMessageBox::about(this,tr("About KitchenAlert"),tr("<p>Version 0.1.1"
+ 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/"));
+ "<p>Bugtracker and project page: https://garage.maemo.org/projects/kitchenalert/").arg(QApplication::applicationVersion()));
}
bool KitchenAlertMainWindow::event(QEvent *event)
void restart();
void stop();
void remove();
+ void saveTimer();
+ void loadTimer();
+
protected:
AlertSound alertSound_;
+ void initializeTimer(Timer * p_timer);
+
};
</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>
+++ /dev/null
-/**************************************************************************
- This file is part of KitchenAlert v.0.09
-
- Copyright (C) 2010 Heli Hyvättinen
-
- Kitchen Alert is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-**************************************************************************/
-
-
-
-
{
QApplication a(argc, argv);
a.setApplicationName("KitchenAlert"); //a name required by phonon
+ a.setApplicationVersion("0.2");
+
KitchenAlertMainWindow w;
#if defined(Q_WS_S60)
w.showMaximized();
--- /dev/null
+/**************************************************************************
+ KitchenAlert
+
+ Copyright (C) 2010 Heli Hyvättinen
+
+ This file is part of KitchenAlert.
+
+ Kitchen Alert is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+**************************************************************************/
+
+
+
+
+
+#include "savedtimers.h"
+
+SavedTimers::SavedTimers(QObject *parent) :
+ QObject(parent)
+{
+}
--- /dev/null
+/**************************************************************************
+ KitchenAlert
+
+ Copyright (C) 2010 Heli Hyvättinen
+
+ This file is part of KitchenAlert.
+
+ Kitchen Alert is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+**************************************************************************/
+
+
+
+
+
+#ifndef SAVEDTIMERS_H
+#define SAVEDTIMERS_H
+
+#include <QObject>
+
+class SavedTimers : public QObject
+{
+ Q_OBJECT
+public:
+ explicit SavedTimers(QObject *parent = 0);
+
+signals:
+
+public slots:
+
+};
+
+#endif // SAVEDTIMERS_H
#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)
}
+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;
+
+
+
+
+}
+
public:
explicit Timer(QObject *parent = 0);
+
int getOriginalTimeInSeconds();
void setOriginalTimeInSeconds(int seconds);
void setAlertText(QString text);
bool isAlerting();
+ bool save(QString filename);
+ bool load(QString filename);
signals:
+
private:
int _originalTime; //seconds!
int _remainingTime; //seconds!
<html><head>
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>KitchenAlert</title></head><body>
<table style="text-align: left; width: 640px; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr align="center">
- <td style="vertical-align: middle; width: 484px; background-color: rgb(204, 204, 255); text-align: center;"><span style="font-family: Helvetica,Arial,sans-serif;"></span> <big><span style="font-family: Helvetica,Arial,sans-serif;">KitchenAlert for Maemo</span></big>
+ <td style="vertical-align: middle; width: 484px; background-color: rgb(204, 204, 255); text-align: center;"><span style="font-family: Helvetica,Arial,sans-serif;"></span><img style="width: 48px; height: 48px;" alt="" src="kitchenalert_48x48.png" align="middle"> <big><span style="font-family: Helvetica,Arial,sans-serif;">KitchenAlert for Maemo</span></big>
<br>
</td>
</tr>
this repositories, it's not necessarily safe: </span><span style="font-family: Helvetica,Arial,sans-serif;">keep in mind the above cautions on volume settings, losing alert sound and battery drain.</span><span style="font-family: Helvetica,Arial,sans-serif;"> Remember to close the repository after installing to
avoid unwanted updating of your applications to development versions.<br>
<br>
-Bug reports and feature request are welcome on the application's <a href="https://garage.maemo.org/projects/kitchenalert/">garage project
+Bug reports and feature requests are welcome on the application's <a href="https://garage.maemo.org/projects/kitchenalert/">garage project
page</a>.</span><br>
<br>
</td>