Diffstat (limited to 'core/pim/today/plugins/datebook/datebookevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/today/plugins/datebook/datebookevent.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp index d4e8e1e..c37813b 100644 --- a/core/pim/today/plugins/datebook/datebookevent.cpp +++ b/core/pim/today/plugins/datebook/datebookevent.cpp | |||
@@ -19,15 +19,14 @@ | |||
19 | #include <qpe/timestring.h> | 19 | #include <qpe/timestring.h> |
20 | #include <qpe/qcopenvelope_qws.h> | 20 | #include <qpe/qcopenvelope_qws.h> |
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | 22 | ||
23 | DateBookEvent::DateBookEvent(const EffectiveEvent &ev, | 23 | DateBookEvent::DateBookEvent(const EffectiveEvent &ev, |
24 | QWidget* parent, | 24 | QWidget* parent, |
25 | int show_location, | 25 | bool show_location, |
26 | int show_notes, | 26 | bool show_notes, |
27 | // int onlyLater, | ||
28 | int maxCharClip, | 27 | int maxCharClip, |
29 | const char* name, | 28 | const char* name, |
30 | WFlags fl) : | 29 | WFlags fl) : |
31 | OClickableLabel(parent,name,fl), event(ev) { | 30 | OClickableLabel(parent,name,fl), event(ev) { |
32 | 31 | ||
33 | setAlignment( AlignTop ); | 32 | setAlignment( AlignTop ); |
@@ -42,13 +41,13 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, | |||
42 | msg += "<B>" + (ev).description() + "</B>"; | 41 | msg += "<B>" + (ev).description() + "</B>"; |
43 | if ( (ev).event().hasAlarm() ) { | 42 | if ( (ev).event().hasAlarm() ) { |
44 | msg += " <b>[with alarm]</b>"; | 43 | msg += " <b>[with alarm]</b>"; |
45 | } | 44 | } |
46 | 45 | ||
47 | // include location or not | 46 | // include location or not |
48 | if ( show_location == 1) { | 47 | if ( show_location ) { |
49 | msg += "<BR><i>" + (ev).location() + "</i>"; | 48 | msg += "<BR><i>" + (ev).location() + "</i>"; |
50 | } | 49 | } |
51 | 50 | ||
52 | if ( ( TimeString::timeString( QTime( (ev).event().start().time() ) ) == "00:00" ) | 51 | if ( ( TimeString::timeString( QTime( (ev).event().start().time() ) ) == "00:00" ) |
53 | && ( TimeString::timeString( QTime( (ev).event().end().time() ) ) == "23:59") ) { | 52 | && ( TimeString::timeString( QTime( (ev).event().end().time() ) ) == "23:59") ) { |
54 | msg += "<br>All day"; | 53 | msg += "<br>All day"; |
@@ -57,22 +56,27 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, | |||
57 | msg += "<br>" + ampmTime(QTime( (ev).event().start().time() ) ) | 56 | msg += "<br>" + ampmTime(QTime( (ev).event().start().time() ) ) |
58 | // end time of event | 57 | // end time of event |
59 | + "<b> - </b>" + ampmTime(QTime( (ev).event().end().time() ) ); | 58 | + "<b> - </b>" + ampmTime(QTime( (ev).event().end().time() ) ); |
60 | } | 59 | } |
61 | 60 | ||
62 | // include possible note or not | 61 | // include possible note or not |
63 | if ( show_notes == 1) { | 62 | if ( show_notes ) { |
64 | msg += "<br> <i>note</i>:" +( (ev).notes() ).mid( 0, maxCharClip ); | 63 | msg += "<br> <i>note</i>:" +( (ev).notes() ).mid( 0, maxCharClip ); |
65 | } | 64 | } |
66 | 65 | ||
67 | setText( msg ); | 66 | setText( msg ); |
68 | connect( this, SIGNAL( clicked() ), this, SLOT( editMe() ) ); | 67 | connect( this, SIGNAL( clicked() ), this, SLOT( editMe() ) ); |
69 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); | 68 | // setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); |
70 | } | 69 | } |
71 | 70 | ||
72 | 71 | ||
72 | /** | ||
73 | * AM/PM timestring conversion. | ||
74 | * @param tm the timestring | ||
75 | * @return formatted to am/pm is system is set to it | ||
76 | */ | ||
73 | QString DateBookEvent::ampmTime( QTime tm ) { | 77 | QString DateBookEvent::ampmTime( QTime tm ) { |
74 | 78 | ||
75 | QString s; | 79 | QString s; |
76 | if( ampm ) { | 80 | if( ampm ) { |
77 | int hour = tm.hour(); | 81 | int hour = tm.hour(); |
78 | if ( hour == 0 ) { | 82 | if ( hour == 0 ) { |
@@ -89,13 +93,13 @@ QString DateBookEvent::ampmTime( QTime tm ) { | |||
89 | return s; | 93 | return s; |
90 | } | 94 | } |
91 | 95 | ||
92 | } | 96 | } |
93 | 97 | ||
94 | 98 | ||
95 | /* | 99 | /** |
96 | * starts the edit dialog as known from datebook | 100 | * starts the edit dialog as known from datebook |
97 | */ | 101 | */ |
98 | void DateBookEvent::editEventSlot( const Event &e ) { | 102 | void DateBookEvent::editEventSlot( const Event &e ) { |
99 | startDatebook(); | 103 | startDatebook(); |
100 | 104 | ||
101 | while( !QCopChannel::isRegistered( "QPE/Datebook" ) ) qApp->processEvents(); | 105 | while( !QCopChannel::isRegistered( "QPE/Datebook" ) ) qApp->processEvents(); |