summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/libopie.pro6
-rw-r--r--libopie/orecurrancewidget.cpp20
-rw-r--r--libopie/orecurrancewidget.h6
3 files changed, 27 insertions, 5 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro
index b7537cc..2e76cb1 100644
--- a/libopie/libopie.pro
+++ b/libopie/libopie.pro
@@ -23,24 +23,27 @@ HEADERS = ofontmenu.h \
pim/ocontactaccessbackend.h \
pim/ocontactaccessbackend_xml.h \
pim/ocontactaccessbackend_vcard.h \
pim/obackendfactory.h \
pim/opimcache.h \
pim/otodoaccessvcal.h \
pim/orecur.h \
pim/opimstate.h \
pim/opimxrefpartner.h \
pim/opimxref.h \
pim/opimxrefmanager.h \
pim/opimmaintainer.h \
+ pim/opimnotify.h \
+ pim/opimnotifymanager.h \
+ pim/opimmainwindow.h \
orecurrancewidget.h \
oticker.h
# pim/otodoaccesssql.h \
SOURCES = ofontmenu.cc \
ocolorbutton.cpp \
sharp_compat.cpp \
xmltree.cc \
ofiledialog.cc ofileselector.cc \
ocheckitem.cpp tododb.cpp todoevent.cpp \
todovcalresource.cpp colordialog.cpp \
colorpopupmenu.cpp oclickablelabel.cpp \
@@ -54,24 +57,27 @@ SOURCES = ofontmenu.cc \
pim/otodoaccessbackend.cpp \
pim/otodoaccessxml.cpp \
pim/ocontact.cpp \
pim/ocontactaccess.cpp \
pim/ocontactaccessbackend_vcard.cpp \
pim/otodoaccessvcal.cpp \
pim/orecur.cpp \
pim/opimstate.cpp \
pim/opimxrefpartner.cpp \
pim/opimxref.cpp \
pim/opimxrefmanager.cpp \
pim/opimmaintainer.cpp \
+ pim/opimnotify.cpp \
+ pim/opimnotifymanager.cpp \
+ pim/opimmainwindow.cpp \
orecurrancewidget.cpp \
oticker.cpp
# pim/otodoaccesssql.cpp \
TARGET = opie
INCLUDEPATH += $(OPIEDIR)/include
DESTDIR = $(QTDIR)/lib$(PROJMAK)
#VERSION = 1.0.0
# LIBS += -lopiesql
INTERFACES = otimepickerbase.ui orecurrancebase.ui
diff --git a/libopie/orecurrancewidget.cpp b/libopie/orecurrancewidget.cpp
index 53cee65..0484ab9 100644
--- a/libopie/orecurrancewidget.cpp
+++ b/libopie/orecurrancewidget.cpp
@@ -45,24 +45,39 @@ ORecurranceWidget::ORecurranceWidget( bool startOnMonday,
}
ORecurranceWidget::ORecurranceWidget( bool startOnMonday,
const ORecur& rp, const QDate& startDate,
QWidget* parent, const char* name,
bool modal, WFlags fl)
: ORecurranceBase( parent, name, modal, fl ),
start( startDate ),
end( rp.endDate() ),
startWeekOnMonday( startOnMonday )
{
// do some stuff with the repeat pattern
init();
+ setRecurrence( rp );
+}
+
+ORecurranceWidget::~ORecurranceWidget() {
+}
+void ORecurranceWidget::setStartDate( const QDate& date ) {
+ qWarning("ORecurranceWidget::setStartDate");
+ setRecurrence( recurrence(), date );
+}
+void ORecurranceWidget::setRecurrence( const ORecur& rp ) {
+ setRecurrence( rp, start );
+}
+void ORecurranceWidget::setRecurrence( const ORecur& rp, const QDate& date ) {
+ start = date;
+ end = rp.endDate();
switch ( rp.type() ) {
default:
case ORecur::NoRepeat:
currInterval = None;
setupNone();
break;
case ORecur::Daily:
currInterval = Day;
setupDaily();
break;
case ORecur::Weekly:
currInterval = Week;
@@ -99,28 +114,25 @@ ORecurranceWidget::ORecurranceWidget( bool startOnMonday,
currInterval = Year;
setupYearly();
break;
}
fraType->setButton( currInterval );
spinFreq->setValue( rp.frequency() );
if ( !rp.hasEndDate() ) {
cmdEnd->setText( tr("No End Date") );
chkNoEnd->setChecked( TRUE );
} else
cmdEnd->setText( TimeString::shortDate( end ) );
}
-ORecurranceWidget::~ORecurranceWidget() {
-
-}
-ORecur ORecurranceWidget::recurrance()const {
+ORecur ORecurranceWidget::recurrence()const {
QListIterator<QToolButton> it( listRTypeButtons );
QListIterator<QToolButton> itExtra( listExtra );
ORecur rpTmp;
int i;
for ( i = 0; *it; ++it, i++ ) {
if ( (*it)->isOn() ) {
switch ( i ) {
case None:
rpTmp.setType( ORecur::NoRepeat );
break;
case Day:
rpTmp.setType( ORecur::Daily );
diff --git a/libopie/orecurrancewidget.h b/libopie/orecurrancewidget.h
index f2d7f87..4a8dd08 100644
--- a/libopie/orecurrancewidget.h
+++ b/libopie/orecurrancewidget.h
@@ -7,43 +7,47 @@
#include <qlist.h>
#include <qtoolbutton.h>
#include <qcheckbox.h>
#include <qdatetime.h>
#include <qbuttongroup.h>
#include <qpe/datebookmonth.h>
#include "orecurrancebase.h"
#include <opie/orecur.h>
+// FIXME spelling!!!! -zecke
class ORecurranceWidget : public ORecurranceBase {
Q_OBJECT
public:
ORecurranceWidget( bool startOnMonday,
const QDate& start, QWidget* parent = 0,
const char* name = 0, bool modal = TRUE,
WFlags fl = 0 );
ORecurranceWidget( bool startOnMonday,
const ORecur& rp, const QDate& start,
QWidget* parent = 0, const char* name =0,
bool modal = TRUE, WFlags = 0 );
~ORecurranceWidget();
- ORecur recurrance()const;
+ ORecur recurrence()const;
QDate endDate()const;
public slots:
void slotSetRType( int );
void endDateChanged( int, int, int );
void slotNoEnd( bool unused );
+ void setStartDate( const QDate& );
+ void setRecurrence( const ORecur& recur, const QDate& start );
+ void setRecurrence( const ORecur& recur );
private slots:
void setupRepeatLabel( const QString& );
void setupRepeatLabel( int );
void slotWeekLabel();
void slotMonthLabel( int );
void slotChangeStartOfWeek( bool onMonday );
private:
void setupNone();
void setupDaily();
void setupWeekly();