Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp | 130 |
1 files changed, 110 insertions, 20 deletions
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 | |||
@@ -9,32 +9,122 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | |||
9 | QWidget* parent, | 9 | QWidget* parent, |
10 | const char* name, WFlags fl) | 10 | const char* name, WFlags fl) |
11 | : QWidget( parent, name, fl ) | 11 | : QWidget( parent, name, fl ) |
12 | { | 12 | { |
13 | QHBoxLayout *layout = new QHBoxLayout( this ); | 13 | m_MainLayout = new QHBoxLayout( this ); |
14 | 14 | ||
15 | DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this); | 15 | leftView = 0; |
16 | layout->addWidget(w); | 16 | rightView = 0; |
17 | connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 17 | setEvents(ev1,ev2,d,onM); |
18 | connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 18 | } |
19 | connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 19 | |
20 | connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 20 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
21 | connect (w, SIGNAL(redraw()), this, SIGNAL(redraw())); | 21 | QDate &d, bool onM, |
22 | connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 22 | QWidget* parent, |
23 | connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 23 | const char* name, WFlags fl) |
24 | : QWidget( parent, name, fl ) | ||
25 | { | ||
26 | m_MainLayout = new QHBoxLayout( this ); | ||
27 | |||
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&)), | ||
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&)), | ||
24 | this, 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(); | ||
25 | 93 | ||
94 | if (rightView) { | ||
95 | rightView->hide(); | ||
96 | } | ||
97 | } | ||
26 | 98 | ||
27 | w=new DateBookWeekLstView(ev2,d.addDays(7),onM,this); | 99 | void DateBookWeekLstDblView::setRightEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) |
28 | layout->addWidget(w); | 100 | { |
29 | connect (w, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 101 | if (!rightView) { |
30 | connect (w, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 102 | rightView=new DateBookWeekLstView(ev1,d,onM,this); |
31 | connect (w, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 103 | m_MainLayout->addWidget(rightView); |
32 | connect (w, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 104 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); |
33 | connect (w, SIGNAL(redraw()), this, SIGNAL(redraw())); | 105 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); |
34 | connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 106 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); |
35 | connect (w, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 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&)), | ||
36 | this, 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 | } |
38 | 128 | ||
39 | DateBookWeekLstDblView::~DateBookWeekLstDblView() | 129 | DateBookWeekLstDblView::~DateBookWeekLstDblView() |
40 | { | 130 | { |