X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fkitchenalertmainwindow.h;h=a9e86a6ccbfa4c5f53edb5583ebbbf9857f01285;hb=c4037ede3790b9ec97001d9c9202cec1003f18e1;hp=9ae6a8d58fc92250926199e3f47caba09a2f673e;hpb=981f6e1b3c110aa5128f08a139c47a4c2a5854cd;p=kitchenalert diff --git a/src/kitchenalertmainwindow.h b/src/kitchenalertmainwindow.h index 9ae6a8d..a9e86a6 100644 --- a/src/kitchenalertmainwindow.h +++ b/src/kitchenalertmainwindow.h @@ -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-08-08 - @version 0.1.1 + @date 2011-03-29 + @version 0.2.1 Operates the UI. @@ -60,36 +60,99 @@ public: 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(); + + /*! Stops the timer selected. + Needs to be connected to the associated button. + */ void stop(); + + /*! Removes the timer selected. + Needs to be connected to the associated button. + */ void remove(); +signals: + + void defaultSoundEnabled(); + + void soundChanged(QString filename); 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 currentTimers_; - - CurrentAlertsTableModel model_; + CurrentAlertsTableModel model_; /*! The model that stores the alerts */ + /*! + Returns a QMoldelIndex pointing to the cell in the column 0 of the row that is currently selected. + */ QModelIndex selectedRow(); - AlertSound alertSound_; + + /*! + Not used. Would allow getting rid of the default sound if used. + */ + void initializeAlertSound(); };