author | alwin <alwin> | 2005-03-16 13:14:26 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-16 13:14:26 (UTC) |
commit | 3d43b9e40e562957e1a3fcbe9268634db45951ce (patch) (unidiff) | |
tree | 637f67a6768f6a90e7834b96100f6c70bb66950b /core/pim/datebook/datebookdayallday.cpp | |
parent | 4fef85eb55dbef5f8546caee084e4f0ce51081d3 (diff) | |
download | opie-3d43b9e40e562957e1a3fcbe9268634db45951ce.zip opie-3d43b9e40e562957e1a3fcbe9268634db45951ce.tar.gz opie-3d43b9e40e562957e1a3fcbe9268634db45951ce.tar.bz2 |
ho.
in dayview a holiday will displayed (if plugin found)
generated a straight forward dummy-holiday-plugin for testing the
stuff.
Diffstat (limited to 'core/pim/datebook/datebookdayallday.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookdayallday.cpp | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/core/pim/datebook/datebookdayallday.cpp b/core/pim/datebook/datebookdayallday.cpp index a0aefd3..3c3f482 100644 --- a/core/pim/datebook/datebookdayallday.cpp +++ b/core/pim/datebook/datebookdayallday.cpp | |||
@@ -66,6 +66,20 @@ DatebookAlldayDisp* DatebookdayAllday::addEvent(const EffectiveEvent&ev) | |||
66 | return lb; | 66 | return lb; |
67 | } | 67 | } |
68 | 68 | ||
69 | DatebookAlldayDisp* DatebookdayAllday::addHoliday(const QString&e) | ||
70 | { | ||
71 | DatebookAlldayDisp * lb; | ||
72 | lb = new DatebookAlldayDisp(e,m_MainFrame,NULL); | ||
73 | lb->show(); | ||
74 | datebookdayalldayLayout->addWidget(lb); | ||
75 | subWidgets.append(lb); | ||
76 | |||
77 | connect(lb,SIGNAL(displayMe(const Event&)),lblDesc,SLOT(disp_event(const Event&))); | ||
78 | ++item_count; | ||
79 | |||
80 | return lb; | ||
81 | } | ||
82 | |||
69 | void DatebookdayAllday::removeAllEvents() | 83 | void DatebookdayAllday::removeAllEvents() |
70 | { | 84 | { |
71 | subWidgets.clear(); | 85 | subWidgets.clear(); |
@@ -85,6 +99,26 @@ DatebookAlldayDisp::DatebookAlldayDisp(DateBookDB *db,const EffectiveEvent& ev, | |||
85 | int s = QFontMetrics(font()).height()+4; | 99 | int s = QFontMetrics(font()).height()+4; |
86 | setMaximumHeight( s ); | 100 | setMaximumHeight( s ); |
87 | setMinimumSize( QSize( 0, s ) ); | 101 | setMinimumSize( QSize( 0, s ) ); |
102 | m_holiday = false; | ||
103 | } | ||
104 | |||
105 | DatebookAlldayDisp::DatebookAlldayDisp(const QString&aholiday,QWidget* parent,const char* name, WFlags fl) | ||
106 | : QLabel(parent,name,fl),m_Ev(),dateBook(0) | ||
107 | { | ||
108 | QString strDesc = aholiday; | ||
109 | strDesc = strDesc.replace(QRegExp("<"),"<"); | ||
110 | Event ev; | ||
111 | ev.setDescription(strDesc); | ||
112 | ev.setAllDay(true); | ||
113 | m_Ev.setEvent(ev); | ||
114 | setBackgroundColor(yellow); | ||
115 | setText(strDesc); | ||
116 | setFrameStyle(QFrame::Raised|QFrame::Panel); | ||
117 | |||
118 | int s = QFontMetrics(font()).height()+4; | ||
119 | setMaximumHeight( s ); | ||
120 | setMinimumSize( QSize( 0, s ) ); | ||
121 | m_holiday = true; | ||
88 | } | 122 | } |
89 | 123 | ||
90 | DatebookAlldayDisp::~DatebookAlldayDisp() | 124 | DatebookAlldayDisp::~DatebookAlldayDisp() |
@@ -93,6 +127,7 @@ DatebookAlldayDisp::~DatebookAlldayDisp() | |||
93 | 127 | ||
94 | void DatebookAlldayDisp::beam_single_event() | 128 | void DatebookAlldayDisp::beam_single_event() |
95 | { | 129 | { |
130 | if (m_holiday) return; | ||
96 | // create an Event and beam it... | 131 | // create an Event and beam it... |
97 | /* | 132 | /* |
98 | * Start with the easy stuff. If start and end date is the same we can just use | 133 | * Start with the easy stuff. If start and end date is the same we can just use |
@@ -151,11 +186,13 @@ void DatebookAlldayDisp::mousePressEvent(QMouseEvent*e) | |||
151 | setBackgroundColor(green); | 186 | setBackgroundColor(green); |
152 | update(); | 187 | update(); |
153 | QPopupMenu m; | 188 | QPopupMenu m; |
154 | m.insertItem( DateBookDayWidget::tr( "Edit" ), 1 ); | 189 | if (!m_holiday) { |
155 | m.insertItem( DateBookDayWidget::tr( "Duplicate" ), 4 ); | 190 | m.insertItem( DateBookDayWidget::tr( "Edit" ), 1 ); |
156 | m.insertItem( DateBookDayWidget::tr( "Delete" ), 2 ); | 191 | m.insertItem( DateBookDayWidget::tr( "Duplicate" ), 4 ); |
157 | if(Ir::supported()) m.insertItem( DateBookDayWidget::tr( "Beam" ), 3 ); | 192 | m.insertItem( DateBookDayWidget::tr( "Delete" ), 2 ); |
158 | if(Ir::supported() && m_Ev.event().doRepeat() ) m.insertItem( DateBookDayWidget::tr( "Beam this occurence"), 5 ); | 193 | if(Ir::supported()) m.insertItem( DateBookDayWidget::tr( "Beam" ), 3 ); |
194 | if(Ir::supported() && m_Ev.event().doRepeat() ) m.insertItem( DateBookDayWidget::tr( "Beam this occurence"), 5 ); | ||
195 | } | ||
159 | m.insertItem( tr( "Info"),6); | 196 | m.insertItem( tr( "Info"),6); |
160 | int r = m.exec( e->globalPos() ); | 197 | int r = m.exec( e->globalPos() ); |
161 | setBackgroundColor(b); | 198 | setBackgroundColor(b); |