author | alwin <alwin> | 2005-03-19 18:06:44 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-19 18:06:44 (UTC) |
commit | ff7fd64d755b2cc63f9944b1a17a6a2e186da0b6 (patch) (unidiff) | |
tree | 11c335300ae6e9dd55b62e5558e56a85222d3fb6 | |
parent | 93d0e2c50c24c518323d7926df37827d3b562a28 (diff) | |
download | opie-ff7fd64d755b2cc63f9944b1a17a6a2e186da0b6.zip opie-ff7fd64d755b2cc63f9944b1a17a6a2e186da0b6.tar.gz opie-ff7fd64d755b2cc63f9944b1a17a6a2e186da0b6.tar.bz2 |
hopefull speedup the weeklistview.
deleting the main widget 4 times when date changed isn't that usefull.
After 1.2 OPIE this view should completly rewritten or removed.
7 files changed, 225 insertions, 58 deletions
diff --git a/core/pim/datebook/holiday/christian/christian-holidays.pro b/core/pim/datebook/holiday/christian/christian-holidays.pro index db3c777..c943510 100644 --- a/core/pim/datebook/holiday/christian/christian-holidays.pro +++ b/core/pim/datebook/holiday/christian/christian-holidays.pro | |||
@@ -14,3 +14,3 @@ DEPENDPATH += $(OPIEDIR)/include \ | |||
14 | 14 | ||
15 | LIBS+= -lqpe -lopiecore2 -lopieui2 -opiepim2 | 15 | LIBS+= -lqpe -lopiecore2 -lopieui2 -lopiepim2 |
16 | 16 | ||
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklst.cpp b/core/pim/datebook/modules/weeklst/datebookweeklst.cpp index 47bc597..6556373 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklst.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklst.cpp | |||
@@ -29,2 +29,3 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB, | |||
29 | setFocusPolicy(StrongFocus); | 29 | setFocusPolicy(StrongFocus); |
30 | dateset = false; | ||
30 | layout = new QVBoxLayout( this ); | 31 | layout = new QVBoxLayout( this ); |
@@ -41,3 +42,3 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB, | |||
41 | 42 | ||
42 | view=NULL; | 43 | m_CurrentView=NULL; |
43 | Config config("DateBook"); | 44 | Config config("DateBook"); |
@@ -47,2 +48,3 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB, | |||
47 | } | 48 | } |
49 | |||
48 | DateBookWeekLst::~DateBookWeekLst(){ | 50 | DateBookWeekLst::~DateBookWeekLst(){ |
@@ -60,4 +62,11 @@ void DateBookWeekLst::setDbl(bool on) { | |||
60 | dbl=on; | 62 | dbl=on; |
61 | redraw(); | 63 | bool displayed = false; |
64 | if (m_CurrentView) { | ||
65 | displayed = m_CurrentView->toggleDoubleView(on); | ||
66 | } | ||
67 | if (!displayed||dbl) { | ||
68 | getEvents(); | ||
69 | } | ||
62 | } | 70 | } |
71 | |||
63 | void DateBookWeekLst::redraw() {getEvents();} | 72 | void DateBookWeekLst::redraw() {getEvents();} |
@@ -84,30 +93,40 @@ QDate DateBookWeekLst::weekDate() const | |||
84 | void DateBookWeekLst::getEvents() { | 93 | void DateBookWeekLst::getEvents() { |
94 | if (!dateset) return; | ||
85 | QDate start = weekDate(); //date(); | 95 | QDate start = weekDate(); //date(); |
86 | QDate stop = start.addDays(6); | 96 | QDate stop = start.addDays(6); |
97 | QDate start2; | ||
98 | |||
99 | |||
87 | QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop); | 100 | QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop); |
101 | QValueList<EffectiveEvent> el2; | ||
88 | 102 | ||
89 | setUpdatesEnabled(false); | ||
90 | if (view) delete view; | ||
91 | if (dbl) { | 103 | if (dbl) { |
92 | QDate start2=start.addDays(7); | 104 | start2 = start.addDays(7); |
93 | stop=start2.addDays(6); | 105 | stop = start2.addDays(6); |
94 | QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop); | 106 | el2 = db->getEffectiveEvents(start2, stop); |
95 | view=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll); | 107 | } |
108 | if (!m_CurrentView) { | ||
109 | if (dbl) { | ||
110 | m_CurrentView=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll); | ||
111 | } else { | ||
112 | m_CurrentView=new DateBookWeekLstDblView(el,start,bStartOnMonday,scroll); | ||
113 | } | ||
114 | m_CurrentView->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | ||
115 | connect (m_CurrentView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
116 | connect (m_CurrentView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
117 | connect (m_CurrentView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
118 | connect (m_CurrentView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
119 | connect (m_CurrentView, SIGNAL(redraw()), this, SLOT(redraw())); | ||
120 | connect (m_CurrentView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
121 | connect (m_CurrentView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
122 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | ||
123 | scroll->addChild(m_CurrentView); | ||
96 | } else { | 124 | } else { |
97 | view=new DateBookWeekLstView(el,start,bStartOnMonday,scroll); | 125 | if (dbl) { |
126 | m_CurrentView->setEvents(el,el2,start,bStartOnMonday); | ||
127 | } else { | ||
128 | m_CurrentView->setEvents(el,start,bStartOnMonday); | ||
129 | } | ||
98 | } | 130 | } |
99 | |||
100 | connect (view, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
101 | connect (view, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
102 | connect (view, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
103 | connect (view, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
104 | connect (view, SIGNAL(redraw()), this, SLOT(redraw())); | ||
105 | connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
106 | connect (view, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
107 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | ||
108 | |||
109 | scroll->addChild(view); | ||
110 | view->show(); | ||
111 | scroll->updateScrollBars(); | 131 | scroll->updateScrollBars(); |
112 | setUpdatesEnabled(true); | ||
113 | } | 132 | } |
@@ -115,3 +134,5 @@ void DateBookWeekLst::getEvents() { | |||
115 | void DateBookWeekLst::dateChanged(QDate &newdate) { | 134 | void DateBookWeekLst::dateChanged(QDate &newdate) { |
135 | dateset = true; | ||
116 | bdate=newdate; | 136 | bdate=newdate; |
137 | odebug << "Date changed " << oendl; | ||
117 | getEvents(); | 138 | getEvents(); |
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklst.h b/core/pim/datebook/modules/weeklst/datebookweeklst.h index 3922fa1..505810b 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklst.h +++ b/core/pim/datebook/modules/weeklst/datebookweeklst.h | |||
@@ -12,3 +12,3 @@ class DateBookWeekLstHeader; | |||
12 | class DateBookWeekLstEvent; | 12 | class DateBookWeekLstEvent; |
13 | class DateBookWeekLstView; | 13 | class DateBookWeekLstDblView; |
14 | class QVBoxLayout; | 14 | class QVBoxLayout; |
@@ -57,5 +57,6 @@ private: | |||
57 | DateBookWeekLstHeader *header; | 57 | DateBookWeekLstHeader *header; |
58 | QWidget *view; | ||
59 | QVBoxLayout *layout; | 58 | QVBoxLayout *layout; |
60 | QScrollView *scroll; | 59 | QScrollView *scroll; |
60 | DateBookWeekLstDblView*m_CurrentView; | ||
61 | bool dateset:1; | ||
61 | 62 | ||
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp index 1cea602..6389822 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp | |||
@@ -12,26 +12,116 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | |||
12 | { | 12 | { |
13 | QHBoxLayout *layout = new QHBoxLayout( this ); | 13 | m_MainLayout = new QHBoxLayout( this ); |
14 | |||
15 | DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this); | ||
16 | layout->addWidget(w); | ||
17 | connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
18 | connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
19 | connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
20 | connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
21 | connect (w, SIGNAL(redraw()), this, SIGNAL(redraw())); | ||
22 | connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
23 | connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
24 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | ||
25 | 14 | ||
15 | leftView = 0; | ||
16 | rightView = 0; | ||
17 | setEvents(ev1,ev2,d,onM); | ||
18 | } | ||
26 | 19 | ||
27 | w=new DateBookWeekLstView(ev2,d.addDays(7),onM,this); | 20 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
28 | layout->addWidget(w); | 21 | QDate &d, bool onM, |
29 | connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 22 | QWidget* parent, |
30 | connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 23 | const char* name, WFlags fl) |
31 | connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 24 | : QWidget( parent, name, fl ) |
32 | connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 25 | { |
33 | connect (w, SIGNAL(redraw()), this, SIGNAL(redraw())); | 26 | m_MainLayout = new QHBoxLayout( this ); |
34 | connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 27 | |
35 | connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 28 | leftView = 0; |
29 | rightView = 0; | ||
30 | setEvents(ev1,d,onM); | ||
31 | } | ||
32 | |||
33 | /* setting the variant with both views */ | ||
34 | void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QValueList<EffectiveEvent> &ev2,QDate &d, bool onM) | ||
35 | { | ||
36 | setUpdatesEnabled(false); | ||
37 | if (!leftView) { | ||
38 | leftView=new DateBookWeekLstView(ev1,d,onM,this); | ||
39 | m_MainLayout->addWidget(leftView); | ||
40 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
41 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
42 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
43 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
44 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); | ||
45 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
46 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
36 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | 47 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); |
48 | |||
49 | } else { | ||
50 | leftView->hide(); | ||
51 | leftView->setEvents(ev1,d,onM); | ||
52 | } | ||
53 | |||
54 | if (!rightView) { | ||
55 | rightView=new DateBookWeekLstView(ev2,d.addDays(7),onM,this); | ||
56 | m_MainLayout->addWidget(rightView); | ||
57 | connect (rightView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
58 | connect (rightView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
59 | connect (rightView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
60 | connect (rightView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
61 | connect (rightView, SIGNAL(redraw()), this, SIGNAL(redraw())); | ||
62 | connect (rightView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
63 | connect (rightView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
64 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | ||
65 | } else { | ||
66 | rightView->hide(); | ||
67 | rightView->setEvents(ev2,d.addDays(7),onM); | ||
68 | } | ||
69 | |||
70 | leftView->show(); | ||
71 | rightView->show(); | ||
72 | setUpdatesEnabled(true); | ||
73 | } | ||
74 | |||
75 | void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) | ||
76 | { | ||
77 | if (!leftView) { | ||
78 | leftView=new DateBookWeekLstView(ev1,d,onM,this); | ||
79 | m_MainLayout->addWidget(leftView); | ||
80 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
81 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
82 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
83 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
84 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); | ||
85 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
86 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
87 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | ||
88 | } else { | ||
89 | leftView->hide(); | ||
90 | leftView->setEvents(ev1,d,onM); | ||
91 | } | ||
92 | leftView->show(); | ||
93 | |||
94 | if (rightView) { | ||
95 | rightView->hide(); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | void DateBookWeekLstDblView::setRightEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) | ||
100 | { | ||
101 | if (!rightView) { | ||
102 | rightView=new DateBookWeekLstView(ev1,d,onM,this); | ||
103 | m_MainLayout->addWidget(rightView); | ||
104 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | ||
105 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | ||
106 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | ||
107 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | ||
108 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); | ||
109 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | ||
110 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | ||
111 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | ||
112 | } else { | ||
113 | rightView->hide(); | ||
114 | rightView->setEvents(ev1,d,onM); | ||
115 | } | ||
116 | rightView->show(); | ||
117 | } | ||
118 | |||
119 | bool DateBookWeekLstDblView::toggleDoubleView(bool how) | ||
120 | { | ||
121 | if (rightView) { | ||
122 | if (how) rightView->show(); | ||
123 | else rightView->hide(); | ||
124 | return true; | ||
125 | } | ||
126 | return false; | ||
37 | } | 127 | } |
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstdblview.h b/core/pim/datebook/modules/weeklst/datebookweeklstdblview.h index 57e9690..808556e 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstdblview.h +++ b/core/pim/datebook/modules/weeklst/datebookweeklstdblview.h | |||
@@ -10,2 +10,5 @@ | |||
10 | 10 | ||
11 | class DateBookWeekLstView; | ||
12 | class QHBoxLayout; | ||
13 | |||
11 | class DateBookWeekLstDblView: public QWidget { | 14 | class DateBookWeekLstDblView: public QWidget { |
@@ -18,3 +21,13 @@ public: | |||
18 | WFlags fl = 0 ); | 21 | WFlags fl = 0 ); |
22 | DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | ||
23 | QDate &d, bool onM, | ||
24 | QWidget* parent = 0, const char* name = 0, | ||
25 | WFlags fl = 0 ); | ||
19 | virtual ~DateBookWeekLstDblView(); | 26 | virtual ~DateBookWeekLstDblView(); |
27 | void setEvents(QValueList<EffectiveEvent> &ev1,QValueList<EffectiveEvent> &ev2,QDate &d, bool onM); | ||
28 | void setEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM); | ||
29 | void setRightEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM); | ||
30 | |||
31 | bool toggleDoubleView(bool how); | ||
32 | |||
20 | signals: | 33 | signals: |
@@ -28,2 +41,6 @@ signals: | |||
28 | const QString &str, const QString &location); | 41 | const QString &str, const QString &location); |
42 | |||
43 | protected: | ||
44 | QHBoxLayout*m_MainLayout; | ||
45 | DateBookWeekLstView *leftView,*rightView; | ||
29 | }; | 46 | }; |
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp index efb4c01..82b9c6d 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp | |||
@@ -19,2 +19,18 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
19 | { | 19 | { |
20 | childs.clear(); | ||
21 | m_MainLayout = new QVBoxLayout( this ); | ||
22 | setEvents(ev,d,onM); | ||
23 | } | ||
24 | |||
25 | void DateBookWeekLstView::setEvents(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM) | ||
26 | { | ||
27 | QValueList<QObject*>::Iterator wIter; | ||
28 | for (wIter=childs.begin();wIter!=childs.end();++wIter) { | ||
29 | QObject*w = (*wIter); | ||
30 | delete w; | ||
31 | } | ||
32 | childs.clear(); | ||
33 | |||
34 | setUpdatesEnabled(false); | ||
35 | // m_MainLayout->deleteAllItems(); | ||
20 | Config config("DateBook"); | 36 | Config config("DateBook"); |
@@ -28,4 +44,2 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
28 | 44 | ||
29 | QVBoxLayout *layout = new QVBoxLayout( this ); | ||
30 | |||
31 | qBubbleSort(ev); | 45 | qBubbleSort(ev); |
@@ -48,4 +62,9 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
48 | for (int i=0; i<7; i++) { | 62 | for (int i=0; i<7; i++) { |
63 | QWidget*w = new QWidget(this); | ||
64 | w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); | ||
65 | w->setPalette(white); | ||
66 | QVBoxLayout * tlayout = new QVBoxLayout(w); | ||
67 | childs.append(w); | ||
49 | // Header | 68 | // Header |
50 | DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,this); | 69 | DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,w); |
51 | connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 70 | connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); |
@@ -53,3 +72,3 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
53 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | 72 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); |
54 | layout->addWidget(hdr); | 73 | tlayout->addWidget(hdr); |
55 | 74 | ||
@@ -58,4 +77,4 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
58 | if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day. | 77 | if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day. |
59 | DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,this); | 78 | DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,w); |
60 | layout->addWidget(l); | 79 | tlayout->addWidget(l); |
61 | connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 80 | connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); |
@@ -68,6 +87,18 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
68 | } | 87 | } |
69 | layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); | 88 | tlayout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); |
89 | m_MainLayout->addWidget(w); | ||
90 | /* | ||
91 | QSpacerItem * tmp = new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding); | ||
92 | m_MainLayout->addItem(tmp); | ||
93 | */ | ||
70 | } | 94 | } |
95 | setUpdatesEnabled(true); | ||
96 | } | ||
97 | |||
98 | DateBookWeekLstView::~DateBookWeekLstView() | ||
99 | {} | ||
100 | |||
101 | void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) | ||
102 | { | ||
103 | e->ignore(); | ||
71 | } | 104 | } |
72 | DateBookWeekLstView::~DateBookWeekLstView(){} | ||
73 | void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} | ||
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstview.h b/core/pim/datebook/modules/weeklst/datebookweeklstview.h index 2428f1f..3d47842 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstview.h +++ b/core/pim/datebook/modules/weeklst/datebookweeklstview.h | |||
@@ -11,2 +11,3 @@ | |||
11 | class QKeyEvent; | 11 | class QKeyEvent; |
12 | class QVBoxLayout; | ||
12 | 13 | ||
@@ -16,6 +17,8 @@ class DateBookWeekLstView: public QWidget | |||
16 | public: | 17 | public: |
17 | DateBookWeekLstView(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM, | 18 | DateBookWeekLstView(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM, QWidget* parent = 0, const char* name = 0, |
18 | QWidget* parent = 0, const char* name = 0, | ||
19 | WFlags fl = 0 ); | 19 | WFlags fl = 0 ); |
20 | ~DateBookWeekLstView(); | 20 | ~DateBookWeekLstView(); |
21 | |||
22 | void setEvents(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM); | ||
23 | |||
21 | signals: | 24 | signals: |
@@ -29,4 +32,8 @@ signals: | |||
29 | const QString &str, const QString &location); | 32 | const QString &str, const QString &location); |
30 | private: | 33 | protected: |
31 | bool bStartOnMonday; | 34 | bool bStartOnMonday; |
35 | QValueList<QObject*> childs; | ||
36 | |||
37 | QVBoxLayout*m_MainLayout; | ||
38 | |||
32 | protected slots: | 39 | protected slots: |