summaryrefslogtreecommitdiff
path: root/core/pim/todo/taskeditoralarms.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/taskeditoralarms.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/taskeditoralarms.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp
index bcc40fe..930c94e 100644
--- a/core/pim/todo/taskeditoralarms.cpp
+++ b/core/pim/todo/taskeditoralarms.cpp
@@ -7,51 +7,50 @@
:`=1 )Y*s>-.--   : the terms of the GNU General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "taskeditoralarms.h"
-#include <opie/otodo.h>
-#include <opie/opimnotifymanager.h>
-#include <opie/otimepicker.h>
+#include <opie2/opimnotifymanager.h>
+#include <opie2/otimepicker.h>
#include <qpe/datebookmonth.h>
#include <qpe/resource.h>
#include <qlistview.h>
#include <qlayout.h>
class AlarmItem : public QListViewItem {
public:
AlarmItem( QListView*, const OPimAlarm& );
~AlarmItem();
OPimAlarm alarm()const;
void setAlarm( const OPimAlarm& );
private:
QDateTime m_dt;
int m_type;
};
AlarmItem::AlarmItem( QListView* view, const OPimAlarm& dt)
: QListViewItem(view) {
setAlarm( dt );
}
void AlarmItem::setAlarm( const OPimAlarm& dt ) {
@@ -101,63 +100,63 @@ TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, int, const char* name, WFl
//QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
connect( btn, SIGNAL( clicked() ), this, SLOT( slotDelete() ) );
layout->addWidget( btn, 1, 2 );
}
TaskEditorAlarms::~TaskEditorAlarms(){
}
void TaskEditorAlarms::slotNew(){
(void)new AlarmItem(lstAlarms, OPimAlarm(0, QDateTime::currentDateTime() ) );
}
void TaskEditorAlarms::slotEdit(){
}
void TaskEditorAlarms::slotDelete(){
QListViewItem* item = lstAlarms->currentItem();
if (!item) return;
lstAlarms->takeItem( item ); delete item;
}
-void TaskEditorAlarms::load( const OTodo& todo) {
+void TaskEditorAlarms::load( const OPimTodo& todo) {
lstAlarms->clear();
if (!todo.hasNotifiers() ) return;
OPimNotifyManager::Alarms als = todo.notifiers().alarms();
if (als.isEmpty() ) return;
OPimNotifyManager::Alarms::Iterator it = als.begin();
for ( ; it != als.end(); ++it )
(void)new AlarmItem( lstAlarms, (*it) );
}
-void TaskEditorAlarms::save( OTodo& todo ) {
+void TaskEditorAlarms::save( OPimTodo& todo ) {
if (lstAlarms->childCount() <= 0 ) return;
OPimNotifyManager::Alarms alarms;
for ( QListViewItem* item = lstAlarms->firstChild(); item; item = item->nextSibling() ) {
AlarmItem *alItem = static_cast<AlarmItem*>(item);
alarms.append( alItem->alarm() );
}
OPimNotifyManager& manager = todo.notifiers();
manager.setAlarms( alarms );
}
void TaskEditorAlarms::inlineEdit( QListViewItem* alarm, const QPoint& p, int col ) {
if (!alarm) return;
AlarmItem* item = static_cast<AlarmItem*>(alarm);
switch( col ) {
// date
case 0:
return inlineSetDate( item, p );
// time
case 1:
return inlineSetTime( item );
// type