summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Unidiff
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 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001 4 Copyright (c) 2001
5 Cornelius Schumacher <schumacher@kde.org> 5 Cornelius Schumacher <schumacher@kde.org>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <qwidgetstack.h> 26#include <qwidgetstack.h>
27 27
28#include <kconfig.h> 28#include <kconfig.h>
29#include <kglobal.h> 29#include <kglobal.h>
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#else 32#else
33#include <qapplication.h> 33#include <qapplication.h>
34#endif 34#endif
35#include "calendarview.h" 35#include "calendarview.h"
36#include "datenavigator.h" 36#include "datenavigator.h"
37#include "kotodoview.h" 37#include "kotodoview.h"
38#include "koagendaview.h" 38#include "koagendaview.h"
39#include "kodialogmanager.h" 39#include "kodialogmanager.h"
40#include "komonthview.h" 40#include "komonthview.h"
41#include "kolistview.h" 41#include "kolistview.h"
42#include "kowhatsnextview.h" 42#include "kowhatsnextview.h"
43#include "kojournalview.h" 43#include "kojournalview.h"
44#include "kotimespanview.h" 44#include "kotimespanview.h"
45#include "koprefs.h" 45#include "koprefs.h"
46#include "navigatorbar.h" 46#include "navigatorbar.h"
47 47
48#include "koviewmanager.h" 48#include "koviewmanager.h"
49#include "koviewmanager.moc"
50//extern bool externFlagMonthviewBlockPainting; 49//extern bool externFlagMonthviewBlockPainting;
51 50
52//bool globalFlagBlockPainting = false; 51//bool globalFlagBlockPainting = false;
53int globalFlagBlockAgenda = 0; 52int globalFlagBlockAgenda = 0;
54int globalFlagBlockLabel = 0; 53int globalFlagBlockLabel = 0;
55int globalFlagBlockAgendaItemPaint = 1; 54int globalFlagBlockAgendaItemPaint = 1;
56int globalFlagBlockAgendaItemUpdate = 1; 55int globalFlagBlockAgendaItemUpdate = 1;
57 56
58 57
59KOViewManager::KOViewManager( CalendarView *mainView ) : 58KOViewManager::KOViewManager( CalendarView *mainView ) :
60 QObject(), mMainView( mainView ) 59 QObject(), mMainView( mainView )
61{ 60{
62 mCurrentView = 0; 61 mCurrentView = 0;
63 62
64 mWhatsNextView = 0; 63 mWhatsNextView = 0;
65 mTodoView = 0; 64 mTodoView = 0;
66 mAgendaView = 0; 65 mAgendaView = 0;
67 mMonthView = 0; 66 mMonthView = 0;
68 mListView = 0; 67 mListView = 0;
69 mJournalView = 0; 68 mJournalView = 0;
70 mTimeSpanView = 0; 69 mTimeSpanView = 0;
71 mCurrentAgendaView = 0 ; 70 mCurrentAgendaView = 0 ;
72 mFlagShowNextxDays = false; 71 mFlagShowNextxDays = false;
73} 72}
74 73
75KOViewManager::~KOViewManager() 74KOViewManager::~KOViewManager()
76{ 75{
77} 76}
78 77
79 78
80KOrg::BaseView *KOViewManager::currentView() 79KOrg::BaseView *KOViewManager::currentView()
81{ 80{
82 return mCurrentView; 81 return mCurrentView;
83} 82}
84 83
85void KOViewManager::readSettings(KConfig *config) 84void KOViewManager::readSettings(KConfig *config)
86{ 85{
87 config->setGroup("General"); 86 config->setGroup("General");
88 QString view = config->readEntry("Current View"); 87 QString view = config->readEntry("Current View");
89 if (view == "WhatsNext") showWhatsNextView(); 88 if (view == "WhatsNext") showWhatsNextView();
90 else if (view == "Month") showMonthView(); 89 else if (view == "Month") showMonthView();
91 else if (view == "List") showListView(); 90 else if (view == "List") showListView();
92 else if (view == "Journal") showJournalView(); 91 else if (view == "Journal") showJournalView();
93 else if (view == "TimeSpan") showTimeSpanView(); 92 else if (view == "TimeSpan") showTimeSpanView();
94 else if (view == "Todo") showTodoView(); 93 else if (view == "Todo") showTodoView();
95 else { 94 else {
96 showAgendaView(); 95 showAgendaView();
97 } 96 }
98} 97}
99 98
100void KOViewManager::writeSettings(KConfig *config) 99void KOViewManager::writeSettings(KConfig *config)
101{ 100{
102 config->setGroup("General"); 101 config->setGroup("General");
103 102
104 QString view; 103 QString view;
105 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 104 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
106 else if (mCurrentView == mMonthView) view = "Month"; 105 else if (mCurrentView == mMonthView) view = "Month";
107 else if (mCurrentView == mListView) view = "List"; 106 else if (mCurrentView == mListView) view = "List";
108 else if (mCurrentView == mJournalView) view = "Journal"; 107 else if (mCurrentView == mJournalView) view = "Journal";
109 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 108 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
110 else if (mCurrentView == mTodoView) view = "Todo"; 109 else if (mCurrentView == mTodoView) view = "Todo";
111 else view = "Agenda"; 110 else view = "Agenda";
112 111
113 config->writeEntry("Current View",view); 112 config->writeEntry("Current View",view);
114 113
115 if (mAgendaView) { 114 if (mAgendaView) {
116 mAgendaView->writeSettings(config); 115 mAgendaView->writeSettings(config);
117 } 116 }
118 if (mTimeSpanView) { 117 if (mTimeSpanView) {
119 mTimeSpanView->writeSettings(config); 118 mTimeSpanView->writeSettings(config);
120 } 119 }
121 if (mListView) { 120 if (mListView) {
122 mListView->writeSettings(config); 121 mListView->writeSettings(config);
123 } 122 }
124 if (mTodoView) { 123 if (mTodoView) {
125 mTodoView->saveLayout(config,"Todo View"); 124 mTodoView->saveLayout(config,"Todo View");
126 } 125 }
127} 126}
128 127
129void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 128void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
130{ 129{
131 130
132 //mFlagShowNextxDays = false; 131 //mFlagShowNextxDays = false;
133 //if(view == mCurrentView) return; 132 //if(view == mCurrentView) return;
134 if ( view == 0 ) { 133 if ( view == 0 ) {
135 view = mCurrentView; 134 view = mCurrentView;
136 if ( view == 0 ) 135 if ( view == 0 )
137 return; 136 return;
138 } 137 }
139 bool full = fullScreen; 138 bool full = fullScreen;
140 if(view == mCurrentView && view != mWhatsNextView ) { 139 if(view == mCurrentView && view != mWhatsNextView ) {
141 if ( mCurrentAgendaView < 0 ) 140 if ( mCurrentAgendaView < 0 )
142 return; 141 return;
143 full = mMainView->leftFrame()->isVisible(); 142 full = mMainView->leftFrame()->isVisible();
144 } else { 143 } else {
145 mCurrentView = view; 144 mCurrentView = view;