-rw-r--r-- | core/pim/datebook/.cvsignore | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebook.pro | 9 | ||||
-rw-r--r-- | core/pim/datebook/dateentry.ui | 13 | ||||
-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 26 | ||||
-rw-r--r-- | core/pim/datebook/dateentryimpl.h | 4 | ||||
-rw-r--r-- | core/pim/datebook/noteentry.ui | 68 | ||||
-rw-r--r-- | core/pim/datebook/noteentryimpl.cpp | 16 | ||||
-rw-r--r-- | core/pim/datebook/noteentryimpl.h | 18 |
8 files changed, 148 insertions, 8 deletions
diff --git a/core/pim/datebook/.cvsignore b/core/pim/datebook/.cvsignore index d2e4975..74ec374 100644 --- a/core/pim/datebook/.cvsignore +++ b/core/pim/datebook/.cvsignore | |||
@@ -11,6 +11,8 @@ datebooksettingsbase.cpp | |||
11 | repeatentrybase.cpp | 11 | repeatentrybase.cpp |
12 | repeatentrybase.h | 12 | repeatentrybase.h |
13 | datebookweeklstdayhdr.cpp | 13 | datebookweeklstdayhdr.cpp |
14 | datebookweeklstdayhdr.h | 14 | datebookweeklstdayhdr.h |
15 | datebookweeklstheader.cpp | 15 | datebookweeklstheader.cpp |
16 | datebookweeklstheader.h | 16 | datebookweeklstheader.h |
17 | noteentry.cpp | ||
18 | noteentry.h | ||
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro index 9383053..60c2b08 100644 --- a/core/pim/datebook/datebook.pro +++ b/core/pim/datebook/datebook.pro | |||
@@ -8,33 +8,36 @@ HEADERS = datebookday.h \ | |||
8 | datebookdayheaderimpl.h \ | 8 | datebookdayheaderimpl.h \ |
9 | datebooksettings.h \ | 9 | datebooksettings.h \ |
10 | datebookweek.h \ | 10 | datebookweek.h \ |
11 | datebookweeklst.h \ | 11 | datebookweeklst.h \ |
12 | datebookweekheaderimpl.h \ | 12 | datebookweekheaderimpl.h \ |
13 | repeatentry.h \ | 13 | repeatentry.h \ |
14 | timepicker.h | 14 | timepicker.h \ |
15 | noteentryimpl.h | ||
15 | 16 | ||
16 | SOURCES= main.cpp \ | 17 | SOURCES= main.cpp \ |
17 | datebookday.cpp \ | 18 | datebookday.cpp \ |
18 | datebook.cpp \ | 19 | datebook.cpp \ |
19 | dateentryimpl.cpp \ | 20 | dateentryimpl.cpp \ |
20 | datebookdayheaderimpl.cpp \ | 21 | datebookdayheaderimpl.cpp \ |
21 | datebooksettings.cpp \ | 22 | datebooksettings.cpp \ |
22 | datebookweek.cpp \ | 23 | datebookweek.cpp \ |
23 | datebookweeklst.cpp \ | 24 | datebookweeklst.cpp \ |
24 | datebookweekheaderimpl.cpp \ | 25 | datebookweekheaderimpl.cpp \ |
25 | repeatentry.cpp \ | 26 | repeatentry.cpp \ |
26 | timepicker.cpp | 27 | timepicker.cpp \ |
28 | noteentryimpl.cpp | ||
27 | 29 | ||
28 | INTERFACES= dateentry.ui \ | 30 | INTERFACES= dateentry.ui \ |
29 | datebookdayheader.ui \ | 31 | datebookdayheader.ui \ |
30 | datebooksettingsbase.ui \ | 32 | datebooksettingsbase.ui \ |
31 | datebookweekheader.ui \ | 33 | datebookweekheader.ui \ |
32 | datebookweeklstheader.ui \ | 34 | datebookweeklstheader.ui \ |
33 | datebookweeklstdayhdr.ui \ | 35 | datebookweeklstdayhdr.ui \ |
34 | repeatentrybase.ui | 36 | repeatentrybase.ui \ |
37 | noteentry.ui | ||
35 | 38 | ||
36 | INCLUDEPATH += $(OPIEDIR)/include | 39 | INCLUDEPATH += $(OPIEDIR)/include |
37 | DEPENDPATH+= $(OPIEDIR)/include | 40 | DEPENDPATH+= $(OPIEDIR)/include |
38 | LIBS += -lqpe -lopie | 41 | LIBS += -lqpe -lopie |
39 | 42 | ||
40 | TARGET = datebook | 43 | TARGET = datebook |
diff --git a/core/pim/datebook/dateentry.ui b/core/pim/datebook/dateentry.ui index 1a712ec..fadbc35 100644 --- a/core/pim/datebook/dateentry.ui +++ b/core/pim/datebook/dateentry.ui | |||
@@ -486,19 +486,30 @@ | |||
486 | <enum>TabFocus</enum> | 486 | <enum>TabFocus</enum> |
487 | </property> | 487 | </property> |
488 | <property stdset="1"> | 488 | <property stdset="1"> |
489 | <name>text</name> | 489 | <name>text</name> |
490 | <string>No Repeat...</string> | 490 | <string>No Repeat...</string> |
491 | </property> | 491 | </property> |
492 | <property stdset="1"> | ||
493 | <name>sizePolicy</name> | ||
494 | <sizepolicy> | ||
495 | <hsizetype>7</hsizetype> | ||
496 | <vsizetype>0</vsizetype> | ||
497 | </sizepolicy> | ||
498 | </property> | ||
492 | </widget> | 499 | </widget> |
493 | <widget row="10" column="0" rowspan="1" colspan="4" > | 500 | <widget row="10" column="0" rowspan="1" colspan="4" > |
494 | <class>QMultiLineEdit</class> | 501 | <class>QToolButton</class> |
495 | <property stdset="1"> | 502 | <property stdset="1"> |
496 | <name>name</name> | 503 | <name>name</name> |
497 | <cstring>editNote</cstring> | 504 | <cstring>editNote</cstring> |
498 | </property> | 505 | </property> |
506 | <property stdset="1"> | ||
507 | <name>text</name> | ||
508 | <string>Note...</string> | ||
509 | </property> | ||
499 | </widget> | 510 | </widget> |
500 | </grid> | 511 | </grid> |
501 | </widget> | 512 | </widget> |
502 | <customwidgets> | 513 | <customwidgets> |
503 | <customwidget> | 514 | <customwidget> |
504 | <class>TimeZoneSelector</class> | 515 | <class>TimeZoneSelector</class> |
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index c4f6c68..9cc5073 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -125,14 +125,14 @@ DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock, | |||
125 | if(!event.description().isEmpty()) | 125 | if(!event.description().isEmpty()) |
126 | addOrPick( comboDescription, event.description() ); | 126 | addOrPick( comboDescription, event.description() ); |
127 | if(!event.location().isEmpty()) | 127 | if(!event.location().isEmpty()) |
128 | addOrPick( comboLocation, event.location() ); | 128 | addOrPick( comboLocation, event.location() ); |
129 | checkAlarm->setChecked( event.hasAlarm() ); | 129 | checkAlarm->setChecked( event.hasAlarm() ); |
130 | checkAllDay->setChecked( event.type() == Event::AllDay ); | 130 | checkAllDay->setChecked( event.type() == Event::AllDay ); |
131 | if(!event.notes().isEmpty()) | 131 | if(!event.notes().isEmpty()) noteStr=event.notes(); |
132 | editNote->setText(event.notes()); | 132 | else noteStr=""; |
133 | spinAlarm->setValue(event.alarmTime()); | 133 | spinAlarm->setValue(event.alarmTime()); |
134 | if ( event.alarmSound() != Event::Silent ) | 134 | if ( event.alarmSound() != Event::Silent ) |
135 | comboSound->setCurrentItem( 1 ); | 135 | comboSound->setCurrentItem( 1 ); |
136 | if ( event.hasRepeat() ) { | 136 | if ( event.hasRepeat() ) { |
137 | rp = event.repeatPattern(); | 137 | rp = event.repeatPattern(); |
138 | cmdRepeat->setText( tr("Repeat...") ); | 138 | cmdRepeat->setText( tr("Repeat...") ); |
@@ -207,23 +207,25 @@ void DateEntry::init() | |||
207 | connect( startPicker, SIGNAL( dateClicked( int, int, int ) ), | 207 | connect( startPicker, SIGNAL( dateClicked( int, int, int ) ), |
208 | this, SLOT( endDateChanged( int, int, int ) ) ); | 208 | this, SLOT( endDateChanged( int, int, int ) ) ); |
209 | connect( qApp, SIGNAL( clockChanged( bool ) ), | 209 | connect( qApp, SIGNAL( clockChanged( bool ) ), |
210 | this, SLOT( slotChangeClock( bool ) ) ); | 210 | this, SLOT( slotChangeClock( bool ) ) ); |
211 | connect( qApp, SIGNAL(weekChanged(bool)), | 211 | connect( qApp, SIGNAL(weekChanged(bool)), |
212 | this, SLOT(slotChangeStartOfWeek(bool)) ); | 212 | this, SLOT(slotChangeStartOfWeek(bool)) ); |
213 | |||
214 | connect( editNote, SIGNAL(clicked()), | ||
215 | this, SLOT(slotEditNote()) ); | ||
213 | 216 | ||
214 | QPopupMenu *m2 = new QPopupMenu( this ); | 217 | QPopupMenu *m2 = new QPopupMenu( this ); |
215 | endPicker = new DateBookMonth( m2, 0, TRUE ); | 218 | endPicker = new DateBookMonth( m2, 0, TRUE ); |
216 | m2->insertItem( endPicker ); | 219 | m2->insertItem( endPicker ); |
217 | buttonEnd->setPopup( m2 ); | 220 | buttonEnd->setPopup( m2 ); |
218 | connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), | 221 | connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), |
219 | this, SLOT( endDateChanged( int, int, int ) ) ); | 222 | this, SLOT( endDateChanged( int, int, int ) ) ); |
220 | 223 | ||
221 | connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ), | 224 | connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ), |
222 | this, SLOT( startTimePicked(const QTime &) )); | 225 | this, SLOT( startTimePicked(const QTime &) )); |
223 | editNote->setFixedVisibleLines(3); | ||
224 | // install eventFilters | 226 | // install eventFilters |
225 | comboEnd->installEventFilter( this ); | 227 | comboEnd->installEventFilter( this ); |
226 | comboStart->installEventFilter( this ); | 228 | comboStart->installEventFilter( this ); |
227 | } | 229 | } |
228 | 230 | ||
229 | /* | 231 | /* |
@@ -235,12 +237,28 @@ DateEntry::~DateEntry() | |||
235 | //cout << "Del: " << comboStart->currentText() << endl; | 237 | //cout << "Del: " << comboStart->currentText() << endl; |
236 | } | 238 | } |
237 | 239 | ||
238 | /* | 240 | /* |
239 | * public slot | 241 | * public slot |
240 | */ | 242 | */ |
243 | |||
244 | void DateEntry::slotEditNote() { | ||
245 | QString s; | ||
246 | s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month()); | ||
247 | NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, | ||
248 | this,0,TRUE); | ||
249 | |||
250 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | ||
251 | noteDlg.showMaximized(); | ||
252 | #endif | ||
253 | if (noteDlg.exec() ) { | ||
254 | noteStr=noteDlg.note->text(); | ||
255 | } | ||
256 | |||
257 | } | ||
258 | |||
241 | void DateEntry::endDateChanged( int y, int m, int d ) | 259 | void DateEntry::endDateChanged( int y, int m, int d ) |
242 | { | 260 | { |
243 | endDate.setYMD( y, m, d ); | 261 | endDate.setYMD( y, m, d ); |
244 | if ( endDate < startDate ) { | 262 | if ( endDate < startDate ) { |
245 | endDate = startDate; | 263 | endDate = startDate; |
246 | } | 264 | } |
@@ -452,13 +470,13 @@ Event DateEntry::event() | |||
452 | st = Event::Loud; | 470 | st = Event::Loud; |
453 | else | 471 | else |
454 | st = Event::Silent; | 472 | st = Event::Silent; |
455 | ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); | 473 | ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); |
456 | if ( rp.type != Event::NoRepeat ) | 474 | if ( rp.type != Event::NoRepeat ) |
457 | ev.setRepeat( TRUE, rp ); | 475 | ev.setRepeat( TRUE, rp ); |
458 | ev.setNotes( editNote->text() ); | 476 | ev.setNotes( noteStr ); |
459 | 477 | ||
460 | //cout << "Start: " << comboStart->currentText() << endl; | 478 | //cout << "Start: " << comboStart->currentText() << endl; |
461 | 479 | ||
462 | return ev; | 480 | return ev; |
463 | } | 481 | } |
464 | 482 | ||
diff --git a/core/pim/datebook/dateentryimpl.h b/core/pim/datebook/dateentryimpl.h index 4eb24b4..a3c4668 100644 --- a/core/pim/datebook/dateentryimpl.h +++ b/core/pim/datebook/dateentryimpl.h | |||
@@ -18,12 +18,13 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef DATEENTRY_H | 20 | #ifndef DATEENTRY_H |
21 | #define DATEENTRY_H | 21 | #define DATEENTRY_H |
22 | 22 | ||
23 | #include "dateentry.h" | 23 | #include "dateentry.h" |
24 | #include "noteentryimpl.h" | ||
24 | 25 | ||
25 | #include <qpe/event.h> | 26 | #include <qpe/event.h> |
26 | 27 | ||
27 | #include <qdatetime.h> | 28 | #include <qdatetime.h> |
28 | 29 | ||
29 | class DateBookMonth; | 30 | class DateBookMonth; |
@@ -52,12 +53,13 @@ public slots: | |||
52 | void startTimeChanged( const QTime & ); | 53 | void startTimeChanged( const QTime & ); |
53 | void startTimePicked( const QTime & ); | 54 | void startTimePicked( const QTime & ); |
54 | void typeChanged( const QString & ); | 55 | void typeChanged( const QString & ); |
55 | void slotRepeat(); | 56 | void slotRepeat(); |
56 | void slotChangeClock( bool ); | 57 | void slotChangeClock( bool ); |
57 | void slotChangeStartOfWeek( bool ); | 58 | void slotChangeStartOfWeek( bool ); |
59 | void slotEditNote(); | ||
58 | 60 | ||
59 | private: | 61 | private: |
60 | void init(); | 62 | void init(); |
61 | void initCombos(); | 63 | void initCombos(); |
62 | void setDates( const QDateTime& s, const QDateTime& e ); | 64 | void setDates( const QDateTime& s, const QDateTime& e ); |
63 | void setRepeatLabel(); | 65 | void setRepeatLabel(); |
@@ -67,9 +69,11 @@ private: | |||
67 | QDate startDate, endDate; | 69 | QDate startDate, endDate; |
68 | QTime startTime, endTime; | 70 | QTime startTime, endTime; |
69 | Event::RepeatPattern rp; | 71 | Event::RepeatPattern rp; |
70 | bool ampm:1; | 72 | bool ampm:1; |
71 | bool startWeekOnMonday:1; | 73 | bool startWeekOnMonday:1; |
72 | bool m_showStart:1; | 74 | bool m_showStart:1; |
75 | |||
76 | QString noteStr; | ||
73 | }; | 77 | }; |
74 | 78 | ||
75 | #endif // DATEENTRY_H | 79 | #endif // DATEENTRY_H |
diff --git a/core/pim/datebook/noteentry.ui b/core/pim/datebook/noteentry.ui new file mode 100644 index 0000000..ce3c4ad --- a/dev/null +++ b/core/pim/datebook/noteentry.ui | |||
@@ -0,0 +1,68 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>NoteEntryBase</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>NoteEntryBase</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>465</width> | ||
15 | <height>500</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Edit Note</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <vbox> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>2</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>0</number> | ||
36 | </property> | ||
37 | <widget> | ||
38 | <class>QLabel</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>eventLabel</cstring> | ||
42 | </property> | ||
43 | <property stdset="1"> | ||
44 | <name>text</name> | ||
45 | <string><b>1/10</b> Lunch</string> | ||
46 | </property> | ||
47 | <property stdset="1"> | ||
48 | <name>alignment</name> | ||
49 | <set>AlignCenter</set> | ||
50 | </property> | ||
51 | <property> | ||
52 | <name>hAlign</name> | ||
53 | </property> | ||
54 | </widget> | ||
55 | <widget> | ||
56 | <class>QMultiLineEdit</class> | ||
57 | <property stdset="1"> | ||
58 | <name>name</name> | ||
59 | <cstring>note</cstring> | ||
60 | </property> | ||
61 | <property stdset="1"> | ||
62 | <name>wordWrap</name> | ||
63 | <enum>WidgetWidth</enum> | ||
64 | </property> | ||
65 | </widget> | ||
66 | </vbox> | ||
67 | </widget> | ||
68 | </UI> | ||
diff --git a/core/pim/datebook/noteentryimpl.cpp b/core/pim/datebook/noteentryimpl.cpp new file mode 100644 index 0000000..9e1abb9 --- a/dev/null +++ b/core/pim/datebook/noteentryimpl.cpp | |||
@@ -0,0 +1,16 @@ | |||
1 | #include "noteentryimpl.h" | ||
2 | #include "qstring.h" | ||
3 | #include "qmultilinedit.h" | ||
4 | #include "qlabel.h" | ||
5 | |||
6 | NoteEntry::NoteEntry(const QString &title, const QString ¬eStr, | ||
7 | QWidget* parent, const char* name, bool modal, | ||
8 | WFlags fl) : | ||
9 | NoteEntryBase(parent, name, modal, fl) { | ||
10 | |||
11 | |||
12 | eventLabel->setText(title); | ||
13 | note->setText(noteStr); | ||
14 | int l=note->length(); | ||
15 | note->setCursorPosition(l,l,false); | ||
16 | } | ||
diff --git a/core/pim/datebook/noteentryimpl.h b/core/pim/datebook/noteentryimpl.h new file mode 100644 index 0000000..f3adfa6 --- a/dev/null +++ b/core/pim/datebook/noteentryimpl.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef noteentryimpl_h | ||
2 | #define noteentryimpl_h | ||
3 | |||
4 | #include "noteentry.h" | ||
5 | |||
6 | class QString; | ||
7 | |||
8 | class NoteEntry : public NoteEntryBase | ||
9 | { | ||
10 | Q_OBJECT | ||
11 | |||
12 | public: | ||
13 | NoteEntry(const QString &title, const QString ¬eStr, | ||
14 | QWidget* parent = 0, const char* name = 0, | ||
15 | bool modal=TRUE, WFlags fl=0); | ||
16 | }; | ||
17 | |||
18 | #endif | ||