Sticky timers are loaded with zero timer at startup
[kitchenalert] / src / kitchenalertmainwindow.h
index 382dff6..9511c40 100644 (file)
@@ -1,7 +1,7 @@
 /**************************************************************************
         KitchenAlert
 
-        Copyright (C) 2010  Heli Hyvättinen
+        Copyright (C) 2010-2011  Heli Hyvättinen
 
         This file is part of KitchenAlert.
 
@@ -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 2011-01-05
+  @version 0.3.0
 
 Operates the UI.
 
@@ -52,8 +52,6 @@ class KitchenAlertMainWindow : public QMainWindow
     Q_OBJECT 
 
 
-
-
 public:
     explicit KitchenAlertMainWindow(QWidget *parent = 0);
     ~KitchenAlertMainWindow();
@@ -112,6 +110,25 @@ public slots:
     */
     void stop();
 
+    /*! Removes the timer selected.
+      Needs to be connected to the associated button.
+       */
+    void remove();
+
+    /*! Opens a dialog for saving the selected timer and, if confirmed, saves the timer to a file.
+    */
+    void saveTimer();
+
+    /*! Opens a dialog for reading a timer from a timer file, and if confirmed opens and starts the timer.
+    */
+    void loadTimer();
+
+    /*! Opens a dialog for choosing which timers to preload at start */
+    void openStickyDialog();
+
+   /*! Loads the sticky timers. */
+    bool loadStickies();
+
 signals:
 
     void defaultSoundEnabled();
@@ -132,25 +149,33 @@ protected:
     */
     void disableSelectionDependentButtons();
 
+
+
+
+
 private:
 
     Ui::KitchenAlertMainWindow *ui;
 
     CurrentAlertsTableModel model_; /*! The model that stores the alerts */
 
+    QString defaultSaveDirectory_;
+
     /*!
-    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();
 
-    AlertSound alertSound_; /*! Takes care of alert sound */ //This has been moved to the timers themselves
 
     /*!
     Not used. Would allow getting rid of the default sound if used.
     */
     void initializeAlertSound();
 
+    void initializeTimer(Timer * p_timer, bool startImmediately = true);
 
+    //Adds the timer to the model and optionally starts it on success, gives an error message on failure
+    bool loadTimer(QString filename, bool startImmediately);
 };
 
 #endif // KITCHENALERTMAINWINDOW_H