From: Heli Hyvättinen Date: Tue, 20 Jul 2010 03:12:14 +0000 (+0300) Subject: Ready to be packaged X-Git-Tag: v0.4.0~43 X-Git-Url: https://vcs.maemo.org/git/?p=kitchenalert;a=commitdiff_plain;h=55e83dd6677893a7d2ed9de67c675fd9b45a68bc Ready to be packaged --- diff --git a/src/KitchenAlert.pro b/src/KitchenAlert.pro index 60442ae..8691efe 100644 --- a/src/KitchenAlert.pro +++ b/src/KitchenAlert.pro @@ -13,22 +13,23 @@ TEMPLATE = app SOURCES += main.cpp\ kitchenalertmainwindow.cpp \ - choosetimersequencedialog.cpp \ createtimersequencedialog.cpp \ timer.cpp \ currentalertstablemodel.cpp \ - alertsound.cpp + alertsound.cpp \ + selectsounddialog.cpp HEADERS += kitchenalertmainwindow.h \ - choosetimersequencedialog.h \ createtimersequencedialog.h \ timer.h \ currentalertstablemodel.h \ - alertsound.h + alertsound.h \ + selectsounddialog.h FORMS += kitchenalertmainwindow.ui \ - choosetimersequencedialog.ui \ - createtimersequencedialog.ui + createtimersequencedialog.ui \ + selectsounddialog.ui \ + kitchenalertmainwindow.ui CONFIG += mobility MOBILITY = @@ -42,4 +43,5 @@ symbian { TARGET.EPOCHEAPSIZE = 0x020000 0x800000 } -RESOURCES += +RESOURCES += \ + kitchenalert.qrc diff --git a/src/KitchenAlert.pro.user b/src/KitchenAlert.pro.user new file mode 100644 index 0000000..028ee78 --- /dev/null +++ b/src/KitchenAlert.pro.user @@ -0,0 +1,309 @@ + + + + ProjectExplorer.Project.ActiveTarget + 1 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Desktop + Qt4ProjectManager.Target.DesktopTarget + 1 + 0 + + + + QtProjectManager.QMakeBuildStep + + + + + Qt4ProjectManager.MakeStep + false + + + + 2 + + + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /holvi/heli/ohjelmointi/KitchenAlert-build-desktop + 4 + 0 + true + + + + + QtProjectManager.QMakeBuildStep + + + + + Qt4ProjectManager.MakeStep + false + + + + 2 + + + Qt4ProjectManager.MakeStep + true + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /holvi/heli/ohjelmointi/KitchenAlert-build-desktop + 4 + 0 + true + + 2 + + KitchenAlert + Qt4ProjectManager.Qt4RunConfiguration + 2 + + KitchenAlert.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Maemo + Qt4ProjectManager.Target.MaemoDeviceTarget + 1 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + + + Qt4ProjectManager.MaemoPackageCreationStep + + false + /home/opt/kitchenalert/kitchenalert + + + 3 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /holvi/heli/ohjelmointi/KitchenAlert-build-maemo + 3 + 9 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + + + Qt4ProjectManager.MaemoPackageCreationStep + + false + /home/opt/kitchenalert/kitchenalert + + + 3 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /holvi/heli/ohjelmointi/KitchenAlert-build-maemo + 3 + 9 + true + + 2 + + KitchenAlert.pro + New Maemo Run Configuration + Qt4ProjectManager.MaemoRunConfiguration + + + 17 + + 2010-07-19T23:08:40 + + + 1 + + + + ProjectExplorer.Project.Target.2 + + Qt Simulator + Qt4ProjectManager.Target.QtSimulatorTarget + 1 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /holvi/heli/ohjelmointi/KitchenAlert-build-simulator + 2 + 0 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /holvi/heli/ohjelmointi/KitchenAlert-build-simulator + 2 + 0 + true + + 2 + + KitchenAlert + Qt4ProjectManager.Qt4RunConfiguration + 2 + + KitchenAlert.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 3 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff --git a/src/KitchenAlert.pro.user.1.3 b/src/KitchenAlert.pro.user.1.3 new file mode 100644 index 0000000..8009944 --- /dev/null +++ b/src/KitchenAlert.pro.user.1.3 @@ -0,0 +1,160 @@ + + + + RunConfiguration0-BaseEnvironmentBase + 2 + + + RunConfiguration0-CommandLineArguments + + + + RunConfiguration0-ProFile + KitchenAlert.pro + + + RunConfiguration0-RunConfiguration.name + KitchenAlert + + + RunConfiguration0-UseDyldImageSuffix + false + + + RunConfiguration0-UseTerminal + false + + + RunConfiguration0-UserEnvironmentChanges + + + + RunConfiguration0-UserSetName + false + + + RunConfiguration0-UserSetWorkingDirectory + false + + + RunConfiguration0-UserWorkingDirectory + + + + RunConfiguration0-type + Qt4ProjectManager.Qt4RunConfiguration + + + activeRunConfiguration + 0 + + + activebuildconfiguration + Debug + + + buildConfiguration-Debug + + Debug + 0 + 0 + 2 + + + + buildConfiguration-Release + + Release + 0 + 0 + + + + buildconfiguration-Debug-buildstep0 + + Debug + + + + buildconfiguration-Debug-buildstep1 + + Debug + + + + buildconfiguration-Debug-cleanstep0 + + Debug + true + + clean + + + + + buildconfiguration-Release-buildstep0 + + Release + + + + buildconfiguration-Release-buildstep1 + + Release + + + + buildconfiguration-Release-cleanstep0 + + Release + + + + buildconfigurations + + Debug + Release + + + + buildstep0 + + + + + + + buildstep1 + + + + + + buildsteps + + trolltech.qt4projectmanager.qmake + trolltech.qt4projectmanager.make + + + + cleanstep0 + + + true + + + + cleansteps + + trolltech.qt4projectmanager.make + + + + defaultFileEncoding + System + + + project + + + diff --git a/src/KitchenAlertTestSound1.wav b/src/KitchenAlertTestSound1.wav new file mode 100755 index 0000000..2cbcc4b Binary files /dev/null and b/src/KitchenAlertTestSound1.wav differ diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..4273046 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,307 @@ +############################################################################# +# Makefile for building: KitchenAlert +# Generated by qmake (2.01a) (Qt 4.6.2) on: su kesä 27 19:46:29 2010 +# Project: KitchenAlert.pro +# Template: app +# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile KitchenAlert.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/phonon -I/usr/include/qt4 -I/usr/include/qt4/phonon_compat -I. -I. +LINK = g++ +LFLAGS = +LIBS = $(SUBLIBS) -L/usr/lib -lphonon -lQtGui -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake-qt4 +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp \ + kitchenalertmainwindow.cpp \ + choosetimersequencedialog.cpp \ + createtimersequencedialog.cpp \ + timer.cpp \ + currentalertstablemodel.cpp \ + alertsound.cpp moc_kitchenalertmainwindow.cpp \ + moc_choosetimersequencedialog.cpp \ + moc_createtimersequencedialog.cpp \ + moc_timer.cpp \ + moc_currentalertstablemodel.cpp \ + moc_alertsound.cpp +OBJECTS = main.o \ + kitchenalertmainwindow.o \ + choosetimersequencedialog.o \ + createtimersequencedialog.o \ + timer.o \ + currentalertstablemodel.o \ + alertsound.o \ + moc_kitchenalertmainwindow.o \ + moc_choosetimersequencedialog.o \ + moc_createtimersequencedialog.o \ + moc_timer.o \ + moc_currentalertstablemodel.o \ + moc_alertsound.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/debug.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ + KitchenAlert.pro +QMAKE_TARGET = KitchenAlert +DESTDIR = +TARGET = KitchenAlert + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): ui_kitchenalertmainwindow.h ui_choosetimersequencedialog.h ui_createtimersequencedialog.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: KitchenAlert.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/debug.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ + /usr/lib/libQtGui.prl \ + /usr/lib/libQtCore.prl + $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile KitchenAlert.pro +/usr/share/qt4/mkspecs/common/g++.conf: +/usr/share/qt4/mkspecs/common/unix.conf: +/usr/share/qt4/mkspecs/common/linux.conf: +/usr/share/qt4/mkspecs/qconfig.pri: +/usr/share/qt4/mkspecs/features/qt_functions.prf: +/usr/share/qt4/mkspecs/features/qt_config.prf: +/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/usr/share/qt4/mkspecs/features/default_pre.prf: +/usr/share/qt4/mkspecs/features/debug.prf: +/usr/share/qt4/mkspecs/features/default_post.prf: +/usr/share/qt4/mkspecs/features/warn_on.prf: +/usr/share/qt4/mkspecs/features/qt.prf: +/usr/share/qt4/mkspecs/features/unix/thread.prf: +/usr/share/qt4/mkspecs/features/moc.prf: +/usr/share/qt4/mkspecs/features/resources.prf: +/usr/share/qt4/mkspecs/features/uic.prf: +/usr/share/qt4/mkspecs/features/yacc.prf: +/usr/share/qt4/mkspecs/features/lex.prf: +/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/usr/lib/libQtGui.prl: +/usr/lib/libQtCore.prl: +qmake: FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile KitchenAlert.pro + +dist: + @$(CHK_DIR_EXISTS) .tmp/KitchenAlert1.0.0 || $(MKDIR) .tmp/KitchenAlert1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/KitchenAlert1.0.0/ && $(COPY_FILE) --parents kitchenalertmainwindow.h choosetimersequencedialog.h createtimersequencedialog.h timer.h currentalertstablemodel.h alertsound.h .tmp/KitchenAlert1.0.0/ && $(COPY_FILE) --parents main.cpp kitchenalertmainwindow.cpp choosetimersequencedialog.cpp createtimersequencedialog.cpp timer.cpp currentalertstablemodel.cpp alertsound.cpp .tmp/KitchenAlert1.0.0/ && $(COPY_FILE) --parents kitchenalertmainwindow.ui choosetimersequencedialog.ui createtimersequencedialog.ui .tmp/KitchenAlert1.0.0/ && (cd `dirname .tmp/KitchenAlert1.0.0` && $(TAR) KitchenAlert1.0.0.tar KitchenAlert1.0.0 && $(COMPRESS) KitchenAlert1.0.0.tar) && $(MOVE) `dirname .tmp/KitchenAlert1.0.0`/KitchenAlert1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/KitchenAlert1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: moc_kitchenalertmainwindow.cpp moc_choosetimersequencedialog.cpp moc_createtimersequencedialog.cpp moc_timer.cpp moc_currentalertstablemodel.cpp moc_alertsound.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_kitchenalertmainwindow.cpp moc_choosetimersequencedialog.cpp moc_createtimersequencedialog.cpp moc_timer.cpp moc_currentalertstablemodel.cpp moc_alertsound.cpp +moc_kitchenalertmainwindow.cpp: timer.h \ + currentalertstablemodel.h \ + alertsound.h \ + kitchenalertmainwindow.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) kitchenalertmainwindow.h -o moc_kitchenalertmainwindow.cpp + +moc_choosetimersequencedialog.cpp: timerschedule.h \ + choosetimersequencedialog.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) choosetimersequencedialog.h -o moc_choosetimersequencedialog.cpp + +moc_createtimersequencedialog.cpp: timer.h \ + createtimersequencedialog.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) createtimersequencedialog.h -o moc_createtimersequencedialog.cpp + +moc_timer.cpp: timer.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) timer.h -o moc_timer.cpp + +moc_currentalertstablemodel.cpp: timer.h \ + currentalertstablemodel.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) currentalertstablemodel.h -o moc_currentalertstablemodel.cpp + +moc_alertsound.cpp: alertsound.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) alertsound.h -o moc_alertsound.cpp + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_kitchenalertmainwindow.h ui_choosetimersequencedialog.h ui_createtimersequencedialog.h +compiler_uic_clean: + -$(DEL_FILE) ui_kitchenalertmainwindow.h ui_choosetimersequencedialog.h ui_createtimersequencedialog.h +ui_kitchenalertmainwindow.h: kitchenalertmainwindow.ui + /usr/bin/uic-qt4 kitchenalertmainwindow.ui -o ui_kitchenalertmainwindow.h + +ui_choosetimersequencedialog.h: choosetimersequencedialog.ui + /usr/bin/uic-qt4 choosetimersequencedialog.ui -o ui_choosetimersequencedialog.h + +ui_createtimersequencedialog.h: createtimersequencedialog.ui + /usr/bin/uic-qt4 createtimersequencedialog.ui -o ui_createtimersequencedialog.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +main.o: main.cpp kitchenalertmainwindow.h \ + timer.h \ + currentalertstablemodel.h \ + alertsound.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +kitchenalertmainwindow.o: kitchenalertmainwindow.cpp kitchenalertmainwindow.h \ + timer.h \ + currentalertstablemodel.h \ + alertsound.h \ + ui_kitchenalertmainwindow.h \ + choosetimersequencedialog.h \ + timerschedule.h \ + createtimersequencedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o kitchenalertmainwindow.o kitchenalertmainwindow.cpp + +choosetimersequencedialog.o: choosetimersequencedialog.cpp choosetimersequencedialog.h \ + timerschedule.h \ + ui_choosetimersequencedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o choosetimersequencedialog.o choosetimersequencedialog.cpp + +createtimersequencedialog.o: createtimersequencedialog.cpp createtimersequencedialog.h \ + timer.h \ + ui_createtimersequencedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o createtimersequencedialog.o createtimersequencedialog.cpp + +timer.o: timer.cpp timer.h \ + currentalertstablemodel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o timer.o timer.cpp + +currentalertstablemodel.o: currentalertstablemodel.cpp currentalertstablemodel.h \ + timer.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o currentalertstablemodel.o currentalertstablemodel.cpp + +alertsound.o: alertsound.cpp alertsound.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o alertsound.o alertsound.cpp + +moc_kitchenalertmainwindow.o: moc_kitchenalertmainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_kitchenalertmainwindow.o moc_kitchenalertmainwindow.cpp + +moc_choosetimersequencedialog.o: moc_choosetimersequencedialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_choosetimersequencedialog.o moc_choosetimersequencedialog.cpp + +moc_createtimersequencedialog.o: moc_createtimersequencedialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_createtimersequencedialog.o moc_createtimersequencedialog.cpp + +moc_timer.o: moc_timer.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_timer.o moc_timer.cpp + +moc_currentalertstablemodel.o: moc_currentalertstablemodel.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_currentalertstablemodel.o moc_currentalertstablemodel.cpp + +moc_alertsound.o: moc_alertsound.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_alertsound.o moc_alertsound.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/Tonitrus.ogg b/src/Tonitrus.ogg new file mode 100644 index 0000000..be3da62 Binary files /dev/null and b/src/Tonitrus.ogg differ diff --git a/src/Tonitrus.wav b/src/Tonitrus.wav new file mode 100644 index 0000000..322fd0e Binary files /dev/null and b/src/Tonitrus.wav differ diff --git a/src/alertsound.cpp b/src/alertsound.cpp index fc8e6d3..fcaefa4 100644 --- a/src/alertsound.cpp +++ b/src/alertsound.cpp @@ -25,6 +25,7 @@ #include "alertsound.h" #include +#include @@ -32,8 +33,24 @@ AlertSound::AlertSound(QObject *parent) : QObject(parent) { + defaultsound_ = ":/defaultsound"; + QString filename; - pSound_ = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("/home/user/MyDocs/KitchenAlertTestSound1.wav")); + QSettings settings("KitchenAlert","KitchenAlert"); + + settings.clear(); //REMOVE THIS AFTER TESTING!!!!!! + + bool useDefaultSound = settings.value("UseDefaultSound",true).toBool(); + qDebug() << "In AlertSound constructor UseDefaultSound is " << useDefaultSound; + if (useDefaultSound == true) + { + filename = defaultsound_; + } + else + { + filename = settings.value("soundfile",defaultsound_).toString(); + } + pSound_ = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(filename)); } void AlertSound::play() @@ -48,3 +65,18 @@ void AlertSound::stop() pSound_->stop(); } + +void AlertSound::setSound(QString filename) +{ + QSettings settings("KitchenAlert","KitchenAlert"); + settings.setValue("UseDefaultSound",false); + settings.setValue("soundfile",filename); + pSound_->setCurrentSource(filename); +} + +void AlertSound::setDefaultSound() +{ + QSettings settings ("KitchenAlert","KitchenAlert"); + settings.setValue("UseDefaultSound",true); + pSound_->setCurrentSource(defaultsound_); +} diff --git a/src/alertsound.h b/src/alertsound.h index d754087..b36cc38 100644 --- a/src/alertsound.h +++ b/src/alertsound.h @@ -31,8 +31,7 @@ - #include - +#include /*! Class for playing the alert sound' @@ -60,11 +59,17 @@ public slots: /*! Stops the sound from playing */ void stop(); + /*! Changes the sound file (both current and saved in settings) */ + void setSound(QString filename); + + void setDefaultSound(); + private: Phonon::MediaObject *pSound_; + QString defaultsound_; }; diff --git a/src/currentalertstablemodel.cpp b/src/currentalertstablemodel.cpp index b856739..c4dadcc 100644 --- a/src/currentalertstablemodel.cpp +++ b/src/currentalertstablemodel.cpp @@ -35,6 +35,8 @@ CurrentAlertsTableModel::CurrentAlertsTableModel(QObject *parent) : QAbstractTableModel(parent) { + + updateViewOnChanges_ = true; } @@ -143,7 +145,10 @@ QVariant CurrentAlertsTableModel::data(const QModelIndex &index, int role) const case statusColumnNumber_: - return QVariant(); //TO BE REPLACED WITH SENDING STATUS ! + if (currentTimers_.at(index.row())->isAlerting() == true) + return QString("ALERT!"); + + else return QString(); } @@ -154,7 +159,7 @@ QVariant CurrentAlertsTableModel::data(const QModelIndex &index, int role) const //No need to care for the column number, all have the same color - if (currentTimers_.at(index.row())->getRemainingTimeInSeconds() > 0) + if (currentTimers_.at(index.row())->isAlerting() == false) return QBrush (QColor(Qt::white)); else return QBrush (QColor(Qt::red)); //change this to black if backgroundrole starts to work! @@ -168,7 +173,7 @@ QVariant CurrentAlertsTableModel::data(const QModelIndex &index, int role) const qDebug() << "BackgroundRole asked"; - if (currentTimers_.at(index.row())->getRemainingTimeInSeconds() > 0) + if (currentTimers_.at(index.row())->isAlerting()) { qDebug() << "black background"; return QBrush (QColor(Qt::black)); @@ -206,41 +211,83 @@ void CurrentAlertsTableModel::addTimers(QList timers) void CurrentAlertsTableModel::refreshTimeColumn() { - qDebug() << "Refresh time column"; - + if (updateViewOnChanges_ == true) //Only update GUI if active to save battery + { + emit dataChanged(createIndex(0,1),createIndex(rowCount(QModelIndex())-1,1)); //Entire time column refreshed + qDebug() << "Refresh time column"; + } - emit dataChanged(createIndex(0,1),createIndex(rowCount(QModelIndex())-1,1)); //Entire time column refreshed } void CurrentAlertsTableModel::startTimer(QModelIndex index) { - currentTimers_.at(index.row())->start(); - refreshTimeColumn(); + Timer * ptimer = currentTimers_.value(index.row()); + if (ptimer != NULL) + { + ptimer->start(); + refreshTimeColumn(); + } } void CurrentAlertsTableModel::stopTimer(QModelIndex index) { - currentTimers_.at(index.row())->stop(); - refreshTimeColumn(); + Timer * ptimer = currentTimers_.value(index.row()); + if (ptimer != NULL) + { + ptimer->stop(); + refreshTimeColumn(); + } } void CurrentAlertsTableModel::snoozeTimer(QModelIndex index) { - - currentTimers_.at(index.row())->snooze(); - refreshTimeColumn(); + Timer * ptimer = currentTimers_.value(index.row()); + if (ptimer != NULL) + { + ptimer->snooze(); + refreshTimeColumn(); + } } QModelIndex CurrentAlertsTableModel::giveIndexForTimer(Timer * ptimer) { int row = currentTimers_.indexOf(ptimer); - if (row < -1) // if not found + if (row <= -1) // if not found return QModelIndex(); //return invalid index return createIndex(row,0); //return index to the timer row's first column } + + +QVariant CurrentAlertsTableModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + //Reimplemented from QAbsractTableModel + //No headers wanted so we just return an empty QVariant + return QVariant(); +} + + +void CurrentAlertsTableModel::setUpdateViewOnChanges(bool update) +{ + updateViewOnChanges_ = update; + if (update == true) + reset(); //Refresh view to catch up with past changes +} + +bool CurrentAlertsTableModel::isThisTimerAlerting(QModelIndex index) +{ + if (index.isValid()) + { + if (currentTimers_.at(index.row())->isAlerting()) + { + return true; + } + + } + return false; +} diff --git a/src/currentalertstablemodel.h b/src/currentalertstablemodel.h index 32cadc3..9751671 100644 --- a/src/currentalertstablemodel.h +++ b/src/currentalertstablemodel.h @@ -28,6 +28,7 @@ #define CURRENTALERTSTABLEMODEL_H #include +#include #include "timer.h" @@ -54,8 +55,12 @@ public: QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QModelIndex giveIndexForTimer(Timer * ptimer); + bool isThisTimerAlerting(QModelIndex index); + signals: public slots: @@ -68,6 +73,9 @@ public slots: void snoozeTimer(QModelIndex index); void stopTimer(QModelIndex index); + + void setUpdateViewOnChanges(bool update); + private: QList currentTimers_; @@ -76,6 +84,10 @@ private: static const int timeRemainingColumnNumber_ = 1; static const int statusColumnNumber_ = 2; + + + bool updateViewOnChanges_; + }; #endif // CURRENTALERTSTABLEMODEL_H diff --git a/src/kitchenalert.qrc b/src/kitchenalert.qrc new file mode 100644 index 0000000..b98d582 --- /dev/null +++ b/src/kitchenalert.qrc @@ -0,0 +1,5 @@ + + + Tonitrus.wav + + diff --git a/src/kitchenalertmainwindow.cpp b/src/kitchenalertmainwindow.cpp index 36b1142..2579155 100644 --- a/src/kitchenalertmainwindow.cpp +++ b/src/kitchenalertmainwindow.cpp @@ -31,12 +31,16 @@ #include #include -#include "choosetimersequencedialog.h" + #include "createtimersequencedialog.h" +#include "selectsounddialog.h" #include + +#include +#include #include @@ -47,19 +51,25 @@ KitchenAlertMainWindow::KitchenAlertMainWindow(QWidget *parent) : { ui->setupUi(this); - connect(ui->LoadTimerScheduleButton, SIGNAL (pressed()), this, SLOT (openTimerSequence())); + + + connect(ui->CreateNewScheduleButton, SIGNAL (pressed()), this, SLOT (newTimerSequence())); + + //alerts' tableview setup + + ui->ComingAlertsTableView->setModel(&model_); ui->ComingAlertsTableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->ComingAlertsTableView->setSelectionBehavior(QAbstractItemView::SelectRows); + ui->ComingAlertsTableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); + ui->ComingAlertsTableView->horizontalHeader()->hide(); //Buttons used to reacting an alarm are hidden by default - ui->DoneButton->setDisabled(true); - ui->SnoozeButton->setDisabled(true); - ui->RestartButton->setDisabled(true); + disableSelectionDependentButtons(); connect(ui->ComingAlertsTableView->selectionModel(),SIGNAL(selectionChanged(QItemSelection,QItemSelection)),this,SLOT(timerSelected(QItemSelection,QItemSelection))); @@ -68,7 +78,15 @@ KitchenAlertMainWindow::KitchenAlertMainWindow(QWidget *parent) : connect(ui->RestartButton,SIGNAL(clicked()),this,SLOT(restart())); connect(ui->SnoozeButton,SIGNAL(clicked()),this, SLOT(snooze())); + // menu setup + + QAction * p_SelectSoundAction = new QAction(tr("Select alert sound"),this); + connect(p_SelectSoundAction, SIGNAL(triggered()), this, SLOT(openSelectSoundDialog())); + menuBar()->addAction(p_SelectSoundAction); + QAction * p_AboutAction = new QAction(tr("About"),this); + connect(p_AboutAction,SIGNAL(triggered()),this,SLOT(openAbout())); + menuBar()->addAction(p_AboutAction); } KitchenAlertMainWindow::~KitchenAlertMainWindow() @@ -90,14 +108,6 @@ void KitchenAlertMainWindow::changeEvent(QEvent *e) } -void KitchenAlertMainWindow::openTimerSequence() -{ - ChooseTimerSequenceDialog opendialog; - opendialog.exec(); - - - -} void KitchenAlertMainWindow::newTimerSequence() { @@ -113,18 +123,19 @@ void KitchenAlertMainWindow::newTimerSequence() Timer* timer1 = alltimers.at(0); // take first timer (currently the only one!) + timer1->start(); + connect(timer1,SIGNAL(alert(QModelIndex)),this,SLOT(alert(QModelIndex))); -// ui->nextAlertText->setText( timer1->getAlertText()); + model_.addTimers(alltimers); // give timers to the model - timer1->start(); - connect(timer1,SIGNAL(alert(QModelIndex)),this,SLOT(alert(QModelIndex))); + // ui->ComingAlertsTableView->resizeColumnsToContents(); + //Disable buttons, as selection is cleared when view is refreshed to show the new timer - model_.addTimers(alltimers); // give timers to the model -// ui->ComingAlertsTableView->update(); + disableSelectionDependentButtons(); @@ -136,21 +147,11 @@ void KitchenAlertMainWindow::newTimerSequence() } -void KitchenAlertMainWindow::updateTime(int seconds) -{ - - -// ui->hoursLcdNumber->display(seconds/360); -// ui->minutesLcdNumber->display((seconds%360)/60); -// ui->secondsLcdNumber->display((seconds%60)); -} - void KitchenAlertMainWindow::alert(QModelIndex indexOfAlerter) { - // QMessageBox::information ( NULL, "KitchenAlert","Alert!!!"); // The program is brought to front and activated when alerted @@ -162,7 +163,6 @@ void KitchenAlertMainWindow::alert(QModelIndex indexOfAlerter) qDebug() << "Should be selected now"; - //Snooze button is enabled @@ -170,27 +170,40 @@ void KitchenAlertMainWindow::alert(QModelIndex indexOfAlerter) //The alert sound is played - - - - //TODO - alertSound_.play(); } -void KitchenAlertMainWindow::timerSelected(QItemSelection,QItemSelection) +void KitchenAlertMainWindow::timerSelected(QItemSelection selected,QItemSelection deselected) { ui->DoneButton->setEnabled(true); ui->RestartButton->setEnabled(true); + + //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 + QModelIndex index = indexes.value(0); + if (index.isValid()) + { + if (model_.isThisTimerAlerting(index) == true) + { + ui->SnoozeButton->setEnabled(true); + } + else ui->SnoozeButton->setDisabled(true); + } + } void KitchenAlertMainWindow::snooze() { - - model_.snoozeTimer(selectedRow()); + QModelIndex row = selectedRow(); + if (row.isValid()) //If there was no row selected invalid row was returned + { + model_.snoozeTimer(row); + } ui->SnoozeButton->setDisabled(true); alertSound_.stop(); @@ -198,8 +211,12 @@ void KitchenAlertMainWindow::snooze() void KitchenAlertMainWindow::restart() { + QModelIndex row = selectedRow(); //If there was no row selected invalid row was returned + if (row.isValid()) + { - model_.startTimer(selectedRow()); + model_.startTimer(row); + } ui->SnoozeButton->setDisabled(true); alertSound_.stop(); @@ -207,7 +224,11 @@ void KitchenAlertMainWindow::restart() void KitchenAlertMainWindow::stop() { - model_.stopTimer(selectedRow()); + QModelIndex row = selectedRow(); + if (row.isValid()) //If there was no row selected invalid row was returned + { + model_.stopTimer(row); + } ui->SnoozeButton->setDisabled(true); alertSound_.stop(); } @@ -217,7 +238,58 @@ QModelIndex KitchenAlertMainWindow::selectedRow() QModelIndexList chosenRows = ui->ComingAlertsTableView->selectionModel()->selectedRows(); //The selection mode used allows only one row to be selected at time, so we just take the first - //There are indexes for all coloumns in the row in the list, but as we only use the row, it does not matter which one we take + //There are indexes for all columns in the row in the list, but as we only use the row, it does not matter which one we take + + return chosenRows.value(0); //gives an invalid QModelIndex if the list is empty +} + +void KitchenAlertMainWindow::openSelectSoundDialog() +{ + 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 + } + disableSelectionDependentButtons(); +} + +void KitchenAlertMainWindow::openAbout() +{ + QMessageBox::about(this,tr("About KitchenAlert"),tr("

Version 0.09" + "

Copyright © Heli Hyvättinen 2010" + "

License: General Public License v3" + "

Bugtracker: https://garage.maemo.org/projects/kitchenalert/")); +} + +bool KitchenAlertMainWindow::event(QEvent *event) +{ + QMainWindow::event(event); + + switch (event->type()) + { + case QEvent::WindowActivate: + + model_.setUpdateViewOnChanges(true); + break; + + case QEvent::WindowDeactivate: + model_.setUpdateViewOnChanges(false); + break; + + default: + break; + } +} + +void KitchenAlertMainWindow::disableSelectionDependentButtons() +{ + ui->DoneButton->setDisabled(true); + ui->SnoozeButton->setDisabled(true); + ui->RestartButton->setDisabled(true); - return chosenRows.takeFirst(); } diff --git a/src/kitchenalertmainwindow.h b/src/kitchenalertmainwindow.h index 393875b..4b0e5be 100644 --- a/src/kitchenalertmainwindow.h +++ b/src/kitchenalertmainwindow.h @@ -60,20 +60,26 @@ public: public slots: - void openTimerSequence(); void newTimerSequence(); + void openSelectSoundDialog(); + void openAbout(); + - void updateTime(int seconds); void alert(QModelIndex indexOfAlerted); - void timerSelected(QItemSelection,QItemSelection); + void timerSelected(QItemSelection selected,QItemSelection deselected); void snooze(); void restart(); void stop(); + protected: void changeEvent(QEvent *e); + bool event(QEvent *event); + + void disableSelectionDependentButtons(); private: + Ui::KitchenAlertMainWindow *ui; QList currentTimers_; @@ -83,6 +89,8 @@ private: QModelIndex selectedRow(); AlertSound alertSound_; + + }; #endif // KITCHENALERTMAINWINDOW_H diff --git a/src/kitchenalertmainwindow.ui b/src/kitchenalertmainwindow.ui index fdbebe7..a8d78e9 100644 --- a/src/kitchenalertmainwindow.ui +++ b/src/kitchenalertmainwindow.ui @@ -76,6 +76,19 @@ + + + Qt::Horizontal + + + + 40 + 20 + + + + + New timer schedule @@ -83,11 +96,17 @@ - - - Load timer schedule + + + Qt::Horizontal - + + + 40 + 20 + + + diff --git a/src/licence template~ b/src/licence template~ new file mode 100644 index 0000000..43ab975 --- /dev/null +++ b/src/licence template~ @@ -0,0 +1,23 @@ +/************************************************************************** + 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 . + +**************************************************************************/ + + + + diff --git a/src/main.cpp b/src/main.cpp index 5e157c4..349ea26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + a.setApplicationName("KitchenAlert"); //a name required by phonon KitchenAlertMainWindow w; #if defined(Q_WS_S60) w.showMaximized(); diff --git a/src/selectsounddialog.cpp b/src/selectsounddialog.cpp new file mode 100644 index 0000000..539796e --- /dev/null +++ b/src/selectsounddialog.cpp @@ -0,0 +1,79 @@ +/************************************************************************** + 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 . + +**************************************************************************/ + + + + + +#include "selectsounddialog.h" +#include "ui_selectsounddialog.h" +#include +#include +#include + +SelectSoundDialog::SelectSoundDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SelectSoundDialog) +{ + ui->setupUi(this); + connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(browse())); + + QSettings settings("KitchenAlert","KitchenAlert"); + QString filename = settings.value("soundfile").toString(); + ui->lineEdit->setText(filename); + + bool useDefaultSoundFile = settings.value("UseDefaultSound",true).toBool(); + if (useDefaultSoundFile == true) + { + ui->DefaultSoundRadioButton->setChecked(true); + ui->browseButton->setDisabled(true); + ui->lineEdit->setDisabled(true); + } + else ui->CustomSoundRadioButton->setChecked(true); + qDebug() << "UseDefaultSoundfile is " << useDefaultSoundFile; +} + +SelectSoundDialog::~SelectSoundDialog() +{ + delete ui; +} + +void SelectSoundDialog::browse() +{ + QString filename = QFileDialog::getOpenFileName(this, tr("Choose a sound file"),"/home/user/"); //Filters: to use or not...? //MAEMO specific dir here... + if (!filename.isEmpty()) //Empty string returned by the dialog if user pressed cancel... + { + ui->lineEdit->setText(filename); + } +} + +QString SelectSoundDialog::getSoundFileName() +{ + if (ui->CustomSoundRadioButton->isChecked() == true) + return ui->lineEdit->displayText(); + else return QString(); +} + +bool SelectSoundDialog::isDefaultSoundChecked() +{ + return ui->DefaultSoundRadioButton->isChecked(); +} diff --git a/src/selectsounddialog.h b/src/selectsounddialog.h new file mode 100644 index 0000000..6e7c77f --- /dev/null +++ b/src/selectsounddialog.h @@ -0,0 +1,53 @@ +/************************************************************************** + 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 . + +**************************************************************************/ + + + + + +#ifndef SELECTSOUNDDIALOG_H +#define SELECTSOUNDDIALOG_H + +#include + +namespace Ui { + class SelectSoundDialog; +} + +class SelectSoundDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SelectSoundDialog(QWidget *parent = 0); + ~SelectSoundDialog(); + QString getSoundFileName(); + bool isDefaultSoundChecked(); + +public slots: + void browse(); + +private: + Ui::SelectSoundDialog *ui; +}; + +#endif // SELECTSOUNDDIALOG_H diff --git a/src/selectsounddialog.ui b/src/selectsounddialog.ui new file mode 100644 index 0000000..4ecdba3 --- /dev/null +++ b/src/selectsounddialog.ui @@ -0,0 +1,182 @@ + + + SelectSoundDialog + + + + 0 + 0 + 770 + 336 + + + + Select the alarm sound for KitchenAlert + + + + + 10 + 14 + 751 + 311 + + + + + + + + + Use the default sound + + + + + + + Use a custom sound + + + + + + + + + + 401 + 0 + + + + + 16 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:16pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600;">Warning:</span><span style=" font-size:9pt;"> choosing a sound file inside the &quot;N900&quot; folder will prevent mounting it outside the device when KitchenAlert is running and the sound from playing if the folder has been mounted out before starting KitchenAlert.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;"></p></body></html> + + + + + + + + + Select a sound file: + + + + + + + + + + Browse + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Done + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + CustomSoundRadioButton + toggled(bool) + browseButton + setEnabled(bool) + + + 649 + 50 + + + 737 + 225 + + + + + CustomSoundRadioButton + toggled(bool) + lineEdit + setEnabled(bool) + + + 441 + 53 + + + 196 + 229 + + + + + OKButton + clicked() + SelectSoundDialog + accept() + + + 382 + 251 + + + 495 + 250 + + + + + diff --git a/src/timer.cpp b/src/timer.cpp index 9c5e75d..3593008 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -68,7 +68,7 @@ void Timer::setAlertText(QString text) void Timer::secondPassed() { _remainingTime--; - emit remainingTimeChanged(); + if (_remainingTime == 0) { @@ -77,6 +77,7 @@ void Timer::secondPassed() qDebug() << "alerting"; } + emit remainingTimeChanged(); //after alerting in case of alert so that status gets updated immediately } void Timer::start() @@ -84,6 +85,8 @@ void Timer::start() _remainingTime = _originalTime; _actualTimer.start(); + alerting_ = false; + } @@ -92,13 +95,14 @@ void Timer::stop() _actualTimer.stop(); _remainingTime = 0; //Stopped timer shows 00:00:00 (which unfortunately makes it red...) - + alerting_ = false; } void Timer::snooze() { _remainingTime = 120; + alerting_ = false; }