summaryrefslogtreecommitdiff
authorhakan <hakan>2002-05-07 15:27:34 (UTC)
committer hakan <hakan>2002-05-07 15:27:34 (UTC)
commitad2c6f2e1b5504989ceed297d9ee8c49129ad1fb (patch) (unidiff)
tree60d75877abb05a322b265d8b50621f3f7f75c9d1
parent8ba0398d93f0e70ea2de254a4090d8bd02f593cd (diff)
downloadopie-ad2c6f2e1b5504989ceed297d9ee8c49129ad1fb.zip
opie-ad2c6f2e1b5504989ceed297d9ee8c49129ad1fb.tar.gz
opie-ad2c6f2e1b5504989ceed297d9ee8c49129ad1fb.tar.bz2
Added separate note editor dialog (currently only a QMultiLineEdit)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/.cvsignore2
-rw-r--r--core/pim/datebook/datebook.pro9
-rw-r--r--core/pim/datebook/dateentry.ui13
-rw-r--r--core/pim/datebook/dateentryimpl.cpp26
-rw-r--r--core/pim/datebook/dateentryimpl.h4
-rw-r--r--core/pim/datebook/noteentry.ui68
-rw-r--r--core/pim/datebook/noteentryimpl.cpp16
-rw-r--r--core/pim/datebook/noteentryimpl.h18
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
@@ -14,3 +14,5 @@ datebookweeklstdayhdr.cpp
14datebookweeklstdayhdr.h 14datebookweeklstdayhdr.h
15datebookweeklstheader.cpp 15datebookweeklstheader.cpp
16datebookweeklstheader.h 16datebookweeklstheader.h
17noteentry.cpp
18noteentry.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
@@ -11,7 +11,8 @@ HEADERS = datebookday.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 \
@@ -23,7 +24,8 @@ SOURCES = main.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 \
@@ -31,7 +33,8 @@ INTERFACES = dateentry.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
36INCLUDEPATH += $(OPIEDIR)/include 39INCLUDEPATH += $(OPIEDIR)/include
37 DEPENDPATH+= $(OPIEDIR)/include 40 DEPENDPATH+= $(OPIEDIR)/include
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
@@ -489,13 +489,24 @@
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>
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
@@ -128,8 +128,8 @@ DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock,
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 );
@@ -210,6 +210,9 @@ void DateEntry::init()
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 );
@@ -220,7 +223,6 @@ void DateEntry::init()
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 );
@@ -238,6 +240,22 @@ DateEntry::~DateEntry()
238/* 240/*
239 * public slot 241 * public slot
240 */ 242 */
243
244void 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
241void DateEntry::endDateChanged( int y, int m, int d ) 259void DateEntry::endDateChanged( int y, int m, int d )
242{ 260{
243 endDate.setYMD( y, m, d ); 261 endDate.setYMD( y, m, d );
@@ -455,7 +473,7 @@ Event DateEntry::event()
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
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
@@ -21,6 +21,7 @@
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
@@ -55,6 +56,7 @@ public slots:
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
59private: 61private:
60 void init(); 62 void init();
@@ -70,6 +72,8 @@ private:
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>&lt;b&gt;1/10&lt;/b&gt; 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
6NoteEntry::NoteEntry(const QString &title, const QString &noteStr,
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
6class QString;
7
8class NoteEntry : public NoteEntryBase
9{
10 Q_OBJECT
11
12public:
13 NoteEntry(const QString &title, const QString &noteStr,
14 QWidget* parent = 0, const char* name = 0,
15 bool modal=TRUE, WFlags fl=0);
16};
17
18#endif