summaryrefslogtreecommitdiff
path: root/core/pim/todo/taskeditoralarms.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/taskeditoralarms.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/taskeditoralarms.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp
index a512fb0..62fc600 100644
--- a/core/pim/todo/taskeditoralarms.cpp
+++ b/core/pim/todo/taskeditoralarms.cpp
@@ -1,88 +1,89 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <> 3             .=l. Copyright (c) 2002 <>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can 5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that 12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with 21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "taskeditoralarms.h" 29#include "taskeditoralarms.h"
30 30
31#include <opie2/opimnotifymanager.h> 31#include <opie2/opimnotifymanager.h>
32#include <opie2/otimepicker.h> 32#include <opie2/otimepicker.h>
33 33
34#include <qpe/datebookmonth.h> 34#include <qpe/datebookmonth.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36 36
37#include <qlistview.h> 37#include <qlistview.h>
38#include <qlayout.h> 38#include <qlayout.h>
39 39
40 40
41using namespace Opie::Ui;
41class AlarmItem : public QListViewItem { 42class AlarmItem : public QListViewItem {
42public: 43public:
43 AlarmItem( QListView*, const OPimAlarm& ); 44 AlarmItem( QListView*, const OPimAlarm& );
44 ~AlarmItem(); 45 ~AlarmItem();
45 46
46 OPimAlarm alarm()const; 47 OPimAlarm alarm()const;
47 void setAlarm( const OPimAlarm& ); 48 void setAlarm( const OPimAlarm& );
48private: 49private:
49 QDateTime m_dt; 50 QDateTime m_dt;
50 int m_type; 51 int m_type;
51}; 52};
52AlarmItem::AlarmItem( QListView* view, const OPimAlarm& dt) 53AlarmItem::AlarmItem( QListView* view, const OPimAlarm& dt)
53 : QListViewItem(view) { 54 : QListViewItem(view) {
54 setAlarm( dt ); 55 setAlarm( dt );
55} 56}
56void AlarmItem::setAlarm( const OPimAlarm& dt ) { 57void AlarmItem::setAlarm( const OPimAlarm& dt ) {
57 m_dt = dt.dateTime(); 58 m_dt = dt.dateTime();
58 m_type = dt.sound(); 59 m_type = dt.sound();
59 setText( 0, TimeString::dateString( m_dt.date() ) ); 60 setText( 0, TimeString::dateString( m_dt.date() ) );
60 setText( 1, TimeString::timeString( m_dt.time() ) ); 61 setText( 1, TimeString::timeString( m_dt.time() ) );
61 setText( 2, m_type == 0 ? QObject::tr("silent") : QObject::tr("loud") ); 62 setText( 2, m_type == 0 ? QObject::tr("silent") : QObject::tr("loud") );
62} 63}
63AlarmItem::~AlarmItem() { 64AlarmItem::~AlarmItem() {
64} 65}
65OPimAlarm AlarmItem::alarm()const{ 66OPimAlarm AlarmItem::alarm()const{
66 OPimAlarm al( m_type, m_dt ); 67 OPimAlarm al( m_type, m_dt );
67 68
68 return al; 69 return al;
69} 70}
70 71
71TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, int, const char* name, WFlags fl ) 72TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, int, const char* name, WFlags fl )
72 : QWidget( parent, name, fl ) 73 : QWidget( parent, name, fl )
73{ 74{
74 m_date = m_type = m_time = 0; 75 m_date = m_type = m_time = 0;
75 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 4 ); 76 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 4 );
76 77
77 lstAlarms = new QListView( this ); 78 lstAlarms = new QListView( this );
78 lstAlarms->addColumn( tr("Date") ); 79 lstAlarms->addColumn( tr("Date") );
79 lstAlarms->addColumn( tr("Time") ); 80 lstAlarms->addColumn( tr("Time") );
80 lstAlarms->addColumn( tr("Type") ); 81 lstAlarms->addColumn( tr("Type") );
81 82
82 connect( lstAlarms, SIGNAL(clicked(QListViewItem*,const QPoint&,int) ), 83 connect( lstAlarms, SIGNAL(clicked(QListViewItem*,const QPoint&,int) ),
83 this, SLOT(inlineEdit(QListViewItem*,const QPoint&,int) ) ); 84 this, SLOT(inlineEdit(QListViewItem*,const QPoint&,int) ) );
84 85
85 layout->addMultiCellWidget( lstAlarms, 0, 0, 0, 2 ); 86 layout->addMultiCellWidget( lstAlarms, 0, 0, 0, 2 );
86 87
87 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), this ); 88 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), this );
88 //QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); 89 //QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );