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.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 88d69c6..fc2bc77 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -1,145 +1,144 @@
/*
This file is part of KOrganizer.
Copyright (c) 2001
Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qwidgetstack.h>
#include <kconfig.h>
#include <kglobal.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#include "calendarview.h"
#include "datenavigator.h"
#include "kotodoview.h"
#include "koagendaview.h"
#include "kodialogmanager.h"
#include "komonthview.h"
#include "kolistview.h"
#include "kowhatsnextview.h"
#include "kojournalview.h"
#include "kotimespanview.h"
#include "koprefs.h"
#include "navigatorbar.h"
#include "koviewmanager.h"
-#include "koviewmanager.moc"
//extern bool externFlagMonthviewBlockPainting;
//bool globalFlagBlockPainting = false;
int globalFlagBlockAgenda = 0;
int globalFlagBlockLabel = 0;
int globalFlagBlockAgendaItemPaint = 1;
int globalFlagBlockAgendaItemUpdate = 1;
KOViewManager::KOViewManager( CalendarView *mainView ) :
QObject(), mMainView( mainView )
{
mCurrentView = 0;
mWhatsNextView = 0;
mTodoView = 0;
mAgendaView = 0;
mMonthView = 0;
mListView = 0;
mJournalView = 0;
mTimeSpanView = 0;
mCurrentAgendaView = 0 ;
mFlagShowNextxDays = false;
}
KOViewManager::~KOViewManager()
{
}
KOrg::BaseView *KOViewManager::currentView()
{
return mCurrentView;
}
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::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) {
mAgendaView->writeSettings(config);
}
if (mTimeSpanView) {
mTimeSpanView->writeSettings(config);
}
if (mListView) {
mListView->writeSettings(config);
}
if (mTodoView) {
mTodoView->saveLayout(config,"Todo View");
}
}
void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
{
//mFlagShowNextxDays = false;
//if(view == mCurrentView) return;
if ( view == 0 ) {
view = mCurrentView;
if ( view == 0 )
return;
}
bool full = fullScreen;
if(view == mCurrentView && view != mWhatsNextView ) {
if ( mCurrentAgendaView < 0 )
return;
full = mMainView->leftFrame()->isVisible();
} else {
mCurrentView = view;