summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a88276e..6da4799 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -85,32 +85,80 @@ KOrg::BaseView *KOViewManager::currentView()
void KOViewManager::readSettings(KConfig *config)
{
config->setGroup("General");
QString view = config->readEntry("Current View");
if (view == "WhatsNext") showWhatsNextView();
else if (view == "Month") showMonthView();
else if (view == "List") showListView();
else if (view == "Journal") showJournalView();
else if (view == "TimeSpan") showTimeSpanView();
else if (view == "Todo") showTodoView();
else {
showAgendaView();
}
}
+
+void KOViewManager::showDateView( int view, QDate date)
+{
+
+ qDebug("date %d %s", view, date.toString().latin1());
+#if 0
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
+#endif
+ if ( view == 3 ) {
+ mMainView->showDay( date );
+ } else if (view == 4 ) {
+ mMainView->dateNavigator()->selectDates( date, 7 );
+ } else if (view == 5 ) {
+ mMainView->dateNavigator()->selectDates( date, 14);
+ } else if (view == 6 ) {
+ showMonthView();
+ mMainView->dateNavigator()->selectMonthByDate( date );
+ mMainView->dateNavigator()->selectDate( date );
+ } else if (view == 7 ) {
+ mMainView->dateNavigator()->selectDate( date );
+ showJournalView();
+ } else if (view == 8 ) {
+ globalFlagBlockAgenda = 1;
+ if ( mCurrentAgendaView != 3 )
+ mCurrentAgendaView = -1;
+ showAgendaView(KOPrefs::instance()->mFullViewMonth);
+ globalFlagBlockAgenda = 2;
+ mMainView->dateNavigator()->selectDates( date ,
+ KOPrefs::instance()->mNextXDays );
+ mFlagShowNextxDays = true;
+ mCurrentAgendaView = 3 ;
+ }
+
+#if 0
+ dateNavigator()->blockSignals( true );
+ dateNavigator()->selectDate( d );
+ dateNavigator()->blockSignals( false );
+ mViewManager->showDayView();
+#endif
+
+}
+
+
+
void KOViewManager::writeSettings(KConfig *config)
{
config->setGroup("General");
QString view;
if (mCurrentView == mWhatsNextView) view = "WhatsNext";
else if (mCurrentView == mMonthView) view = "Month";
else if (mCurrentView == mListView) view = "List";
else if (mCurrentView == mJournalView) view = "Journal";
else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
else if (mCurrentView == mTodoView) view = "Todo";
else view = "Agenda";
config->writeEntry("Current View",view);
if (mAgendaView) {
@@ -295,33 +343,33 @@ void KOViewManager::showAgendaView( bool fullScreen )
mMainView->dialogManager()->hideSearchDialog();
// qDebug("KOViewManager::showAgendaView ");
bool full;
full = fullScreen;
if (!mAgendaView) {
full = false;
mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
addView(mAgendaView);
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
#endif
connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
// SIGNALS/SLOTS FOR DAY/WEEK VIEW
-
+ connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
mMainView, SLOT(newEvent(QDateTime)));
connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
mMainView, SLOT(newEvent(QDateTime,QDateTime)));
connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
mMainView, SLOT(newEvent(QDate)));
connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
mMainView, SLOT(editIncidence(Incidence *)));
connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
mMainView, SLOT(showIncidence(Incidence *)));
connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
mMainView, SLOT(deleteIncidence(Incidence *)));