-rw-r--r-- | libopie/libopie.pro | 6 | ||||
-rw-r--r-- | libopie/orecurrancewidget.cpp | 20 | ||||
-rw-r--r-- | libopie/orecurrancewidget.h | 6 |
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 \ | |||
23 | pim/ocontactaccessbackend.h \ | 23 | pim/ocontactaccessbackend.h \ |
24 | pim/ocontactaccessbackend_xml.h \ | 24 | pim/ocontactaccessbackend_xml.h \ |
25 | pim/ocontactaccessbackend_vcard.h \ | 25 | pim/ocontactaccessbackend_vcard.h \ |
26 | pim/obackendfactory.h \ | 26 | pim/obackendfactory.h \ |
27 | pim/opimcache.h \ | 27 | pim/opimcache.h \ |
28 | pim/otodoaccessvcal.h \ | 28 | pim/otodoaccessvcal.h \ |
29 | pim/orecur.h \ | 29 | pim/orecur.h \ |
30 | pim/opimstate.h \ | 30 | pim/opimstate.h \ |
31 | pim/opimxrefpartner.h \ | 31 | pim/opimxrefpartner.h \ |
32 | pim/opimxref.h \ | 32 | pim/opimxref.h \ |
33 | pim/opimxrefmanager.h \ | 33 | pim/opimxrefmanager.h \ |
34 | pim/opimmaintainer.h \ | 34 | pim/opimmaintainer.h \ |
35 | pim/opimnotify.h \ | ||
36 | pim/opimnotifymanager.h \ | ||
37 | pim/opimmainwindow.h \ | ||
35 | orecurrancewidget.h \ | 38 | orecurrancewidget.h \ |
36 | oticker.h | 39 | oticker.h |
37 | # pim/otodoaccesssql.h \ | 40 | # pim/otodoaccesssql.h \ |
38 | 41 | ||
39 | SOURCES = ofontmenu.cc \ | 42 | SOURCES = ofontmenu.cc \ |
40 | ocolorbutton.cpp \ | 43 | ocolorbutton.cpp \ |
41 | sharp_compat.cpp \ | 44 | sharp_compat.cpp \ |
42 | xmltree.cc \ | 45 | xmltree.cc \ |
43 | ofiledialog.cc ofileselector.cc \ | 46 | ofiledialog.cc ofileselector.cc \ |
44 | ocheckitem.cpp tododb.cpp todoevent.cpp \ | 47 | ocheckitem.cpp tododb.cpp todoevent.cpp \ |
45 | todovcalresource.cpp colordialog.cpp \ | 48 | todovcalresource.cpp colordialog.cpp \ |
46 | colorpopupmenu.cpp oclickablelabel.cpp \ | 49 | colorpopupmenu.cpp oclickablelabel.cpp \ |
@@ -54,24 +57,27 @@ SOURCES = ofontmenu.cc \ | |||
54 | pim/otodoaccessbackend.cpp \ | 57 | pim/otodoaccessbackend.cpp \ |
55 | pim/otodoaccessxml.cpp \ | 58 | pim/otodoaccessxml.cpp \ |
56 | pim/ocontact.cpp \ | 59 | pim/ocontact.cpp \ |
57 | pim/ocontactaccess.cpp \ | 60 | pim/ocontactaccess.cpp \ |
58 | pim/ocontactaccessbackend_vcard.cpp \ | 61 | pim/ocontactaccessbackend_vcard.cpp \ |
59 | pim/otodoaccessvcal.cpp \ | 62 | pim/otodoaccessvcal.cpp \ |
60 | pim/orecur.cpp \ | 63 | pim/orecur.cpp \ |
61 | pim/opimstate.cpp \ | 64 | pim/opimstate.cpp \ |
62 | pim/opimxrefpartner.cpp \ | 65 | pim/opimxrefpartner.cpp \ |
63 | pim/opimxref.cpp \ | 66 | pim/opimxref.cpp \ |
64 | pim/opimxrefmanager.cpp \ | 67 | pim/opimxrefmanager.cpp \ |
65 | pim/opimmaintainer.cpp \ | 68 | pim/opimmaintainer.cpp \ |
69 | pim/opimnotify.cpp \ | ||
70 | pim/opimnotifymanager.cpp \ | ||
71 | pim/opimmainwindow.cpp \ | ||
66 | orecurrancewidget.cpp \ | 72 | orecurrancewidget.cpp \ |
67 | oticker.cpp | 73 | oticker.cpp |
68 | # pim/otodoaccesssql.cpp \ | 74 | # pim/otodoaccesssql.cpp \ |
69 | 75 | ||
70 | TARGET = opie | 76 | TARGET = opie |
71 | INCLUDEPATH += $(OPIEDIR)/include | 77 | INCLUDEPATH += $(OPIEDIR)/include |
72 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 78 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
73 | #VERSION = 1.0.0 | 79 | #VERSION = 1.0.0 |
74 | 80 | ||
75 | # LIBS += -lopiesql | 81 | # LIBS += -lopiesql |
76 | 82 | ||
77 | INTERFACES = otimepickerbase.ui orecurrancebase.ui | 83 | 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, | |||
45 | } | 45 | } |
46 | ORecurranceWidget::ORecurranceWidget( bool startOnMonday, | 46 | ORecurranceWidget::ORecurranceWidget( bool startOnMonday, |
47 | const ORecur& rp, const QDate& startDate, | 47 | const ORecur& rp, const QDate& startDate, |
48 | QWidget* parent, const char* name, | 48 | QWidget* parent, const char* name, |
49 | bool modal, WFlags fl) | 49 | bool modal, WFlags fl) |
50 | : ORecurranceBase( parent, name, modal, fl ), | 50 | : ORecurranceBase( parent, name, modal, fl ), |
51 | start( startDate ), | 51 | start( startDate ), |
52 | end( rp.endDate() ), | 52 | end( rp.endDate() ), |
53 | startWeekOnMonday( startOnMonday ) | 53 | startWeekOnMonday( startOnMonday ) |
54 | { | 54 | { |
55 | // do some stuff with the repeat pattern | 55 | // do some stuff with the repeat pattern |
56 | init(); | 56 | init(); |
57 | setRecurrence( rp ); | ||
58 | } | ||
59 | |||
60 | ORecurranceWidget::~ORecurranceWidget() { | ||
61 | } | ||
62 | void ORecurranceWidget::setStartDate( const QDate& date ) { | ||
63 | qWarning("ORecurranceWidget::setStartDate"); | ||
64 | setRecurrence( recurrence(), date ); | ||
65 | } | ||
66 | void ORecurranceWidget::setRecurrence( const ORecur& rp ) { | ||
67 | setRecurrence( rp, start ); | ||
68 | } | ||
69 | void ORecurranceWidget::setRecurrence( const ORecur& rp, const QDate& date ) { | ||
70 | start = date; | ||
71 | end = rp.endDate(); | ||
57 | switch ( rp.type() ) { | 72 | switch ( rp.type() ) { |
58 | default: | 73 | default: |
59 | case ORecur::NoRepeat: | 74 | case ORecur::NoRepeat: |
60 | currInterval = None; | 75 | currInterval = None; |
61 | setupNone(); | 76 | setupNone(); |
62 | break; | 77 | break; |
63 | case ORecur::Daily: | 78 | case ORecur::Daily: |
64 | currInterval = Day; | 79 | currInterval = Day; |
65 | setupDaily(); | 80 | setupDaily(); |
66 | break; | 81 | break; |
67 | case ORecur::Weekly: | 82 | case ORecur::Weekly: |
68 | currInterval = Week; | 83 | currInterval = Week; |
@@ -99,28 +114,25 @@ ORecurranceWidget::ORecurranceWidget( bool startOnMonday, | |||
99 | currInterval = Year; | 114 | currInterval = Year; |
100 | setupYearly(); | 115 | setupYearly(); |
101 | break; | 116 | break; |
102 | } | 117 | } |
103 | fraType->setButton( currInterval ); | 118 | fraType->setButton( currInterval ); |
104 | spinFreq->setValue( rp.frequency() ); | 119 | spinFreq->setValue( rp.frequency() ); |
105 | if ( !rp.hasEndDate() ) { | 120 | if ( !rp.hasEndDate() ) { |
106 | cmdEnd->setText( tr("No End Date") ); | 121 | cmdEnd->setText( tr("No End Date") ); |
107 | chkNoEnd->setChecked( TRUE ); | 122 | chkNoEnd->setChecked( TRUE ); |
108 | } else | 123 | } else |
109 | cmdEnd->setText( TimeString::shortDate( end ) ); | 124 | cmdEnd->setText( TimeString::shortDate( end ) ); |
110 | } | 125 | } |
111 | ORecurranceWidget::~ORecurranceWidget() { | 126 | ORecur ORecurranceWidget::recurrence()const { |
112 | |||
113 | } | ||
114 | ORecur ORecurranceWidget::recurrance()const { | ||
115 | QListIterator<QToolButton> it( listRTypeButtons ); | 127 | QListIterator<QToolButton> it( listRTypeButtons ); |
116 | QListIterator<QToolButton> itExtra( listExtra ); | 128 | QListIterator<QToolButton> itExtra( listExtra ); |
117 | ORecur rpTmp; | 129 | ORecur rpTmp; |
118 | int i; | 130 | int i; |
119 | for ( i = 0; *it; ++it, i++ ) { | 131 | for ( i = 0; *it; ++it, i++ ) { |
120 | if ( (*it)->isOn() ) { | 132 | if ( (*it)->isOn() ) { |
121 | switch ( i ) { | 133 | switch ( i ) { |
122 | case None: | 134 | case None: |
123 | rpTmp.setType( ORecur::NoRepeat ); | 135 | rpTmp.setType( ORecur::NoRepeat ); |
124 | break; | 136 | break; |
125 | case Day: | 137 | case Day: |
126 | rpTmp.setType( ORecur::Daily ); | 138 | 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 @@ | |||
7 | 7 | ||
8 | #include <qlist.h> | 8 | #include <qlist.h> |
9 | #include <qtoolbutton.h> | 9 | #include <qtoolbutton.h> |
10 | #include <qcheckbox.h> | 10 | #include <qcheckbox.h> |
11 | #include <qdatetime.h> | 11 | #include <qdatetime.h> |
12 | #include <qbuttongroup.h> | 12 | #include <qbuttongroup.h> |
13 | 13 | ||
14 | #include <qpe/datebookmonth.h> | 14 | #include <qpe/datebookmonth.h> |
15 | 15 | ||
16 | #include "orecurrancebase.h" | 16 | #include "orecurrancebase.h" |
17 | #include <opie/orecur.h> | 17 | #include <opie/orecur.h> |
18 | 18 | ||
19 | // FIXME spelling!!!! -zecke | ||
19 | class ORecurranceWidget : public ORecurranceBase { | 20 | class ORecurranceWidget : public ORecurranceBase { |
20 | Q_OBJECT | 21 | Q_OBJECT |
21 | public: | 22 | public: |
22 | ORecurranceWidget( bool startOnMonday, | 23 | ORecurranceWidget( bool startOnMonday, |
23 | const QDate& start, QWidget* parent = 0, | 24 | const QDate& start, QWidget* parent = 0, |
24 | const char* name = 0, bool modal = TRUE, | 25 | const char* name = 0, bool modal = TRUE, |
25 | WFlags fl = 0 ); | 26 | WFlags fl = 0 ); |
26 | ORecurranceWidget( bool startOnMonday, | 27 | ORecurranceWidget( bool startOnMonday, |
27 | const ORecur& rp, const QDate& start, | 28 | const ORecur& rp, const QDate& start, |
28 | QWidget* parent = 0, const char* name =0, | 29 | QWidget* parent = 0, const char* name =0, |
29 | bool modal = TRUE, WFlags = 0 ); | 30 | bool modal = TRUE, WFlags = 0 ); |
30 | ~ORecurranceWidget(); | 31 | ~ORecurranceWidget(); |
31 | ORecur recurrance()const; | 32 | ORecur recurrence()const; |
32 | QDate endDate()const; | 33 | QDate endDate()const; |
33 | 34 | ||
34 | public slots: | 35 | public slots: |
35 | void slotSetRType( int ); | 36 | void slotSetRType( int ); |
36 | void endDateChanged( int, int, int ); | 37 | void endDateChanged( int, int, int ); |
37 | void slotNoEnd( bool unused ); | 38 | void slotNoEnd( bool unused ); |
39 | void setStartDate( const QDate& ); | ||
40 | void setRecurrence( const ORecur& recur, const QDate& start ); | ||
41 | void setRecurrence( const ORecur& recur ); | ||
38 | 42 | ||
39 | private slots: | 43 | private slots: |
40 | void setupRepeatLabel( const QString& ); | 44 | void setupRepeatLabel( const QString& ); |
41 | void setupRepeatLabel( int ); | 45 | void setupRepeatLabel( int ); |
42 | void slotWeekLabel(); | 46 | void slotWeekLabel(); |
43 | void slotMonthLabel( int ); | 47 | void slotMonthLabel( int ); |
44 | void slotChangeStartOfWeek( bool onMonday ); | 48 | void slotChangeStartOfWeek( bool onMonday ); |
45 | 49 | ||
46 | private: | 50 | private: |
47 | void setupNone(); | 51 | void setupNone(); |
48 | void setupDaily(); | 52 | void setupDaily(); |
49 | void setupWeekly(); | 53 | void setupWeekly(); |