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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp
index 930c94e..a512fb0 100644
--- a/core/pim/todo/taskeditoralarms.cpp
+++ b/core/pim/todo/taskeditoralarms.cpp
@@ -34,98 +34,98 @@
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
41class AlarmItem : public QListViewItem { 41class AlarmItem : public QListViewItem {
42public: 42public:
43 AlarmItem( QListView*, const OPimAlarm& ); 43 AlarmItem( QListView*, const OPimAlarm& );
44 ~AlarmItem(); 44 ~AlarmItem();
45 45
46 OPimAlarm alarm()const; 46 OPimAlarm alarm()const;
47 void setAlarm( const OPimAlarm& ); 47 void setAlarm( const OPimAlarm& );
48private: 48private:
49 QDateTime m_dt; 49 QDateTime m_dt;
50 int m_type; 50 int m_type;
51}; 51};
52AlarmItem::AlarmItem( QListView* view, const OPimAlarm& dt) 52AlarmItem::AlarmItem( QListView* view, const OPimAlarm& dt)
53 : QListViewItem(view) { 53 : QListViewItem(view) {
54 setAlarm( dt ); 54 setAlarm( dt );
55} 55}
56void AlarmItem::setAlarm( const OPimAlarm& dt ) { 56void AlarmItem::setAlarm( const OPimAlarm& dt ) {
57 m_dt = dt.dateTime(); 57 m_dt = dt.dateTime();
58 m_type = dt.sound(); 58 m_type = dt.sound();
59 setText( 0, TimeString::dateString( m_dt.date() ) ); 59 setText( 0, TimeString::dateString( m_dt.date() ) );
60 setText( 1, TimeString::timeString( m_dt.time() ) ); 60 setText( 1, TimeString::timeString( m_dt.time() ) );
61 setText( 2, m_type == 0 ? QObject::tr("silent") : QObject::tr("loud") ); 61 setText( 2, m_type == 0 ? QObject::tr("silent") : QObject::tr("loud") );
62} 62}
63AlarmItem::~AlarmItem() { 63AlarmItem::~AlarmItem() {
64} 64}
65OPimAlarm AlarmItem::alarm()const{ 65OPimAlarm AlarmItem::alarm()const{
66 OPimAlarm al( m_type, m_dt ); 66 OPimAlarm al( m_type, m_dt );
67 67
68 return al; 68 return al;
69} 69}
70 70
71TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, int, const char* name, WFlags fl ) 71TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, int, const char* name, WFlags fl )
72 : QWidget( parent, name, fl ) 72 : QWidget( parent, name, fl )
73{ 73{
74 m_date = m_type = m_time = 0; 74 m_date = m_type = m_time = 0;
75 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 4 ); 75 QGridLayout *layout = new QGridLayout( this, 2, 2, 4, 4 );
76 76
77 lstAlarms = new QListView( this ); 77 lstAlarms = new QListView( this );
78 lstAlarms->addColumn( tr("Date") ); 78 lstAlarms->addColumn( tr("Date") );
79 lstAlarms->addColumn( tr("Time") ); 79 lstAlarms->addColumn( tr("Time") );
80 lstAlarms->addColumn( tr("Type") ); 80 lstAlarms->addColumn( tr("Type") );
81 81
82 connect( lstAlarms, SIGNAL(clicked ( QListViewItem *, const QPoint &, int ) ), 82 connect( lstAlarms, SIGNAL(clicked(QListViewItem*,const QPoint&,int) ),
83 this, SLOT(inlineEdit(QListViewItem*, const QPoint&, int ) ) ); 83 this, SLOT(inlineEdit(QListViewItem*,const QPoint&,int) ) );
84 84
85 layout->addMultiCellWidget( lstAlarms, 0, 0, 0, 2 ); 85 layout->addMultiCellWidget( lstAlarms, 0, 0, 0, 2 );
86 86
87 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), this ); 87 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), this );
88 //QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); 88 //QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
89 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNew() ) ); 89 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNew() ) );
90 layout->addWidget( btn, 1, 0 ); 90 layout->addWidget( btn, 1, 0 );
91/* use when we've reminders too */ 91/* use when we've reminders too */
92#if 0 92#if 0
93 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), this ); 93 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), this );
94 //QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); 94 //QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
95 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); 95 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEdit() ) );
96 layout->addWidget( btn, 1, 1 ); 96 layout->addWidget( btn, 1, 1 );
97#endif 97#endif
98 98
99 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this ); 99 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this );
100 //QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); 100 //QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
101 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDelete() ) ); 101 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDelete() ) );
102 layout->addWidget( btn, 1, 2 ); 102 layout->addWidget( btn, 1, 2 );
103} 103}
104 104
105TaskEditorAlarms::~TaskEditorAlarms(){ 105TaskEditorAlarms::~TaskEditorAlarms(){
106} 106}
107 107
108void TaskEditorAlarms::slotNew(){ 108void TaskEditorAlarms::slotNew(){
109 (void)new AlarmItem(lstAlarms, OPimAlarm(0, QDateTime::currentDateTime() ) ); 109 (void)new AlarmItem(lstAlarms, OPimAlarm(0, QDateTime::currentDateTime() ) );
110} 110}
111 111
112void TaskEditorAlarms::slotEdit(){ 112void TaskEditorAlarms::slotEdit(){
113} 113}
114 114
115void TaskEditorAlarms::slotDelete(){ 115void TaskEditorAlarms::slotDelete(){
116 QListViewItem* item = lstAlarms->currentItem(); 116 QListViewItem* item = lstAlarms->currentItem();
117 if (!item) return; 117 if (!item) return;
118 118
119 lstAlarms->takeItem( item ); delete item; 119 lstAlarms->takeItem( item ); delete item;
120 120
121 121
122} 122}
123 123
124void TaskEditorAlarms::load( const OPimTodo& todo) { 124void TaskEditorAlarms::load( const OPimTodo& todo) {
125 lstAlarms->clear(); 125 lstAlarms->clear();
126 if (!todo.hasNotifiers() ) return; 126 if (!todo.hasNotifiers() ) return;
127 127
128 OPimNotifyManager::Alarms als = todo.notifiers().alarms(); 128 OPimNotifyManager::Alarms als = todo.notifiers().alarms();
129 129
130 if (als.isEmpty() ) return; 130 if (als.isEmpty() ) return;
131 131