Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

datebookweeklstdblview.cpp

Go to the documentation of this file.
00001 #include "datebookweeklstdblview.h"
00002 #include "datebookweeklstview.h"
00003 
00004 #include <qlayout.h>
00005 
00006 DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
00007                            QValueList<EffectiveEvent> &ev2,
00008                            QDate &d, bool onM,
00009                            QWidget* parent,
00010                            const char* name, WFlags fl)
00011     : QWidget( parent, name, fl )
00012 {
00013     m_MainLayout = new QHBoxLayout( this );
00014 
00015     leftView = 0;
00016     rightView = 0;
00017     setEvents(ev1,ev2,d,onM);
00018 }
00019 
00020 DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
00021                            QDate &d, bool onM,
00022                            QWidget* parent,
00023                            const char* name, WFlags fl)
00024     : QWidget( parent, name, fl )
00025 {
00026     m_MainLayout = new QHBoxLayout( this );
00027 
00028     leftView = 0;
00029     rightView = 0;
00030     setEvents(ev1,d,onM);
00031 }
00032 
00033 /* setting the variant with both views */
00034 void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QValueList<EffectiveEvent> &ev2,QDate &d, bool onM)
00035 {
00036     setUpdatesEnabled(false);
00037     if (!leftView) {
00038         leftView=new DateBookWeekLstView(ev1,d,onM,this);
00039         m_MainLayout->addWidget(leftView);
00040         connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
00041         connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
00042         connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
00043         connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
00044         connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw()));
00045         connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
00046         connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
00047         this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
00048 
00049     } else {
00050         leftView->hide();
00051         leftView->setEvents(ev1,d,onM);
00052     }
00053 
00054     if (!rightView) {
00055         rightView=new DateBookWeekLstView(ev2,d.addDays(7),onM,this);
00056         m_MainLayout->addWidget(rightView);
00057         connect (rightView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
00058         connect (rightView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
00059         connect (rightView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
00060         connect (rightView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
00061         connect (rightView, SIGNAL(redraw()), this, SIGNAL(redraw()));
00062         connect (rightView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
00063         connect (rightView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
00064             this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
00065     } else {
00066         rightView->hide();
00067         rightView->setEvents(ev2,d.addDays(7),onM);
00068     }
00069 
00070     leftView->show();
00071     rightView->show();
00072     setUpdatesEnabled(true);
00073 }
00074 
00075 void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM)
00076 {
00077     if (!leftView) {
00078         leftView=new DateBookWeekLstView(ev1,d,onM,this);
00079         m_MainLayout->addWidget(leftView);
00080         connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
00081         connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
00082         connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
00083         connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
00084         connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw()));
00085         connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
00086         connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
00087             this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
00088     } else {
00089         leftView->hide();
00090         leftView->setEvents(ev1,d,onM);
00091     }
00092     leftView->show();
00093 
00094     if (rightView) {
00095         rightView->hide();
00096     }
00097 }
00098 
00099 void DateBookWeekLstDblView::setRightEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM)
00100 {
00101     if (!rightView) {
00102         rightView=new DateBookWeekLstView(ev1,d,onM,this);
00103         m_MainLayout->addWidget(rightView);
00104         connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
00105         connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
00106         connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
00107         connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
00108         connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw()));
00109         connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
00110         connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
00111             this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
00112     } else {
00113         rightView->hide();
00114         rightView->setEvents(ev1,d,onM);
00115     }
00116     rightView->show();
00117 }
00118 
00119 bool DateBookWeekLstDblView::toggleDoubleView(bool how)
00120 {
00121     if (rightView) {
00122         if (how) rightView->show();
00123         else rightView->hide();
00124         return true;
00125     }
00126     return false;
00127 }
00128 
00129 DateBookWeekLstDblView::~DateBookWeekLstDblView()
00130 {
00131 }

Generated on Sat Nov 5 16:15:49 2005 for OPIE by  doxygen 1.4.2