<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US"> <head> <title>korganizer: calendarview.cpp Source File (korganizer)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> <style type="text/css"> <!-- hr { display: none; } #content h2 { margin-left: 0px; } table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; } td.mdRow { padding: 8px 20px; } td.md { font-weight: bold; } td.mdname1 { font-weight: bold; color: #602020; } td.mdname { font-weight: bold; color: #602020; } --> </style> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <img id="nav_header_logo_right" alt="" align="right" src="../../pimlogo.png" border="0" /> <div id="nav_header_title" align="left">KDE PIM API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_left" style="text-align: left;"> / <a href="../../">API Reference</a> / <a href=".">korganizer</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <h2><a name="content"></a>korganizer</h2> <!-- Generated by Doxygen 1.5.5 --> <h1>calendarview.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> This file is part of KOrganizer.</span> <a name="l00003"></a>00003 <span class="comment"></span> <a name="l00004"></a>00004 <span class="comment"> Copyright (c) 1997, 1998, 1999</span> <a name="l00005"></a>00005 <span class="comment"> Preston Brown (preston.brown@yale.edu)</span> <a name="l00006"></a>00006 <span class="comment"> Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)</span> <a name="l00007"></a>00007 <span class="comment"> Ian Dawes (iadawes@globalserve.net)</span> <a name="l00008"></a>00008 <span class="comment"> Laszlo Boloni (boloni@cs.purdue.edu)</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> Copyright (c) 2000, 2001, 2002, 2003, 2004</span> <a name="l00011"></a>00011 <span class="comment"> Cornelius Schumacher <schumacher@kde.org></span> <a name="l00012"></a>00012 <span class="comment"> Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com></span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment"> This program is free software; you can redistribute it and/or modify</span> <a name="l00015"></a>00015 <span class="comment"> it under the terms of the GNU General Public License as published by</span> <a name="l00016"></a>00016 <span class="comment"> the Free Software Foundation; either version 2 of the License, or</span> <a name="l00017"></a>00017 <span class="comment"> (at your option) any later version.</span> <a name="l00018"></a>00018 <span class="comment"></span> <a name="l00019"></a>00019 <span class="comment"> This program is distributed in the hope that it will be useful,</span> <a name="l00020"></a>00020 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00021"></a>00021 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00022"></a>00022 <span class="comment"> GNU General Public License for more details.</span> <a name="l00023"></a>00023 <span class="comment"></span> <a name="l00024"></a>00024 <span class="comment"> You should have received a copy of the GNU General Public License</span> <a name="l00025"></a>00025 <span class="comment"> along with this program; if not, write to the Free Software</span> <a name="l00026"></a>00026 <span class="comment"> Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</span> <a name="l00027"></a>00027 <span class="comment"></span> <a name="l00028"></a>00028 <span class="comment"> As a special exception, permission is given to link this program</span> <a name="l00029"></a>00029 <span class="comment"> with any edition of Qt, and distribute the resulting executable,</span> <a name="l00030"></a>00030 <span class="comment"> without including the source code for Qt in the source distribution.</span> <a name="l00031"></a>00031 <span class="comment">*/</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="preprocessor">#include "calendarview.h"</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="preprocessor">#ifndef KORG_NOPRINTER</span> <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#include "calprinter.h"</span> <a name="l00037"></a>00037 <span class="preprocessor">#endif</span> <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#include "koeventeditor.h"</span> <a name="l00039"></a>00039 <span class="preprocessor">#include "kotodoeditor.h"</span> <a name="l00040"></a>00040 <span class="preprocessor">#include "kojournaleditor.h"</span> <a name="l00041"></a>00041 <span class="preprocessor">#include "koprefs.h"</span> <a name="l00042"></a>00042 <span class="preprocessor">#include "koeventviewerdialog.h"</span> <a name="l00043"></a>00043 <span class="preprocessor">#include "publishdialog.h"</span> <a name="l00044"></a>00044 <span class="preprocessor">#include "koglobals.h"</span> <a name="l00045"></a>00045 <span class="preprocessor">#include "koviewmanager.h"</span> <a name="l00046"></a>00046 <span class="preprocessor">#include "koagendaview.h"</span> <a name="l00047"></a>00047 <span class="preprocessor">#include "kodialogmanager.h"</span> <a name="l00048"></a>00048 <span class="preprocessor">#include "statusdialog.h"</span> <a name="l00049"></a>00049 <span class="preprocessor">#include "datenavigatorcontainer.h"</span> <a name="l00050"></a>00050 <span class="preprocessor">#include "kotodoview.h"</span> <a name="l00051"></a>00051 <span class="preprocessor">#include "datenavigator.h"</span> <a name="l00052"></a>00052 <span class="preprocessor">#include "resourceview.h"</span> <a name="l00053"></a>00053 <span class="preprocessor">#include "navigatorbar.h"</span> <a name="l00054"></a>00054 <span class="preprocessor">#include "history.h"</span> <a name="l00055"></a>00055 <span class="preprocessor">#include "kogroupware.h"</span> <a name="l00056"></a>00056 <span class="preprocessor">#include "freebusymanager.h"</span> <a name="l00057"></a>00057 <span class="preprocessor">#include "komonthview.h"</span> <a name="l00058"></a>00058 <span class="preprocessor">#include "datechecker.h"</span> <a name="l00059"></a>00059 <span class="preprocessor">#include "komessagebox.h"</span> <a name="l00060"></a>00060 <span class="preprocessor">#include "exportwebdialog.h"</span> <a name="l00061"></a>00061 <span class="preprocessor">#include "kocorehelper.h"</span> <a name="l00062"></a>00062 <span class="preprocessor">#include "incidencechanger.h"</span> <a name="l00063"></a>00063 <span class="preprocessor">#include "kholidays.h"</span> <a name="l00064"></a>00064 <span class="preprocessor">#include "mailscheduler.h"</span> <a name="l00065"></a>00065 <span class="preprocessor">#include "komailclient.h"</span> <a name="l00066"></a>00066 <span class="preprocessor">#include "multiagendaview.h"</span> <a name="l00067"></a>00067 <a name="l00068"></a>00068 <span class="preprocessor">#include <libkcal/vcaldrag.h></span> <a name="l00069"></a>00069 <span class="preprocessor">#include <libkcal/icaldrag.h></span> <a name="l00070"></a>00070 <span class="preprocessor">#include <libkcal/icalformat.h></span> <a name="l00071"></a>00071 <span class="preprocessor">#include <libkcal/vcalformat.h></span> <a name="l00072"></a>00072 <span class="preprocessor">#include <libkcal/scheduler.h></span> <a name="l00073"></a>00073 <span class="preprocessor">#include <libkcal/calendarlocal.h></span> <a name="l00074"></a>00074 <span class="preprocessor">#include <libkcal/journal.h></span> <a name="l00075"></a>00075 <span class="preprocessor">#include <libkcal/calfilter.h></span> <a name="l00076"></a>00076 <span class="preprocessor">#include <libkcal/attendee.h></span> <a name="l00077"></a>00077 <span class="preprocessor">#include <libkcal/dndfactory.h></span> <a name="l00078"></a>00078 <span class="preprocessor">#include <libkcal/freebusy.h></span> <a name="l00079"></a>00079 <span class="preprocessor">#include <libkcal/filestorage.h></span> <a name="l00080"></a>00080 <span class="preprocessor">#include <<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/calendarresources_8h.html">libkcal/calendarresources.h</a>></span> <a name="l00081"></a>00081 <span class="preprocessor">#include <libkcal/calendarnull.h></span> <a name="l00082"></a>00082 <span class="preprocessor">#include <libkcal/htmlexportsettings.h></span> <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="preprocessor">#include <kglobal.h></span> <a name="l00085"></a>00085 <span class="preprocessor">#include <kdebug.h></span> <a name="l00086"></a>00086 <span class="preprocessor">#include <kstandarddirs.h></span> <a name="l00087"></a>00087 <span class="preprocessor">#include <kfiledialog.h></span> <a name="l00088"></a>00088 <span class="preprocessor">#include <kmessagebox.h></span> <a name="l00089"></a>00089 <span class="preprocessor">#include <knotifyclient.h></span> <a name="l00090"></a>00090 <span class="preprocessor">#include <kconfig.h></span> <a name="l00091"></a>00091 <span class="preprocessor">#include <krun.h></span> <a name="l00092"></a>00092 <span class="preprocessor">#include <kdirwatch.h></span> <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="preprocessor">#include <qapplication.h></span> <a name="l00095"></a>00095 <span class="preprocessor">#include <qclipboard.h></span> <a name="l00096"></a>00096 <span class="preprocessor">#include <qcursor.h></span> <a name="l00097"></a>00097 <span class="preprocessor">#include <qmultilineedit.h></span> <a name="l00098"></a>00098 <span class="preprocessor">#include <qtimer.h></span> <a name="l00099"></a>00099 <span class="preprocessor">#include <qwidgetstack.h></span> <a name="l00100"></a>00100 <span class="preprocessor">#include <qptrlist.h></span> <a name="l00101"></a>00101 <span class="preprocessor">#include <qfile.h></span> <a name="l00102"></a>00102 <span class="preprocessor">#include <qlayout.h></span> <a name="l00103"></a>00103 <span class="preprocessor">#ifndef KORG_NOSPLITTER</span> <a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#include <qsplitter.h></span> <a name="l00105"></a>00105 <span class="preprocessor">#endif</span> <a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#include <qvbox.h></span> <a name="l00107"></a>00107 <span class="preprocessor">#include <qwhatsthis.h></span> <a name="l00108"></a>00108 <a name="l00109"></a>00109 <span class="preprocessor">#include <stdlib.h></span> <a name="l00110"></a>00110 <span class="preprocessor">#include <assert.h></span> <a name="l00111"></a>00111 <a name="l00112"></a>00112 <span class="keyword">using namespace </span>KOrg; <a name="l00113"></a>00113 <a name="l00114"></a><a class="code" href="classCalendarView.html#c64a34e0c6d323b0059d85c4cd63a048">00114</a> <a class="code" href="classCalendarView.html#c64a34e0c6d323b0059d85c4cd63a048" title="Constructs a new calendar view widget.">CalendarView::CalendarView</a>( QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name ) <a name="l00115"></a>00115 : <a class="code" href="classKOrg_1_1CalendarViewBase.html" title="interface for main calendar view widget">CalendarViewBase</a>( parent, name ), <a name="l00116"></a>00116 mHistory( 0 ), <a name="l00117"></a>00117 mCalendar( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalendarNull.html">CalendarNull</a>::self() ), <a name="l00118"></a>00118 mChanger( 0 ) <a name="l00119"></a>00119 { <a name="l00120"></a>00120 kdDebug(5850) << <span class="stringliteral">"CalendarView::CalendarView( Calendar )"</span> << endl; <a name="l00121"></a>00121 <a name="l00122"></a>00122 mViewManager = <span class="keyword">new</span> <a class="code" href="classKOViewManager.html" title="This class manages the views of the calendar.">KOViewManager</a>( <span class="keyword">this</span> ); <a name="l00123"></a>00123 mDialogManager = <span class="keyword">new</span> <a class="code" href="classKODialogManager.html" title="This class manages the dialogs used by the calendar view.">KODialogManager</a>( <span class="keyword">this</span> ); <a name="l00124"></a>00124 <a name="l00125"></a>00125 mModified = <span class="keyword">false</span>; <a name="l00126"></a>00126 mReadOnly = <span class="keyword">false</span>; <a name="l00127"></a>00127 mSelectedIncidence = 0; <a name="l00128"></a>00128 <a name="l00129"></a>00129 mFilters.setAutoDelete( <span class="keyword">true</span> ); <a name="l00130"></a>00130 <a name="l00131"></a>00131 mExtensions.setAutoDelete( <span class="keyword">true</span> ); <a name="l00132"></a>00132 <a name="l00133"></a>00133 mNavigator = <span class="keyword">new</span> <a class="code" href="classDateNavigator.html" title="This class controls date navigation.">DateNavigator</a>( <span class="keyword">this</span> ); <a name="l00134"></a>00134 mDateChecker = <span class="keyword">new</span> DateChecker( <span class="keyword">this</span> ); <a name="l00135"></a>00135 <a name="l00136"></a>00136 QBoxLayout *topLayout = <span class="keyword">new</span> QVBoxLayout( <span class="keyword">this</span> ); <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="preprocessor">#ifndef KORG_NOSPLITTER</span> <a name="l00139"></a>00139 <span class="preprocessor"></span> <span class="comment">// create the main layout frames.</span> <a name="l00140"></a>00140 mPanner = <span class="keyword">new</span> QSplitter( QSplitter::Horizontal, <span class="keyword">this</span>, <a name="l00141"></a>00141 <span class="stringliteral">"CalendarView::Panner"</span> ); <a name="l00142"></a>00142 topLayout->addWidget( mPanner ); <a name="l00143"></a>00143 <a name="l00144"></a>00144 mLeftSplitter = <span class="keyword">new</span> QSplitter( QSplitter::Vertical, mPanner, <a name="l00145"></a>00145 <span class="stringliteral">"CalendarView::LeftFrame"</span> ); <a name="l00146"></a>00146 <span class="comment">// mPanner->setResizeMode( mLeftSplitter, QSplitter::Stretch );</span> <a name="l00147"></a>00147 <a name="l00148"></a>00148 mDateNavigator = <span class="keyword">new</span> DateNavigatorContainer( mLeftSplitter, <a name="l00149"></a>00149 <span class="stringliteral">"CalendarView::DateNavigator"</span> ); <a name="l00150"></a>00150 <a name="l00151"></a>00151 <span class="comment">// mLeftSplitter->setResizeMode( mDateNavigator, QSplitter::Stretch );</span> <a name="l00152"></a>00152 mLeftSplitter->setCollapsible( mDateNavigator, <span class="keyword">true</span> ); <a name="l00153"></a>00153 mTodoList = <span class="keyword">new</span> <a class="code" href="classKOTodoView.html" title="This class provides a multi-column list view of todo events.">KOTodoView</a>( CalendarNull::self(), mLeftSplitter, <span class="stringliteral">"todolist"</span> ); <a name="l00154"></a>00154 <a name="l00155"></a>00155 mEventViewer = <span class="keyword">new</span> <a class="code" href="classKOEventViewer.html" title="Viewer widget for events.">KOEventViewer</a>( mLeftSplitter,<span class="stringliteral">"EventViewer"</span> ); <a name="l00156"></a>00156 <a name="l00157"></a>00157 QVBox *rightBox = <span class="keyword">new</span> QVBox( mPanner ); <a name="l00158"></a>00158 mNavigatorBar = <span class="keyword">new</span> NavigatorBar( rightBox ); <a name="l00159"></a>00159 mRightFrame = <span class="keyword">new</span> QWidgetStack( rightBox ); <a name="l00160"></a>00160 rightBox->setStretchFactor( mRightFrame, 1 ); <a name="l00161"></a>00161 <a name="l00162"></a>00162 mLeftFrame = mLeftSplitter; <a name="l00163"></a>00163 <span class="preprocessor">#else</span> <a name="l00164"></a>00164 <span class="preprocessor"></span> QWidget *mainBox; <a name="l00165"></a>00165 QWidget *leftFrame; <a name="l00166"></a>00166 <a name="l00167"></a>00167 <span class="keywordflow">if</span> ( KOPrefs::instance()->mVerticalScreen ) { <a name="l00168"></a>00168 mainBox = <span class="keyword">new</span> QVBox( <span class="keyword">this</span> ); <a name="l00169"></a>00169 leftFrame = <span class="keyword">new</span> QHBox( mainBox ); <a name="l00170"></a>00170 } <span class="keywordflow">else</span> { <a name="l00171"></a>00171 mainBox = <span class="keyword">new</span> QHBox( <span class="keyword">this</span> ); <a name="l00172"></a>00172 leftFrame = <span class="keyword">new</span> QVBox( mainBox ); <a name="l00173"></a>00173 } <a name="l00174"></a>00174 <a name="l00175"></a>00175 topLayout->addWidget( mainBox ); <a name="l00176"></a>00176 <a name="l00177"></a>00177 mDateNavigator = <span class="keyword">new</span> KDateNavigator( leftFrame, <span class="keyword">true</span>, <a name="l00178"></a>00178 <span class="stringliteral">"CalendarView::DateNavigator"</span>, <a name="l00179"></a>00179 QDate::currentDate() ); <a name="l00180"></a>00180 mTodoList = <span class="keyword">new</span> <a class="code" href="classKOTodoView.html" title="This class provides a multi-column list view of todo events.">KOTodoView</a>( CalendarNull::self(), leftFrame, <span class="stringliteral">"todolist"</span> ); <a name="l00181"></a>00181 <a name="l00182"></a>00182 mEventViewer = <span class="keyword">new</span> <a class="code" href="classKOEventViewer.html" title="Viewer widget for events.">KOEventViewer</a> ( leftFrame, <span class="stringliteral">"EventViewer"</span> ); <a name="l00183"></a>00183 <a name="l00184"></a>00184 QWidget *rightBox = <span class="keyword">new</span> QWidget( mainBox ); <a name="l00185"></a>00185 QBoxLayout *rightLayout = <span class="keyword">new</span> QVBoxLayout( rightBox ); <a name="l00186"></a>00186 <a name="l00187"></a>00187 mNavigatorBar = <span class="keyword">new</span> NavigatorBar( QDate::currentDate(), rightBox ); <a name="l00188"></a>00188 rightLayout->addWidget( mNavigatorBar ); <a name="l00189"></a>00189 <a name="l00190"></a>00190 mRightFrame = <span class="keyword">new</span> QWidgetStack( rightBox ); <a name="l00191"></a>00191 rightLayout->addWidget( mRightFrame ); <a name="l00192"></a>00192 <a name="l00193"></a>00193 mLeftFrame = leftFrame; <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="keywordflow">if</span> ( KOPrefs::instance()->mVerticalScreen ) { <a name="l00196"></a>00196 <span class="comment">// mTodoList->setFixedHeight( 60 );</span> <a name="l00197"></a>00197 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); <a name="l00198"></a>00198 } <a name="l00199"></a>00199 <span class="preprocessor">#endif</span> <a name="l00200"></a>00200 <span class="preprocessor"></span> <a name="l00201"></a>00201 connect( mNavigator, SIGNAL( datesSelected( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ), <a name="l00202"></a>00202 SLOT( <a class="code" href="classCalendarView.html#b258f1610070638eb1077c9d932f70f6" title="Select a view or adapt the current view to display the specified dates.">showDates</a>( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ) ); <a name="l00203"></a>00203 connect( mNavigator, SIGNAL( datesSelected( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ), <a name="l00204"></a>00204 mDateNavigator, SLOT( selectDates( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ) ); <a name="l00205"></a>00205 <a name="l00206"></a>00206 connect( mNavigatorBar, SIGNAL( goPrevYear() ), <a name="l00207"></a>00207 mNavigator, SLOT( selectPreviousYear() ) ); <a name="l00208"></a>00208 connect( mNavigatorBar, SIGNAL( goNextYear() ), <a name="l00209"></a>00209 mNavigator, SLOT( selectNextYear() ) ); <a name="l00210"></a>00210 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), <a name="l00211"></a>00211 mNavigator, SLOT( selectPreviousMonth() ) ); <a name="l00212"></a>00212 connect( mNavigatorBar, SIGNAL( goNextMonth() ), <a name="l00213"></a>00213 mNavigator, SLOT( selectNextMonth() ) ); <a name="l00214"></a>00214 connect( mNavigatorBar, SIGNAL( goMonth(<span class="keywordtype">int</span>) ), <a name="l00215"></a>00215 mNavigator, SLOT( selectMonth(<span class="keywordtype">int</span>) ) ); <a name="l00216"></a>00216 <a name="l00217"></a>00217 connect( mNavigator, SIGNAL( datesSelected( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ), <a name="l00218"></a>00218 mNavigatorBar, SLOT( selectDates( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ) ); <a name="l00219"></a>00219 <a name="l00220"></a>00220 connect( mDateNavigator, SIGNAL( weekClicked( <span class="keyword">const</span> QDate & ) ), <a name="l00221"></a>00221 mNavigator, SLOT( selectWeek( <span class="keyword">const</span> QDate & ) ) ); <a name="l00222"></a>00222 <a name="l00223"></a>00223 connect( mDateNavigator, SIGNAL( goPrevYear() ), <a name="l00224"></a>00224 mNavigator, SLOT( selectPreviousYear() ) ); <a name="l00225"></a>00225 connect( mDateNavigator, SIGNAL( goNextYear() ), <a name="l00226"></a>00226 mNavigator, SLOT( selectNextYear() ) ); <a name="l00227"></a>00227 connect( mDateNavigator, SIGNAL( goPrevMonth() ), <a name="l00228"></a>00228 mNavigator, SLOT( selectPreviousMonth() ) ); <a name="l00229"></a>00229 connect( mDateNavigator, SIGNAL( goNextMonth() ), <a name="l00230"></a>00230 mNavigator, SLOT( selectNextMonth() ) ); <a name="l00231"></a>00231 connect( mDateNavigator, SIGNAL( goMonth(<span class="keywordtype">int</span>) ), <a name="l00232"></a>00232 mNavigator, SLOT( selectMonth(<span class="keywordtype">int</span>) ) ); <a name="l00233"></a>00233 <a name="l00234"></a>00234 connect( mDateNavigator, SIGNAL( <a class="code" href="classCalendarView.html#e8b94a61d440a620539ce240ecbd19d6" title="Move to the previous date(s) in the current view.">goPrevious</a>() ), <a name="l00235"></a>00235 mNavigator, SLOT( selectPrevious() ) ); <a name="l00236"></a>00236 connect( mDateNavigator, SIGNAL( <a class="code" href="classCalendarView.html#5df101819d44e0e43f0a783e09cb4f95" title="Move to the next date(s) in the current view.">goNext</a>() ), <a name="l00237"></a>00237 mNavigator, SLOT( selectNext() ) ); <a name="l00238"></a>00238 <a name="l00239"></a>00239 connect( mDateNavigator, SIGNAL( datesSelected( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ), <a name="l00240"></a>00240 mNavigator, SLOT( selectDates( <span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">KCal::DateList</a> & ) ) ); <a name="l00241"></a>00241 <a name="l00242"></a>00242 connect( mDateNavigator, SIGNAL(incidenceDropped(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <span class="keyword">const</span> QDate&)), <a name="l00243"></a>00243 SLOT( addIncidenceOn( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *, <span class="keyword">const</span> QDate & ) ) ); <a name="l00244"></a>00244 connect( mDateNavigator, SIGNAL(incidenceDroppedMove(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*,<span class="keyword">const</span> QDate&)), <a name="l00245"></a>00245 SLOT( moveIncidenceTo( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *, <span class="keyword">const</span> QDate & ) ) ); <a name="l00246"></a>00246 <a name="l00247"></a>00247 connect( mDateChecker, SIGNAL( <a class="code" href="classCalendarView.html#8a09973554f2581b1e7e126c4eb51800" title="Emitted, when a day changed (i.e.">dayPassed</a>( <span class="keyword">const</span> QDate & ) ), <a name="l00248"></a>00248 mTodoList, SLOT( <a class="code" href="classCalendarView.html#8a09973554f2581b1e7e126c4eb51800" title="Emitted, when a day changed (i.e.">dayPassed</a>( <span class="keyword">const</span> QDate & ) ) ); <a name="l00249"></a>00249 connect( mDateChecker, SIGNAL( <a class="code" href="classCalendarView.html#8a09973554f2581b1e7e126c4eb51800" title="Emitted, when a day changed (i.e.">dayPassed</a>( <span class="keyword">const</span> QDate & ) ), <a name="l00250"></a>00250 SIGNAL( <a class="code" href="classCalendarView.html#8a09973554f2581b1e7e126c4eb51800" title="Emitted, when a day changed (i.e.">dayPassed</a>( <span class="keyword">const</span> QDate & ) ) ); <a name="l00251"></a>00251 connect( mDateChecker, SIGNAL( <a class="code" href="classCalendarView.html#8a09973554f2581b1e7e126c4eb51800" title="Emitted, when a day changed (i.e.">dayPassed</a>( <span class="keyword">const</span> QDate & ) ), <a name="l00252"></a>00252 mDateNavigator, SLOT( updateToday() ) ); <a name="l00253"></a>00253 <a name="l00254"></a>00254 connect( <span class="keyword">this</span>, SIGNAL( <a class="code" href="classCalendarView.html#d311610eb71e155954fd57d2f5c136e1" title="when change is made to options dialog, the topwidget will catch this and emit this...">configChanged</a>() ), <a name="l00255"></a>00255 mDateNavigator, SLOT( <a class="code" href="classCalendarView.html#9e30932f0e7379c706b9004eb159279f" title="options dialog made a changed to the configuration.">updateConfig</a>() ) ); <a name="l00256"></a>00256 <a name="l00257"></a>00257 connect( <span class="keyword">this</span>, SIGNAL( <a class="code" href="classCalendarView.html#0abb2fa200ff11b9db54ec1e088724af" title="Emitted when an incidence gets selected.">incidenceSelected</a>(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *) ), <a name="l00258"></a>00258 mEventViewer, SLOT ( setIncidence (<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *) ) ); <a name="l00259"></a>00259 <a name="l00260"></a>00260 <span class="comment">//TODO: do a pretty Summary,</span> <a name="l00261"></a>00261 QString s; <a name="l00262"></a>00262 s = i18n( <span class="stringliteral">"<p><em>No Item Selected</em></p>"</span> <a name="l00263"></a>00263 <span class="stringliteral">"<p>Select an event, to-do or journal entry to view its details "</span> <a name="l00264"></a>00264 <span class="stringliteral">"here.</p>"</span>); <a name="l00265"></a>00265 <a name="l00266"></a>00266 mEventViewer-><a class="code" href="classKOEventViewer.html#e437b420dca06e05739751215d2f2fe5" title="Set the default text that is showed when there aren&#39;t a incidence to show.">setDefaultText</a>( s ); <a name="l00267"></a>00267 QWhatsThis::add( mEventViewer, <a name="l00268"></a>00268 i18n( <span class="stringliteral">"View the details of events, journal entries or to-dos "</span> <a name="l00269"></a>00269 <span class="stringliteral">"selected in KOrganizer's main view here."</span> ) ); <a name="l00270"></a>00270 mEventViewer-><a class="code" href="classKOEventViewer.html#ec22599a85190d3266c5946058991132" title="Show given incidence in viewer.">setIncidence</a>( 0 ); <a name="l00271"></a>00271 <a name="l00272"></a>00272 mViewManager-><a class="code" href="classKOViewManager.html#c36ccc4f700af3b74f017cd95eb9a97b">connectTodoView</a>( mTodoList ); <a name="l00273"></a>00273 mViewManager-><a class="code" href="classKOViewManager.html#534d7c034eee94a519c1f376f7a05e8e">connectView</a>( mTodoList ); <a name="l00274"></a>00274 <a name="l00275"></a>00275 KOGlobals::self()-> <a name="l00276"></a>00276 setHolidays( <span class="keyword">new</span> KHolidays( KOPrefs::instance()->mHolidays ) ); <a name="l00277"></a>00277 <a name="l00278"></a>00278 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), <a name="l00279"></a>00279 SLOT( <a class="code" href="classCalendarView.html#96d0f8056db26255b365ff861de28da6" title="Check if clipboard contains vCalendar event.">checkClipboard</a>() ) ); <a name="l00280"></a>00280 <a name="l00281"></a>00281 connect( mTodoList, SIGNAL( <a class="code" href="classCalendarView.html#0abb2fa200ff11b9db54ec1e088724af" title="Emitted when an incidence gets selected.">incidenceSelected</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ), <a name="l00282"></a>00282 SLOT( processTodoListSelection( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ) ); <a name="l00283"></a>00283 disconnect( mTodoList, SIGNAL( <a class="code" href="classCalendarView.html#0abb2fa200ff11b9db54ec1e088724af" title="Emitted when an incidence gets selected.">incidenceSelected</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ), <a name="l00284"></a>00284 <span class="keyword">this</span>, SLOT( processMainViewSelection( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ) ); <a name="l00285"></a>00285 <a name="l00286"></a>00286 kdDebug(5850) << <span class="stringliteral">"CalendarView::CalendarView() done"</span> << endl; <a name="l00287"></a>00287 } <a name="l00288"></a>00288 <a name="l00289"></a>00289 CalendarView::~CalendarView() <a name="l00290"></a>00290 { <a name="l00291"></a>00291 kdDebug(5850) << <span class="stringliteral">"~CalendarView()"</span> << endl; <a name="l00292"></a>00292 <a name="l00293"></a>00293 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#691818c82a13ff376918d75ebfb9879d">unregisterObserver</a>( <span class="keyword">this</span> ); <a name="l00294"></a>00294 <a name="l00295"></a>00295 <span class="keyword">delete</span> mDialogManager; <a name="l00296"></a>00296 <span class="keyword">delete</span> mViewManager; <a name="l00297"></a>00297 <span class="keyword">delete</span> mEventViewer; <a name="l00298"></a>00298 kdDebug(5850) << <span class="stringliteral">"~CalendarView() done"</span> << endl; <a name="l00299"></a>00299 } <a name="l00300"></a>00300 <a name="l00301"></a>00301 <span class="keywordtype">void</span> CalendarView::setCalendar( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html">Calendar</a> *cal ) <a name="l00302"></a>00302 { <a name="l00303"></a>00303 kdDebug(5850)<<<span class="stringliteral">"CalendarView::setCalendar"</span><<endl; <a name="l00304"></a>00304 mCalendar = cal; <a name="l00305"></a>00305 <a name="l00306"></a>00306 <span class="keyword">delete</span> mHistory; <a name="l00307"></a>00307 mHistory = <span class="keyword">new</span> History( mCalendar ); <a name="l00308"></a>00308 connect( mHistory, SIGNAL( undone() ), SLOT( updateView() ) ); <a name="l00309"></a>00309 connect( mHistory, SIGNAL( redone() ), SLOT( updateView() ) ); <a name="l00310"></a>00310 <a name="l00311"></a>00311 <span class="keywordflow">if</span> ( mChanger ) <span class="keyword">delete</span> mChanger; <a name="l00312"></a>00312 setIncidenceChanger( <span class="keyword">new</span> IncidenceChanger( mCalendar, <span class="keyword">this</span> ) ); <a name="l00313"></a>00313 <a name="l00314"></a>00314 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#448cfb6c7cdc83e0bc28cc469235302c">registerObserver</a>( <span class="keyword">this</span> ); <a name="l00315"></a>00315 <a name="l00316"></a>00316 mDateNavigator->setCalendar( mCalendar ); <a name="l00317"></a>00317 <a name="l00318"></a>00318 mTodoList-><a class="code" href="classKOTodoView.html#20a7263c79c9ed89193e5233466d7e76">setCalendar</a>( mCalendar ); <a name="l00319"></a>00319 } <a name="l00320"></a>00320 <a name="l00321"></a>00321 <span class="keywordtype">void</span> CalendarView::setIncidenceChanger( IncidenceChangerBase *changer ) <a name="l00322"></a>00322 { <a name="l00323"></a>00323 mChanger = changer; <a name="l00324"></a>00324 emit newIncidenceChanger( mChanger ); <a name="l00325"></a>00325 connect( mChanger, SIGNAL( incidenceAdded( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* ) ), <a name="l00326"></a>00326 <span class="keyword">this</span>, SLOT( incidenceAdded( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* ) ) ); <a name="l00327"></a>00327 connect( mChanger, SIGNAL( incidenceChanged( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <span class="keywordtype">int</span> ) ), <a name="l00328"></a>00328 <span class="keyword">this</span>, SLOT( incidenceChanged( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <span class="keywordtype">int</span> ) ) ); <a name="l00329"></a>00329 connect( mChanger, SIGNAL( incidenceChanged( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* ) ), <a name="l00330"></a>00330 <span class="keyword">this</span>, SLOT( incidenceChanged( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* ) ) ); <a name="l00331"></a>00331 connect( mChanger, SIGNAL( incidenceToBeDeleted( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ), <a name="l00332"></a>00332 <span class="keyword">this</span>, SLOT( incidenceToBeDeleted( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ) ); <a name="l00333"></a>00333 connect( mChanger, SIGNAL( incidenceDeleted( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ), <a name="l00334"></a>00334 <span class="keyword">this</span>, SLOT( incidenceDeleted( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ) ); <a name="l00335"></a>00335 <a name="l00336"></a>00336 connect( mChanger, SIGNAL( schedule( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Scheduler.html#b5bb0cf1cf4c936a606b1968e85601b1">Scheduler::Method</a>, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*) ), <a name="l00337"></a>00337 <span class="keyword">this</span>, SLOT( schedule( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Scheduler.html#b5bb0cf1cf4c936a606b1968e85601b1">Scheduler::Method</a>, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*) ) ); <a name="l00338"></a>00338 <a name="l00339"></a>00339 <a name="l00340"></a>00340 connect( <span class="keyword">this</span>, SIGNAL( <a class="code" href="classCalendarView.html#69fa5e742ded9b1d19af38d52e3e331b" title="Attendees were removed from this incidence.">cancelAttendees</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ), <a name="l00341"></a>00341 mChanger, SLOT( <a class="code" href="classCalendarView.html#69fa5e742ded9b1d19af38d52e3e331b" title="Attendees were removed from this incidence.">cancelAttendees</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) ) ); <a name="l00342"></a>00342 } <a name="l00343"></a>00343 <a name="l00344"></a>00344 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html">Calendar</a> *CalendarView::calendar() <a name="l00345"></a>00345 { <a name="l00346"></a>00346 <span class="keywordflow">if</span> ( mCalendar ) <span class="keywordflow">return</span> mCalendar; <a name="l00347"></a>00347 <span class="keywordflow">else</span> <span class="keywordflow">return</span> CalendarNull::self(); <a name="l00348"></a>00348 } <a name="l00349"></a>00349 <a name="l00350"></a>00350 <a class="code" href="classKOIncidenceEditor.html" title="This is the base class for the calendar component editors.">KOIncidenceEditor</a> *CalendarView::editorDialog( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence )<span class="keyword"> const</span> <a name="l00351"></a>00351 <span class="keyword"></span>{ <a name="l00352"></a>00352 <span class="keywordflow">if</span> (mDialogList.find(incidence) != mDialogList.end ()) <a name="l00353"></a>00353 <span class="keywordflow">return</span> mDialogList[incidence]; <a name="l00354"></a>00354 <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0; <a name="l00355"></a>00355 } <a name="l00356"></a>00356 <a name="l00357"></a>00357 QDate CalendarView::startDate() <a name="l00358"></a>00358 { <a name="l00359"></a>00359 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">DateList</a> dates = mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>(); <a name="l00360"></a>00360 <a name="l00361"></a>00361 <span class="keywordflow">return</span> dates.first(); <a name="l00362"></a>00362 } <a name="l00363"></a>00363 <a name="l00364"></a>00364 QDate CalendarView::endDate() <a name="l00365"></a>00365 { <a name="l00366"></a>00366 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">DateList</a> dates = mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>(); <a name="l00367"></a>00367 <a name="l00368"></a>00368 <span class="keywordflow">return</span> dates.last(); <a name="l00369"></a>00369 } <a name="l00370"></a>00370 <a name="l00371"></a>00371 <a name="l00372"></a><a class="code" href="classCalendarView.html#aed1aa4ae29884417e6d89a707cb127a">00372</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#aed1aa4ae29884417e6d89a707cb127a" title="Load calendar from file filename.">CalendarView::openCalendar</a>(<span class="keyword">const</span> QString& filename, <span class="keywordtype">bool</span> merge) <a name="l00373"></a>00373 { <a name="l00374"></a>00374 kdDebug(5850) << <span class="stringliteral">"CalendarView::openCalendar(): "</span> << filename << endl; <a name="l00375"></a>00375 <a name="l00376"></a>00376 <span class="keywordflow">if</span> (filename.isEmpty()) { <a name="l00377"></a>00377 kdDebug(5850) << <span class="stringliteral">"CalendarView::openCalendar(): Error! Empty filename."</span> << endl; <a name="l00378"></a>00378 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00379"></a>00379 } <a name="l00380"></a>00380 <a name="l00381"></a>00381 <span class="keywordflow">if</span> (!QFile::exists(filename)) { <a name="l00382"></a>00382 kdDebug(5850) << <span class="stringliteral">"CalendarView::openCalendar(): Error! File '"</span> << filename <a name="l00383"></a>00383 << <span class="stringliteral">"' doesn't exist."</span> << endl; <a name="l00384"></a>00384 } <a name="l00385"></a>00385 <a name="l00386"></a>00386 <span class="keywordtype">bool</span> loadedSuccesfully = <span class="keyword">true</span>; <a name="l00387"></a>00387 <span class="keywordflow">if</span> ( !merge ) { <a name="l00388"></a>00388 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d6d1e7529785af4133fbacfae48caad6">close</a>(); <a name="l00389"></a>00389 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalendarLocal.html">CalendarLocal</a> *cl = <span class="keyword">dynamic_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalendarLocal.html">CalendarLocal</a>*<span class="keyword">></span>( mCalendar ); <a name="l00390"></a>00390 <span class="keywordflow">if</span> ( cl ) { <a name="l00391"></a>00391 loadedSuccesfully = cl-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalendarLocal.html#54cd4ef78b62f33d28212b1487eaa342">load</a>( filename ); <a name="l00392"></a>00392 } <span class="keywordflow">else</span> { <a name="l00393"></a>00393 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalendarResources.html">CalendarResources</a> *cr = <span class="keyword">dynamic_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalendarResources.html">CalendarResources</a>*<span class="keyword">></span>( mCalendar ); <a name="l00394"></a>00394 assert( cr ); <span class="comment">// otherwise something is majorly wrong</span> <a name="l00395"></a>00395 <span class="comment">// openCalendar called without merge and a filename, what should we do?</span> <a name="l00396"></a>00396 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00397"></a>00397 } <a name="l00398"></a>00398 } <span class="keywordflow">else</span> { <a name="l00399"></a>00399 <span class="comment">// merge in a file</span> <a name="l00400"></a>00400 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html">FileStorage</a> storage( mCalendar ); <a name="l00401"></a>00401 storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#a657ddd68332bc4d87a270617f779863">setFileName</a>( filename ); <a name="l00402"></a>00402 loadedSuccesfully = storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#cec1ff977a4fb2885ca0f90336b2c296">load</a>(); <a name="l00403"></a>00403 } <a name="l00404"></a>00404 <a name="l00405"></a>00405 <span class="keywordflow">if</span> ( loadedSuccesfully ) { <a name="l00406"></a>00406 <span class="keywordflow">if</span> ( merge ) <a name="l00407"></a>00407 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( <span class="keyword">true</span> ); <a name="l00408"></a>00408 <span class="keywordflow">else</span> { <a name="l00409"></a>00409 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( <span class="keyword">false</span> ); <a name="l00410"></a>00410 mViewManager-><a class="code" href="classKOViewManager.html#2fdb6b559e8e63ac1a50b9dbe5e03e77">setDocumentId</a>( filename ); <a name="l00411"></a>00411 mTodoList-><a class="code" href="classKOTodoView.html#2a70850a2b23c2ed2f6c837ca2b0c86b">setDocumentId</a>( filename ); <a name="l00412"></a>00412 } <a name="l00413"></a>00413 <a class="code" href="classCalendarView.html#0b2d2114e3c71dcd630cdbb0b7bf8048" title="Calendar configuration was changed, so refresh categories list.">updateCategories</a>(); <a name="l00414"></a>00414 updateView(); <a name="l00415"></a>00415 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00416"></a>00416 } <span class="keywordflow">else</span> { <a name="l00417"></a>00417 <span class="comment">// while failing to load, the calendar object could</span> <a name="l00418"></a>00418 <span class="comment">// have become partially populated. Clear it out.</span> <a name="l00419"></a>00419 <span class="keywordflow">if</span> ( !merge ) mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d6d1e7529785af4133fbacfae48caad6">close</a>(); <a name="l00420"></a>00420 <a name="l00421"></a>00421 KMessageBox::error(<span class="keyword">this</span>,i18n(<span class="stringliteral">"Could not load calendar '%1'."</span>).arg(filename)); <a name="l00422"></a>00422 <a name="l00423"></a>00423 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00424"></a>00424 } <a name="l00425"></a>00425 } <a name="l00426"></a>00426 <a name="l00427"></a><a class="code" href="classCalendarView.html#642a91df10ca3e6cb55228fbe6308988">00427</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#642a91df10ca3e6cb55228fbe6308988" title="Save calendar data to file.">CalendarView::saveCalendar</a>( <span class="keyword">const</span> QString& filename ) <a name="l00428"></a>00428 { <a name="l00429"></a>00429 kdDebug(5850) << <span class="stringliteral">"CalendarView::saveCalendar(): "</span> << filename << endl; <a name="l00430"></a>00430 <a name="l00431"></a>00431 <span class="comment">// Store back all unsaved data into calendar object</span> <a name="l00432"></a>00432 mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#1bd62a1d3b217a475a89c69e7e16ec9c" title="Write all unsaved data back to calendar store.">flushView</a>(); <a name="l00433"></a>00433 <a name="l00434"></a>00434 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html">FileStorage</a> storage( mCalendar ); <a name="l00435"></a>00435 storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#a657ddd68332bc4d87a270617f779863">setFileName</a>( filename ); <a name="l00436"></a>00436 storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#a01b1b4fda24b7798c1a6510c1882498">setSaveFormat</a>( <span class="keyword">new</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html">ICalFormat</a> ); <a name="l00437"></a>00437 <a name="l00438"></a>00438 <span class="keywordtype">bool</span> success = storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#bc882239d83ffc2b3ddc86aad18ac83c">save</a>(); <a name="l00439"></a>00439 <a name="l00440"></a>00440 <span class="keywordflow">if</span> ( !success ) { <a name="l00441"></a>00441 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00442"></a>00442 } <a name="l00443"></a>00443 <a name="l00444"></a>00444 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00445"></a>00445 } <a name="l00446"></a>00446 <a name="l00447"></a><a class="code" href="classCalendarView.html#dd056f87c202689ae0f6b16e6e50697e">00447</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#dd056f87c202689ae0f6b16e6e50697e" title="Close calendar.">CalendarView::closeCalendar</a>() <a name="l00448"></a>00448 { <a name="l00449"></a>00449 kdDebug(5850) << <span class="stringliteral">"CalendarView::closeCalendar()"</span> << endl; <a name="l00450"></a>00450 <a name="l00451"></a>00451 <span class="comment">// child windows no longer valid</span> <a name="l00452"></a>00452 emit <a class="code" href="classCalendarView.html#f610e0f7b36c7ab8cb59ffca42583965" title="emitted when the topwidget is closing down, so that any attached child windows can...">closingDown</a>(); <a name="l00453"></a>00453 <a name="l00454"></a>00454 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d6d1e7529785af4133fbacfae48caad6">close</a>(); <a name="l00455"></a>00455 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( <span class="keyword">false</span> ); <a name="l00456"></a>00456 updateView(); <a name="l00457"></a>00457 } <a name="l00458"></a>00458 <a name="l00459"></a><a class="code" href="classCalendarView.html#df01385160e676ad104a7fba3b379529">00459</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#df01385160e676ad104a7fba3b379529" title="Archive old events of calendar.">CalendarView::archiveCalendar</a>() <a name="l00460"></a>00460 { <a name="l00461"></a>00461 mDialogManager-><a class="code" href="classKODialogManager.html#4f27c78dc43c81ddb5ec7a78db4d64fa">showArchiveDialog</a>(); <a name="l00462"></a>00462 } <a name="l00463"></a>00463 <a name="l00464"></a>00464 <a name="l00465"></a><a class="code" href="classCalendarView.html#40891a0bd7119b1a5620ce2a1910a0e2">00465</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#40891a0bd7119b1a5620ce2a1910a0e2" title="Using the KConfig associated with the kapp variable, read in the settings from the...">CalendarView::readSettings</a>() <a name="l00466"></a>00466 { <a name="l00467"></a>00467 <span class="comment">// kdDebug(5850) << "CalendarView::readSettings()" << endl;</span> <a name="l00468"></a>00468 <a name="l00469"></a>00469 QString str; <a name="l00470"></a>00470 <a name="l00471"></a>00471 <span class="comment">// read settings from the KConfig, supplying reasonable</span> <a name="l00472"></a>00472 <span class="comment">// defaults where none are to be found</span> <a name="l00473"></a>00473 <a name="l00474"></a>00474 KConfig *config = KOGlobals::self()->config(); <a name="l00475"></a>00475 <a name="l00476"></a>00476 <span class="preprocessor">#ifndef KORG_NOSPLITTER</span> <a name="l00477"></a>00477 <span class="preprocessor"></span> config->setGroup( <span class="stringliteral">"KOrganizer Geometry"</span> ); <a name="l00478"></a>00478 <a name="l00479"></a>00479 QValueList<int> sizes = config->readIntListEntry( <span class="stringliteral">"Separator1"</span> ); <a name="l00480"></a>00480 <span class="keywordflow">if</span> ( sizes.count() != 2 ) { <a name="l00481"></a>00481 sizes << mDateNavigator->minimumSizeHint().width(); <a name="l00482"></a>00482 sizes << 300; <a name="l00483"></a>00483 } <a name="l00484"></a>00484 mPanner->setSizes( sizes ); <a name="l00485"></a>00485 <a name="l00486"></a>00486 sizes = config->readIntListEntry( <span class="stringliteral">"Separator2"</span> ); <a name="l00487"></a>00487 mLeftSplitter->setSizes( sizes ); <a name="l00488"></a>00488 <span class="preprocessor">#endif</span> <a name="l00489"></a>00489 <span class="preprocessor"></span> <a name="l00490"></a>00490 mEventViewer-><a class="code" href="classKOEventViewer.html#5fb49b7682e245313b16290c9f41314a">readSettings</a>( config ); <a name="l00491"></a>00491 <a name="l00492"></a>00492 mViewManager-><a class="code" href="classKOViewManager.html#e65988062718fe1fb6249d582f0ce7e3">readSettings</a>( config ); <a name="l00493"></a>00493 mTodoList-><a class="code" href="classKOTodoView.html#40cf41c5cdd3018ea7bf7c906086d910">restoreLayout</a>( config, QString( <span class="stringliteral">"Todo Layout"</span> ) ); <a name="l00494"></a>00494 <a name="l00495"></a>00495 <a class="code" href="classCalendarView.html#4c21a158eb6f5548a4ab0237f5223a5a" title="read settings for calendar filters">readFilterSettings</a>( config ); <a name="l00496"></a>00496 <a name="l00497"></a>00497 config->setGroup( <span class="stringliteral">"Views"</span> ); <a name="l00498"></a>00498 <span class="keywordtype">int</span> dateCount = config->readNumEntry( <span class="stringliteral">"ShownDatesCount"</span>, 7 ); <a name="l00499"></a>00499 <span class="keywordflow">if</span> ( dateCount == 7 ) mNavigator-><a class="code" href="classDateNavigator.html#7d0f6a221120ac12f5a959727efa1e9f">selectWeek</a>(); <a name="l00500"></a>00500 <span class="keywordflow">else</span> mNavigator-><a class="code" href="classDateNavigator.html#10a224c2cd644cc94d143b2e5c54ed17">selectDates</a>( mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>().first(), dateCount ); <a name="l00501"></a>00501 } <a name="l00502"></a>00502 <a name="l00503"></a>00503 <a name="l00504"></a><a class="code" href="classCalendarView.html#7e793ecd8f744a6cc1b6fe0220931dfb">00504</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7e793ecd8f744a6cc1b6fe0220931dfb" title="write current state to config file.">CalendarView::writeSettings</a>() <a name="l00505"></a>00505 { <a name="l00506"></a>00506 <span class="comment">// kdDebug(5850) << "CalendarView::writeSettings" << endl;</span> <a name="l00507"></a>00507 <a name="l00508"></a>00508 KConfig *config = KOGlobals::self()->config(); <a name="l00509"></a>00509 <a name="l00510"></a>00510 <span class="preprocessor">#ifndef KORG_NOSPLITTER</span> <a name="l00511"></a>00511 <span class="preprocessor"></span> config->setGroup( <span class="stringliteral">"KOrganizer Geometry"</span> ); <a name="l00512"></a>00512 <a name="l00513"></a>00513 QValueList<int> list = mPanner->sizes(); <a name="l00514"></a>00514 config->writeEntry( <span class="stringliteral">"Separator1"</span>, list ); <a name="l00515"></a>00515 <a name="l00516"></a>00516 list = mLeftSplitter->sizes(); <a name="l00517"></a>00517 config->writeEntry( <span class="stringliteral">"Separator2"</span>, list ); <a name="l00518"></a>00518 <span class="preprocessor">#endif</span> <a name="l00519"></a>00519 <span class="preprocessor"></span> mEventViewer-><a class="code" href="classKOEventViewer.html#6964ce766380a0387669e164f7e59d01">writeSettings</a>( config ); <a name="l00520"></a>00520 mViewManager-><a class="code" href="classKOViewManager.html#22efc28ddbe1c414feeda757aa71daae">writeSettings</a>( config ); <a name="l00521"></a>00521 mTodoList-><a class="code" href="classKOTodoView.html#6b87fa097dfc155afbc46ecd2fe3e7f3">saveLayout</a>( config, QString( <span class="stringliteral">"Todo Layout"</span> ) ); <a name="l00522"></a>00522 <a name="l00523"></a>00523 KOPrefs::instance()->writeConfig(); <a name="l00524"></a>00524 <a name="l00525"></a>00525 <a class="code" href="classCalendarView.html#b049a89c5fa2e48348cb684c79584e30" title="write settings for calendar filters">writeFilterSettings</a>( config ); <a name="l00526"></a>00526 <a name="l00527"></a>00527 config->setGroup( <span class="stringliteral">"Views"</span> ); <a name="l00528"></a>00528 config->writeEntry( <span class="stringliteral">"ShownDatesCount"</span>, mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>().count() ); <a name="l00529"></a>00529 <a name="l00530"></a>00530 config->sync(); <a name="l00531"></a>00531 } <a name="l00532"></a>00532 <a name="l00533"></a><a class="code" href="classCalendarView.html#4c21a158eb6f5548a4ab0237f5223a5a">00533</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#4c21a158eb6f5548a4ab0237f5223a5a" title="read settings for calendar filters">CalendarView::readFilterSettings</a>( KConfig *config ) <a name="l00534"></a>00534 { <a name="l00535"></a>00535 <span class="comment">// kdDebug(5850) << "CalendarView::readFilterSettings()" << endl;</span> <a name="l00536"></a>00536 <a name="l00537"></a>00537 mFilters.clear(); <a name="l00538"></a>00538 <a name="l00539"></a>00539 config->setGroup( <span class="stringliteral">"General"</span> ); <a name="l00540"></a>00540 <span class="comment">// FIXME: Move the filter loading and saving to the CalFilter class in libkcal</span> <a name="l00541"></a>00541 QStringList filterList = config->readListEntry (<span class="stringliteral">"CalendarFilters"</span> ); <a name="l00542"></a>00542 QString currentFilter = config->readEntry( <span class="stringliteral">"Current Filter"</span> ); <a name="l00543"></a>00543 <a name="l00544"></a>00544 QStringList::ConstIterator it = filterList.begin(); <a name="l00545"></a>00545 QStringList::ConstIterator end = filterList.end(); <a name="l00546"></a>00546 <span class="keywordflow">while</span>( it != end ) { <a name="l00547"></a>00547 <span class="comment">// kdDebug(5850) << " filter: " << (*it) << endl;</span> <a name="l00548"></a>00548 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a> *filter; <a name="l00549"></a>00549 filter = <span class="keyword">new</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a>( *it ); <a name="l00550"></a>00550 config->setGroup( <span class="stringliteral">"Filter_"</span> + (*it) ); <a name="l00551"></a>00551 filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#77b957d2dc69713d8b755b9e004be56f">setCriteria</a>( config->readNumEntry( <span class="stringliteral">"Criteria"</span>, 0 ) ); <a name="l00552"></a>00552 filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#cbcb3b832f9a68b8d75791a3e60a5c7c">setCategoryList</a>( config->readListEntry( <span class="stringliteral">"CategoryList"</span> ) ); <a name="l00553"></a>00553 <span class="keywordflow">if</span> ( filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#fe72bf18f139577c897b7f0e24c8e7bd">criteria</a>() & KCal::CalFilter::HideTodosWithoutAttendeeInEmailList ) <a name="l00554"></a>00554 filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#90406399a04000946aa7226ad2be8c4e">setEmailList</a>( KOPrefs::instance()->allEmails() ); <a name="l00555"></a>00555 filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#0b727b97f432821435304facfde3a020">setCompletedTimeSpan</a>( config->readNumEntry( <span class="stringliteral">"HideTodoDays"</span>, 0 ) ); <a name="l00556"></a>00556 mFilters.append( filter ); <a name="l00557"></a>00557 <a name="l00558"></a>00558 ++it; <a name="l00559"></a>00559 } <a name="l00560"></a>00560 <a name="l00561"></a>00561 config->setGroup( <span class="stringliteral">"General"</span> ); <a name="l00562"></a>00562 <span class="keywordtype">int</span> pos = filterList.findIndex( currentFilter ); <a name="l00563"></a>00563 mCurrentFilter = 0; <a name="l00564"></a>00564 <span class="keywordflow">if</span> ( pos>=0 ) { <a name="l00565"></a>00565 mCurrentFilter = mFilters.at( pos ); <a name="l00566"></a>00566 } <a name="l00567"></a>00567 <a class="code" href="classCalendarView.html#310e87d7d277e1981c99255417444054" title="Filter configuration changed.">updateFilter</a>(); <a name="l00568"></a>00568 } <a name="l00569"></a>00569 <a name="l00570"></a><a class="code" href="classCalendarView.html#b049a89c5fa2e48348cb684c79584e30">00570</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#b049a89c5fa2e48348cb684c79584e30" title="write settings for calendar filters">CalendarView::writeFilterSettings</a>( KConfig *config ) <a name="l00571"></a>00571 { <a name="l00572"></a>00572 <span class="comment">// kdDebug(5850) << "CalendarView::writeFilterSettings()" << endl;</span> <a name="l00573"></a>00573 <a name="l00574"></a>00574 QStringList filterList; <a name="l00575"></a>00575 <a name="l00576"></a>00576 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a> *filter = mFilters.first(); <a name="l00577"></a>00577 <span class="keywordflow">while</span>( filter ) { <a name="l00578"></a>00578 <span class="comment">// kdDebug(5850) << " fn: " << filter->name() << endl;</span> <a name="l00579"></a>00579 filterList << filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#31017f02bb684997b491a5e4258fa4fd">name</a>(); <a name="l00580"></a>00580 config->setGroup( <span class="stringliteral">"Filter_"</span> + filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#31017f02bb684997b491a5e4258fa4fd">name</a>() ); <a name="l00581"></a>00581 config->writeEntry( <span class="stringliteral">"Criteria"</span>, filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#fe72bf18f139577c897b7f0e24c8e7bd">criteria</a>() ); <a name="l00582"></a>00582 config->writeEntry( <span class="stringliteral">"CategoryList"</span>, filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#3f1da6b0084e4878a03007f0faac390d">categoryList</a>() ); <a name="l00583"></a>00583 config->writeEntry( <span class="stringliteral">"HideTodoDays"</span>, filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#01b2aaa92f96a6a2cea1dce3148b4493">completedTimeSpan</a>() ); <a name="l00584"></a>00584 filter = mFilters.next(); <a name="l00585"></a>00585 } <a name="l00586"></a>00586 config->setGroup( <span class="stringliteral">"General"</span> ); <a name="l00587"></a>00587 config->writeEntry( <span class="stringliteral">"CalendarFilters"</span>, filterList ); <a name="l00588"></a>00588 <span class="keywordflow">if</span> ( mCurrentFilter ) { <a name="l00589"></a>00589 config->writeEntry( <span class="stringliteral">"Current Filter"</span>, mCurrentFilter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#31017f02bb684997b491a5e4258fa4fd">name</a>() ); <a name="l00590"></a>00590 } <span class="keywordflow">else</span> { <a name="l00591"></a>00591 config->writeEntry( <span class="stringliteral">"Current Filter"</span>, QString::null ); <a name="l00592"></a>00592 } <a name="l00593"></a>00593 } <a name="l00594"></a>00594 <a name="l00595"></a>00595 <a name="l00596"></a><a class="code" href="classCalendarView.html#dd0a21baa2428f1e10bc7fddac286f65">00596</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#dd0a21baa2428f1e10bc7fddac286f65" title="Move the current view date to the specified date.">CalendarView::goDate</a>( <span class="keyword">const</span> QDate& date ) <a name="l00597"></a>00597 { <a name="l00598"></a>00598 mNavigator-><a class="code" href="classDateNavigator.html#b95a455b5c2024131abc1f57b8eda438">selectDate</a>( date ); <a name="l00599"></a>00599 } <a name="l00600"></a>00600 <a name="l00601"></a><a class="code" href="classCalendarView.html#3fb89853ab99808d96ac962f34504846">00601</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#3fb89853ab99808d96ac962f34504846" title="Show the given date without changing date selection length.">CalendarView::showDate</a>(<span class="keyword">const</span> QDate & date) <a name="l00602"></a>00602 { <a name="l00603"></a>00603 <span class="keywordtype">int</span> dateCount = mNavigator-><a class="code" href="classDateNavigator.html#f7f76baace53d03156808d35b39abdf2">datesCount</a>(); <a name="l00604"></a>00604 <span class="keywordflow">if</span> ( dateCount == 7 ) <a name="l00605"></a>00605 mNavigator-><a class="code" href="classDateNavigator.html#7d0f6a221120ac12f5a959727efa1e9f">selectWeek</a>( date ); <a name="l00606"></a>00606 <span class="keywordflow">else</span> <a name="l00607"></a>00607 mNavigator-><a class="code" href="classDateNavigator.html#10a224c2cd644cc94d143b2e5c54ed17">selectDates</a>( date, dateCount ); <a name="l00608"></a>00608 } <a name="l00609"></a>00609 <a name="l00610"></a><a class="code" href="classCalendarView.html#8ea1f0f84e309e8069e1378e125b0533">00610</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#8ea1f0f84e309e8069e1378e125b0533" title="Move the current view date to today.">CalendarView::goToday</a>() <a name="l00611"></a>00611 { <a name="l00612"></a>00612 mNavigator-><a class="code" href="classDateNavigator.html#88a91c7838fd6c3f7cced824fec8235c">selectToday</a>(); <a name="l00613"></a>00613 } <a name="l00614"></a>00614 <a name="l00615"></a><a class="code" href="classCalendarView.html#5df101819d44e0e43f0a783e09cb4f95">00615</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#5df101819d44e0e43f0a783e09cb4f95" title="Move to the next date(s) in the current view.">CalendarView::goNext</a>() <a name="l00616"></a>00616 { <a name="l00617"></a>00617 <span class="keywordflow">if</span> ( dynamic_cast<KOMonthView*>( mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>() ) ) <a name="l00618"></a>00618 mNavigator-><a class="code" href="classDateNavigator.html#6c484d436d0853adbdd23ac0275c96f0">selectNextMonth</a>(); <a name="l00619"></a>00619 <span class="keywordflow">else</span> <a name="l00620"></a>00620 mNavigator-><a class="code" href="classDateNavigator.html#323608b66d55a9fc1109e5261ca6c9d6">selectNext</a>(); <a name="l00621"></a>00621 } <a name="l00622"></a>00622 <a name="l00623"></a><a class="code" href="classCalendarView.html#e8b94a61d440a620539ce240ecbd19d6">00623</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#e8b94a61d440a620539ce240ecbd19d6" title="Move to the previous date(s) in the current view.">CalendarView::goPrevious</a>() <a name="l00624"></a>00624 { <a name="l00625"></a>00625 <span class="keywordflow">if</span> ( dynamic_cast<KOMonthView*>( mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>() ) ) <a name="l00626"></a>00626 mNavigator-><a class="code" href="classDateNavigator.html#3b5e8e0ea973f79e77b2e3896e2277be">selectPreviousMonth</a>(); <a name="l00627"></a>00627 <span class="keywordflow">else</span> <a name="l00628"></a>00628 mNavigator-><a class="code" href="classDateNavigator.html#c57819b63d68480df6f1d8eefbc52185">selectPrevious</a>(); <a name="l00629"></a>00629 } <a name="l00630"></a>00630 <a name="l00631"></a><a class="code" href="classCalendarView.html#9e30932f0e7379c706b9004eb159279f">00631</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#9e30932f0e7379c706b9004eb159279f" title="options dialog made a changed to the configuration.">CalendarView::updateConfig</a>( <span class="keyword">const</span> QCString& receiver) <a name="l00632"></a>00632 { <a name="l00633"></a>00633 <span class="keywordflow">if</span> ( receiver != <span class="stringliteral">"korganizer"</span> ) <span class="keywordflow">return</span>; <a name="l00634"></a>00634 kdDebug(5850) << <span class="stringliteral">"CalendarView::updateConfig()"</span> << endl; <a name="l00635"></a>00635 <a name="l00636"></a>00636 KOGlobals::self()-> <a name="l00637"></a>00637 setHolidays( <span class="keyword">new</span> KHolidays( KOPrefs::instance()->mHolidays ) ); <a name="l00638"></a>00638 <a name="l00639"></a>00639 QString tz( mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#dbb33ceb6de6668520995b95b4fd646b">timeZoneId</a>() ); <a name="l00640"></a>00640 <span class="comment">// Only set a new time zone if it changed. This prevents the window</span> <a name="l00641"></a>00641 <span class="comment">// from being modified on start</span> <a name="l00642"></a>00642 <span class="keywordflow">if</span> ( tz != KOPrefs::instance()->mTimeZoneId ) { <a name="l00643"></a>00643 <a name="l00644"></a>00644 <span class="keyword">const</span> QString question( i18n(<span class="stringliteral">"The timezone setting was changed. Do you want to keep the absolute time of "</span> <a name="l00645"></a>00645 <span class="stringliteral">"the items in your calendar, which will show them to be at a different time than "</span> <a name="l00646"></a>00646 <span class="stringliteral">"before, or move them to be at the old time also in the new timezone?"</span>) ); <a name="l00647"></a>00647 <span class="keywordtype">int</span> rc = KMessageBox::questionYesNo( <span class="keyword">this</span>, question, <a name="l00648"></a>00648 i18n(<span class="stringliteral">"Keep Absolute Times?"</span>), <a name="l00649"></a>00649 KGuiItem(i18n(<span class="stringliteral">"Keep Times"</span>)), <a name="l00650"></a>00650 KGuiItem(i18n(<span class="stringliteral">"Move Times"</span>)), <a name="l00651"></a>00651 <span class="stringliteral">"calendarKeepAbsoluteTimes"</span>); <a name="l00652"></a>00652 <span class="keywordflow">if</span> ( rc == KMessageBox::Yes ) { <a name="l00653"></a>00653 <span class="comment">// user wants us to shift</span> <a name="l00654"></a>00654 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#2145646024cf3620c88e52b05ac123c1">setTimeZoneIdViewOnly</a>( KOPrefs::instance()->mTimeZoneId ); <a name="l00655"></a>00655 } <span class="keywordflow">else</span> { <a name="l00656"></a>00656 <span class="comment">// only set the new timezone, wihtout shifting events, they will be</span> <a name="l00657"></a>00657 <span class="comment">// interpreted as being in the new timezone now</span> <a name="l00658"></a>00658 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#0140baff3c473d4404bd5172fc1aad2f">setTimeZoneId</a>( KOPrefs::instance()->mTimeZoneId ); <a name="l00659"></a>00659 } <a name="l00660"></a>00660 } <a name="l00661"></a>00661 emit <a class="code" href="classCalendarView.html#d311610eb71e155954fd57d2f5c136e1" title="when change is made to options dialog, the topwidget will catch this and emit this...">configChanged</a>(); <a name="l00662"></a>00662 <a name="l00663"></a>00663 <span class="comment">// force reload and handle agenda view type switch</span> <a name="l00664"></a>00664 <span class="keyword">const</span> <span class="keywordtype">bool</span> showMerged = KOPrefs::instance()->agendaViewCalendarDisplay() == KOPrefs::CalendarsMerged; <a name="l00665"></a>00665 <span class="keyword">const</span> <span class="keywordtype">bool</span> showSideBySide = KOPrefs::instance()->agendaViewCalendarDisplay() == KOPrefs::CalendarsSideBySide; <a name="l00666"></a>00666 <a class="code" href="classKOrg_1_1BaseView.html" title="This class provides an interface for all views being displayed within the main calendar...">KOrg::BaseView</a> *view = mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>(); <a name="l00667"></a>00667 mViewManager-><a class="code" href="classKOViewManager.html#545f109f8f4e656bd9f3464725e5e2d3">showAgendaView</a>(); <a name="l00668"></a>00668 <span class="keywordflow">if</span> ( view == mViewManager-><a class="code" href="classKOViewManager.html#c74d629127df584a4159f4f48c803f81">agendaView</a>() && showSideBySide ) <a name="l00669"></a>00669 view = mViewManager-><a class="code" href="classKOViewManager.html#eba8c6b04635a9d034af0733800e5304">multiAgendaView</a>(); <a name="l00670"></a>00670 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( view == mViewManager-><a class="code" href="classKOViewManager.html#eba8c6b04635a9d034af0733800e5304">multiAgendaView</a>() && showMerged ) <a name="l00671"></a>00671 view = mViewManager-><a class="code" href="classKOViewManager.html#c74d629127df584a4159f4f48c803f81">agendaView</a>(); <a name="l00672"></a>00672 mViewManager-><a class="code" href="classKOViewManager.html#bbeec9f6f4219728cea3c612f41c80b7" title="changes the view to be the currently selected view">showView</a>( view ); <a name="l00673"></a>00673 <a name="l00674"></a>00674 <span class="comment">// To make the "fill window" configurations work</span> <a name="l00675"></a>00675 mViewManager-><a class="code" href="classKOViewManager.html#877b67e70c7eab20a842d312906b85b9">raiseCurrentView</a>(); <a name="l00676"></a>00676 } <a name="l00677"></a>00677 <a name="l00678"></a>00678 <a name="l00679"></a>00679 <span class="keywordtype">void</span> CalendarView::incidenceAdded( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l00680"></a>00680 { <a name="l00681"></a>00681 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( <span class="keyword">true</span> ); <a name="l00682"></a>00682 history()->recordAdd( incidence ); <a name="l00683"></a>00683 <a class="code" href="classCalendarView.html#41f2935fc0d9b420dc505aacc3e19d0e" title="passes on the message that an event has changed to the currently activated view so...">changeIncidenceDisplay</a>( incidence, KOGlobals::INCIDENCEADDED ); <a name="l00684"></a>00684 updateUnmanagedViews(); <a name="l00685"></a>00685 checkForFilteredChange( incidence ); <a name="l00686"></a>00686 } <a name="l00687"></a>00687 <a name="l00688"></a>00688 <span class="keywordtype">void</span> CalendarView::incidenceChanged( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *oldIncidence, <a name="l00689"></a>00689 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *newIncidence ) <a name="l00690"></a>00690 { <a name="l00691"></a>00691 incidenceChanged( oldIncidence, newIncidence, KOGlobals::UNKNOWN_MODIFIED ); <a name="l00692"></a>00692 } <a name="l00693"></a>00693 <a name="l00694"></a>00694 <span class="keywordtype">void</span> CalendarView::incidenceChanged( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *oldIncidence, <a name="l00695"></a>00695 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *newIncidence, <span class="keywordtype">int</span> what ) <a name="l00696"></a>00696 { <a name="l00697"></a>00697 <span class="comment">// FIXME: Make use of the what flag, which indicates which parts of the incidence have changed!</span> <a name="l00698"></a>00698 <a class="code" href="classKOIncidenceEditor.html" title="This is the base class for the calendar component editors.">KOIncidenceEditor</a> *tmp = editorDialog( newIncidence ); <a name="l00699"></a>00699 <span class="keywordflow">if</span> ( tmp ) { <a name="l00700"></a>00700 kdDebug(5850) << <span class="stringliteral">"Incidence modified and open"</span> << endl; <a name="l00701"></a>00701 tmp-><a class="code" href="classKOIncidenceEditor.html#bfab13d1143c8524197712f98662faac" title="This incidence has been modified externally.">modified</a>( what ); <a name="l00702"></a>00702 } <a name="l00703"></a>00703 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( <span class="keyword">true</span> ); <a name="l00704"></a>00704 history()->recordEdit( oldIncidence, newIncidence ); <a name="l00705"></a>00705 <a name="l00706"></a>00706 <span class="comment">// Record completed todos in journals, if enabled. we should to this here in</span> <a name="l00707"></a>00707 <span class="comment">// favour of the todolist. users can mark a task as completed in an editor</span> <a name="l00708"></a>00708 <span class="comment">// as well.</span> <a name="l00709"></a>00709 <span class="keywordflow">if</span> ( newIncidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> <a name="l00710"></a>00710 && KOPrefs::instance()->recordTodosInJournals() <a name="l00711"></a>00711 && ( what == KOGlobals::COMPLETION_MODIFIED <a name="l00712"></a>00712 || what == KOGlobals::COMPLETION_MODIFIED_WITH_RECURRENCE ) ) { <a name="l00713"></a>00713 <a name="l00714"></a>00714 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *<span class="keyword">></span>(newIncidence); <a name="l00715"></a>00715 <span class="keywordflow">if</span> ( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#c935ce3f04f7e9d828d3f954de585af6">isCompleted</a>() <a name="l00716"></a>00716 || what == KOGlobals::COMPLETION_MODIFIED_WITH_RECURRENCE ) { <a name="l00717"></a>00717 QString timeStr = KGlobal::locale()->formatTime( QTime::currentTime() ); <a name="l00718"></a>00718 QString description = i18n( <span class="stringliteral">"To-do completed: %1 (%2)"</span> ).arg( <a name="l00719"></a>00719 newIncidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ).arg( timeStr ); <a name="l00720"></a>00720 <a name="l00721"></a>00721 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ListBase.html">Journal::List</a> journals = calendar()-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#c6b55e4bc2dcc1557b63ffd9273bd6bc">journals</a>( QDate::currentDate() ); <a name="l00722"></a>00722 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Journal.html">Journal</a> *journal; <a name="l00723"></a>00723 <a name="l00724"></a>00724 <span class="keywordflow">if</span> ( journals.isEmpty() ) { <a name="l00725"></a>00725 journal = <span class="keyword">new</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Journal.html">Journal</a>(); <a name="l00726"></a>00726 journal-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#e3042339856d8295139b32fc40064876">setDtStart</a>( QDateTime::currentDateTime() ); <a name="l00727"></a>00727 <a name="l00728"></a>00728 QString dateStr = KGlobal::locale()->formatDate( QDate::currentDate() ); <a name="l00729"></a>00729 journal-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#fc2fecb0924ad84c61b9210d5cc5cc9f">setSummary</a>( i18n(<span class="stringliteral">"Journal of %1"</span>).arg( dateStr ) ); <a name="l00730"></a>00730 journal-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#d0b8ac8e276e7532ffe7320e92ef6680">setDescription</a>( description ); <a name="l00731"></a>00731 <a name="l00732"></a>00732 <span class="keywordflow">if</span> ( !mChanger->addIncidence( journal, <span class="keyword">this</span> ) ) { <a name="l00733"></a>00733 KODialogManager::errorSaveIncidence( <span class="keyword">this</span>, journal ); <a name="l00734"></a>00734 <span class="keyword">delete</span> journal; <a name="l00735"></a>00735 <span class="keywordflow">return</span>; <a name="l00736"></a>00736 } <a name="l00737"></a>00737 <a name="l00738"></a>00738 } <span class="keywordflow">else</span> { <span class="comment">// journal list is not empty</span> <a name="l00739"></a>00739 journal = *(journals.at(0)); <a name="l00740"></a>00740 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Journal.html">Journal</a> *oldJournal = journal-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Journal.html#f6321ca91028ba531242cca9a79e37ce">clone</a>(); <a name="l00741"></a>00741 journal-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#d0b8ac8e276e7532ffe7320e92ef6680">setDescription</a>( journal-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5614d24c09a8909b08c26c5e33918831">description</a>().append( <span class="stringliteral">"\n"</span> + description ) ); <a name="l00742"></a>00742 <a name="l00743"></a>00743 <span class="keywordflow">if</span> ( !mChanger->changeIncidence( oldJournal, journal ) ) { <a name="l00744"></a>00744 KODialogManager::errorSaveIncidence( <span class="keyword">this</span>, journal ); <a name="l00745"></a>00745 <span class="keyword">delete</span> journal; <a name="l00746"></a>00746 <span class="keywordflow">return</span>; <a name="l00747"></a>00747 } <a name="l00748"></a>00748 } <a name="l00749"></a>00749 } <a name="l00750"></a>00750 } <a name="l00751"></a>00751 <a name="l00752"></a>00752 <a class="code" href="classCalendarView.html#41f2935fc0d9b420dc505aacc3e19d0e" title="passes on the message that an event has changed to the currently activated view so...">changeIncidenceDisplay</a>( newIncidence, KOGlobals::INCIDENCEEDITED ); <a name="l00753"></a>00753 updateUnmanagedViews(); <a name="l00754"></a>00754 checkForFilteredChange( newIncidence ); <a name="l00755"></a>00755 } <a name="l00756"></a>00756 <a name="l00757"></a>00757 <span class="keywordtype">void</span> CalendarView::incidenceToBeDeleted( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l00758"></a>00758 { <a name="l00759"></a>00759 <a class="code" href="classKOIncidenceEditor.html" title="This is the base class for the calendar component editors.">KOIncidenceEditor</a> *tmp = editorDialog( incidence ); <a name="l00760"></a>00760 <span class="keywordflow">if</span> (tmp) { <a name="l00761"></a>00761 kdDebug(5850) << <span class="stringliteral">"Incidence to be deleted and open in editor"</span> << endl; <a name="l00762"></a>00762 tmp->delayedDestruct(); <a name="l00763"></a>00763 } <a name="l00764"></a>00764 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( <span class="keyword">true</span> ); <a name="l00765"></a>00765 history()->recordDelete( incidence ); <a name="l00766"></a>00766 <span class="comment">// changeIncidenceDisplay( incidence, KOGlobals::INCIDENCEDELETED );</span> <a name="l00767"></a>00767 updateUnmanagedViews(); <a name="l00768"></a>00768 } <a name="l00769"></a>00769 <a name="l00770"></a>00770 <span class="keywordtype">void</span> CalendarView::incidenceDeleted( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l00771"></a>00771 { <a name="l00772"></a>00772 <a class="code" href="classCalendarView.html#41f2935fc0d9b420dc505aacc3e19d0e" title="passes on the message that an event has changed to the currently activated view so...">changeIncidenceDisplay</a>( incidence, KOGlobals::INCIDENCEDELETED ); <a name="l00773"></a>00773 updateUnmanagedViews(); <a name="l00774"></a>00774 } <a name="l00775"></a>00775 <a name="l00776"></a>00776 <span class="keywordtype">void</span> CalendarView::checkForFilteredChange( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l00777"></a>00777 { <a name="l00778"></a>00778 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a> *filter = calendar()-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#7aa8780fde5754abc19e7616fc179a8e">filter</a>(); <a name="l00779"></a>00779 <span class="keywordflow">if</span> ( filter && !filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#2fd760a856990932d425e7c3f54982f6">filterIncidence</a>( incidence ) ) { <a name="l00780"></a>00780 <span class="comment">// Incidence is filtered and thus not shown in the view, tell the</span> <a name="l00781"></a>00781 <span class="comment">// user so that he isn't surprised if his new event doesn't show up</span> <a name="l00782"></a>00782 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The item \"%1\" is filtered by "</span> <a name="l00783"></a>00783 <span class="stringliteral">"your current filter rules, so it will be hidden and not "</span> <a name="l00784"></a>00784 <span class="stringliteral">"appear in the view."</span>).arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ), <a name="l00785"></a>00785 i18n(<span class="stringliteral">"Filter Applied"</span>), <span class="stringliteral">"ChangedIncidenceFiltered"</span> ); <a name="l00786"></a>00786 } <a name="l00787"></a>00787 } <a name="l00788"></a>00788 <a name="l00789"></a>00789 <span class="keywordtype">void</span> CalendarView::startMultiModify( <span class="keyword">const</span> QString &text ) <a name="l00790"></a>00790 { <a name="l00791"></a>00791 history()->startMultiModify( text ); <a name="l00792"></a>00792 } <a name="l00793"></a>00793 <a name="l00794"></a>00794 <span class="keywordtype">void</span> CalendarView::endMultiModify() <a name="l00795"></a>00795 { <a name="l00796"></a>00796 history()->endMultiModify(); <a name="l00797"></a>00797 } <a name="l00798"></a>00798 <a name="l00799"></a>00799 <a name="l00800"></a><a class="code" href="classCalendarView.html#41f2935fc0d9b420dc505aacc3e19d0e">00800</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#41f2935fc0d9b420dc505aacc3e19d0e" title="passes on the message that an event has changed to the currently activated view so...">CalendarView::changeIncidenceDisplay</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence, <span class="keywordtype">int</span> action ) <a name="l00801"></a>00801 { <a name="l00802"></a>00802 mDateNavigator->updateView(); <a name="l00803"></a>00803 mDialogManager-><a class="code" href="classKODialogManager.html#68d1e0f4cc66274c2d96f7371cc7c444">updateSearchDialog</a>(); <a name="l00804"></a>00804 <a name="l00805"></a>00805 <span class="keywordflow">if</span> ( incidence ) { <a name="l00806"></a>00806 <span class="comment">// If there is an event view visible update the display</span> <a name="l00807"></a>00807 mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#585f0a666a4fe514ac48844bedeea739" title="Updates the current display to reflect the changes to one particular incidence.">changeIncidenceDisplay</a>( incidence, action ); <a name="l00808"></a>00808 <span class="keywordflow">if</span> ( mTodoList ) mTodoList-><a class="code" href="classKOTodoView.html#02c8b4768b797afffe324ea47636211f" title="Updates the current display to reflect the changes to one particular incidence.">changeIncidenceDisplay</a>( incidence, action ); <a name="l00809"></a>00809 mEventViewer-><a class="code" href="classKOEventViewer.html#67290cfdc13bfbe2f8a48d9a07e09728">changeIncidenceDisplay</a>( incidence, action ); <a name="l00810"></a>00810 } <span class="keywordflow">else</span> { <a name="l00811"></a>00811 mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#77ec9b0385cfef0d355ea25b0e118bfd" title="Updates the current display to reflect changes that may have happened in the calendar...">updateView</a>(); <a name="l00812"></a>00812 <span class="keywordflow">if</span> ( mTodoList ) mTodoList-><a class="code" href="classKOTodoView.html#26c71a69605713ecd502e0f4c9e84540" title="Updates the current display to reflect changes that may have happened in the calendar...">updateView</a>(); <a name="l00813"></a>00813 } <a name="l00814"></a>00814 } <a name="l00815"></a>00815 <a name="l00816"></a>00816 <a name="l00817"></a>00817 <span class="keywordtype">void</span> CalendarView::updateView(<span class="keyword">const</span> QDate &start, <span class="keyword">const</span> QDate &end) <a name="l00818"></a>00818 { <a name="l00819"></a>00819 mTodoList-><a class="code" href="classKOTodoView.html#26c71a69605713ecd502e0f4c9e84540" title="Updates the current display to reflect changes that may have happened in the calendar...">updateView</a>(); <a name="l00820"></a>00820 mViewManager-><a class="code" href="classKOViewManager.html#6c22c0fe512dbb5bcf2ad96a94307ae7">updateView</a>(start, end); <a name="l00821"></a>00821 mDateNavigator->updateView(); <a name="l00822"></a>00822 } <a name="l00823"></a>00823 <a name="l00824"></a>00824 <span class="keywordtype">void</span> CalendarView::updateView() <a name="l00825"></a>00825 { <a name="l00826"></a>00826 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">DateList</a> tmpList = mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>(); <a name="l00827"></a>00827 <a name="l00828"></a>00828 <span class="comment">// We assume that the navigator only selects consecutive days.</span> <a name="l00829"></a>00829 updateView( tmpList.first(), tmpList.last() ); <a name="l00830"></a>00830 } <a name="l00831"></a>00831 <a name="l00832"></a>00832 <span class="keywordtype">void</span> CalendarView::updateUnmanagedViews() <a name="l00833"></a>00833 { <a name="l00834"></a>00834 mDateNavigator->updateDayMatrix(); <a name="l00835"></a>00835 } <a name="l00836"></a>00836 <a name="l00837"></a>00837 <span class="keywordtype">int</span> CalendarView::msgItemDelete( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l00838"></a>00838 { <a name="l00839"></a>00839 <span class="keywordflow">return</span> KMessageBox::warningContinueCancel(<span class="keyword">this</span>, <a name="l00840"></a>00840 i18n(<span class="stringliteral">"The item \"%1\" will be permanently deleted."</span>).arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ), <a name="l00841"></a>00841 i18n(<span class="stringliteral">"KOrganizer Confirmation"</span>), KGuiItem(i18n(<span class="stringliteral">"&Delete"</span>),<span class="stringliteral">"editdelete"</span>)); <a name="l00842"></a>00842 } <a name="l00843"></a>00843 <a name="l00844"></a>00844 <a name="l00845"></a><a class="code" href="classCalendarView.html#55833939ce770640f73278cf10aa5e26">00845</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#55833939ce770640f73278cf10aa5e26" title="cut the current appointment to the clipboard">CalendarView::edit_cut</a>() <a name="l00846"></a>00846 { <a name="l00847"></a>00847 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l00848"></a>00848 <a name="l00849"></a>00849 <span class="keywordflow">if</span> ( !incidence || !mChanger ) { <a name="l00850"></a>00850 KNotifyClient::beep(); <a name="l00851"></a>00851 <span class="keywordflow">return</span>; <a name="l00852"></a>00852 } <a name="l00853"></a>00853 mChanger->cutIncidence( incidence ); <a name="l00854"></a>00854 } <a name="l00855"></a>00855 <a name="l00856"></a><a class="code" href="classCalendarView.html#caf61e1a0d95174bf5023e4cb1c24c03">00856</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#caf61e1a0d95174bf5023e4cb1c24c03" title="copy the current appointment(s) to the clipboard">CalendarView::edit_copy</a>() <a name="l00857"></a>00857 { <a name="l00858"></a>00858 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l00859"></a>00859 <a name="l00860"></a>00860 <span class="keywordflow">if</span> (!incidence) { <a name="l00861"></a>00861 KNotifyClient::beep(); <a name="l00862"></a>00862 <span class="keywordflow">return</span>; <a name="l00863"></a>00863 } <a name="l00864"></a>00864 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1DndFactory.html">DndFactory</a> factory( mCalendar ); <a name="l00865"></a>00865 <span class="keywordflow">if</span> ( !factory.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1DndFactory.html#d5a9fca86aa0e7f8ea4d013c2a5bf0ef">copyIncidence</a>( incidence ) ) { <a name="l00866"></a>00866 KNotifyClient::beep(); <a name="l00867"></a>00867 } <a name="l00868"></a>00868 } <a name="l00869"></a>00869 <a name="l00870"></a><a class="code" href="classCalendarView.html#7f601cf861f7d18dc1dc4585a4ca90ff">00870</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7f601cf861f7d18dc1dc4585a4ca90ff" title="paste the current vobject(s) in the clipboard buffer into calendar">CalendarView::edit_paste</a>() <a name="l00871"></a>00871 { <a name="l00872"></a>00872 <span class="comment">// If in agenda view, use the selected time and date from there.</span> <a name="l00873"></a>00873 <span class="comment">// In all other cases, paste the event on the first day of the</span> <a name="l00874"></a>00874 <span class="comment">// selection in the day matrix on the left</span> <a name="l00875"></a>00875 <a name="l00876"></a>00876 QDate date; <a name="l00877"></a>00877 <span class="comment">// create an invalid time to check if we got a new time for the eevent</span> <a name="l00878"></a>00878 QTime time(-1,-1); <a name="l00879"></a>00879 QDateTime startDT, endDT; <a name="l00880"></a>00880 <span class="keywordtype">bool</span> useEndTime = <span class="keyword">false</span>; <a name="l00881"></a>00881 <a name="l00882"></a>00882 <a class="code" href="classKOAgendaView.html" title="KOAgendaView is the agenda-like view used to display events in a single one or multi-day...">KOAgendaView</a> *aView = mViewManager-><a class="code" href="classKOViewManager.html#c74d629127df584a4159f4f48c803f81">agendaView</a>(); <a name="l00883"></a>00883 <span class="keywordflow">if</span> (aView && aView-><a class="code" href="classKOAgendaView.html#7c0452e2dd71a033fcd7b13713a15539" title="start-datetime of selection">selectionStart</a>().isValid()) { <a name="l00884"></a>00884 date = aView-><a class="code" href="classKOAgendaView.html#7c0452e2dd71a033fcd7b13713a15539" title="start-datetime of selection">selectionStart</a>().date(); <a name="l00885"></a>00885 startDT = aView-><a class="code" href="classKOAgendaView.html#7c0452e2dd71a033fcd7b13713a15539" title="start-datetime of selection">selectionStart</a>(); <a name="l00886"></a>00886 endDT = aView-><a class="code" href="classKOAgendaView.html#6ef0620b515b25f6f40d0732e5f53225" title="end-datetime of selection">selectionEnd</a>(); <a name="l00887"></a>00887 useEndTime = !aView-><a class="code" href="classKOAgendaView.html#1c10ada402b21fe32cc799d5bb5bfa5f" title="returns if only a single cell is selected, or a range of cells">selectedIsSingleCell</a>(); <a name="l00888"></a>00888 <span class="keywordflow">if</span> (!aView-><a class="code" href="classKOAgendaView.html#fa74a3312df104a2b36a0544b448ef5d" title="returns true if selection is for whole day">selectedIsAllDay</a>()) { <a name="l00889"></a>00889 time = aView-><a class="code" href="classKOAgendaView.html#7c0452e2dd71a033fcd7b13713a15539" title="start-datetime of selection">selectionStart</a>().time(); <a name="l00890"></a>00890 } <a name="l00891"></a>00891 <a name="l00892"></a>00892 } <span class="keywordflow">else</span> { <a name="l00893"></a>00893 date = mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>().first(); <a name="l00894"></a>00894 } <a name="l00895"></a>00895 <a name="l00896"></a>00896 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1DndFactory.html">DndFactory</a> factory( mCalendar ); <a name="l00897"></a>00897 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *pastedIncidence; <a name="l00898"></a>00898 <span class="keywordflow">if</span> (time.isValid()) <a name="l00899"></a>00899 pastedIncidence = factory.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1DndFactory.html#47a6d8e696e70d107991c8f3697ce4c1">pasteIncidence</a>( date, &time ); <a name="l00900"></a>00900 <span class="keywordflow">else</span> <a name="l00901"></a>00901 pastedIncidence = factory.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1DndFactory.html#47a6d8e696e70d107991c8f3697ce4c1">pasteIncidence</a>( date ); <a name="l00902"></a>00902 <span class="keywordflow">if</span> ( !pastedIncidence ) <span class="keywordflow">return</span>; <a name="l00903"></a>00903 <a name="l00904"></a>00904 <span class="comment">// FIXME: use a visitor here</span> <a name="l00905"></a>00905 <span class="keywordflow">if</span> (pastedIncidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Event"</span> ) { <a name="l00906"></a>00906 <a name="l00907"></a>00907 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html">Event</a>* pastedEvent = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html">Event</a>*<span class="keyword">></span>(pastedIncidence); <a name="l00908"></a>00908 <span class="comment">// only use selected area if event is of the same type (all-day or non-all-day</span> <a name="l00909"></a>00909 <span class="comment">// as the current selection is</span> <a name="l00910"></a>00910 <span class="keywordflow">if</span> ( aView && endDT.isValid() && useEndTime ) { <a name="l00911"></a>00911 <span class="keywordflow">if</span> ( (pastedEvent-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#edfe188f8024f1ec9e25972ddd332724">doesFloat</a>() && aView-><a class="code" href="classKOAgendaView.html#fa74a3312df104a2b36a0544b448ef5d" title="returns true if selection is for whole day">selectedIsAllDay</a>()) || <a name="l00912"></a>00912 (!pastedEvent-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#edfe188f8024f1ec9e25972ddd332724">doesFloat</a>() && ! aView-><a class="code" href="classKOAgendaView.html#fa74a3312df104a2b36a0544b448ef5d" title="returns true if selection is for whole day">selectedIsAllDay</a>()) ) { <a name="l00913"></a>00913 pastedEvent-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html#0d6840be8adf1a8fd37617ecf3da535b">setDtEnd</a>(endDT); <a name="l00914"></a>00914 } <a name="l00915"></a>00915 } <a name="l00916"></a>00916 mChanger->addIncidence( pastedEvent, <span class="keyword">this</span> ); <a name="l00917"></a>00917 <a name="l00918"></a>00918 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( pastedIncidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l00919"></a>00919 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>* pastedTodo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>*<span class="keyword">></span>(pastedIncidence); <a name="l00920"></a>00920 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>* _selectedTodo = selectedTodo(); <a name="l00921"></a>00921 <span class="keywordflow">if</span> ( _selectedTodo ) <a name="l00922"></a>00922 pastedTodo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#3cb36283ad2b012e5bf9a769d13593ad">setRelatedTo</a>( _selectedTodo ); <a name="l00923"></a>00923 mChanger->addIncidence( pastedTodo, <span class="keyword">this</span> ); <a name="l00924"></a>00924 } <a name="l00925"></a>00925 } <a name="l00926"></a>00926 <a name="l00927"></a><a class="code" href="classCalendarView.html#ac4d77c67e97fd7569ac6376601674d3">00927</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#ac4d77c67e97fd7569ac6376601674d3" title="edit viewing and configuration options.">CalendarView::edit_options</a>() <a name="l00928"></a>00928 { <a name="l00929"></a>00929 mDialogManager-><a class="code" href="classKODialogManager.html#4145fd61c2105add0aa393c165f82b01">showOptionsDialog</a>(); <a name="l00930"></a>00930 } <a name="l00931"></a>00931 <a name="l00932"></a><a class="code" href="classCalendarView.html#080a7e6b064beb4a527eee763997fc11">00932</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#080a7e6b064beb4a527eee763997fc11" title="Adjust the given date/times by valid defaults (selection or configured defaults,...">CalendarView::dateTimesForNewEvent</a>( QDateTime &startDt, QDateTime &endDt, <span class="keywordtype">bool</span> &allDay ) <a name="l00933"></a>00933 { <a name="l00934"></a>00934 <span class="keywordflow">if</span> ( !startDt.isValid() ) { <a name="l00935"></a>00935 <span class="comment">// Default start is the first selected date with the preferred time as set</span> <a name="l00936"></a>00936 <span class="comment">// in the config dlg.</span> <a name="l00937"></a>00937 <span class="keywordflow">if</span> ( !startDt.date().isValid() ) { <a name="l00938"></a>00938 startDt.setDate( mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>().first() ); <a name="l00939"></a>00939 } <a name="l00940"></a>00940 <span class="keywordflow">if</span> ( !startDt.time().isValid() ) { <a name="l00941"></a>00941 startDt.setTime( KOPrefs::instance()->mStartTime.time() ); <a name="l00942"></a>00942 } <a name="l00943"></a>00943 } <a name="l00944"></a>00944 <span class="keywordflow">if</span> ( !endDt.isValid() ) { <a name="l00945"></a>00945 <span class="keywordtype">int</span> addSecs = ( KOPrefs::instance()->mDefaultDuration.time().hour()*3600 ) + <a name="l00946"></a>00946 ( KOPrefs::instance()->mDefaultDuration.time().minute()*60 ); <a name="l00947"></a>00947 endDt = startDt.addSecs( addSecs ); <a name="l00948"></a>00948 } <a name="l00949"></a>00949 mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#9aa618a5f7e8d2f044586506e9f59315" title="Set the default start/end date/time for new events.">eventDurationHint</a>( startDt, endDt, allDay ); <a name="l00950"></a>00950 } <a name="l00951"></a>00951 <a name="l00952"></a>00952 <a class="code" href="classKOEventEditor.html" title="This class provides a dialog for editing an event.">KOEventEditor</a> *CalendarView::newEventEditor( <span class="keyword">const</span> QDateTime &startDtParam, <a name="l00953"></a>00953 <span class="keyword">const</span> QDateTime &endDtParam, <span class="keywordtype">bool</span> allDayParam) <a name="l00954"></a>00954 { <a name="l00955"></a>00955 <span class="comment">// let the current view change the default start/end datetime</span> <a name="l00956"></a>00956 <span class="keywordtype">bool</span> allDay = allDayParam; <a name="l00957"></a>00957 QDateTime startDt( startDtParam ), endDt( endDtParam ); <a name="l00958"></a>00958 <span class="comment">// Adjust the start/end date times (i.e. replace invalid values by defaults,</span> <a name="l00959"></a>00959 <span class="comment">// and let the view adjust the type.</span> <a name="l00960"></a>00960 <a class="code" href="classCalendarView.html#080a7e6b064beb4a527eee763997fc11" title="Adjust the given date/times by valid defaults (selection or configured defaults,...">dateTimesForNewEvent</a>( startDt, endDt, allDay ); <a name="l00961"></a>00961 <a name="l00962"></a>00962 <a class="code" href="classKOEventEditor.html" title="This class provides a dialog for editing an event.">KOEventEditor</a> *eventEditor = mDialogManager-><a class="code" href="classKODialogManager.html#8a557ac6ed90eb72820c11ab564a3ecb" title="Get an editor dialog for an Event.">getEventEditor</a>(); <a name="l00963"></a>00963 eventEditor-><a class="code" href="classKOEventEditor.html#ff9b16dd572f5cce0c9a37f7683c2d78" title="Clear event win for new event.">newEvent</a>(); <a name="l00964"></a>00964 connectIncidenceEditor( eventEditor ); <a name="l00965"></a>00965 eventEditor-><a class="code" href="classKOEventEditor.html#2b4db8b13411b9babe923313f0c4271d" title="Set widgets to the given date/time values.">setDates</a>( startDt, endDt, allDay ); <a name="l00966"></a>00966 mDialogManager-><a class="code" href="classKODialogManager.html#7a24e7f02c3a3eb3b6d269a03df9820a">connectTypeAhead</a>( eventEditor, dynamic_cast<KOrg::AgendaView*>(viewManager()->currentView()) ); <a name="l00967"></a>00967 <span class="keywordflow">return</span> eventEditor; <a name="l00968"></a>00968 } <a name="l00969"></a>00969 <a name="l00970"></a>00970 <a name="l00971"></a>00971 <a name="l00972"></a>00972 <a name="l00973"></a><a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58">00973</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">CalendarView::newEvent</a>() <a name="l00974"></a>00974 { <a name="l00975"></a>00975 kdDebug(5850) << <span class="stringliteral">"CalendarView::newEvent()"</span> << endl; <a name="l00976"></a>00976 <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">newEvent</a>( QDateTime(), QDateTime() ); <a name="l00977"></a>00977 } <a name="l00978"></a>00978 <a name="l00979"></a><a class="code" href="classCalendarView.html#9d4a43271ea1a5e87a485e67b8b636bd">00979</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">CalendarView::newEvent</a>( <span class="keyword">const</span> QDate &dt ) <a name="l00980"></a>00980 { <a name="l00981"></a>00981 QDateTime startDt( dt, KOPrefs::instance()->mStartTime.time() ); <a name="l00982"></a>00982 <span class="keywordflow">return</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">newEvent</a>( QDateTime( dt ), QDateTime() ); <a name="l00983"></a>00983 } <a name="l00984"></a>00984 <a name="l00985"></a>00985 <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">CalendarView::newEvent</a>( <span class="keyword">const</span> QDateTime &startDt ) <a name="l00986"></a>00986 { <a name="l00987"></a>00987 <span class="keywordflow">return</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">newEvent</a>( startDt, QDateTime() ); <a name="l00988"></a>00988 } <a name="l00989"></a>00989 <a name="l00990"></a>00990 <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">CalendarView::newEvent</a>( <span class="keyword">const</span> QDateTime &startDt, <span class="keyword">const</span> QDateTime &endDt, <a name="l00991"></a>00991 <span class="keywordtype">bool</span> allDay ) <a name="l00992"></a>00992 { <a name="l00993"></a>00993 <a class="code" href="classKOEventEditor.html" title="This class provides a dialog for editing an event.">KOEventEditor</a> *eventEditor = newEventEditor( startDt, endDt, allDay ); <a name="l00994"></a>00994 eventEditor->show(); <a name="l00995"></a>00995 } <a name="l00996"></a>00996 <a name="l00997"></a><a class="code" href="classCalendarView.html#9121d9b76cd0bf435df4334f5ae02f22">00997</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">CalendarView::newEvent</a>( <span class="keyword">const</span> QString &summary, <span class="keyword">const</span> QString &description, <a name="l00998"></a>00998 <span class="keyword">const</span> QStringList &attachments, <span class="keyword">const</span> QStringList &attendees, <a name="l00999"></a>00999 <span class="keyword">const</span> QStringList &attachmentMimetypes, <span class="keywordtype">bool</span> inlineAttachment ) <a name="l01000"></a>01000 { <a name="l01001"></a>01001 <a class="code" href="classKOEventEditor.html" title="This class provides a dialog for editing an event.">KOEventEditor</a> *eventEditor = newEventEditor(); <a name="l01002"></a>01002 eventEditor-><a class="code" href="classKOEventEditor.html#d2c23eeab022b0a14f2a762c00d82c26" title="Sets the given summary and description.">setTexts</a>( summary, description ); <a name="l01003"></a>01003 <span class="comment">// if attach or attendee list is empty, these methods don't do anything, so</span> <a name="l01004"></a>01004 <span class="comment">// it's save to call them in every case</span> <a name="l01005"></a>01005 eventEditor-><a class="code" href="classKOIncidenceEditor.html#eeb7a521dbd5c82dafdfde1037e38015" title="Adds attachments to the editor.">addAttachments</a>( attachments, attachmentMimetypes, inlineAttachment ); <a name="l01006"></a>01006 eventEditor-><a class="code" href="classKOIncidenceEditor.html#4ba4f0afecd11f0c1aa45dac6fc099fd" title="Adds attendees to the editor.">addAttendees</a>( attendees ); <a name="l01007"></a>01007 eventEditor->show(); <a name="l01008"></a>01008 } <a name="l01009"></a>01009 <a name="l01010"></a>01010 <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#cd10740af57c8bb8721e70c22cfeda6f" title="create new todo">CalendarView::newTodo</a>( <span class="keyword">const</span> QString &summary, <span class="keyword">const</span> QString &description, <a name="l01011"></a>01011 <span class="keyword">const</span> QStringList &attachments, <span class="keyword">const</span> QStringList &attendees, <a name="l01012"></a>01012 <span class="keyword">const</span> QStringList &attachmentMimetypes, <span class="keywordtype">bool</span> inlineAttachment ) <a name="l01013"></a>01013 { <a name="l01014"></a>01014 kdDebug(5850) << k_funcinfo << endl; <a name="l01015"></a>01015 <a class="code" href="classKOTodoEditor.html" title="This class provides a dialog for editing a Todo.">KOTodoEditor</a> *todoEditor = mDialogManager-><a class="code" href="classKODialogManager.html#c23ec920b075b8695b050d8945956222" title="Get an editor dialog for a Todo.">getTodoEditor</a>(); <a name="l01016"></a>01016 connectIncidenceEditor( todoEditor ); <a name="l01017"></a>01017 todoEditor-><a class="code" href="classKOTodoEditor.html#60a8eb0572988836150f4634d7cd25d1" title="Edit new todo.">newTodo</a>(); <a name="l01018"></a>01018 todoEditor-><a class="code" href="classKOTodoEditor.html#6761cefa1a125103dfebf317b96c1266" title="Sets the given summary and description.">setTexts</a>( summary, description ); <a name="l01019"></a>01019 todoEditor-><a class="code" href="classKOIncidenceEditor.html#eeb7a521dbd5c82dafdfde1037e38015" title="Adds attachments to the editor.">addAttachments</a>( attachments, attachmentMimetypes, inlineAttachment ); <a name="l01020"></a>01020 todoEditor-><a class="code" href="classKOIncidenceEditor.html#4ba4f0afecd11f0c1aa45dac6fc099fd" title="Adds attendees to the editor.">addAttendees</a>( attendees ); <a name="l01021"></a>01021 todoEditor->show(); <a name="l01022"></a>01022 } <a name="l01023"></a>01023 <a name="l01024"></a><a class="code" href="classCalendarView.html#cd10740af57c8bb8721e70c22cfeda6f">01024</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#cd10740af57c8bb8721e70c22cfeda6f" title="create new todo">CalendarView::newTodo</a>() <a name="l01025"></a>01025 { <a name="l01026"></a>01026 kdDebug(5850) << k_funcinfo << endl; <a name="l01027"></a>01027 QDateTime dtDue; <a name="l01028"></a>01028 <span class="keywordtype">bool</span> allday = <span class="keyword">true</span>; <a name="l01029"></a>01029 <a class="code" href="classKOTodoEditor.html" title="This class provides a dialog for editing a Todo.">KOTodoEditor</a> *todoEditor = mDialogManager-><a class="code" href="classKODialogManager.html#c23ec920b075b8695b050d8945956222" title="Get an editor dialog for a Todo.">getTodoEditor</a>(); <a name="l01030"></a>01030 connectIncidenceEditor( todoEditor ); <a name="l01031"></a>01031 todoEditor-><a class="code" href="classKOTodoEditor.html#60a8eb0572988836150f4634d7cd25d1" title="Edit new todo.">newTodo</a>(); <a name="l01032"></a>01032 <span class="keywordflow">if</span> ( mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#bd095caeae8863e11c1d7342f4f42e0d" title="Return if this view is a view for displaying events.">isEventView</a>() ) { <a name="l01033"></a>01033 dtDue.setDate( mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>().first() ); <a name="l01034"></a>01034 QDateTime dtDummy = QDateTime::currentDateTime(); <a name="l01035"></a>01035 mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-> <a name="l01036"></a>01036 eventDurationHint( dtDue, dtDummy, allday ); <a name="l01037"></a>01037 todoEditor-><a class="code" href="classKOTodoEditor.html#d684c3909eaca554ca6b7c7b796642b4" title="Set widgets to default values.">setDates</a>( dtDue, allday ); <a name="l01038"></a>01038 } <a name="l01039"></a>01039 todoEditor->show(); <a name="l01040"></a>01040 } <a name="l01041"></a>01041 <a name="l01042"></a><a class="code" href="classCalendarView.html#778bc2a9cd11fc7d41ce5eb159378687">01042</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#cd10740af57c8bb8721e70c22cfeda6f" title="create new todo">CalendarView::newTodo</a>( <span class="keyword">const</span> QDate &date ) <a name="l01043"></a>01043 { <a name="l01044"></a>01044 <a class="code" href="classKOTodoEditor.html" title="This class provides a dialog for editing a Todo.">KOTodoEditor</a> *todoEditor = mDialogManager-><a class="code" href="classKODialogManager.html#c23ec920b075b8695b050d8945956222" title="Get an editor dialog for a Todo.">getTodoEditor</a>(); <a name="l01045"></a>01045 connectIncidenceEditor( todoEditor ); <a name="l01046"></a>01046 todoEditor-><a class="code" href="classKOTodoEditor.html#60a8eb0572988836150f4634d7cd25d1" title="Edit new todo.">newTodo</a>(); <a name="l01047"></a>01047 todoEditor-><a class="code" href="classKOTodoEditor.html#d684c3909eaca554ca6b7c7b796642b4" title="Set widgets to default values.">setDates</a>( QDateTime( date, QTime::currentTime() ), <span class="keyword">true</span> ); <a name="l01048"></a>01048 todoEditor->show(); <a name="l01049"></a>01049 } <a name="l01050"></a>01050 <a name="l01051"></a>01051 <span class="keywordtype">void</span> CalendarView::newJournal() <a name="l01052"></a>01052 { <a name="l01053"></a>01053 kdDebug(5850) << <span class="stringliteral">"CalendarView::newJournal()"</span> << endl; <a name="l01054"></a>01054 newJournal( QString::null, QDate() ); <a name="l01055"></a>01055 } <a name="l01056"></a>01056 <a name="l01057"></a>01057 <span class="keywordtype">void</span> CalendarView::newJournal( <span class="keyword">const</span> QDate &date) <a name="l01058"></a>01058 { <a name="l01059"></a>01059 newJournal( QString::null, date ); <a name="l01060"></a>01060 } <a name="l01061"></a>01061 <a name="l01062"></a>01062 <span class="keywordtype">void</span> CalendarView::newJournal( <span class="keyword">const</span> QString &text, <span class="keyword">const</span> QDate &date ) <a name="l01063"></a>01063 { <a name="l01064"></a>01064 <a class="code" href="classKOJournalEditor.html" title="This class provides a dialog for editing a Journal.">KOJournalEditor</a> *journalEditor = mDialogManager-><a class="code" href="classKODialogManager.html#33dc670ac7efe8e139224a1357a323ad" title="Get an editor dialog for a Journal.">getJournalEditor</a>(); <a name="l01065"></a>01065 connectIncidenceEditor( journalEditor ); <a name="l01066"></a>01066 journalEditor-><a class="code" href="classKOJournalEditor.html#1f806ba2efde43f7ba247649bff6945e" title="Clear editor for new Journal.">newJournal</a>(); <a name="l01067"></a>01067 journalEditor-><a class="code" href="classKOJournalEditor.html#342890f4b90e33f4c183aa7e479f183c" title="Sets the given summary and description.">setTexts</a>( text ); <a name="l01068"></a>01068 <span class="keywordflow">if</span> ( !date.isValid() ) { <a name="l01069"></a>01069 journalEditor-><a class="code" href="classKOJournalEditor.html#c5431e7db4e587b1dddb673aba935fa7" title="Set widgets to default values.">setDate</a>( mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>().first() ); <a name="l01070"></a>01070 } <span class="keywordflow">else</span> { <a name="l01071"></a>01071 journalEditor-><a class="code" href="classKOJournalEditor.html#c5431e7db4e587b1dddb673aba935fa7" title="Set widgets to default values.">setDate</a>( date ); <a name="l01072"></a>01072 } <a name="l01073"></a>01073 journalEditor->show(); <a name="l01074"></a>01074 } <a name="l01075"></a>01075 <a name="l01076"></a><a class="code" href="classCalendarView.html#0ac95d11a2d0a3ad326fda26970ca378">01076</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#0ac95d11a2d0a3ad326fda26970ca378" title="create new todo with a parent todo">CalendarView::newSubTodo</a>() <a name="l01077"></a>01077 { <a name="l01078"></a>01078 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo = selectedTodo(); <a name="l01079"></a>01079 <span class="keywordflow">if</span> ( todo ) <a class="code" href="classCalendarView.html#0ac95d11a2d0a3ad326fda26970ca378" title="create new todo with a parent todo">newSubTodo</a>( todo ); <a name="l01080"></a>01080 } <a name="l01081"></a>01081 <a name="l01082"></a><a class="code" href="classCalendarView.html#a07f3103f369bed4bd310092b63a8e46">01082</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#0ac95d11a2d0a3ad326fda26970ca378" title="create new todo with a parent todo">CalendarView::newSubTodo</a>(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *parentEvent) <a name="l01083"></a>01083 { <a name="l01084"></a>01084 <a class="code" href="classKOTodoEditor.html" title="This class provides a dialog for editing a Todo.">KOTodoEditor</a> *todoEditor = mDialogManager-><a class="code" href="classKODialogManager.html#c23ec920b075b8695b050d8945956222" title="Get an editor dialog for a Todo.">getTodoEditor</a>(); <a name="l01085"></a>01085 connectIncidenceEditor( todoEditor ); <a name="l01086"></a>01086 todoEditor-><a class="code" href="classKOTodoEditor.html#60a8eb0572988836150f4634d7cd25d1" title="Edit new todo.">newTodo</a>(); <a name="l01087"></a>01087 todoEditor-><a class="code" href="classKOTodoEditor.html#d684c3909eaca554ca6b7c7b796642b4" title="Set widgets to default values.">setDates</a>( QDateTime(), <span class="keyword">false</span>, parentEvent ); <a name="l01088"></a>01088 todoEditor->show(); <a name="l01089"></a>01089 } <a name="l01090"></a>01090 <a name="l01091"></a>01091 <span class="keywordtype">void</span> CalendarView::newFloatingEvent() <a name="l01092"></a>01092 { <a name="l01093"></a>01093 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">DateList</a> tmpList = mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>(); <a name="l01094"></a>01094 QDate date = tmpList.first(); <a name="l01095"></a>01095 <a name="l01096"></a>01096 <a class="code" href="classCalendarView.html#7674cba89b6a288f22c60c03c3387e58" title="create new event without having a date hint.">newEvent</a>( QDateTime( date, QTime( 12, 0, 0 ) ), <a name="l01097"></a>01097 QDateTime( date, QTime( 12, 0, 0 ) ), <span class="keyword">true</span> ); <a name="l01098"></a>01098 } <a name="l01099"></a>01099 <a name="l01100"></a><a class="code" href="classCalendarView.html#fd5501293843fee37e6abc7587b54521">01100</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#fd5501293843fee37e6abc7587b54521" title="Add an incidence to the active calendar.">CalendarView::addIncidence</a>( <span class="keyword">const</span> QString &ical ) <a name="l01101"></a>01101 { <a name="l01102"></a>01102 kdDebug(5850) << <span class="stringliteral">"CalendarView::addIncidence:\n"</span> << ical << endl; <a name="l01103"></a>01103 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html">ICalFormat</a> format; <a name="l01104"></a>01104 format.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html#0f1d58323f91008a5758541ff77396a8">setTimeZone</a>( mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#dbb33ceb6de6668520995b95b4fd646b">timeZoneId</a>(), true ); <a name="l01105"></a>01105 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = format.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html#91e6cc78ec3a8c7d29f04e0f7f871ff2">fromString</a>( ical ); <a name="l01106"></a>01106 <span class="keywordflow">if</span> ( !incidence ) <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01107"></a>01107 <span class="keywordflow">if</span> ( !mChanger->addIncidence( incidence, <span class="keyword">this</span> ) ) { <a name="l01108"></a>01108 <span class="keyword">delete</span> incidence; <a name="l01109"></a>01109 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01110"></a>01110 } <a name="l01111"></a>01111 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l01112"></a>01112 } <a name="l01113"></a>01113 <a name="l01114"></a><a class="code" href="classCalendarView.html#e1af9ca8403b08a0d4daad42b3c0ef27">01114</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#e1af9ca8403b08a0d4daad42b3c0ef27" title="pop up a dialog to show an existing appointment.">CalendarView::appointment_show</a>() <a name="l01115"></a>01115 { <a name="l01116"></a>01116 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l01117"></a>01117 <span class="keywordflow">if</span> (incidence) <a name="l01118"></a>01118 showIncidence( incidence ); <a name="l01119"></a>01119 <span class="keywordflow">else</span> <a name="l01120"></a>01120 KNotifyClient::beep(); <a name="l01121"></a>01121 } <a name="l01122"></a>01122 <a name="l01123"></a><a class="code" href="classCalendarView.html#47dd1c342e575cea1b9aac18c40c87b5">01123</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#47dd1c342e575cea1b9aac18c40c87b5" title="pop up an Appointment Dialog to edit an existing appointment.">CalendarView::appointment_edit</a>() <a name="l01124"></a>01124 { <a name="l01125"></a>01125 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l01126"></a>01126 <span class="keywordflow">if</span> (incidence) <a name="l01127"></a>01127 editIncidence( incidence ); <a name="l01128"></a>01128 <span class="keywordflow">else</span> <a name="l01129"></a>01129 KNotifyClient::beep(); <a name="l01130"></a>01130 } <a name="l01131"></a>01131 <a name="l01132"></a><a class="code" href="classCalendarView.html#01f5195d2653f4787848785b8be9d321">01132</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#01f5195d2653f4787848785b8be9d321" title="pop up dialog confirming deletion of currently selected event in the View.">CalendarView::appointment_delete</a>() <a name="l01133"></a>01133 { <a name="l01134"></a>01134 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l01135"></a>01135 <span class="keywordflow">if</span> (incidence) <a name="l01136"></a>01136 deleteIncidence( incidence ); <a name="l01137"></a>01137 <span class="keywordflow">else</span> <a name="l01138"></a>01138 KNotifyClient::beep(); <a name="l01139"></a>01139 } <a name="l01140"></a>01140 <a name="l01141"></a>01141 <span class="keywordtype">void</span> CalendarView::todo_unsub() <a name="l01142"></a>01142 { <a name="l01143"></a>01143 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *anTodo = selectedTodo(); <a name="l01144"></a>01144 <span class="keywordflow">if</span>( todo_unsub (anTodo ) ) { <a name="l01145"></a>01145 updateView(); <a name="l01146"></a>01146 } <a name="l01147"></a>01147 } <a name="l01148"></a>01148 <a name="l01149"></a>01149 <span class="keywordtype">bool</span> CalendarView::todo_unsub( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo ) <a name="l01150"></a>01150 { <a name="l01151"></a>01151 <span class="keywordtype">bool</span> status= <span class="keyword">false</span>; <a name="l01152"></a>01152 <span class="keywordflow">if</span> ( !todo || !todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#9b09c1637d3900ba0c2e768b39fff819">relatedTo</a>() ) <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01153"></a>01153 <a name="l01154"></a>01154 <span class="keywordflow">if</span> ( mChanger->beginChange( todo ) ) { <a name="l01155"></a>01155 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *oldTodo = todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#5de897dfd17f8fd85394eda93ddf377b">clone</a>(); <a name="l01156"></a>01156 todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#3cb36283ad2b012e5bf9a769d13593ad">setRelatedTo</a>(0); <a name="l01157"></a>01157 mChanger->changeIncidence( oldTodo, todo, KOGlobals::RELATION_MODIFIED ); <a name="l01158"></a>01158 mChanger->endChange( todo ); <a name="l01159"></a>01159 <span class="keyword">delete</span> oldTodo; <a name="l01160"></a>01160 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>(<span class="keyword">true</span>); <a name="l01161"></a>01161 status = <span class="keyword">true</span>; <a name="l01162"></a>01162 } <a name="l01163"></a>01163 <span class="keywordflow">if</span> ( ! status ) { <a name="l01164"></a>01164 KMessageBox::sorry( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to turn sub-to-do into a top-level "</span> <a name="l01165"></a>01165 <span class="stringliteral">"to-do, because it cannot be locked."</span>) ); <a name="l01166"></a>01166 } <a name="l01167"></a>01167 <a name="l01168"></a>01168 <span class="keywordflow">return</span> status; <a name="l01169"></a>01169 } <a name="l01170"></a>01170 <a name="l01171"></a><a class="code" href="classCalendarView.html#cb45a342846d90107f9cd7b0acdca068">01171</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#cb45a342846d90107f9cd7b0acdca068" title="Make all sub-to-dos of todo independents, update the view.">CalendarView::makeSubTodosIndependents</a> ( ) <a name="l01172"></a>01172 { <a name="l01173"></a>01173 <span class="keywordtype">bool</span> status = <span class="keyword">false</span>; <a name="l01174"></a>01174 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *anTodo = selectedTodo(); <a name="l01175"></a>01175 <a name="l01176"></a>01176 <span class="keywordflow">if</span>( <a class="code" href="classCalendarView.html#cb45a342846d90107f9cd7b0acdca068" title="Make all sub-to-dos of todo independents, update the view.">makeSubTodosIndependents</a>( anTodo ) ) { <a name="l01177"></a>01177 updateView(); <a name="l01178"></a>01178 status = <span class="keyword">true</span>; <a name="l01179"></a>01179 } <a name="l01180"></a>01180 <span class="keywordflow">return</span> status; <a name="l01181"></a>01181 } <a name="l01182"></a>01182 <a name="l01183"></a><a class="code" href="classCalendarView.html#c0fa44a8c0a640a6040081e09cb567a5">01183</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#cb45a342846d90107f9cd7b0acdca068" title="Make all sub-to-dos of todo independents, update the view.">CalendarView::makeSubTodosIndependents</a> ( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo ) <a name="l01184"></a>01184 { <a name="l01185"></a>01185 <span class="keywordflow">if</span>( !todo || todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#a4543a67ede7777dda57b127fa8fdf88">relations</a>().isEmpty() ) <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01186"></a>01186 <a name="l01187"></a>01187 startMultiModify ( i18n( <span class="stringliteral">"Make sub-to-dos independent"</span> ) ); <a name="l01188"></a>01188 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> subTodos( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#a4543a67ede7777dda57b127fa8fdf88">relations</a>() ); <a name="l01189"></a>01189 Incidence::List::Iterator it; <a name="l01190"></a>01190 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *aIncidence; <a name="l01191"></a>01191 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *aTodo; <a name="l01192"></a>01192 <a name="l01193"></a>01193 <span class="keywordflow">for</span> ( it= subTodos.begin(); it != subTodos.end(); ++it ) { <a name="l01194"></a>01194 aIncidence = *it; <a name="l01195"></a>01195 <span class="keywordflow">if</span>( aIncidence && aIncidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l01196"></a>01196 aTodo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>*<span class="keyword">></span>( aIncidence ); <a name="l01197"></a>01197 todo_unsub ( aTodo ); <a name="l01198"></a>01198 } <a name="l01199"></a>01199 } <a name="l01200"></a>01200 endMultiModify(); <a name="l01201"></a>01201 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l01202"></a>01202 } <a name="l01203"></a>01203 <a name="l01204"></a><a class="code" href="classCalendarView.html#7858d3d084d800704fa9aa3afb8a0377">01204</a> <span class="keywordtype">bool</span> CalendarView::deleteIncidence( <span class="keyword">const</span> QString &uid, <span class="keywordtype">bool</span> force ) <a name="l01205"></a>01205 { <a name="l01206"></a>01206 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *inc = mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d271d711219da854049efa30723188c4">incidence</a>( uid ); <a name="l01207"></a>01207 <span class="keywordflow">if</span> ( inc ) { <a name="l01208"></a>01208 deleteIncidence( inc, force ); <a name="l01209"></a>01209 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l01210"></a>01210 } <span class="keywordflow">else</span> { <a name="l01211"></a>01211 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01212"></a>01212 } <a name="l01213"></a>01213 } <a name="l01214"></a>01214 <a name="l01215"></a>01215 <span class="keywordtype">void</span> CalendarView::toggleAlarm( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l01216"></a>01216 { <a name="l01217"></a>01217 <span class="keywordflow">if</span> ( !incidence || !mChanger ) { <a name="l01218"></a>01218 kdDebug(5850) << <span class="stringliteral">"CalendarView::toggleAlarm() called without having a clicked item"</span> << endl; <a name="l01219"></a>01219 <span class="keywordflow">return</span>; <a name="l01220"></a>01220 } <a name="l01221"></a>01221 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*oldincidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l01222"></a>01222 <span class="keywordflow">if</span> ( !mChanger->beginChange( incidence ) ) { <a name="l01223"></a>01223 kdDebug(5850) << <span class="stringliteral">"Unable to lock incidence "</span> << endl; <a name="l01224"></a>01224 <span class="keyword">delete</span> oldincidence; <a name="l01225"></a>01225 <span class="keywordflow">return</span>; <a name="l01226"></a>01226 } <a name="l01227"></a>01227 <a name="l01228"></a>01228 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Alarm.html#2fd946edcd6ecaf41dfba95e77ea2dbf">Alarm::List</a> alarms = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#33727cd753dde462c0995d5a4f1ea40c">alarms</a>(); <a name="l01229"></a>01229 Alarm::List::ConstIterator it; <a name="l01230"></a>01230 <span class="keywordflow">for</span>( it = alarms.begin(); it != alarms.end(); ++it ) <a name="l01231"></a>01231 (*it)->toggleAlarm(); <a name="l01232"></a>01232 <span class="keywordflow">if</span> (alarms.isEmpty()) { <a name="l01233"></a>01233 <span class="comment">// Add an alarm if it didn't have one</span> <a name="l01234"></a>01234 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Alarm.html">Alarm</a>*alm = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#3c7e11ab7af4f867584d2ea502f097f5">newAlarm</a>(); <a name="l01235"></a>01235 alm-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Alarm.html#2d8acc8bc95f7946afd32872eee96d83">setEnabled</a>(<span class="keyword">true</span>); <a name="l01236"></a>01236 } <a name="l01237"></a>01237 mChanger->changeIncidence( oldincidence, incidence, KOGlobals::ALARM_MODIFIED ); <a name="l01238"></a>01238 mChanger->endChange( incidence ); <a name="l01239"></a>01239 <span class="keyword">delete</span> oldincidence; <a name="l01240"></a>01240 <a name="l01241"></a>01241 <span class="comment">// mClickedItem->updateIcons();</span> <a name="l01242"></a>01242 } <a name="l01243"></a>01243 <a name="l01244"></a>01244 <span class="keywordtype">void</span> CalendarView::dissociateOccurrence( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence, <span class="keyword">const</span> QDate &date ) <a name="l01245"></a>01245 { <a name="l01246"></a>01246 <span class="keywordflow">if</span> ( !incidence || !mChanger ) { <a name="l01247"></a>01247 kdDebug(5850) << <span class="stringliteral">"CalendarView::toggleAlarm() called without having a clicked item"</span> << endl; <a name="l01248"></a>01248 <span class="keywordflow">return</span>; <a name="l01249"></a>01249 } <a name="l01250"></a>01250 <span class="keywordflow">if</span> ( !mChanger->beginChange( incidence ) ) { <a name="l01251"></a>01251 kdDebug(5850) << <span class="stringliteral">"Unable to lock incidence "</span> << endl; <a name="l01252"></a>01252 <span class="keywordflow">return</span>; <a name="l01253"></a>01253 } <a name="l01254"></a>01254 startMultiModify( i18n(<span class="stringliteral">"Dissociate occurrence"</span>) ); <a name="l01255"></a>01255 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*oldincidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l01256"></a>01256 <a name="l01257"></a>01257 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* newInc = mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#f62ea6d835b9e816156dc756e9e04051">dissociateOccurrence</a>( incidence, date, <span class="keyword">true</span> ); <a name="l01258"></a>01258 <a name="l01259"></a>01259 <span class="keywordflow">if</span> ( newInc ) { <a name="l01260"></a>01260 <span class="comment">// TODO: Use the same resource instead of asking again!</span> <a name="l01261"></a>01261 mChanger->changeIncidence( oldincidence, incidence ); <a name="l01262"></a>01262 mChanger->addIncidence( newInc, <span class="keyword">this</span> ); <a name="l01263"></a>01263 } <span class="keywordflow">else</span> { <a name="l01264"></a>01264 KMessageBox::sorry( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Dissociating the occurrence failed."</span>), <a name="l01265"></a>01265 i18n(<span class="stringliteral">"Dissociating Failed"</span>) ); <a name="l01266"></a>01266 } <a name="l01267"></a>01267 mChanger->endChange( incidence ); <a name="l01268"></a>01268 endMultiModify(); <a name="l01269"></a>01269 <span class="keyword">delete</span> oldincidence; <a name="l01270"></a>01270 } <a name="l01271"></a>01271 <a name="l01272"></a>01272 <span class="keywordtype">void</span> CalendarView::dissociateFutureOccurrence( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence, <span class="keyword">const</span> QDate &date ) <a name="l01273"></a>01273 { <a name="l01274"></a>01274 <span class="keywordflow">if</span> ( !incidence || !mChanger ) { <a name="l01275"></a>01275 kdDebug(5850) << <span class="stringliteral">"CalendarView::toggleAlarm() called without having a clicked item"</span> << endl; <a name="l01276"></a>01276 <span class="keywordflow">return</span>; <a name="l01277"></a>01277 } <a name="l01278"></a>01278 <span class="keywordflow">if</span> ( !mChanger->beginChange( incidence ) ) { <a name="l01279"></a>01279 kdDebug(5850) << <span class="stringliteral">"Unable to lock incidence "</span> << endl; <a name="l01280"></a>01280 <span class="keywordflow">return</span>; <a name="l01281"></a>01281 } <a name="l01282"></a>01282 startMultiModify( i18n(<span class="stringliteral">"Dissociate future occurrences"</span>) ); <a name="l01283"></a>01283 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>*oldincidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l01284"></a>01284 <a name="l01285"></a>01285 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* newInc = mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#f62ea6d835b9e816156dc756e9e04051">dissociateOccurrence</a>( incidence, date, <span class="keyword">true</span> ); <a name="l01286"></a>01286 <span class="keywordflow">if</span> ( newInc ) { <a name="l01287"></a>01287 <span class="comment">// TODO: Use the same resource instead of asking again!</span> <a name="l01288"></a>01288 mChanger->changeIncidence( oldincidence, incidence ); <a name="l01289"></a>01289 mChanger->addIncidence( newInc, <span class="keyword">this</span> ); <a name="l01290"></a>01290 } <span class="keywordflow">else</span> { <a name="l01291"></a>01291 KMessageBox::sorry( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Dissociating the future occurrences failed."</span>), <a name="l01292"></a>01292 i18n(<span class="stringliteral">"Dissociating Failed"</span>) ); <a name="l01293"></a>01293 } <a name="l01294"></a>01294 endMultiModify(); <a name="l01295"></a>01295 mChanger->endChange( incidence ); <a name="l01296"></a>01296 <span class="keyword">delete</span> oldincidence; <a name="l01297"></a>01297 } <a name="l01298"></a>01298 <a name="l01299"></a>01299 <a name="l01300"></a>01300 <span class="comment">/*****************************************************************************/</span> <a name="l01301"></a>01301 <a name="l01302"></a>01302 <a name="l01303"></a>01303 <span class="keywordtype">void</span> CalendarView::schedule_publish(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01304"></a>01304 { <a name="l01305"></a>01305 <span class="keywordflow">if</span> (incidence == 0) <a name="l01306"></a>01306 incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l01307"></a>01307 <a name="l01308"></a>01308 <span class="keywordflow">if</span> (!incidence) { <a name="l01309"></a>01309 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"No item selected."</span>), <a name="l01310"></a>01310 <span class="stringliteral">"PublishNoEventSelected"</span> ); <a name="l01311"></a>01311 <span class="keywordflow">return</span>; <a name="l01312"></a>01312 } <a name="l01313"></a>01313 <a name="l01314"></a>01314 PublishDialog *publishdlg = <span class="keyword">new</span> PublishDialog(); <a name="l01315"></a>01315 <span class="keywordflow">if</span> (incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#24b54bf623c725751eef25ce0f45aa73">attendeeCount</a>()>0) { <a name="l01316"></a>01316 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ListBase.html">Attendee::List</a> attendees = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#df4df93778bfab1d165580946320b0de">attendees</a>(); <a name="l01317"></a>01317 Attendee::List::ConstIterator it; <a name="l01318"></a>01318 <span class="keywordflow">for</span>( it = attendees.begin(); it != attendees.end(); ++it ) { <a name="l01319"></a>01319 publishdlg->addAttendee( *it ); <a name="l01320"></a>01320 } <a name="l01321"></a>01321 } <a name="l01322"></a>01322 <span class="keywordflow">if</span> ( publishdlg->exec() == QDialog::Accepted ) { <a name="l01323"></a>01323 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *inc = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l01324"></a>01324 inc-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#490816ccda2c6637b0f12235ba0b5869">registerObserver</a>( 0 ); <a name="l01325"></a>01325 inc-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#9565a3c9aa2eb8f2fcae35c3967d456b">clearAttendees</a>(); <a name="l01326"></a>01326 <a name="l01327"></a>01327 <span class="comment">// Send the mail</span> <a name="l01328"></a>01328 KCal::MailScheduler scheduler( mCalendar ); <a name="l01329"></a>01329 <span class="keywordflow">if</span> ( scheduler.publish( incidence, publishdlg->addresses() ) ) { <a name="l01330"></a>01330 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The item information was successfully sent."</span>), <a name="l01331"></a>01331 i18n(<span class="stringliteral">"Publishing"</span>), <span class="stringliteral">"IncidencePublishSuccess"</span> ); <a name="l01332"></a>01332 } <span class="keywordflow">else</span> { <a name="l01333"></a>01333 KMessageBox::error( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to publish the item '%1'"</span>).arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ) ); <a name="l01334"></a>01334 } <a name="l01335"></a>01335 } <a name="l01336"></a>01336 <span class="keyword">delete</span> publishdlg; <a name="l01337"></a>01337 } <a name="l01338"></a>01338 <a name="l01339"></a>01339 <span class="keywordtype">void</span> CalendarView::schedule_request(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01340"></a>01340 { <a name="l01341"></a>01341 schedule(Scheduler::Request,incidence); <a name="l01342"></a>01342 } <a name="l01343"></a>01343 <a name="l01344"></a>01344 <span class="keywordtype">void</span> CalendarView::schedule_refresh(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01345"></a>01345 { <a name="l01346"></a>01346 schedule(Scheduler::Refresh,incidence); <a name="l01347"></a>01347 } <a name="l01348"></a>01348 <a name="l01349"></a>01349 <span class="keywordtype">void</span> CalendarView::schedule_cancel(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01350"></a>01350 { <a name="l01351"></a>01351 schedule(Scheduler::Cancel,incidence); <a name="l01352"></a>01352 } <a name="l01353"></a>01353 <a name="l01354"></a>01354 <span class="keywordtype">void</span> CalendarView::schedule_add(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01355"></a>01355 { <a name="l01356"></a>01356 schedule(Scheduler::Add,incidence); <a name="l01357"></a>01357 } <a name="l01358"></a>01358 <a name="l01359"></a>01359 <span class="keywordtype">void</span> CalendarView::schedule_reply(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01360"></a>01360 { <a name="l01361"></a>01361 schedule(Scheduler::Reply,incidence); <a name="l01362"></a>01362 } <a name="l01363"></a>01363 <a name="l01364"></a>01364 <span class="keywordtype">void</span> CalendarView::schedule_counter(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01365"></a>01365 { <a name="l01366"></a>01366 schedule(Scheduler::Counter,incidence); <a name="l01367"></a>01367 } <a name="l01368"></a>01368 <a name="l01369"></a>01369 <span class="keywordtype">void</span> CalendarView::schedule_declinecounter(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01370"></a>01370 { <a name="l01371"></a>01371 schedule(Scheduler::Declinecounter,incidence); <a name="l01372"></a>01372 } <a name="l01373"></a>01373 <a name="l01374"></a>01374 <span class="keywordtype">void</span> CalendarView::schedule_forward(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * incidence) <a name="l01375"></a>01375 { <a name="l01376"></a>01376 <span class="keywordflow">if</span> (incidence == 0) <a name="l01377"></a>01377 incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l01378"></a>01378 <a name="l01379"></a>01379 <span class="keywordflow">if</span> (!incidence) { <a name="l01380"></a>01380 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"No item selected."</span>), <a name="l01381"></a>01381 <span class="stringliteral">"ForwardNoEventSelected"</span> ); <a name="l01382"></a>01382 <span class="keywordflow">return</span>; <a name="l01383"></a>01383 } <a name="l01384"></a>01384 <a name="l01385"></a>01385 PublishDialog publishdlg; <a name="l01386"></a>01386 <span class="keywordflow">if</span> ( publishdlg.exec() == QDialog::Accepted ) { <a name="l01387"></a>01387 QString recipients = publishdlg.addresses(); <a name="l01388"></a>01388 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html">ICalFormat</a> format; <a name="l01389"></a>01389 QString messageText = format.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html#789376be2eb2c1fc185f459e013dde09">createScheduleMessage</a>( incidence, Scheduler::Request ); <a name="l01390"></a>01390 KOMailClient mailer; <a name="l01391"></a>01391 <span class="keywordflow">if</span> ( mailer.mailTo( incidence, recipients, messageText ) ) { <a name="l01392"></a>01392 <a name="l01393"></a>01393 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The item information was successfully sent."</span>), <a name="l01394"></a>01394 i18n(<span class="stringliteral">"Forwarding"</span>), <span class="stringliteral">"IncidenceForwardSuccess"</span> ); <a name="l01395"></a>01395 } <span class="keywordflow">else</span> { <a name="l01396"></a>01396 KMessageBox::error( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to forward the item '%1'"</span>).arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ) ); <a name="l01397"></a>01397 } <a name="l01398"></a>01398 } <a name="l01399"></a>01399 } <a name="l01400"></a>01400 <a name="l01401"></a>01401 <span class="keywordtype">void</span> CalendarView::mailFreeBusy( <span class="keywordtype">int</span> daysToPublish ) <a name="l01402"></a>01402 { <a name="l01403"></a>01403 QDateTime start = QDateTime::currentDateTime(); <a name="l01404"></a>01404 QDateTime end = start.addDays(daysToPublish); <a name="l01405"></a>01405 <a name="l01406"></a>01406 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FreeBusy.html">FreeBusy</a> *freebusy = <span class="keyword">new</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FreeBusy.html">FreeBusy</a>(mCalendar, start, end); <a name="l01407"></a>01407 freebusy-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#117a09a965803c17635d9a3631a66772">setOrganizer</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Person.html">Person</a>( KOPrefs::instance()->fullName(), <a name="l01408"></a>01408 KOPrefs::instance()->email() ) ); <a name="l01409"></a>01409 <a name="l01410"></a>01410 kdDebug(5850) << <span class="stringliteral">"calendarview: schedule_publish_freebusy: startDate: "</span> <a name="l01411"></a>01411 << KGlobal::locale()->formatDateTime( start ) << <span class="stringliteral">" End Date: "</span> <a name="l01412"></a>01412 << KGlobal::locale()->formatDateTime( end ) << endl; <a name="l01413"></a>01413 <a name="l01414"></a>01414 PublishDialog *publishdlg = <span class="keyword">new</span> PublishDialog(); <a name="l01415"></a>01415 <span class="keywordflow">if</span> ( publishdlg->exec() == QDialog::Accepted ) { <a name="l01416"></a>01416 <span class="comment">// Send the mail</span> <a name="l01417"></a>01417 KCal::MailScheduler scheduler( mCalendar ); <a name="l01418"></a>01418 <span class="keywordflow">if</span> ( scheduler.publish( freebusy, publishdlg->addresses() ) ) { <a name="l01419"></a>01419 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The free/busy information was successfully sent."</span>), <a name="l01420"></a>01420 i18n(<span class="stringliteral">"Sending Free/Busy"</span>), <span class="stringliteral">"FreeBusyPublishSuccess"</span> ); <a name="l01421"></a>01421 } <span class="keywordflow">else</span> { <a name="l01422"></a>01422 KMessageBox::error( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to publish the free/busy data."</span>) ); <a name="l01423"></a>01423 } <a name="l01424"></a>01424 } <a name="l01425"></a>01425 <span class="keyword">delete</span> freebusy; <a name="l01426"></a>01426 <span class="keyword">delete</span> publishdlg; <a name="l01427"></a>01427 } <a name="l01428"></a>01428 <a name="l01429"></a>01429 <span class="keywordtype">void</span> CalendarView::uploadFreeBusy() <a name="l01430"></a>01430 { <a name="l01431"></a>01431 KOGroupware::instance()->freeBusyManager()->publishFreeBusy(); <a name="l01432"></a>01432 } <a name="l01433"></a>01433 <a name="l01434"></a>01434 <span class="keywordtype">void</span> CalendarView::schedule(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Scheduler.html#b5bb0cf1cf4c936a606b1968e85601b1">Scheduler::Method</a> method, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence) <a name="l01435"></a>01435 { <a name="l01436"></a>01436 <span class="keywordflow">if</span> ( !incidence ) { <a name="l01437"></a>01437 incidence = <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>(); <a name="l01438"></a>01438 } <a name="l01439"></a>01439 <a name="l01440"></a>01440 <span class="keywordflow">if</span> ( !incidence ) { <a name="l01441"></a>01441 KMessageBox::sorry( <span class="keyword">this</span>, i18n(<span class="stringliteral">"No item selected."</span>), <a name="l01442"></a>01442 <span class="stringliteral">"ScheduleNoEventSelected"</span> ); <a name="l01443"></a>01443 <span class="keywordflow">return</span>; <a name="l01444"></a>01444 } <a name="l01445"></a>01445 <a name="l01446"></a>01446 <span class="keywordflow">if</span>( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#24b54bf623c725751eef25ce0f45aa73">attendeeCount</a>() == 0 && method != Scheduler::Publish ) { <a name="l01447"></a>01447 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The item has no attendees."</span>), <a name="l01448"></a>01448 <span class="stringliteral">"ScheduleNoIncidences"</span> ); <a name="l01449"></a>01449 <span class="keywordflow">return</span>; <a name="l01450"></a>01450 } <a name="l01451"></a>01451 <a name="l01452"></a>01452 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *inc = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l01453"></a>01453 inc-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#490816ccda2c6637b0f12235ba0b5869">registerObserver</a>( 0 ); <a name="l01454"></a>01454 inc-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#9565a3c9aa2eb8f2fcae35c3967d456b">clearAttendees</a>(); <a name="l01455"></a>01455 <a name="l01456"></a>01456 <span class="comment">// Send the mail</span> <a name="l01457"></a>01457 KCal::MailScheduler scheduler( mCalendar ); <a name="l01458"></a>01458 <span class="keywordflow">if</span> ( !scheduler.performTransaction( incidence, method ) ) { <a name="l01459"></a>01459 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The groupware message for item '%1'"</span> <a name="l01460"></a>01460 <span class="stringliteral">"was successfully sent.\nMethod: %2"</span>) <a name="l01461"></a>01461 .arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ) <a name="l01462"></a>01462 .arg( Scheduler::methodName( method ) ), <a name="l01463"></a>01463 i18n(<span class="stringliteral">"Sending Free/Busy"</span>), <a name="l01464"></a>01464 <span class="stringliteral">"FreeBusyPublishSuccess"</span> ); <a name="l01465"></a>01465 } <span class="keywordflow">else</span> { <a name="l01466"></a>01466 KMessageBox::error( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Groupware message sending failed. "</span> <a name="l01467"></a>01467 <span class="stringliteral">"%2 is request/reply/add/cancel/counter/etc."</span>, <a name="l01468"></a>01468 <span class="stringliteral">"Unable to send the item '%1'.\nMethod: %2"</span>) <a name="l01469"></a>01469 .arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ) <a name="l01470"></a>01470 .arg( Scheduler::methodName( method ) ) ); <a name="l01471"></a>01471 } <a name="l01472"></a>01472 } <a name="l01473"></a>01473 <a name="l01474"></a>01474 <span class="keywordtype">void</span> CalendarView::openAddressbook() <a name="l01475"></a>01475 { <a name="l01476"></a>01476 KRun::runCommand(<span class="stringliteral">"kaddressbook"</span>); <a name="l01477"></a>01477 } <a name="l01478"></a>01478 <a name="l01479"></a><a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2">01479</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">CalendarView::setModified</a>(<span class="keywordtype">bool</span> modified) <a name="l01480"></a>01480 { <a name="l01481"></a>01481 <span class="keywordflow">if</span> (mModified != modified) { <a name="l01482"></a>01482 mModified = modified; <a name="l01483"></a>01483 emit <a class="code" href="classCalendarView.html#5c77fb2db8cd1a932f2a0539b9bb6bc7" title="Emitted when state of modified flag changes.">modifiedChanged</a>(mModified); <a name="l01484"></a>01484 } <a name="l01485"></a>01485 } <a name="l01486"></a>01486 <a name="l01487"></a><a class="code" href="classCalendarView.html#9d5fb038280ce1b5b147fc563aa871d0">01487</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#9d5fb038280ce1b5b147fc563aa871d0" title="query if the calendar is read-only.">CalendarView::isReadOnly</a>() <a name="l01488"></a>01488 { <a name="l01489"></a>01489 <span class="keywordflow">return</span> mReadOnly; <a name="l01490"></a>01490 } <a name="l01491"></a>01491 <a name="l01492"></a><a class="code" href="classCalendarView.html#26cc819b921644969f69295beaa144bb">01492</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#26cc819b921644969f69295beaa144bb" title="set state of calendar to read-only">CalendarView::setReadOnly</a>(<span class="keywordtype">bool</span> readOnly) <a name="l01493"></a>01493 { <a name="l01494"></a>01494 <span class="keywordflow">if</span> (mReadOnly != readOnly) { <a name="l01495"></a>01495 mReadOnly = readOnly; <a name="l01496"></a>01496 emit <a class="code" href="classCalendarView.html#da4f89ee7c52e2b35c350ba780c9b2c0" title="Emitted when state of read-only flag changes.">readOnlyChanged</a>(mReadOnly); <a name="l01497"></a>01497 } <a name="l01498"></a>01498 } <a name="l01499"></a>01499 <a name="l01500"></a><a class="code" href="classCalendarView.html#98886de323db121635c5bf91b2593b05">01500</a> <span class="keywordtype">bool</span> <a class="code" href="classCalendarView.html#98886de323db121635c5bf91b2593b05" title="query whether or not the calendar is &quot;dirty&quot;.">CalendarView::isModified</a>() <a name="l01501"></a>01501 { <a name="l01502"></a>01502 <span class="keywordflow">return</span> mModified; <a name="l01503"></a>01503 } <a name="l01504"></a>01504 <a name="l01505"></a><a class="code" href="classCalendarView.html#7f48f49c683ceb4e9c3f83d924cb7498">01505</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#7f48f49c683ceb4e9c3f83d924cb7498" title="Functions for printing, previewing a print, and setting up printing parameters.">CalendarView::print</a>() <a name="l01506"></a>01506 { <a name="l01507"></a>01507 <span class="preprocessor">#ifndef KORG_NOPRINTER</span> <a name="l01508"></a>01508 <span class="preprocessor"></span> KOCoreHelper helper; <a name="l01509"></a>01509 <a class="code" href="classCalPrinter.html" title="CalPrinter is a class for printing Calendars.">CalPrinter</a> printer( <span class="keyword">this</span>, mCalendar, &helper ); <a name="l01510"></a>01510 connect( <span class="keyword">this</span>, SIGNAL(<a class="code" href="classCalendarView.html#d311610eb71e155954fd57d2f5c136e1" title="when change is made to options dialog, the topwidget will catch this and emit this...">configChanged</a>()), &printer, SLOT(<a class="code" href="classCalendarView.html#9e30932f0e7379c706b9004eb159279f" title="options dialog made a changed to the configuration.">updateConfig</a>()) ); <a name="l01511"></a>01511 <a name="l01512"></a>01512 <a class="code" href="classKOrg_1_1BaseView.html" title="This class provides an interface for all views being displayed within the main calendar...">KOrg::BaseView</a> *currentView = mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>(); <a name="l01513"></a>01513 <a name="l01514"></a>01514 CalPrinterBase::PrintType printType = CalPrinterBase::Month; <a name="l01515"></a>01515 <span class="keywordflow">if</span> ( currentView ) printType = currentView-><a class="code" href="classKOrg_1_1BaseView.html#dac02c53f3f3981791a180780f666ea8">printType</a>(); <a name="l01516"></a>01516 <a name="l01517"></a>01517 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">DateList</a> tmpDateList = mNavigator-><a class="code" href="classDateNavigator.html#68b98ea86532441909e0da2b648dd98c">selectedDates</a>(); <a name="l01518"></a>01518 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> selectedIncidences; <a name="l01519"></a>01519 <span class="keywordflow">if</span> ( mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>() ) { <a name="l01520"></a>01520 selectedIncidences = mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#e8c1cf14d73ad58b1c2ffc09c0a23ef0">selectedIncidences</a>(); <a name="l01521"></a>01521 } <a name="l01522"></a>01522 printer.<a class="code" href="classCalPrinter.html#8649ddf228854a88c26b98c584172cf1">print</a>( printType, tmpDateList.first(), tmpDateList.last(), selectedIncidences ); <a name="l01523"></a>01523 <span class="preprocessor">#endif</span> <a name="l01524"></a>01524 <span class="preprocessor"></span>} <a name="l01525"></a>01525 <a name="l01526"></a><a class="code" href="classCalendarView.html#279b9f70bce6ef93005ebf23484340fa">01526</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#279b9f70bce6ef93005ebf23484340fa" title="Export as HTML file.">CalendarView::exportWeb</a>() <a name="l01527"></a>01527 { <a name="l01528"></a>01528 <span class="comment">// FIXME: Get rid of the settings object. When can I delete it???</span> <a name="l01529"></a>01529 HTMLExportSettings *settings = <span class="keyword">new</span> HTMLExportSettings( <span class="stringliteral">"KOrganizer"</span> ); <a name="l01530"></a>01530 <span class="comment">// Manually read in the config, because parametrized kconfigxt objects don't</span> <a name="l01531"></a>01531 <span class="comment">// seem to load the config theirselves</span> <a name="l01532"></a>01532 <span class="keywordflow">if</span> ( settings ) settings->readConfig(); <a name="l01533"></a>01533 <a class="code" href="classExportWebDialog.html" title="ExportWebDialog is a class that provides the dialog and functions to export a calendar...">ExportWebDialog</a> *dlg = <span class="keyword">new</span> <a class="code" href="classExportWebDialog.html" title="ExportWebDialog is a class that provides the dialog and functions to export a calendar...">ExportWebDialog</a>( settings, <span class="keyword">this</span> ); <a name="l01534"></a>01534 connect( dlg, SIGNAL( exportHTML( HTMLExportSettings* ) ), <a name="l01535"></a>01535 <span class="keyword">this</span>, SIGNAL( exportHTML( HTMLExportSettings* ) ) ); <a name="l01536"></a>01536 dlg->show(); <a name="l01537"></a>01537 } <a name="l01538"></a>01538 <a name="l01539"></a><a class="code" href="classCalendarView.html#b9cf3c6ace1b196c23370efa270ade2c">01539</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#b9cf3c6ace1b196c23370efa270ade2c" title="Export as iCalendar file.">CalendarView::exportICalendar</a>() <a name="l01540"></a>01540 { <a name="l01541"></a>01541 QString filename = KFileDialog::getSaveFileName(<span class="stringliteral">"icalout.ics"</span>,i18n(<span class="stringliteral">"*.ics|ICalendars"</span>),<span class="keyword">this</span>); <a name="l01542"></a>01542 <a name="l01543"></a>01543 <span class="comment">// Force correct extension</span> <a name="l01544"></a>01544 <span class="keywordflow">if</span> (filename.right(4) != <span class="stringliteral">".ics"</span>) filename += <span class="stringliteral">".ics"</span>; <a name="l01545"></a>01545 <a name="l01546"></a>01546 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html">FileStorage</a> storage( mCalendar, filename, <span class="keyword">new</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ICalFormat.html">ICalFormat</a> ); <a name="l01547"></a>01547 storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#bc882239d83ffc2b3ddc86aad18ac83c">save</a>(); <a name="l01548"></a>01548 } <a name="l01549"></a>01549 <a name="l01550"></a><a class="code" href="classCalendarView.html#85d4f35813c37629f9d790e538e4f326">01550</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#85d4f35813c37629f9d790e538e4f326" title="Export as vCalendar file.">CalendarView::exportVCalendar</a>() <a name="l01551"></a>01551 { <a name="l01552"></a>01552 <span class="keywordflow">if</span> (mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#c6b55e4bc2dcc1557b63ffd9273bd6bc">journals</a>().count() > 0) { <a name="l01553"></a>01553 <span class="keywordtype">int</span> result = KMessageBox::warningContinueCancel(<span class="keyword">this</span>, <a name="l01554"></a>01554 i18n(<span class="stringliteral">"The journal entries can not be exported to a vCalendar file."</span>), <a name="l01555"></a>01555 i18n(<span class="stringliteral">"Data Loss Warning"</span>),i18n(<span class="stringliteral">"Proceed"</span>),<span class="stringliteral">"dontaskVCalExport"</span>, <a name="l01556"></a>01556 <span class="keyword">true</span>); <a name="l01557"></a>01557 <span class="keywordflow">if</span> (result != KMessageBox::Continue) <span class="keywordflow">return</span>; <a name="l01558"></a>01558 } <a name="l01559"></a>01559 <a name="l01560"></a>01560 QString filename = KFileDialog::getSaveFileName(<span class="stringliteral">"vcalout.vcs"</span>,i18n(<span class="stringliteral">"*.vcs|vCalendars"</span>),<span class="keyword">this</span>); <a name="l01561"></a>01561 <a name="l01562"></a>01562 <span class="comment">// TODO: I don't like forcing extensions:</span> <a name="l01563"></a>01563 <span class="comment">// Force correct extension</span> <a name="l01564"></a>01564 <span class="keywordflow">if</span> (filename.right(4) != <span class="stringliteral">".vcs"</span>) filename += <span class="stringliteral">".vcs"</span>; <a name="l01565"></a>01565 <a name="l01566"></a>01566 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html">FileStorage</a> storage( mCalendar, filename, <span class="keyword">new</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1VCalFormat.html">VCalFormat</a> ); <a name="l01567"></a>01567 storage.<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1FileStorage.html#bc882239d83ffc2b3ddc86aad18ac83c">save</a>(); <a name="l01568"></a>01568 } <a name="l01569"></a>01569 <a name="l01570"></a>01570 <span class="keywordtype">void</span> CalendarView::eventUpdated(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *) <a name="l01571"></a>01571 { <a name="l01572"></a>01572 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>(); <a name="l01573"></a>01573 <span class="comment">// Don't call updateView here. The code, which has caused the update of the</span> <a name="l01574"></a>01574 <span class="comment">// event is responsible for updating the view.</span> <a name="l01575"></a>01575 <span class="comment">// updateView();</span> <a name="l01576"></a>01576 } <a name="l01577"></a>01577 <a name="l01578"></a><a class="code" href="classCalendarView.html#af6bd6bc25568a1f73806b7f948d46c2">01578</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#af6bd6bc25568a1f73806b7f948d46c2" title="Adapt navigation units corresponding to step size of navigation of the current view...">CalendarView::adaptNavigationUnits</a>() <a name="l01579"></a>01579 { <a name="l01580"></a>01580 <span class="keywordflow">if</span> (mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#bd095caeae8863e11c1d7342f4f42e0d" title="Return if this view is a view for displaying events.">isEventView</a>()) { <a name="l01581"></a>01581 <span class="keywordtype">int</span> days = mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#99cc2148ee1ed066f4dee4c4e34b83f4" title="Return number of currently shown dates.">currentDateCount</a>(); <a name="l01582"></a>01582 <span class="keywordflow">if</span> (days == 1) { <a name="l01583"></a>01583 emit <a class="code" href="classCalendarView.html#25bcb5f90d780bc061866f95c96700ae" title="Emitted when the unit of navigation changes.">changeNavStringPrev</a>(i18n(<span class="stringliteral">"&Previous Day"</span>)); <a name="l01584"></a>01584 emit changeNavStringNext(i18n(<span class="stringliteral">"&Next Day"</span>)); <a name="l01585"></a>01585 } <span class="keywordflow">else</span> { <a name="l01586"></a>01586 emit <a class="code" href="classCalendarView.html#25bcb5f90d780bc061866f95c96700ae" title="Emitted when the unit of navigation changes.">changeNavStringPrev</a>(i18n(<span class="stringliteral">"&Previous Week"</span>)); <a name="l01587"></a>01587 emit changeNavStringNext(i18n(<span class="stringliteral">"&Next Week"</span>)); <a name="l01588"></a>01588 } <a name="l01589"></a>01589 } <a name="l01590"></a>01590 } <a name="l01591"></a>01591 <a name="l01592"></a>01592 <span class="keywordtype">void</span> CalendarView::processMainViewSelection( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l01593"></a>01593 { <a name="l01594"></a>01594 <span class="keywordflow">if</span> ( incidence ) mTodoList-><a class="code" href="classKOTodoView.html#c0e1e85bfac0dc6fae74fa6c2e96169e" title="Clear selection.">clearSelection</a>(); <a name="l01595"></a>01595 processIncidenceSelection( incidence ); <a name="l01596"></a>01596 } <a name="l01597"></a>01597 <a name="l01598"></a>01598 <span class="keywordtype">void</span> CalendarView::processTodoListSelection( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l01599"></a>01599 { <a name="l01600"></a>01600 <span class="keywordflow">if</span> ( incidence && mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>() ) { <a name="l01601"></a>01601 mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>()-><a class="code" href="classKOrg_1_1BaseView.html#8f55811dac020dac1f0f9319371b569f" title="Clear selection.">clearSelection</a>(); <a name="l01602"></a>01602 } <a name="l01603"></a>01603 processIncidenceSelection( incidence ); <a name="l01604"></a>01604 } <a name="l01605"></a>01605 <a name="l01606"></a>01606 <span class="keywordtype">void</span> CalendarView::processIncidenceSelection( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l01607"></a>01607 { <a name="l01608"></a>01608 <span class="keywordflow">if</span> ( incidence == mSelectedIncidence ) <span class="keywordflow">return</span>; <a name="l01609"></a>01609 <a name="l01610"></a>01610 mSelectedIncidence = incidence; <a name="l01611"></a>01611 <a name="l01612"></a>01612 emit <a class="code" href="classCalendarView.html#0abb2fa200ff11b9db54ec1e088724af" title="Emitted when an incidence gets selected.">incidenceSelected</a>( mSelectedIncidence ); <a name="l01613"></a>01613 <span class="keywordtype">bool</span> organizerEvents = <span class="keyword">false</span>; <a name="l01614"></a>01614 <span class="keywordtype">bool</span> groupEvents = <span class="keyword">false</span>; <a name="l01615"></a>01615 <span class="keywordtype">bool</span> todo = <span class="keyword">false</span>; <a name="l01616"></a>01616 <span class="keywordtype">bool</span> subtodo = <span class="keyword">false</span>; <a name="l01617"></a>01617 <a name="l01618"></a>01618 <span class="keywordflow">if</span> ( incidence ) { <a name="l01619"></a>01619 organizerEvents = KOPrefs::instance()->thatIsMe( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#eb4c2be5ce3f3961dc10204fbc5206a7">organizer</a>().<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Person.html#b998a684c9d50625dead81ec3f18698c">email</a>() ); <a name="l01620"></a>01620 groupEvents = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#4a308da7815893271e5b8c046f75bac4">attendeeByMails</a>( KOPrefs::instance()->allEmails() ); <a name="l01621"></a>01621 <a name="l01622"></a>01622 <span class="keywordflow">if</span> ( incidence && incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l01623"></a>01623 todo = <span class="keyword">true</span>; <a name="l01624"></a>01624 subtodo = ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#9b09c1637d3900ba0c2e768b39fff819">relatedTo</a>() != 0 ); <a name="l01625"></a>01625 } <a name="l01626"></a>01626 } <a name="l01627"></a>01627 emit <a class="code" href="classCalendarView.html#f80bedd676c4f956cef1319d2d82f130" title="Emitted, when a todoitem is selected or deselected.">todoSelected</a>( todo ); <a name="l01628"></a>01628 emit subtodoSelected( subtodo ); <a name="l01629"></a>01629 emit <a class="code" href="classCalendarView.html#84827c81b621124022a68f28a03fb022" title="Emitted when state of events selection has changed and user is organizer.">organizerEventsSelected</a>( organizerEvents ); <a name="l01630"></a>01630 emit <a class="code" href="classCalendarView.html#15426ed3b06b0b65bad23fb8a4852df3" title="Emitted when state of events selection has changed and user is attendee.">groupEventsSelected</a>( groupEvents ); <a name="l01631"></a>01631 } <a name="l01632"></a>01632 <a name="l01633"></a>01633 <a name="l01634"></a><a class="code" href="classCalendarView.html#96d0f8056db26255b365ff861de28da6">01634</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#96d0f8056db26255b365ff861de28da6" title="Check if clipboard contains vCalendar event.">CalendarView::checkClipboard</a>() <a name="l01635"></a>01635 { <a name="l01636"></a>01636 <span class="preprocessor">#ifndef KORG_NODND</span> <a name="l01637"></a>01637 <span class="preprocessor"></span> <span class="keywordflow">if</span> (ICalDrag::canDecode(QApplication::clipboard()->data())) { <a name="l01638"></a>01638 kdDebug(5850) << <span class="stringliteral">"CalendarView::checkClipboard() true"</span> << endl; <a name="l01639"></a>01639 emit <a class="code" href="classCalendarView.html#41aeb7d54d83196d36c28f24eef45d38" title="Emitted, when clipboard content changes.">pasteEnabled</a>(<span class="keyword">true</span>); <a name="l01640"></a>01640 } <span class="keywordflow">else</span> { <a name="l01641"></a>01641 kdDebug(5850) << <span class="stringliteral">"CalendarView::checkClipboard() false"</span> << endl; <a name="l01642"></a>01642 emit <a class="code" href="classCalendarView.html#41aeb7d54d83196d36c28f24eef45d38" title="Emitted, when clipboard content changes.">pasteEnabled</a>(<span class="keyword">false</span>); <a name="l01643"></a>01643 } <a name="l01644"></a>01644 <span class="preprocessor">#endif</span> <a name="l01645"></a>01645 <span class="preprocessor"></span>} <a name="l01646"></a>01646 <a name="l01647"></a><a class="code" href="classCalendarView.html#b258f1610070638eb1077c9d932f70f6">01647</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#b258f1610070638eb1077c9d932f70f6" title="Select a view or adapt the current view to display the specified dates.">CalendarView::showDates</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/namespaceKCal.html#3e5daeebfd357711bf15f127f85635ad">DateList</a> &selectedDates) <a name="l01648"></a>01648 { <a name="l01649"></a>01649 <span class="comment">// kdDebug(5850) << "CalendarView::selectDates()" << endl;</span> <a name="l01650"></a>01650 <a name="l01651"></a>01651 <span class="keywordflow">if</span> ( mViewManager-><a class="code" href="classKOViewManager.html#c4b233149e84e3e288c8cb83cb3d755e">currentView</a>() ) { <a name="l01652"></a>01652 updateView( selectedDates.first(), selectedDates.last() ); <a name="l01653"></a>01653 } <span class="keywordflow">else</span> { <a name="l01654"></a>01654 mViewManager-><a class="code" href="classKOViewManager.html#545f109f8f4e656bd9f3464725e5e2d3">showAgendaView</a>(); <a name="l01655"></a>01655 } <a name="l01656"></a>01656 } <a name="l01657"></a>01657 <a name="l01658"></a>01658 <span class="keywordtype">void</span> CalendarView::editFilters() <a name="l01659"></a>01659 { <a name="l01660"></a>01660 kdDebug(5850) << <span class="stringliteral">"CalendarView::editFilters()"</span> << endl; <a name="l01661"></a>01661 <a name="l01662"></a>01662 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a> *filter = mFilters.first(); <a name="l01663"></a>01663 <span class="keywordflow">while</span>(filter) { <a name="l01664"></a>01664 kdDebug(5850) << <span class="stringliteral">" Filter: "</span> << filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#31017f02bb684997b491a5e4258fa4fd">name</a>() << endl; <a name="l01665"></a>01665 filter = mFilters.next(); <a name="l01666"></a>01666 } <a name="l01667"></a>01667 <a name="l01668"></a>01668 mDialogManager-><a class="code" href="classKODialogManager.html#619044a43a835a54d7ce2dc66045a26b">showFilterEditDialog</a>(&mFilters); <a name="l01669"></a>01669 } <a name="l01670"></a>01670 <a name="l01673"></a><a class="code" href="classCalendarView.html#310e87d7d277e1981c99255417444054">01673</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#310e87d7d277e1981c99255417444054" title="Filter configuration changed.">CalendarView::updateFilter</a>() <a name="l01674"></a>01674 { <a name="l01675"></a>01675 QStringList filters; <a name="l01676"></a>01676 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a> *filter; <a name="l01677"></a>01677 <a name="l01678"></a>01678 <span class="keywordtype">int</span> pos = mFilters.find( mCurrentFilter ); <a name="l01679"></a>01679 <span class="keywordflow">if</span> ( pos < 0 ) { <a name="l01680"></a>01680 mCurrentFilter = 0; <a name="l01681"></a>01681 } <a name="l01682"></a>01682 <a name="l01683"></a>01683 filters << i18n(<span class="stringliteral">"No filter"</span>); <a name="l01684"></a>01684 <span class="keywordflow">for</span> ( filter = mFilters.first(); filter; filter = mFilters.next() ) { <a name="l01685"></a>01685 filters << filter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#31017f02bb684997b491a5e4258fa4fd">name</a>(); <a name="l01686"></a>01686 } <a name="l01687"></a>01687 <a name="l01688"></a>01688 emit newFilterListSignal( filters ); <a name="l01689"></a>01689 <span class="comment">// account for the additional "No filter" at the beginning! if the</span> <a name="l01690"></a>01690 <span class="comment">// filter is not in the list, pos == -1...</span> <a name="l01691"></a>01691 emit selectFilterSignal( pos+1 ); <a name="l01692"></a>01692 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#46e84475e7efa21e96cdda8373eb44d6">setFilter</a>( mCurrentFilter ); <a name="l01693"></a>01693 updateView(); <a name="l01694"></a>01694 } <a name="l01695"></a>01695 <a name="l01698"></a><a class="code" href="classCalendarView.html#85c3a5be83bc4a3af922c7a9b69de32c">01698</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#85c3a5be83bc4a3af922c7a9b69de32c" title="A different filter was selected.">CalendarView::filterActivated</a>( <span class="keywordtype">int</span> filterNo ) <a name="l01699"></a>01699 { <a name="l01700"></a>01700 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html">CalFilter</a> *newFilter = 0; <a name="l01701"></a>01701 <span class="keywordflow">if</span> ( filterNo > 0 && filterNo <= <span class="keywordtype">int</span>(mFilters.count()) ) { <a name="l01702"></a>01702 newFilter = mFilters.at( filterNo-1 ); <a name="l01703"></a>01703 } <a name="l01704"></a>01704 <span class="keywordflow">if</span> ( newFilter != mCurrentFilter ) { <a name="l01705"></a>01705 mCurrentFilter = newFilter; <a name="l01706"></a>01706 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#46e84475e7efa21e96cdda8373eb44d6">setFilter</a>( mCurrentFilter ); <a name="l01707"></a>01707 updateView(); <a name="l01708"></a>01708 } <a name="l01709"></a>01709 emit filterChanged(); <a name="l01710"></a>01710 } <a name="l01711"></a>01711 <a name="l01712"></a><a class="code" href="classCalendarView.html#8114c441a8ef65dc16efa11c1b6d9ee2">01712</a> QString <a class="code" href="classCalendarView.html#8114c441a8ef65dc16efa11c1b6d9ee2" title="Returns the name of the current filter.">CalendarView::currentFilterName</a>()<span class="keyword"> const</span> <a name="l01713"></a>01713 <span class="keyword"></span>{ <a name="l01714"></a>01714 <span class="keywordflow">if</span> ( mCurrentFilter) { <a name="l01715"></a>01715 <span class="keywordflow">return</span> mCurrentFilter-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1CalFilter.html#31017f02bb684997b491a5e4258fa4fd">name</a>(); <a name="l01716"></a>01716 } <span class="keywordflow">else</span> <span class="keywordflow">return</span> i18n(<span class="stringliteral">"No filter"</span>); <a name="l01717"></a>01717 } <a name="l01718"></a>01718 <a name="l01719"></a><a class="code" href="classCalendarView.html#ab44c69c4dbd5c861620eb04b4673e51">01719</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#ab44c69c4dbd5c861620eb04b4673e51" title="Take ownership of selected event.">CalendarView::takeOverEvent</a>() <a name="l01720"></a>01720 { <a name="l01721"></a>01721 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#e8315a9534a5ad530a5bf55e1912343f" title="currentSelection() returns a pointer to the incidence selected in the current view...">currentSelection</a>(); <a name="l01722"></a>01722 <a name="l01723"></a>01723 <span class="keywordflow">if</span> (!incidence) <span class="keywordflow">return</span>; <a name="l01724"></a>01724 <a name="l01725"></a>01725 incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#117a09a965803c17635d9a3631a66772">setOrganizer</a>( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Person.html">Person</a>( KOPrefs::instance()->fullName(), <a name="l01726"></a>01726 KOPrefs::instance()->email() ) ); <a name="l01727"></a>01727 incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#2ab366525e4ea376c8bfe334c10a347a">recreate</a>(); <a name="l01728"></a>01728 incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#0cb14b1419d3fad1d3c19c9a3e98a57b">setReadOnly</a>(<span class="keyword">false</span>); <a name="l01729"></a>01729 <a name="l01730"></a>01730 updateView(); <a name="l01731"></a>01731 } <a name="l01732"></a>01732 <a name="l01733"></a><a class="code" href="classCalendarView.html#4b29703b3c7383686ce9e888d557e8d1">01733</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#4b29703b3c7383686ce9e888d557e8d1" title="Take ownership of all events in calendar.">CalendarView::takeOverCalendar</a>() <a name="l01734"></a>01734 { <a name="l01735"></a>01735 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> incidences = mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#310db8f95e7abc7f20a5293e1bbd9ebb">rawIncidences</a>(); <a name="l01736"></a>01736 Incidence::List::Iterator it; <a name="l01737"></a>01737 <a name="l01738"></a>01738 <span class="keywordflow">for</span> ( it = incidences.begin(); it != incidences.end(); ++it ) { <a name="l01739"></a>01739 (*it)->setOrganizer( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Person.html">Person</a>( KOPrefs::instance()->fullName(), <a name="l01740"></a>01740 KOPrefs::instance()->email() ) ); <a name="l01741"></a>01741 (*it)->recreate(); <a name="l01742"></a>01742 (*it)->setReadOnly(<span class="keyword">false</span>); <a name="l01743"></a>01743 } <a name="l01744"></a>01744 updateView(); <a name="l01745"></a>01745 } <a name="l01746"></a>01746 <a name="l01747"></a>01747 <span class="keywordtype">void</span> CalendarView::showIntro() <a name="l01748"></a>01748 { <a name="l01749"></a>01749 kdDebug(5850) << <span class="stringliteral">"To be implemented."</span> << endl; <a name="l01750"></a>01750 } <a name="l01751"></a>01751 <a name="l01752"></a>01752 <span class="keywordtype">void</span> CalendarView::showDateNavigator( <span class="keywordtype">bool</span> show ) <a name="l01753"></a>01753 { <a name="l01754"></a>01754 <span class="keywordflow">if</span>( show ) <a name="l01755"></a>01755 mDateNavigator->show(); <a name="l01756"></a>01756 <span class="keywordflow">else</span> <a name="l01757"></a>01757 mDateNavigator->hide(); <a name="l01758"></a>01758 } <a name="l01759"></a>01759 <a name="l01760"></a>01760 <span class="keywordtype">void</span> CalendarView::showTodoView( <span class="keywordtype">bool</span> show ) <a name="l01761"></a>01761 { <a name="l01762"></a>01762 <span class="keywordflow">if</span>( show ) <a name="l01763"></a>01763 mTodoList->show(); <a name="l01764"></a>01764 <span class="keywordflow">else</span> <a name="l01765"></a>01765 mTodoList->hide(); <a name="l01766"></a>01766 } <a name="l01767"></a>01767 <a name="l01768"></a>01768 <span class="keywordtype">void</span> CalendarView::showEventViewer( <span class="keywordtype">bool</span> show ) <a name="l01769"></a>01769 { <a name="l01770"></a>01770 <span class="keywordflow">if</span>( show ) <a name="l01771"></a>01771 mEventViewer->show(); <a name="l01772"></a>01772 <span class="keywordflow">else</span> <a name="l01773"></a>01773 mEventViewer->hide(); <a name="l01774"></a>01774 } <a name="l01775"></a>01775 <a name="l01776"></a>01776 <a name="l01777"></a>01777 <span class="keywordtype">void</span> CalendarView::addView(<a class="code" href="classKOrg_1_1BaseView.html" title="This class provides an interface for all views being displayed within the main calendar...">KOrg::BaseView</a> *view) <a name="l01778"></a>01778 { <a name="l01779"></a>01779 mViewManager-><a class="code" href="classKOViewManager.html#a541099828ffa62a47c065efdbd544c1">addView</a>(view); <a name="l01780"></a>01780 } <a name="l01781"></a>01781 <a name="l01782"></a><a class="code" href="classCalendarView.html#ab3606234a30229fcc6b187f0a391124">01782</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#ab3606234a30229fcc6b187f0a391124" title="changes the view to be the currently selected view">CalendarView::showView</a>(<a class="code" href="classKOrg_1_1BaseView.html" title="This class provides an interface for all views being displayed within the main calendar...">KOrg::BaseView</a> *view) <a name="l01783"></a>01783 { <a name="l01784"></a>01784 mViewManager-><a class="code" href="classKOViewManager.html#bbeec9f6f4219728cea3c612f41c80b7" title="changes the view to be the currently selected view">showView</a>(view); <a name="l01785"></a>01785 } <a name="l01786"></a>01786 <a name="l01787"></a><a class="code" href="classCalendarView.html#b682f96a463e0c05283e59dffd7b6a68">01787</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#b682f96a463e0c05283e59dffd7b6a68" title="Add calendar view extension widget.">CalendarView::addExtension</a>( CalendarViewExtension::Factory *factory ) <a name="l01788"></a>01788 { <a name="l01789"></a>01789 CalendarViewExtension *extension = factory->create( mLeftSplitter ); <a name="l01790"></a>01790 <a name="l01791"></a>01791 mExtensions.append( extension ); <a name="l01792"></a>01792 } <a name="l01793"></a>01793 <a name="l01794"></a>01794 <span class="keywordtype">void</span> CalendarView::toggleExpand() <a name="l01795"></a>01795 { <a name="l01796"></a>01796 showLeftFrame( mLeftFrame->isHidden() ); <a name="l01797"></a>01797 } <a name="l01798"></a>01798 <a name="l01799"></a>01799 <span class="keywordtype">void</span> CalendarView::showLeftFrame(<span class="keywordtype">bool</span> show) <a name="l01800"></a>01800 { <a name="l01801"></a>01801 <span class="keywordflow">if</span> (show) { <a name="l01802"></a>01802 mLeftFrame->show(); <a name="l01803"></a>01803 emit calendarViewExpanded( <span class="keyword">false</span> ); <a name="l01804"></a>01804 } <span class="keywordflow">else</span> { <a name="l01805"></a>01805 mLeftFrame->hide(); <a name="l01806"></a>01806 emit calendarViewExpanded( <span class="keyword">true</span> ); <a name="l01807"></a>01807 } <a name="l01808"></a>01808 } <a name="l01809"></a>01809 <a name="l01810"></a>01810 <span class="keywordtype">void</span> CalendarView::calendarModified( <span class="keywordtype">bool</span> modified, <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html">Calendar</a> * ) <a name="l01811"></a>01811 { <a name="l01812"></a>01812 <a class="code" href="classCalendarView.html#ddbb05803e0a87011a196ed21ce8dfd2" title="set the state of calendar.">setModified</a>( modified ); <a name="l01813"></a>01813 } <a name="l01814"></a>01814 <a name="l01815"></a>01815 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *CalendarView::selectedTodo() <a name="l01816"></a>01816 { <a name="l01817"></a>01817 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#e8315a9534a5ad530a5bf55e1912343f" title="currentSelection() returns a pointer to the incidence selected in the current view...">currentSelection</a>(); <a name="l01818"></a>01818 <span class="keywordflow">if</span> ( incidence && incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l01819"></a>01819 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *<span class="keyword">></span>( incidence ); <a name="l01820"></a>01820 } <a name="l01821"></a>01821 incidence = 0; <a name="l01822"></a>01822 <a name="l01823"></a>01823 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> selectedIncidences = mTodoList-><a class="code" href="classKOTodoView.html#b770f897964318430ab1167f6d495bd9">selectedIncidences</a>(); <a name="l01824"></a>01824 <span class="keywordflow">if</span> ( !selectedIncidences.isEmpty() ) incidence = selectedIncidences.first(); <a name="l01825"></a>01825 <span class="keywordflow">if</span> ( incidence && incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l01826"></a>01826 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *<span class="keyword">></span>( incidence ); <a name="l01827"></a>01827 } <a name="l01828"></a>01828 <a name="l01829"></a>01829 <span class="keywordflow">return</span> 0; <a name="l01830"></a>01830 } <a name="l01831"></a>01831 <a name="l01832"></a>01832 <span class="keywordtype">void</span> CalendarView::dialogClosing( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *in ) <a name="l01833"></a>01833 { <a name="l01834"></a>01834 <span class="comment">// FIXME: this doesn't work, because if it's a new incidence, it's not locked!</span> <a name="l01835"></a>01835 mChanger->endChange( in ); <a name="l01836"></a>01836 mDialogList.remove( in ); <a name="l01837"></a>01837 } <a name="l01838"></a>01838 <a name="l01839"></a><a class="code" href="classCalendarView.html#e8315a9534a5ad530a5bf55e1912343f">01839</a> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *<a class="code" href="classCalendarView.html#e8315a9534a5ad530a5bf55e1912343f" title="currentSelection() returns a pointer to the incidence selected in the current view...">CalendarView::currentSelection</a>() <a name="l01840"></a>01840 { <a name="l01841"></a>01841 <span class="keywordflow">return</span> mViewManager-><a class="code" href="classKOViewManager.html#71c20349bcbec821a83a24334a301415">currentSelection</a>(); <a name="l01842"></a>01842 } <a name="l01843"></a>01843 <a name="l01844"></a><a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a">01844</a> <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a>* <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">CalendarView::selectedIncidence</a>() <a name="l01845"></a>01845 { <a name="l01846"></a>01846 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = <a class="code" href="classCalendarView.html#e8315a9534a5ad530a5bf55e1912343f" title="currentSelection() returns a pointer to the incidence selected in the current view...">currentSelection</a>(); <a name="l01847"></a>01847 <span class="keywordflow">if</span> ( !incidence ) { <a name="l01848"></a>01848 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> selectedIncidences = mTodoList-><a class="code" href="classKOTodoView.html#b770f897964318430ab1167f6d495bd9">selectedIncidences</a>(); <a name="l01849"></a>01849 <span class="keywordflow">if</span> ( !selectedIncidences.isEmpty() ) <a name="l01850"></a>01850 incidence = selectedIncidences.first(); <a name="l01851"></a>01851 } <a name="l01852"></a>01852 <span class="keywordflow">return</span> incidence; <a name="l01853"></a>01853 } <a name="l01854"></a>01854 <a name="l01855"></a>01855 <span class="keywordtype">void</span> CalendarView::showIncidence() <a name="l01856"></a>01856 { <a name="l01857"></a>01857 showIncidence( <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>() ); <a name="l01858"></a>01858 } <a name="l01859"></a>01859 <a name="l01860"></a>01860 <span class="keywordtype">void</span> CalendarView::editIncidence() <a name="l01861"></a>01861 { <a name="l01862"></a>01862 editIncidence( <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>() ); <a name="l01863"></a>01863 } <a name="l01864"></a>01864 <a name="l01865"></a>01865 <span class="keywordtype">bool</span> CalendarView::editIncidence( <span class="keyword">const</span> QString& uid ) <a name="l01866"></a>01866 { <a name="l01867"></a>01867 kdDebug(5850) << <span class="stringliteral">"CalendarView::editIncidence()"</span> << endl; <a name="l01868"></a>01868 <span class="keywordflow">return</span> editIncidence( mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d271d711219da854049efa30723188c4">incidence</a>( uid ) ); <a name="l01869"></a>01869 } <a name="l01870"></a>01870 <a name="l01871"></a>01871 <span class="keywordtype">void</span> CalendarView::deleteIncidence() <a name="l01872"></a>01872 { <a name="l01873"></a>01873 deleteIncidence( <a class="code" href="classCalendarView.html#cd838c843b32133012f0cc079b64d15a" title="Return a pointer to the incidence selected in the current view.">selectedIncidence</a>() ); <a name="l01874"></a>01874 } <a name="l01875"></a>01875 <a name="l01876"></a><a class="code" href="classCalendarView.html#2fe261a114bd5cdce98cbe51b9dffec5">01876</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#2fe261a114bd5cdce98cbe51b9dffec5" title="Cuts the selected incidence using the edit_cut() method.">CalendarView::cutIncidence</a>(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *) <a name="l01877"></a>01877 { <a name="l01878"></a>01878 <a class="code" href="classCalendarView.html#55833939ce770640f73278cf10aa5e26" title="cut the current appointment to the clipboard">edit_cut</a>(); <a name="l01879"></a>01879 } <a name="l01880"></a>01880 <a name="l01881"></a><a class="code" href="classCalendarView.html#8ae6031a80f331746bbfa2d34ec67e55">01881</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#8ae6031a80f331746bbfa2d34ec67e55" title="Copies the selected incidence using the edit_copy() method.">CalendarView::copyIncidence</a>(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *) <a name="l01882"></a>01882 { <a name="l01883"></a>01883 <a class="code" href="classCalendarView.html#caf61e1a0d95174bf5023e4cb1c24c03" title="copy the current appointment(s) to the clipboard">edit_copy</a>(); <a name="l01884"></a>01884 } <a name="l01885"></a>01885 <a name="l01886"></a><a class="code" href="classCalendarView.html#cc03ae70baf5ab593012cc7a22644aff">01886</a> <span class="keywordtype">void</span> CalendarView::showIncidence( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l01887"></a>01887 { <a name="l01888"></a>01888 <a class="code" href="classKOEventViewerDialog.html" title="Viewer dialog for events.">KOEventViewerDialog</a> *eventViewer = <span class="keyword">new</span> <a class="code" href="classKOEventViewerDialog.html" title="Viewer dialog for events.">KOEventViewerDialog</a>( <span class="keyword">this</span> ); <a name="l01889"></a>01889 eventViewer-><a class="code" href="classKOEventViewerDialog.html#7984b4dd6ef2fc1633c79ea42123bf14">setIncidence</a>( incidence ); <a name="l01890"></a>01890 eventViewer->show(); <a name="l01891"></a>01891 } <a name="l01892"></a>01892 <a name="l01893"></a><a class="code" href="classCalendarView.html#ffd75267c57ceb03643b197a01b22794">01893</a> <span class="keywordtype">bool</span> CalendarView::editIncidence( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence ) <a name="l01894"></a>01894 { <a name="l01895"></a>01895 kdDebug(5850) << <span class="stringliteral">"CalendarView::editEvent()"</span> << endl; <a name="l01896"></a>01896 <a name="l01897"></a>01897 <span class="keywordflow">if</span> ( !incidence || !mChanger ) { <a name="l01898"></a>01898 KNotifyClient::beep(); <a name="l01899"></a>01899 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01900"></a>01900 } <a name="l01901"></a>01901 <a class="code" href="classKOIncidenceEditor.html" title="This is the base class for the calendar component editors.">KOIncidenceEditor</a> *tmp = editorDialog( incidence ); <a name="l01902"></a>01902 <span class="keywordflow">if</span> ( tmp ) { <a name="l01903"></a>01903 kdDebug(5850) << <span class="stringliteral">"CalendarView::editIncidence() in List"</span> << endl; <a name="l01904"></a>01904 tmp-><a class="code" href="classKOIncidenceEditor.html#44aeff25838f126f4568bbaecd0e551f">reload</a>(); <a name="l01905"></a>01905 tmp->raise(); <a name="l01906"></a>01906 tmp->show(); <a name="l01907"></a>01907 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l01908"></a>01908 } <a name="l01909"></a>01909 <a name="l01910"></a>01910 <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#ed5d0696a6288811b20343d6e467a93a">isReadOnly</a>() ) { <a name="l01911"></a>01911 showIncidence( incidence ); <a name="l01912"></a>01912 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l01913"></a>01913 } <a name="l01914"></a>01914 <a name="l01915"></a>01915 <span class="keywordflow">if</span> ( !mChanger->beginChange( incidence ) ) { <a name="l01916"></a>01916 warningChangeFailed( incidence ); <a name="l01917"></a>01917 showIncidence( incidence ); <a name="l01918"></a>01918 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l01919"></a>01919 } <a name="l01920"></a>01920 <a name="l01921"></a>01921 kdDebug(5850) << <span class="stringliteral">"CalendarView::editIncidence() new IncidenceEditor"</span> << endl; <a name="l01922"></a>01922 <a class="code" href="classKOIncidenceEditor.html" title="This is the base class for the calendar component editors.">KOIncidenceEditor</a> *incidenceEditor = mDialogManager-><a class="code" href="classKODialogManager.html#4e630f32594bfd4c9b34988f48d99a82" title="Get the appropriate editor for the given incidence.">getEditor</a>( incidence ); <a name="l01923"></a>01923 connectIncidenceEditor( incidenceEditor ); <a name="l01924"></a>01924 <a name="l01925"></a>01925 mDialogList.insert( incidence, incidenceEditor ); <a name="l01926"></a>01926 incidenceEditor-><a class="code" href="classKOIncidenceEditor.html#829cc117c4a5990cc78e3bcca850b237" title="Edit an existing todo.">editIncidence</a>( incidence, mCalendar ); <a name="l01927"></a>01927 incidenceEditor->show(); <a name="l01928"></a>01928 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l01929"></a>01929 } <a name="l01930"></a>01930 <a name="l01931"></a><a class="code" href="classCalendarView.html#4ca71b45f7e94b69a2721c63b43a8402">01931</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#4ca71b45f7e94b69a2721c63b43a8402" title="Delete the supplied todo and all sub-todos.">CalendarView::deleteSubTodosIncidence</a> ( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo ) <a name="l01932"></a>01932 { <a name="l01933"></a>01933 <span class="keywordflow">if</span>( !todo ) <span class="keywordflow">return</span>; <a name="l01934"></a>01934 <a name="l01935"></a>01935 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> subTodos( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#a4543a67ede7777dda57b127fa8fdf88">relations</a>() ); <a name="l01936"></a>01936 Incidence::List::Iterator it; <a name="l01937"></a>01937 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *aIncidence; <a name="l01938"></a>01938 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *aTodo; <a name="l01939"></a>01939 <a name="l01940"></a>01940 <span class="keywordflow">for</span> ( it= subTodos.begin(); it != subTodos.end(); ++it ) { <a name="l01941"></a>01941 aIncidence = *it; <a name="l01942"></a>01942 <span class="keywordflow">if</span>( aIncidence && aIncidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l01943"></a>01943 aTodo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>*<span class="keyword">></span>( aIncidence ); <a name="l01944"></a>01944 <a class="code" href="classCalendarView.html#4ca71b45f7e94b69a2721c63b43a8402" title="Delete the supplied todo and all sub-todos.">deleteSubTodosIncidence</a> ( aTodo ); <a name="l01945"></a>01945 } <a name="l01946"></a>01946 } <a name="l01947"></a>01947 mChanger->deleteIncidence ( todo ); <a name="l01948"></a>01948 } <a name="l01949"></a>01949 <a name="l01950"></a><a class="code" href="classCalendarView.html#5f90a83a8f1be7639c4d7ff710dea60f">01950</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#5f90a83a8f1be7639c4d7ff710dea60f" title="Delete the todo incidence, and its sub-to-dos.">CalendarView::deleteTodoIncidence</a> ( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo, <span class="keywordtype">bool</span> force ) <a name="l01951"></a>01951 { <a name="l01952"></a>01952 <span class="keywordflow">if</span> ( !todo ) return ; <a name="l01953"></a>01953 <a name="l01954"></a>01954 <span class="comment">// it a simple todo, ask and delete it.</span> <a name="l01955"></a>01955 <span class="keywordflow">if</span> (todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#a4543a67ede7777dda57b127fa8fdf88">relations</a>().isEmpty() ) { <a name="l01956"></a>01956 <span class="keywordtype">bool</span> doDelete = <span class="keyword">true</span>; <a name="l01957"></a>01957 <span class="keywordflow">if</span> ( !force && KOPrefs::instance()->mConfirm ) { <a name="l01958"></a>01958 doDelete = ( msgItemDelete( todo ) == KMessageBox::Continue ); <a name="l01959"></a>01959 } <a name="l01960"></a>01960 <span class="keywordflow">if</span> ( doDelete ) <a name="l01961"></a>01961 mChanger->deleteIncidence( todo ); <a name="l01962"></a>01962 <span class="keywordflow">return</span>; <a name="l01963"></a>01963 } <a name="l01964"></a>01964 <a name="l01965"></a>01965 <span class="comment">/* Ok, this to-do has sub-to-dos, ask what to do */</span> <a name="l01966"></a>01966 <span class="keywordtype">int</span> km = KMessageBox::No; <a name="l01967"></a>01967 <span class="keywordflow">if</span> ( !force ) { <a name="l01968"></a>01968 km=KMessageBox::questionYesNoCancel( <span class="keyword">this</span>, <a name="l01969"></a>01969 i18n(<span class="stringliteral">"The item \"%1\" has sub-to-dos. "</span> <a name="l01970"></a>01970 <span class="stringliteral">"Do you want to delete just this item and "</span> <a name="l01971"></a>01971 <span class="stringliteral">"make all its sub-to-dos independent, or "</span> <a name="l01972"></a>01972 <span class="stringliteral">"delete the to-do with all its sub-to-dos?"</span> <a name="l01973"></a>01973 ).arg( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ), <a name="l01974"></a>01974 i18n(<span class="stringliteral">"KOrganizer Confirmation"</span>), <a name="l01975"></a>01975 i18n(<span class="stringliteral">"Delete Only This"</span>), <a name="l01976"></a>01976 i18n(<span class="stringliteral">"Delete All"</span>)); <a name="l01977"></a>01977 } <a name="l01978"></a>01978 startMultiModify( i18n(<span class="stringliteral">"Deleting sub-to-dos"</span> ) ); <a name="l01979"></a>01979 <span class="comment">// Delete only the father</span> <a name="l01980"></a>01980 <span class="keywordflow">if</span>( km == KMessageBox::Yes ) { <a name="l01981"></a>01981 <a name="l01982"></a>01982 <a class="code" href="classCalendarView.html#cb45a342846d90107f9cd7b0acdca068" title="Make all sub-to-dos of todo independents, update the view.">makeSubTodosIndependents</a> ( todo ); <a name="l01983"></a>01983 mChanger->deleteIncidence( todo ); <a name="l01984"></a>01984 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( km == KMessageBox::No ) { <a name="l01985"></a>01985 <span class="comment">// Delete all</span> <a name="l01986"></a>01986 <span class="comment">// we have to hide the delete confirmation for each itemDate</span> <a name="l01987"></a>01987 <a class="code" href="classCalendarView.html#4ca71b45f7e94b69a2721c63b43a8402" title="Delete the supplied todo and all sub-todos.">deleteSubTodosIncidence</a> ( todo ); <a name="l01988"></a>01988 } <a name="l01989"></a>01989 endMultiModify(); <a name="l01990"></a>01990 } <a name="l01991"></a>01991 <a name="l01992"></a><a class="code" href="classCalendarView.html#7d0cacc48881f494413995d672f8920d">01992</a> <span class="keywordtype">void</span> CalendarView::deleteIncidence(<a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence, <span class="keywordtype">bool</span> force) <a name="l01993"></a>01993 { <a name="l01994"></a>01994 <span class="keywordflow">if</span> ( !incidence || !mChanger ) { <a name="l01995"></a>01995 <span class="keywordflow">if</span> ( !force ) { <a name="l01996"></a>01996 KNotifyClient::beep(); <a name="l01997"></a>01997 } <a name="l01998"></a>01998 <span class="keywordflow">return</span>; <a name="l01999"></a>01999 } <a name="l02000"></a>02000 <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#ed5d0696a6288811b20343d6e467a93a">isReadOnly</a>() ) { <a name="l02001"></a>02001 <span class="keywordflow">if</span> ( !force ) { <a name="l02002"></a>02002 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"The item \"%1\" is marked read-only "</span> <a name="l02003"></a>02003 <span class="stringliteral">"and cannot be deleted; it probably belongs to "</span> <a name="l02004"></a>02004 <span class="stringliteral">"a read-only calendar resource."</span>) <a name="l02005"></a>02005 .arg(incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>()), <a name="l02006"></a>02006 i18n(<span class="stringliteral">"Removing not possible"</span>), <a name="l02007"></a>02007 <span class="stringliteral">"deleteReadOnlyIncidence"</span> ); <a name="l02008"></a>02008 } <a name="l02009"></a>02009 <span class="keywordflow">return</span>; <a name="l02010"></a>02010 } <a name="l02011"></a>02011 <a name="l02012"></a>02012 CanDeleteIncidenceVisitor v; <a name="l02013"></a>02013 <a name="l02014"></a>02014 <span class="comment">// Let the visitor do special things for special incidence types.</span> <a name="l02015"></a>02015 <span class="comment">// e.g. todos with children cannot be deleted, so act(..) returns false</span> <a name="l02016"></a>02016 <span class="keywordflow">if</span> ( !v.act( incidence, <span class="keyword">this</span> ) ) <a name="l02017"></a>02017 <span class="keywordflow">return</span>; <a name="l02018"></a>02018 <span class="comment">//If it is a todo, there are specific delete function</span> <a name="l02019"></a>02019 <a name="l02020"></a>02020 <span class="keywordflow">if</span> ( incidence && incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>()==<span class="stringliteral">"Todo"</span> ) { <a name="l02021"></a>02021 <a class="code" href="classCalendarView.html#5f90a83a8f1be7639c4d7ff710dea60f" title="Delete the todo incidence, and its sub-to-dos.">deleteTodoIncidence</a>( static_cast<Todo*>(incidence), force ); <a name="l02022"></a>02022 <span class="keywordflow">return</span>; <a name="l02023"></a>02023 } <a name="l02024"></a>02024 <a name="l02025"></a>02025 <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#81ad15662138be07f0d55be6b075b043">doesRecur</a>() ) { <a name="l02026"></a>02026 QDate itemDate = mViewManager-><a class="code" href="classKOViewManager.html#483e528e29ea11a8b561e54b544d7578">currentSelectionDate</a>(); <a name="l02027"></a>02027 kdDebug(5850) << <span class="stringliteral">"Recurrence-Date: "</span> << itemDate.toString() << endl; <a name="l02028"></a>02028 <span class="keywordtype">int</span> km = KMessageBox::Ok; <a name="l02029"></a>02029 <span class="keywordflow">if</span> ( !force ) { <a name="l02030"></a>02030 <span class="keywordflow">if</span> ( !itemDate.isValid() ) { <a name="l02031"></a>02031 kdDebug(5850) << <span class="stringliteral">"Date Not Valid"</span> << endl; <a name="l02032"></a>02032 km = KMessageBox::warningContinueCancel(<span class="keyword">this</span>, <a name="l02033"></a>02033 i18n(<span class="stringliteral">"The calendar item \"%1\" recurs over multiple dates; "</span> <a name="l02034"></a>02034 <span class="stringliteral">"are you sure you want to delete it "</span> <a name="l02035"></a>02035 <span class="stringliteral">"and all its recurrences?"</span>).arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ), <a name="l02036"></a>02036 i18n(<span class="stringliteral">"KOrganizer Confirmation"</span>), i18n(<span class="stringliteral">"Delete All"</span>) ); <a name="l02037"></a>02037 } <span class="keywordflow">else</span> { <a name="l02038"></a>02038 km = KOMessageBox::fourBtnMsgBox( <span class="keyword">this</span>, QMessageBox::Warning, <a name="l02039"></a>02039 i18n(<span class="stringliteral">"The calendar item \"%1\" recurs over multiple dates. "</span> <a name="l02040"></a>02040 <span class="stringliteral">"Do you want to delete only the current one on %2, only all "</span> <a name="l02041"></a>02041 <span class="stringliteral">"future recurrences, or all its recurrences?"</span> ) <a name="l02042"></a>02042 .arg( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#5f6e41afa4e1b167c4b49e603506b34c">summary</a>() ) <a name="l02043"></a>02043 .arg( KGlobal::locale()->formatDate(itemDate)), <a name="l02044"></a>02044 i18n(<span class="stringliteral">"KOrganizer Confirmation"</span>), i18n(<span class="stringliteral">"Delete C&urrent"</span>), <a name="l02045"></a>02045 i18n(<span class="stringliteral">"Delete &Future"</span>), <a name="l02046"></a>02046 i18n(<span class="stringliteral">"Delete &All"</span>)); <a name="l02047"></a>02047 } <a name="l02048"></a>02048 } <a name="l02049"></a>02049 <span class="keywordflow">switch</span>(km) { <a name="l02050"></a>02050 <span class="keywordflow">case</span> KMessageBox::Ok: <span class="comment">// Continue // all</span> <a name="l02051"></a>02051 <span class="keywordflow">case</span> KMessageBox::Continue: <a name="l02052"></a>02052 mChanger->deleteIncidence( incidence ); <a name="l02053"></a>02053 <span class="keywordflow">break</span>; <a name="l02054"></a>02054 <a name="l02055"></a>02055 <span class="keywordflow">case</span> KMessageBox::Yes: <span class="comment">// just this one</span> <a name="l02056"></a>02056 <span class="keywordflow">if</span> ( mChanger->beginChange( incidence ) ) { <a name="l02057"></a>02057 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *oldIncidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l02058"></a>02058 incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#d06004593e064a37d08c96f9ae16735e">recurrence</a>()-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Recurrence.html#12d7d0347442011c30b8152cfb429580">addExDate</a>( itemDate ); <a name="l02059"></a>02059 mChanger->changeIncidence( oldIncidence, incidence ); <a name="l02060"></a>02060 mChanger->endChange( incidence ); <a name="l02061"></a>02061 <span class="keyword">delete</span> oldIncidence; <a name="l02062"></a>02062 } <a name="l02063"></a>02063 <span class="keywordflow">break</span>; <a name="l02064"></a>02064 <span class="keywordflow">case</span> KMessageBox::No: <span class="comment">// all future items</span> <a name="l02065"></a>02065 <span class="keywordflow">if</span> ( mChanger->beginChange( incidence ) ) { <a name="l02066"></a>02066 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *oldIncidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l02067"></a>02067 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Recurrence.html">Recurrence</a> *recur = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#d06004593e064a37d08c96f9ae16735e">recurrence</a>(); <a name="l02068"></a>02068 recur-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Recurrence.html#bc15a53c9b3ffd469ee5b15c071da2f8">setEndDate</a>( itemDate.addDays(-1) ); <a name="l02069"></a>02069 mChanger->changeIncidence( oldIncidence, incidence ); <a name="l02070"></a>02070 mChanger->endChange( incidence ); <a name="l02071"></a>02071 <span class="keyword">delete</span> oldIncidence; <a name="l02072"></a>02072 } <a name="l02073"></a>02073 <span class="keywordflow">break</span>; <a name="l02074"></a>02074 } <a name="l02075"></a>02075 } <span class="keywordflow">else</span> { <a name="l02076"></a>02076 <span class="keywordtype">bool</span> doDelete = <span class="keyword">true</span>; <a name="l02077"></a>02077 <span class="keywordflow">if</span> ( !force && KOPrefs::instance()->mConfirm ) { <a name="l02078"></a>02078 doDelete = ( msgItemDelete( incidence ) == KMessageBox::Continue ); <a name="l02079"></a>02079 } <a name="l02080"></a>02080 <span class="keywordflow">if</span> ( doDelete ) { <a name="l02081"></a>02081 mChanger->deleteIncidence( incidence ); <a name="l02082"></a>02082 processIncidenceSelection( 0 ); <a name="l02083"></a>02083 } <a name="l02084"></a>02084 } <a name="l02085"></a>02085 } <a name="l02086"></a>02086 <a name="l02087"></a>02087 <span class="keywordtype">void</span> CalendarView::connectIncidenceEditor( <a class="code" href="classKOIncidenceEditor.html" title="This is the base class for the calendar component editors.">KOIncidenceEditor</a> *editor ) <a name="l02088"></a>02088 { <a name="l02089"></a>02089 connect( <span class="keyword">this</span>, SIGNAL( newIncidenceChanger( IncidenceChangerBase* ) ), <a name="l02090"></a>02090 editor, SLOT( setIncidenceChanger( IncidenceChangerBase* ) ) ); <a name="l02091"></a>02091 editor-><a class="code" href="classKOIncidenceEditor.html#d9099d8562beb4e95661e1cdf55037e9">setIncidenceChanger</a>( mChanger ); <a name="l02092"></a>02092 } <a name="l02093"></a>02093 <a name="l02094"></a>02094 <span class="keywordtype">bool</span> CalendarView::purgeCompletedSubTodos( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>* todo, <span class="keywordtype">bool</span> &allPurged ) <a name="l02095"></a>02095 { <a name="l02096"></a>02096 <span class="keywordflow">if</span> ( !todo ) <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l02097"></a>02097 <span class="keywordtype">bool</span> deleteThisTodo = <span class="keyword">true</span>; <a name="l02098"></a>02098 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#74056b273d15b567668640fc37169c6d">Incidence::List</a> subTodos( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#a4543a67ede7777dda57b127fa8fdf88">relations</a>() ); <a name="l02099"></a>02099 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *aIncidence; <a name="l02100"></a>02100 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *aTodo; <a name="l02101"></a>02101 Incidence::List::Iterator it; <a name="l02102"></a>02102 <span class="keywordflow">for</span> ( it = subTodos.begin(); it != subTodos.end(); ++it ) { <a name="l02103"></a>02103 aIncidence = *it; <a name="l02104"></a>02104 <span class="keywordflow">if</span> ( aIncidence && aIncidence->type()==<span class="stringliteral">"Todo"</span> ) { <a name="l02105"></a>02105 aTodo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>*<span class="keyword">></span>( aIncidence ); <a name="l02106"></a>02106 deleteThisTodo &= purgeCompletedSubTodos( aTodo, allPurged ); <a name="l02107"></a>02107 } <a name="l02108"></a>02108 } <a name="l02109"></a>02109 <a name="l02110"></a>02110 <span class="keywordflow">if</span> ( deleteThisTodo ) { <a name="l02111"></a>02111 <span class="keywordflow">if</span> ( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#c935ce3f04f7e9d828d3f954de585af6">isCompleted</a>() ) { <a name="l02112"></a>02112 <span class="keywordflow">if</span> ( !mChanger->deleteIncidence( todo ) ) <a name="l02113"></a>02113 allPurged = <span class="keyword">false</span>; <a name="l02114"></a>02114 } <span class="keywordflow">else</span> { <a name="l02115"></a>02115 deleteThisTodo = <span class="keyword">false</span>; <a name="l02116"></a>02116 } <a name="l02117"></a>02117 } <span class="keywordflow">else</span> { <a name="l02118"></a>02118 <span class="keywordflow">if</span> ( todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#c935ce3f04f7e9d828d3f954de585af6">isCompleted</a>() ) { <a name="l02119"></a>02119 allPurged = <span class="keyword">false</span>; <a name="l02120"></a>02120 } <a name="l02121"></a>02121 } <a name="l02122"></a>02122 <span class="keywordflow">return</span> deleteThisTodo; <a name="l02123"></a>02123 } <a name="l02124"></a>02124 <a name="l02125"></a>02125 <span class="keywordtype">void</span> CalendarView::purgeCompleted() <a name="l02126"></a>02126 { <a name="l02127"></a>02127 <span class="keywordtype">int</span> result = KMessageBox::warningContinueCancel(<span class="keyword">this</span>, <a name="l02128"></a>02128 i18n(<span class="stringliteral">"Delete all completed to-dos?"</span>),i18n(<span class="stringliteral">"Purge To-dos"</span>),i18n(<span class="stringliteral">"Purge"</span>)); <a name="l02129"></a>02129 <a name="l02130"></a>02130 <span class="keywordflow">if</span> (result == KMessageBox::Continue) { <a name="l02131"></a>02131 <span class="keywordtype">bool</span> allDeleted = <span class="keyword">true</span>; <a name="l02132"></a>02132 startMultiModify( i18n(<span class="stringliteral">"Purging completed to-dos"</span>) ); <a name="l02133"></a>02133 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ListBase.html">Todo::List</a> todos = calendar()-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#c95bdb0d0e9399280396d1ff26a8377d">rawTodos</a>(); <a name="l02134"></a>02134 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1ListBase.html">Todo::List</a> rootTodos; <a name="l02135"></a>02135 Todo::List::ConstIterator it; <a name="l02136"></a>02136 <span class="keywordflow">for</span> ( it = todos.begin(); it != todos.end(); ++it ) { <a name="l02137"></a>02137 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *aTodo = *it; <a name="l02138"></a>02138 <span class="keywordflow">if</span> ( aTodo && !aTodo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#9b09c1637d3900ba0c2e768b39fff819">relatedTo</a>() ) <a name="l02139"></a>02139 rootTodos.append( aTodo ); <a name="l02140"></a>02140 } <a name="l02141"></a>02141 <span class="comment">// now that we have a list of all root todos, check them and their children</span> <a name="l02142"></a>02142 <span class="keywordflow">for</span> ( it = rootTodos.begin(); it != rootTodos.end(); ++it ) { <a name="l02143"></a>02143 purgeCompletedSubTodos( *it, allDeleted ); <a name="l02144"></a>02144 } <a name="l02145"></a>02145 endMultiModify(); <a name="l02146"></a>02146 <span class="keywordflow">if</span> ( !allDeleted ) { <a name="l02147"></a>02147 KMessageBox::information( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to purge to-dos with "</span> <a name="l02148"></a>02148 <span class="stringliteral">"uncompleted children."</span>), i18n(<span class="stringliteral">"Delete To-do"</span>), <a name="l02149"></a>02149 <span class="stringliteral">"UncompletedChildrenPurgeTodos"</span> ); <a name="l02150"></a>02150 } <a name="l02151"></a>02151 } <a name="l02152"></a>02152 } <a name="l02153"></a>02153 <a name="l02154"></a>02154 <span class="keywordtype">void</span> CalendarView::slotCalendarChanged() <a name="l02155"></a>02155 { <a name="l02156"></a>02156 kdDebug(5850) << <span class="stringliteral">"CalendarView::slotCalendarChanged()"</span> << endl; <a name="l02157"></a>02157 <a name="l02158"></a>02158 updateView(); <a name="l02159"></a>02159 } <a name="l02160"></a>02160 <a name="l02161"></a>02161 <span class="keywordtype">void</span> CalendarView::warningChangeFailed( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> * ) <a name="l02162"></a>02162 { <a name="l02163"></a>02163 KMessageBox::sorry( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to edit item: "</span> <a name="l02164"></a>02164 <span class="stringliteral">"it is locked by another process."</span>) ); <a name="l02165"></a>02165 } <a name="l02166"></a>02166 <a name="l02167"></a>02167 <span class="keywordtype">void</span> CalendarView::editCanceled( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *i ) <a name="l02168"></a>02168 { <a name="l02169"></a>02169 mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#7e89faf167259c9f92c3702fdf53b89b">endChange</a>( i ); <a name="l02170"></a>02170 } <a name="l02171"></a>02171 <a name="l02172"></a>02172 <span class="keywordtype">void</span> CalendarView::showErrorMessage( <span class="keyword">const</span> QString &msg ) <a name="l02173"></a>02173 { <a name="l02174"></a>02174 KMessageBox::error( <span class="keyword">this</span>, msg ); <a name="l02175"></a>02175 } <a name="l02176"></a>02176 <a name="l02177"></a><a class="code" href="classCalendarView.html#0b2d2114e3c71dcd630cdbb0b7bf8048">02177</a> <span class="keywordtype">void</span> <a class="code" href="classCalendarView.html#0b2d2114e3c71dcd630cdbb0b7bf8048" title="Calendar configuration was changed, so refresh categories list.">CalendarView::updateCategories</a>() <a name="l02178"></a>02178 { <a name="l02179"></a>02179 QStringList allCats( calendar()->categories() ); <a name="l02180"></a>02180 allCats.sort(); <a name="l02181"></a>02181 QStringList categories( KOPrefs::instance()->mCustomCategories ); <a name="l02182"></a>02182 <span class="keywordflow">for</span> ( QStringList::ConstIterator si = allCats.constBegin(); si != allCats.constEnd(); ++si ) { <a name="l02183"></a>02183 <span class="keywordflow">if</span> ( categories.find( *si ) == categories.end() ) { <a name="l02184"></a>02184 categories.append( *si ); <a name="l02185"></a>02185 } <a name="l02186"></a>02186 } <a name="l02187"></a>02187 KOPrefs::instance()->mCustomCategories = categories; <a name="l02188"></a>02188 KOPrefs::instance()->writeConfig(); <a name="l02189"></a>02189 <span class="comment">// Make the category editor update the list!</span> <a name="l02190"></a>02190 emit <a class="code" href="classCalendarView.html#f191910435e7023773dd94533e524a6c" title="Emitted when the categories were updated, and thus the categories editor dialog needs...">categoriesChanged</a>(); <a name="l02191"></a>02191 } <a name="l02192"></a>02192 <a name="l02193"></a>02193 <span class="keywordtype">void</span> CalendarView::addIncidenceOn( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incadd, <span class="keyword">const</span> QDate &dt ) <a name="l02194"></a>02194 { <a name="l02195"></a>02195 <span class="keywordflow">if</span> ( !incadd || !mChanger ) { <a name="l02196"></a>02196 KMessageBox::sorry(<span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to copy the item to %1."</span>) <a name="l02197"></a>02197 .arg( dt.toString() ), i18n(<span class="stringliteral">"Copying Failed"</span>) ); <a name="l02198"></a>02198 <span class="keywordflow">return</span>; <a name="l02199"></a>02199 } <a name="l02200"></a>02200 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d271d711219da854049efa30723188c4">incidence</a>( incadd-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#75c8bd2df73c5a62bd7cf77c2ac4d3c6">uid</a>() ); <a name="l02201"></a>02201 <span class="keywordflow">if</span> ( !incidence ) incidence = incadd; <a name="l02202"></a>02202 <span class="comment">// Create a copy of the incidence, since the incadd doesn't belong to us.</span> <a name="l02203"></a>02203 incidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l02204"></a>02204 incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#2ab366525e4ea376c8bfe334c10a347a">recreate</a>(); <a name="l02205"></a>02205 <a name="l02206"></a>02206 <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Event"</span> ) { <a name="l02207"></a>02207 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html">Event</a> *<span class="keyword">event</span> = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html">Event</a>*<span class="keyword">></span>(incidence); <a name="l02208"></a>02208 <a name="l02209"></a>02209 <span class="comment">// Adjust date</span> <a name="l02210"></a>02210 QDateTime start = <span class="keyword">event</span>->dtStart(); <a name="l02211"></a>02211 QDateTime end = <span class="keyword">event</span>->dtEnd(); <a name="l02212"></a>02212 <a name="l02213"></a>02213 <span class="keywordtype">int</span> duration = start.daysTo( end ); <a name="l02214"></a>02214 start.setDate( dt ); <a name="l02215"></a>02215 end.setDate( dt.addDays( duration ) ); <a name="l02216"></a>02216 <a name="l02217"></a>02217 <span class="keyword">event</span>->setDtStart( start ); <a name="l02218"></a>02218 <span class="keyword">event</span>->setDtEnd( end ); <a name="l02219"></a>02219 <a name="l02220"></a>02220 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l02221"></a>02221 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>*<span class="keyword">></span>(incidence); <a name="l02222"></a>02222 QDateTime due = todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#09d6933ae42390339b27053faee3afec">dtDue</a>(); <a name="l02223"></a>02223 due.setDate( dt ); <a name="l02224"></a>02224 <a name="l02225"></a>02225 todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#68e50e47f65def4d8d58a68423952ddb">setDtDue</a>( due ); <a name="l02226"></a>02226 todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#e806a381254cd454e80a6a82f114e84d">setHasDueDate</a>( <span class="keyword">true</span> ); <a name="l02227"></a>02227 } <a name="l02228"></a>02228 <a name="l02229"></a>02229 <span class="keywordflow">if</span> ( !mChanger->addIncidence( incidence, <span class="keyword">this</span> ) ) { <a name="l02230"></a>02230 KODialogManager::errorSaveIncidence( <span class="keyword">this</span>, incidence ); <a name="l02231"></a>02231 <span class="keyword">delete</span> incidence; <a name="l02232"></a>02232 } <a name="l02233"></a>02233 } <a name="l02234"></a>02234 <a name="l02235"></a>02235 <span class="keywordtype">void</span> CalendarView::moveIncidenceTo( <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incmove, <span class="keyword">const</span> QDate &dt ) <a name="l02236"></a>02236 { <a name="l02237"></a>02237 <span class="keywordflow">if</span> ( !incmove || !mChanger ) { <a name="l02238"></a>02238 KMessageBox::sorry( <span class="keyword">this</span>, i18n(<span class="stringliteral">"Unable to move the item to %1."</span>) <a name="l02239"></a>02239 .arg( dt.toString() ), i18n(<span class="stringliteral">"Moving Failed"</span>) ); <a name="l02240"></a>02240 <span class="keywordflow">return</span>; <a name="l02241"></a>02241 } <a name="l02242"></a>02242 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *incidence = mCalendar-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Calendar.html#d271d711219da854049efa30723188c4">incidence</a>( incmove-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#75c8bd2df73c5a62bd7cf77c2ac4d3c6">uid</a>() ); <a name="l02243"></a>02243 <span class="keywordflow">if</span> ( !incidence ) { <a name="l02244"></a>02244 addIncidenceOn( incidence, dt ); <a name="l02245"></a>02245 <span class="keywordflow">return</span>; <a name="l02246"></a>02246 } <a name="l02247"></a>02247 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html">Incidence</a> *oldIncidence = incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Incidence.html#176e62775d8267e8fb8a0c745b154607">clone</a>(); <a name="l02248"></a>02248 <span class="keywordflow">if</span> ( !mChanger->beginChange( incidence ) ) { <a name="l02249"></a>02249 <span class="keyword">delete</span> oldIncidence; <a name="l02250"></a>02250 <span class="keywordflow">return</span>; <a name="l02251"></a>02251 } <a name="l02252"></a>02252 <a name="l02253"></a>02253 <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Event"</span> ) { <a name="l02254"></a>02254 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html">Event</a> *<span class="keyword">event</span> = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Event.html">Event</a>*<span class="keyword">></span>(incidence); <a name="l02255"></a>02255 <a name="l02256"></a>02256 <span class="comment">// Adjust date</span> <a name="l02257"></a>02257 QDateTime start = <span class="keyword">event</span>-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#5419a946a4e5715a0c34ec2c7e04cd9b">dtStart</a>(); <a name="l02258"></a>02258 QDateTime end = <span class="keyword">event</span>->dtEnd(); <a name="l02259"></a>02259 <a name="l02260"></a>02260 <span class="keywordtype">int</span> duration = start.daysTo( end ); <a name="l02261"></a>02261 start.setDate( dt ); <a name="l02262"></a>02262 end.setDate( dt.addDays( duration ) ); <a name="l02263"></a>02263 <a name="l02264"></a>02264 <span class="keyword">event</span>->setDtStart( start ); <a name="l02265"></a>02265 <span class="keyword">event</span>->setDtEnd( end ); <a name="l02266"></a>02266 <a name="l02267"></a>02267 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( incidence-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1IncidenceBase.html#7981c13389e270b9e3e06a79d8564d5b">type</a>() == <span class="stringliteral">"Todo"</span> ) { <a name="l02268"></a>02268 <a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a> *todo = <span class="keyword">static_cast<</span><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html">Todo</a>*<span class="keyword">></span>(incidence); <a name="l02269"></a>02269 QDateTime due = todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#09d6933ae42390339b27053faee3afec">dtDue</a>(); <a name="l02270"></a>02270 due.setDate( dt ); <a name="l02271"></a>02271 <a name="l02272"></a>02272 todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#68e50e47f65def4d8d58a68423952ddb">setDtDue</a>( due ); <a name="l02273"></a>02273 todo-><a class="codeRef" doxygen="libkcal.tag:../../libkcal/html/" href="../../libkcal/html/classKCal_1_1Todo.html#e806a381254cd454e80a6a82f114e84d">setHasDueDate</a>( <span class="keyword">true</span> ); <a name="l02274"></a>02274 } <a name="l02275"></a>02275 mChanger->changeIncidence( oldIncidence, incidence ); <a name="l02276"></a>02276 mChanger->endChange( incidence ); <a name="l02277"></a>02277 <span class="keyword">delete</span> oldIncidence; <a name="l02278"></a>02278 } <a name="l02279"></a>02279 <a name="l02280"></a>02280 <span class="preprocessor">#include "calendarview.moc"</span> </pre></div></div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>korganizer</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="functions.html">Class Members</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classActionManager.html">actionmanager</option>, <option value="classCalendarView.html">calendarview</option>, <option value="classCalPrinter.html">calprinter</option>, <option value="classCalPrintPluginBase.html">calprintpluginbase</option>, <option value="classConfigDialog.html">configdialog</option>, <option value="classConverter.html">converter</option>, <option value="classDateNavigator.html">datenavigator</option>, <option value="classDynamicTip.html">dynamictip</option>, <option value="classEventArchiver.html">eventarchiver</option>, <option value="classExportWebDialog.html">exportwebdialog</option>, <option value="classFilterEditDialog.html">filtereditdialog</option>, <option value="classFreeBusyDownloadJob.html">freebusydownloadjob</option>, <option value="classHoliday.html">holiday</option>, <option value="classKCalendarIface.html">kcalendariface</option>, <option value="classKOAgendaView.html">koagendaview</option>, <option value="classKOAttendeeEditor.html">koattendeeeditor</option>, <option value="classKOAttendeeListView.html">koattendeelistview</option>, <option value="classKOCounterDialog.html">kocounterdialog</option>, <option value="classKODayMatrix.html">kodaymatrix</option>, <option value="classKODialogManager.html">kodialogmanager</option>, <option value="classKOEventEditor.html">koeventeditor</option>, <option value="classKOEventView.html">koeventview</option>, <option value="classKOEventViewer.html">koeventviewer</option>, <option value="classKOEventViewerDialog.html">koeventviewerdialog</option>, <option value="classKOIncidenceEditor.html">koincidenceeditor</option>, <option value="classKOIncidenceToolTip.html">koincidencetooltip</option>, <option value="classKOJournalEditor.html">kojournaleditor</option>, <option value="classKOJournalView.html">kojournalview</option>, <option value="classKOListView.html">kolistview</option>, <option value="classKOMonthView.html">komonthview</option>, <option value="classKOProjectView.html">koprojectview</option>, <option value="classKOProjectViewItem.html">koprojectviewitem</option>, <option value="classKOrg_1_1AgendaView.html">korg::agendaview</option>, <option value="classKOrg_1_1BaseView.html">korg::baseview</option>, <option value="classKOrg_1_1CalendarDecoration.html">korg::calendardecoration</option>, <option value="classKOrg_1_1CalendarViewBase.html">korg::calendarviewbase</option>, <option value="classKOrg_1_1CalPrinterBase.html">korg::calprinterbase</option>, <option value="classKOrg_1_1MainWindow.html">korg::mainwindow</option>, <option value="classKOrg_1_1MultiAgendaView.html">korg::multiagendaview</option>, <option value="classKOrg_1_1PrintPlugin.html">korg::printplugin</option>, <option value="classKOrganizer.html">korganizer</option>, <option value="classKOTimelineView.html">kotimelineview</option>, <option value="classKOTodoEditor.html">kotodoeditor</option>, <option value="classKOTodoView.html">kotodoview</option>, <option value="classKOTodoViewItem.html">kotodoviewitem</option>, <option value="classKOViewManager.html">koviewmanager</option>, <option value="classKOWhatsNextView.html">kowhatsnextview</option>, <option value="classKOWindowList.html">kowindowlist</option>, <option value="classMonthViewCell.html">monthviewcell</option>, <option value="classParsha.html">parsha</option>, <option value="classResourceView.html">resourceview</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../akregator/html/index.html">akregator</a></li><li> <a href="../../akregator/src/html/index.html">src</a></li><li> <a href="../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../certmanager/html/index.html">certmanager</a></li><li> <a href="../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../kalarm/html/index.html">kalarm</a></li><li> <a href="../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../kandy/html/index.html">kandy</a></li><li><a href="../../karm/html/index.html">karm</a></li><li><a href="../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../kgantt/html/index.html">kgantt</a></li><li><a href="../../kioslaves/html/index.html">kioslaves</a></li><li> <a href="../../kioslaves/imap4/html/index.html">imap4</a></li><li> <a href="../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../kmail/html/index.html">kmail</a></li><li><a href="../../knotes/html/index.html">knotes</a></li><li><a href="../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../kontact/html/index.html">kontact</a></li><li><a href="../../korganizer/html/index.html">korganizer</a></li><li><a href="../../kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../libkcal/html/index.html">libkcal</a></li><li><a href="../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../libkmime/html/index.html">libkmime</a></li><li><a href="../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../libkpimidentities/html/index.html">libkpimidentities</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>