Just backing up the current sources...
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 29 Oct 2010 16:53:44 +0000 (19:53 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 29 Oct 2010 16:53:44 +0000 (19:53 +0300)
Near ready 0.2.0, hopefully...

14 files changed:
data/Doorbell-old-tring-modified-multiplied-low-quality.mp3 [new file with mode: 0644]
src/alertsound.cpp
src/alertsound.h
src/currentalertstablemodel.cpp
src/currentalertstablemodel.h
src/kitchenalert.desktop
src/kitchenalert48x48.png [new file with mode: 0644]
src/kitchenalert48x48.png.en [new file with mode: 0644]
src/kitchenalertmainwindow.cpp
src/kitchenalertmainwindow.h
src/kitchenalertmainwindow.ui
src/main.cpp
src/src.pro
src/timer.h

diff --git a/data/Doorbell-old-tring-modified-multiplied-low-quality.mp3 b/data/Doorbell-old-tring-modified-multiplied-low-quality.mp3
new file mode 100644 (file)
index 0000000..691fe3a
Binary files /dev/null and b/data/Doorbell-old-tring-modified-multiplied-low-quality.mp3 differ
index c10f065..8fd54b7 100644 (file)
@@ -35,7 +35,7 @@ AlertSound::AlertSound(QObject *parent) :
 
     //THIS NEEDS TESTING: DOES IT REALLY CHANGE TUNE WHEN RESTARTING THE APPLICATION?
 
-    defaultsound_ = "/opt/KitchenAlert/06capemaycloser_modifiedlouder.mp3";
+    defaultsound_ = "/home/opt/KitchenAlert/Doorbell-old-tring-modified-multiplied-low-quality.mp3";
     QString filename;
 
     QSettings settings("KitchenAlert","KitchenAlert");
@@ -55,6 +55,15 @@ AlertSound::AlertSound(QObject *parent) :
     pSound_ = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(filename));
 }
 
+AlertSound::~AlertSound()
+{
+
+    if (pSound_ != NULL)
+    {
+        delete pSound_;
+    }
+}
+
 void AlertSound::play()
 {
     pSound_->stop(); //Just testing if stopping the previous alert will prevent the jammming of the sound
index 19f4a59..7866d71 100644 (file)
@@ -37,8 +37,8 @@
 /*! Class for playing the alert sound'
 
   @author Heli Hyvättinen
-  @date 2010-07-20
-  @version 0.1
+  @date 2010-09-27
+  @version 0.2.0
 
 Class for playing (and stopping) the alert sound.
 
@@ -50,6 +50,8 @@ class AlertSound : public QObject
 public:
     explicit AlertSound(QObject *parent = 0);
 
+    virtual ~AlertSound();
+
 signals:
 
 public slots:
@@ -62,6 +64,7 @@ public slots:
     /*! Changes the sound file (both current and saved in settings) */
     void setSound(QString filename);
 
+    /*! Switches to using the default sound and saves this behaviour in settings */
     void setDefaultSound();
 
 private:
index cc47fd0..7631630 100644 (file)
@@ -293,8 +293,11 @@ void CurrentAlertsTableModel::setUpdateViewOnChanges(bool update)
 {
     updateViewOnChanges_ = update;
     if (update == true)
+    {
         refreshTimeAndStatusColumns(); //Refresh to catch up with past changes
-}
+        qDebug() << "Just refreshed time and status colums after returning to the app";
+    }
+    }
 
 bool CurrentAlertsTableModel::isThisTimerAlerting(QModelIndex index)
 {
@@ -308,3 +311,17 @@ bool CurrentAlertsTableModel::isThisTimerAlerting(QModelIndex index)
     }
     return false;
 }
+
+void CurrentAlertsTableModel::removeTimer(QModelIndex index)
+{
+    if (index.isValid() == false)
+        return;
+
+    int i = index.row();
+    beginRemoveRows(QModelIndex(),i,i);
+    Timer * p_timer = currentTimers_.takeAt(i);
+    delete p_timer;
+    endRemoveRows();
+
+}
+
index b4a7b87..d0e49d6 100644 (file)
@@ -35,7 +35,7 @@
 /*! Class that contains the model that holds the timers'
 
   @author Heli Hyvättinen
-  @date 2010-09-08
+  @date 2010-09-27
   @version 0.1.1
 
 Class that contains the model that holds the timers
@@ -85,6 +85,7 @@ public:
       */
     bool isThisTimerAlerting(QModelIndex index);
 
+
 signals:
 
 public slots:
@@ -127,6 +128,14 @@ Sets whether the view should be kept up to date.
 */
     void setUpdateViewOnChanges(bool update);
 
+/*!
+  Removes a timer from the model
+  */
+
+    void removeTimer(QModelIndex index);
+
+
+
 private:
     QList <Timer * > currentTimers_; /*! Holds the timers */
 
index 1b14e2d..471635a 100644 (file)
@@ -4,8 +4,8 @@ Version=1.0
 Type=Application
 Name=KitchenAlert
 Exec=/usr/bin/KitchenAlert
-Icon=KA_icon64
+Icon=kitchenalert
 Categories=Utility;
-X-Window-Icon=KA_icon64
+X-Window-Icon=kitchenalert
 X-Osso-Type=application/x-executable
 Comment=Timer application with multiple timers
diff --git a/src/kitchenalert48x48.png b/src/kitchenalert48x48.png
new file mode 100644 (file)
index 0000000..a9a9bf1
Binary files /dev/null and b/src/kitchenalert48x48.png differ
diff --git a/src/kitchenalert48x48.png.en b/src/kitchenalert48x48.png.en
new file mode 100644 (file)
index 0000000..9fc8a27
--- /dev/null
@@ -0,0 +1,121 @@
+begin-base64 644 kitchenalert48x48.png
+iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c
+6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0
+SU1FB9oKDQwYCTV2jAwAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJ
+TVBXgQ4XAAAUOElEQVRo3nWaaYxl13Hff3XOufe+pfeenm7OTklDziKK9HDV
+RllUKJlKAgSIDBOBNihS4CROACWCAyOJLQJyPuSTnARCEAGOA8SWbNORrChI
+KIkmJYuSFdowOeIyFIcznLVnep3ut97lnMqHc9/rbtF5wOt+/fr17ao6/6r6
+17+u/Oq/0H/QbGpDkUaR0zSG5swMTUSzqiARI7Kwn9DvU1ijeVnKYHubgfc6
+aDYZdrqSFzlFklBUFWVVaekDJSoe8EClEFTxKEFVQ1AJqAZVFAggAUEFBZEg
+oPFnFEVVACUAKDuvAXXOaVqU0mhk2pqYkInBgMmi1Mm5Wdp9JEtSte2WVMEz
+sFa6vR7dJMVmInQ6oAFNEg1FgfdBAipeBAuoKj4ohkAIiqiqgED8IsaIiiCg
+IiIoorJjsSiigKii6Nj48UMBl6aSqpJ5Ly1jdGpqSuYGA5m3VufbE0w3Grhm
+k1wMt25t6pq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r4oxrgmKqibbjWofBirbbsOE5Cd
+sTFE3I+WfFEYjmXVGEi3y2wc0l33WGgch1UQcTpeGe/dou9tB/JzsX/LoldA
+9Sf/U5JgZ/7wR9eK50MIOkpMDWPCPqr/Gv8i1Kc0rn7jZioCW7ld/8o3yHR8
+p0RsS/HGl2jU/wPC1TAyCltiPAAAAABJRU5ErkJggg==
+====
index 13b2454..fbc6c5d 100644 (file)
@@ -88,7 +88,7 @@ KitchenAlertMainWindow::KitchenAlertMainWindow(QWidget *parent) :
   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()));
   // menu setup
 
   QAction * p_SelectSoundAction = new QAction(tr("Select alert sound"),this);
@@ -178,8 +178,11 @@ void KitchenAlertMainWindow::alert(QModelIndex indexOfAlerter)
 
     // The alerting timer is selected
     ui->ComingAlertsTableView->selectionModel()->select(QItemSelection(indexOfAlerter,indexOfAlerter),QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows );
+
+    //Scrolls the view so that the alerting timer is visible
     ui->ComingAlertsTableView->scrollTo(indexOfAlerter);
-    qDebug() << "Should be selected now";
+
+   // qDebug() << "Should be selected now";
 
 
     //Snooze button is enabled
@@ -205,6 +208,7 @@ void KitchenAlertMainWindow::timerSelected(QItemSelection selected,QItemSelectio
 {
     ui->DoneButton->setEnabled(true);
     ui->RestartButton->setEnabled(true);
+    ui->RemoveButton->setEnabled(true);
 
 
     //snooze button enabled only when alerting
@@ -261,10 +265,12 @@ void KitchenAlertMainWindow::stop()
 
 QModelIndex KitchenAlertMainWindow::selectedRow()
 {
+    //Returns the cells in row 0 that have the whole row selected (the selection mode used allows only selecting whole rows
+
     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 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
 }
@@ -300,15 +306,17 @@ bool KitchenAlertMainWindow::event(QEvent *event)
 
     switch (event->type())
     {
-        case QEvent::WindowActivate:
+        case QEvent::ApplicationActivate:
 
             model_.setUpdateViewOnChanges(true);
+            ui->debugLabel->setText("Returned to the application!");
 
 
               break;
 
-       case QEvent::WindowDeactivate:
+       case QEvent::ApplicationDeactivate:
             model_.setUpdateViewOnChanges(false);
+            ui->debugLabel->setText("");
             break;
 
        default:
@@ -323,6 +331,7 @@ void KitchenAlertMainWindow::disableSelectionDependentButtons()
     ui->DoneButton->setDisabled(true);
     ui->SnoozeButton->setDisabled(true);
     ui->RestartButton->setDisabled(true);
+    ui->RemoveButton->setDisabled(true);
 
 }
 
@@ -351,3 +360,18 @@ void KitchenAlertMainWindow::initializeAlertSound()
    }
 
 }
+
+void KitchenAlertMainWindow::remove()
+{
+    QModelIndex row = selectedRow();
+    if (row.isValid()) //If there was no row selected invalid row was returned
+    {
+        QString text = tr("Are you sure you want to remove this timer from the list:\n");
+        text.append((row.data().toString()));
+        if (QMessageBox::question(this,tr("Confirm timer removal"),text,QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
+        {
+            model_.removeTimer(row);
+        }
+    }
+    ui->SnoozeButton->setDisabled(true);
+}
index 382dff6..c2045e4 100644 (file)
@@ -40,8 +40,8 @@ namespace Ui {
 /*! The main window class of KitchenAlert'
 
   @author Heli Hyvättinen
-  @date 2010-09-08
-  @version 0.1.1
+  @date 2010-09-27
+  @version 0.2.0
 
 Operates the UI.
 
@@ -112,6 +112,11 @@ public slots:
     */
     void stop();
 
+    /*! Removes the timer selected.
+      Needs to be connected to the associated button.
+       */
+    void remove();
+
 signals:
 
     void defaultSoundEnabled();
@@ -139,7 +144,7 @@ private:
     CurrentAlertsTableModel model_; /*! The model that stores the alerts */
 
     /*!
-    Returns a QMoldelIndex pointing to a cell in the row that is currently selected.
+    Returns a QMoldelIndex pointing to the cell in the column 0 of the row that is currently selected.
     */
     QModelIndex selectedRow();
 
index 23cf09e..0b419ec 100644 (file)
           </widget>
          </item>
          <item>
+          <widget class="QPushButton" name="RemoveButton">
+           <property name="text">
+            <string>Remove</string>
+           </property>
+          </widget>
+         </item>
+         <item>
           <spacer name="horizontalSpacer_2">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
index ff33e51..96a27eb 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
     a.setApplicationName("KitchenAlert"); //a name is required by phonon
-    a.setApplicationVersion("0.1.1");
+    a.setApplicationVersion("0.2.0");
     a.setOrganizationName("KitchenAlert");
     KitchenAlertMainWindow w;
 #if defined(Q_WS_S60)
index 96f4059..79d12ca 100644 (file)
@@ -39,6 +39,9 @@ symbian {
     TARGET.EPOCHEAPSIZE = 0x020000 0x800000
 }
 
+RESOURCES += \
+    kitchenalert.qrc
+
 
 unix {
   #VARIABLES
@@ -52,25 +55,11 @@ unix {
 
   #MAKE INSTALL
 
-  INSTALLS += target desktop service iconxpm icon26 icon48 icon64
+  INSTALLS += target desktop 
 
   target.path =$$BINDIR
 
   desktop.path = $$DATADIR/applications/hildon
   desktop.files += $${TARGET}.desktop
 
-  service.path = $$DATADIR/dbus-1/services
-  service.files += $${TARGET}.service
-
-  iconxpm.path = $$DATADIR/pixmap
-  iconxpm.files += ../data/maemo/$${TARGET}.xpm
-
-  icon26.path = $$DATADIR/icons/hicolor/26x26/apps
-  icon26.files += ../data/26x26/$${TARGET}.png
-
-  icon48.path = $$DATADIR/icons/hicolor/48x48/apps
-  icon48.files += ../data/48x48/$${TARGET}.png
-
-  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
-  icon64.files += ../data/64x64/$${TARGET}.png
 }
index 519039c..cbfac47 100644 (file)
@@ -63,24 +63,42 @@ public:
     /*! Returns the time remaining before the alert in seconds       */
     int getRemainingTimeInSeconds();
 
+    /*! Returns the alert text */
     QString getAlertText();
+
+    /*! Sets the alert text */
     void setAlertText(QString text);
 
+    /*! Returns whether the timer is alerting */
     bool isAlerting();
 
 
 signals:
-
+    /*! Emitted when the remaining time in the timer has changed */
     void remainingTimeChanged();
+
+    /*! Emitted when the timer alerts */
     void alert(QModelIndex indexOfAlerter);
 
 public slots:
+    /*! The internal QTimer is connected to this slot */
     void secondPassed();
+
+    /*! Start the timer */
     void start();
+
+    /*! Stop the timer*/
     void stop();
+
+    /*! Snooze the timer
+        Currently sets the timer to alert again in two minutes.
+    */
     void snooze();
 
+    /*! Switches to use the default sound (and saves it to settings */
     void enableDefaultSound();
+
+    /*! Changes the sound file used and saves it to settings */
     void changeAlertSound(QString filename);