calendarui/views/src/calenagendaview.cpp
author hgs
Mon, 28 Jun 2010 15:22:02 +0530
changeset 45 b6db4fd4947b
child 51 0b38fc5b94c6
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  CalenAgendaView implementation.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
// System includes
hgs
parents:
diff changeset
    19
#include <QGraphicsSceneEvent>
hgs
parents:
diff changeset
    20
#include <hbmainwindow.h>
hgs
parents:
diff changeset
    21
#include <hbaction.h>
hgs
parents:
diff changeset
    22
#include <hbpangesture.h>
hgs
parents:
diff changeset
    23
#include <hbswipegesture.h>
hgs
parents:
diff changeset
    24
#include <hbapplication.h> // hbapplication
hgs
parents:
diff changeset
    25
#include <hbactivitymanager.h> // Activity Manager
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
// User includes
hgs
parents:
diff changeset
    28
#include "calenagendaview.h"
hgs
parents:
diff changeset
    29
#include "calendocloader.h"
hgs
parents:
diff changeset
    30
#include "calenagendaviewwidget.h"
hgs
parents:
diff changeset
    31
#include "calenservices.h"
hgs
parents:
diff changeset
    32
#include "calencommon.h"
hgs
parents:
diff changeset
    33
#include "calencontext.h"
hgs
parents:
diff changeset
    34
#include "calendateutils.h"
hgs
parents:
diff changeset
    35
#include "calenconstants.h"
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    38
// CalenAgendaView::CalenAgendaView
hgs
parents:
diff changeset
    39
// Rest of the details are commented in the header
hgs
parents:
diff changeset
    40
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    41
//
hgs
parents:
diff changeset
    42
CalenAgendaView::CalenAgendaView(MCalenServices &services):
hgs
parents:
diff changeset
    43
CalenNativeView(services),
hgs
parents:
diff changeset
    44
mSoftKeyAction(NULL),
hgs
parents:
diff changeset
    45
mGoToTodayAction(NULL),
hgs
parents:
diff changeset
    46
mSwitchToDayViewAction(NULL),
hgs
parents:
diff changeset
    47
mActionTaken(false),
hgs
parents:
diff changeset
    48
mIsAboutToQuitEventConnected(false)
hgs
parents:
diff changeset
    49
{
hgs
parents:
diff changeset
    50
    // No implementation yet
hgs
parents:
diff changeset
    51
    grabGesture(Qt::SwipeGesture);
hgs
parents:
diff changeset
    52
}
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    55
// CalenAgendaView::~CalenAgendaView
hgs
parents:
diff changeset
    56
// Rest of the details are commented in the header
hgs
parents:
diff changeset
    57
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    58
//    
hgs
parents:
diff changeset
    59
CalenAgendaView::~CalenAgendaView()
hgs
parents:
diff changeset
    60
{
hgs
parents:
diff changeset
    61
    // No implementation yet
hgs
parents:
diff changeset
    62
}
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    65
// CalenAgendaView::setupView
hgs
parents:
diff changeset
    66
// Rest of the details are commented in the header
hgs
parents:
diff changeset
    67
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    68
//    
hgs
parents:
diff changeset
    69
void CalenAgendaView::setupView(CalenDocLoader *docLoader)
hgs
parents:
diff changeset
    70
{
hgs
parents:
diff changeset
    71
    if (!docLoader) {
hgs
parents:
diff changeset
    72
        // Nothing can be done. Simply return
hgs
parents:
diff changeset
    73
        return;
hgs
parents:
diff changeset
    74
    }
hgs
parents:
diff changeset
    75
    // Store the document loader for reference later
hgs
parents:
diff changeset
    76
	mDocLoader = docLoader;
hgs
parents:
diff changeset
    77
	
hgs
parents:
diff changeset
    78
	// Listen to orientation change events
hgs
parents:
diff changeset
    79
	connect(&(mServices.MainWindow()), SIGNAL(orientationChanged(Qt::Orientation)),
hgs
parents:
diff changeset
    80
	        this, SLOT(orientationChanged(Qt::Orientation)));
hgs
parents:
diff changeset
    81
	
hgs
parents:
diff changeset
    82
	// Get the pointer to the content widget
hgs
parents:
diff changeset
    83
	mAgendaViewWidget = qobject_cast<CalenAgendaViewWidget*>(mDocLoader->findWidget(CALEN_AGENDAVIEW_WIDGET));
hgs
parents:
diff changeset
    84
	if (!mAgendaViewWidget) {
hgs
parents:
diff changeset
    85
	    qFatal("calenagendaview.cpp : Unable to find the content widget");
hgs
parents:
diff changeset
    86
	}
hgs
parents:
diff changeset
    87
	mAgendaViewWidget->setupWidget(this);
hgs
parents:
diff changeset
    88
	
hgs
parents:
diff changeset
    89
	// Initialize all the menu and toolbar actions
hgs
parents:
diff changeset
    90
	setupActions();
hgs
parents:
diff changeset
    91
	// get a poitner to activity manager
hgs
parents:
diff changeset
    92
	HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
	// clean up any previous versions of this activity, if any, i.e. activityName, from the activity manager. 
hgs
parents:
diff changeset
    95
	// Ignore return value, first boot would always return False. bool declared 
hgs
parents:
diff changeset
    96
	// only for debugging purpose.
hgs
parents:
diff changeset
    97
	bool ok = activityManager->removeActivity(activityName);
hgs
parents:
diff changeset
    98
	
hgs
parents:
diff changeset
    99
}
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   102
// CalenAgendaView::doPopulation
hgs
parents:
diff changeset
   103
// Rest of the details are commented in the header
hgs
parents:
diff changeset
   104
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   105
// 
hgs
parents:
diff changeset
   106
void CalenAgendaView::doPopulation()
hgs
parents:
diff changeset
   107
    {
hgs
parents:
diff changeset
   108
    // The content widget has not been constructed. Don't do anything
hgs
parents:
diff changeset
   109
    if (!mAgendaViewWidget) {
hgs
parents:
diff changeset
   110
        return;
hgs
parents:
diff changeset
   111
    }
hgs
parents:
diff changeset
   112
    // Get the day for which this view is being shown from the context
hgs
parents:
diff changeset
   113
    mDate = mServices.Context().focusDateAndTime();
hgs
parents:
diff changeset
   114
    
hgs
parents:
diff changeset
   115
    // Check if the current day being shown is "Today"
hgs
parents:
diff changeset
   116
    if (mGoToTodayAction) {
hgs
parents:
diff changeset
   117
        if (mDate.date() == CalenDateUtils::today().date()) {
hgs
parents:
diff changeset
   118
            // Hide the "Go to today" option
hgs
parents:
diff changeset
   119
            mGoToTodayAction->setVisible(false);
hgs
parents:
diff changeset
   120
        } else {
hgs
parents:
diff changeset
   121
            mGoToTodayAction->setVisible(true);
hgs
parents:
diff changeset
   122
        }
hgs
parents:
diff changeset
   123
    }
hgs
parents:
diff changeset
   124
    
hgs
parents:
diff changeset
   125
    // Set self as the current view
hgs
parents:
diff changeset
   126
    // mServices.MainWindow().setCurrentView(this);
hgs
parents:
diff changeset
   127
    
hgs
parents:
diff changeset
   128
    // Dont override the soft key behavior if day view is the first view
hgs
parents:
diff changeset
   129
    if (ECalenAgendaView != mServices.getFirstView()) {
hgs
parents:
diff changeset
   130
		mSoftKeyAction = new HbAction(Hb::BackNaviAction);
hgs
parents:
diff changeset
   131
		setNavigationAction(mSoftKeyAction);
hgs
parents:
diff changeset
   132
		// Connect to the signal triggered by clicking on back button.
hgs
parents:
diff changeset
   133
		connect(mSoftKeyAction, SIGNAL(triggered()), this,
hgs
parents:
diff changeset
   134
		        SLOT(launchMonthView()));
hgs
parents:
diff changeset
   135
		if (mSwitchToDayViewAction) {
hgs
parents:
diff changeset
   136
			mSwitchToDayViewAction->setVisible(true);
hgs
parents:
diff changeset
   137
				}
hgs
parents:
diff changeset
   138
	} else {
hgs
parents:
diff changeset
   139
		if (mSwitchToDayViewAction) {
hgs
parents:
diff changeset
   140
			mSwitchToDayViewAction->setVisible(false);
hgs
parents:
diff changeset
   141
		}
hgs
parents:
diff changeset
   142
	}
hgs
parents:
diff changeset
   143
    // Initialize the content widget
hgs
parents:
diff changeset
   144
    mAgendaViewWidget->showWidget();
hgs
parents:
diff changeset
   145
    
hgs
parents:
diff changeset
   146
	//set Current Activity as day view
hgs
parents:
diff changeset
   147
    mActivityId = ECalenAgendaView;
hgs
parents:
diff changeset
   148
hgs
parents:
diff changeset
   149
	// connect to receive a call back on Day View exit. Call back would result in saveActivity 
hgs
parents:
diff changeset
   150
	// to be called in Native View
hgs
parents:
diff changeset
   151
    if (!mIsAboutToQuitEventConnected) // check if already not connected
hgs
parents:
diff changeset
   152
        {
hgs
parents:
diff changeset
   153
        connect(qobject_cast<HbApplication*>(qApp), SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
hgs
parents:
diff changeset
   154
		mIsAboutToQuitEventConnected = true;
hgs
parents:
diff changeset
   155
        }
hgs
parents:
diff changeset
   156
hgs
parents:
diff changeset
   157
hgs
parents:
diff changeset
   158
    // Population is complete, issue a notification
hgs
parents:
diff changeset
   159
    populationComplete();
hgs
parents:
diff changeset
   160
    }
hgs
parents:
diff changeset
   161
hgs
parents:
diff changeset
   162
/*!
hgs
parents:
diff changeset
   163
 Funtion to refresh the current view upon selecting a date
hgs
parents:
diff changeset
   164
 from GoToDate popup
hgs
parents:
diff changeset
   165
 */
hgs
parents:
diff changeset
   166
void CalenAgendaView::refreshViewOnGoToDate()
hgs
parents:
diff changeset
   167
{
hgs
parents:
diff changeset
   168
	// Get the day for which this view is being shown from the context
hgs
parents:
diff changeset
   169
	mDate = mServices.Context().focusDateAndTime();
hgs
parents:
diff changeset
   170
	
hgs
parents:
diff changeset
   171
	// Check if the current day being shown is "Today"
hgs
parents:
diff changeset
   172
	if (mGoToTodayAction) {
hgs
parents:
diff changeset
   173
		if (mDate.date() == CalenDateUtils::today().date()) {
hgs
parents:
diff changeset
   174
			// Hide the "Go to today" option
hgs
parents:
diff changeset
   175
			mGoToTodayAction->setVisible(false);
hgs
parents:
diff changeset
   176
		} else {
hgs
parents:
diff changeset
   177
			mGoToTodayAction->setVisible(true);
hgs
parents:
diff changeset
   178
		}
hgs
parents:
diff changeset
   179
	}
hgs
parents:
diff changeset
   180
	
hgs
parents:
diff changeset
   181
	// Initialize the content widget
hgs
parents:
diff changeset
   182
	mAgendaViewWidget->showWidget();
hgs
parents:
diff changeset
   183
}
hgs
parents:
diff changeset
   184
hgs
parents:
diff changeset
   185
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   186
// CalenAgendaView::HandleNotification
hgs
parents:
diff changeset
   187
// Rest of the details are commented in the header
hgs
parents:
diff changeset
   188
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   189
//    
hgs
parents:
diff changeset
   190
void CalenAgendaView::HandleNotification(const TCalenNotification notification)
hgs
parents:
diff changeset
   191
{
hgs
parents:
diff changeset
   192
    Q_UNUSED(notification)
hgs
parents:
diff changeset
   193
    // No implementation yet
hgs
parents:
diff changeset
   194
}
hgs
parents:
diff changeset
   195
hgs
parents:
diff changeset
   196
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   197
// CalenAgendaView::docLoader
hgs
parents:
diff changeset
   198
// Rest of the details are commented in the header
hgs
parents:
diff changeset
   199
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   200
//    
hgs
parents:
diff changeset
   201
CalenDocLoader* CalenAgendaView::docLoader()
hgs
parents:
diff changeset
   202
{
hgs
parents:
diff changeset
   203
    return mDocLoader;
hgs
parents:
diff changeset
   204
}
hgs
parents:
diff changeset
   205
hgs
parents:
diff changeset
   206
/*
hgs
parents:
diff changeset
   207
	Function to listen for gestures
hgs
parents:
diff changeset
   208
*/
hgs
parents:
diff changeset
   209
void CalenAgendaView::gestureEvent(QGestureEvent *event)
hgs
parents:
diff changeset
   210
{
hgs
parents:
diff changeset
   211
    if(HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) {
hgs
parents:
diff changeset
   212
        if (gesture->state() == Qt::GestureStarted) {
hgs
parents:
diff changeset
   213
            if(QSwipeGesture::Left == gesture->sceneHorizontalDirection()) {
hgs
parents:
diff changeset
   214
                mServices.IssueCommandL(ECalenShowNextDay);
hgs
parents:
diff changeset
   215
                event->accept(Qt::SwipeGesture);
hgs
parents:
diff changeset
   216
            } else if(QSwipeGesture::Right == gesture->sceneHorizontalDirection()) {
hgs
parents:
diff changeset
   217
                mServices.IssueCommandL(ECalenShowPrevDay);
hgs
parents:
diff changeset
   218
               event->accept(Qt::SwipeGesture);
hgs
parents:
diff changeset
   219
            }
hgs
parents:
diff changeset
   220
        }
hgs
parents:
diff changeset
   221
    } 
hgs
parents:
diff changeset
   222
}
hgs
parents:
diff changeset
   223
hgs
parents:
diff changeset
   224
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   225
// CalenAgendaView::createToolBar
hgs
parents:
diff changeset
   226
// Rest of the details are commented in the header
hgs
parents:
diff changeset
   227
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   228
//
hgs
parents:
diff changeset
   229
void CalenAgendaView::setupActions()
hgs
parents:
diff changeset
   230
{
hgs
parents:
diff changeset
   231
	// Get the actions associated with this view
hgs
parents:
diff changeset
   232
	HbAction *newEventAction = qobject_cast<HbAction *>
hgs
parents:
diff changeset
   233
                                (mDocLoader->findObject(CALEN_AGENDAVIEW_MENU_NEW_EVENT));
hgs
parents:
diff changeset
   234
	if (!newEventAction) {
hgs
parents:
diff changeset
   235
	    qFatal("calenagendaview.cpp : Unable to find new event action");
hgs
parents:
diff changeset
   236
	}
hgs
parents:
diff changeset
   237
	// Connect to the signal triggered by new event action
hgs
parents:
diff changeset
   238
	connect(newEventAction, SIGNAL(triggered()), mAgendaViewWidget, SLOT(createNewEvent()));
hgs
parents:
diff changeset
   239
	
hgs
parents:
diff changeset
   240
	mGoToTodayAction = qobject_cast<HbAction *>
hgs
parents:
diff changeset
   241
                        (mDocLoader->findObject(CALEN_AGENDAVIEW_MENU_GO_TO_TODAY));
hgs
parents:
diff changeset
   242
	if (!mGoToTodayAction) {
hgs
parents:
diff changeset
   243
	    qFatal("calenagendaview.cpp : Unable to find go to today action");
hgs
parents:
diff changeset
   244
	}
hgs
parents:
diff changeset
   245
	// Connect to the signal triggered by go to Today action
hgs
parents:
diff changeset
   246
	connect(mGoToTodayAction, SIGNAL(triggered()), mAgendaViewWidget, SLOT(goToToday()));
hgs
parents:
diff changeset
   247
	
hgs
parents:
diff changeset
   248
	HbAction *goToDateAction = qobject_cast<HbAction *>
hgs
parents:
diff changeset
   249
                                (mDocLoader->findObject(CALEN_AGENDAVIEW_MENU_GO_TO_DATE));
hgs
parents:
diff changeset
   250
	if (!goToDateAction) {
hgs
parents:
diff changeset
   251
	    qFatal("calenagendaview.cpp : Unable to find go to date action");
hgs
parents:
diff changeset
   252
	}
hgs
parents:
diff changeset
   253
	// Connect to the signal triggered by go to Date action
hgs
parents:
diff changeset
   254
	connect(goToDateAction, SIGNAL(triggered()), this, SLOT(goToDate()));
hgs
parents:
diff changeset
   255
	
hgs
parents:
diff changeset
   256
	mSwitchToDayViewAction = qobject_cast<HbAction *>
hgs
parents:
diff changeset
   257
	                                (mDocLoader->findObject(CALEN_AGENDAVIEW_MENU_SWITCH_TO_DAYVIEW));
hgs
parents:
diff changeset
   258
	if (!mSwitchToDayViewAction) {
hgs
parents:
diff changeset
   259
		    qFatal("calenagendaview.cpp : Unable to find go to date action");
hgs
parents:
diff changeset
   260
		}
hgs
parents:
diff changeset
   261
	// Connect to the signal triggered by switch to dayview action
hgs
parents:
diff changeset
   262
	connect(mSwitchToDayViewAction, SIGNAL(triggered()), this, SLOT(launchDayView()));
hgs
parents:
diff changeset
   263
	
hgs
parents:
diff changeset
   264
	HbAction *settingsAction = qobject_cast<HbAction *>
hgs
parents:
diff changeset
   265
                                (mDocLoader->findObject(CALEN_AGENDAVIEW_MENU_SETTINGS));
hgs
parents:
diff changeset
   266
	if (!settingsAction) {
hgs
parents:
diff changeset
   267
	    qFatal("calenagendaview.cpp : Unable to find settings action");
hgs
parents:
diff changeset
   268
	}
hgs
parents:
diff changeset
   269
	// Connect to the signal triggered by settings action
hgs
parents:
diff changeset
   270
	connect(settingsAction, SIGNAL(triggered()), this, SLOT(launchSettingsView()));
hgs
parents:
diff changeset
   271
}
hgs
parents:
diff changeset
   272
hgs
parents:
diff changeset
   273
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   274
// CalenAgendaView::onLocaleChanged
hgs
parents:
diff changeset
   275
// Rest of the details are commented in the header
hgs
parents:
diff changeset
   276
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   277
//    
hgs
parents:
diff changeset
   278
void CalenAgendaView::onLocaleChanged(int reason)
hgs
parents:
diff changeset
   279
{
hgs
parents:
diff changeset
   280
    Q_UNUSED(reason)
hgs
parents:
diff changeset
   281
    // Notify the content widget about the change
hgs
parents:
diff changeset
   282
    if(mAgendaViewWidget) {
hgs
parents:
diff changeset
   283
    mAgendaViewWidget->handleLocaleChange();
hgs
parents:
diff changeset
   284
    }
hgs
parents:
diff changeset
   285
}
hgs
parents:
diff changeset
   286
hgs
parents:
diff changeset
   287
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   288
// CalenAgendaView::orientationChanged
hgs
parents:
diff changeset
   289
// Rest of the details are commented in the header
hgs
parents:
diff changeset
   290
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   291
// 
hgs
parents:
diff changeset
   292
void CalenAgendaView::orientationChanged(Qt::Orientation orientation)
hgs
parents:
diff changeset
   293
{
hgs
parents:
diff changeset
   294
    // Notify the content widget about the change
hgs
parents:
diff changeset
   295
    if (mAgendaViewWidget) {
hgs
parents:
diff changeset
   296
    mAgendaViewWidget->orientationChanged(orientation);
hgs
parents:
diff changeset
   297
    }
hgs
parents:
diff changeset
   298
}
hgs
parents:
diff changeset
   299
hgs
parents:
diff changeset
   300
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   301
// CalenAgendaView::launchMonthView
hgs
parents:
diff changeset
   302
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   303
//    
hgs
parents:
diff changeset
   304
void CalenAgendaView::launchMonthView()
hgs
parents:
diff changeset
   305
{
hgs
parents:
diff changeset
   306
    // Issue the command to launch the month view
hgs
parents:
diff changeset
   307
    mServices.IssueCommandL(ECalenMonthView);
hgs
parents:
diff changeset
   308
	// month view launched now, disconnect to get the call backs for saveActivity 
hgs
parents:
diff changeset
   309
	// on aboutToQuit signal
hgs
parents:
diff changeset
   310
    disconnectAboutToQuitEvent();
hgs
parents:
diff changeset
   311
}
hgs
parents:
diff changeset
   312
hgs
parents:
diff changeset
   313
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   314
// CalenAgendaView::launchDayView
hgs
parents:
diff changeset
   315
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   316
//    
hgs
parents:
diff changeset
   317
void CalenAgendaView::launchDayView()
hgs
parents:
diff changeset
   318
{
hgs
parents:
diff changeset
   319
    // Issue the command to launch the day view
hgs
parents:
diff changeset
   320
    mServices.IssueCommandL(ECalenDayView);
hgs
parents:
diff changeset
   321
}
hgs
parents:
diff changeset
   322
hgs
parents:
diff changeset
   323
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   324
// clears the list model 
hgs
parents:
diff changeset
   325
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   326
// 
hgs
parents:
diff changeset
   327
void CalenAgendaView::clearListModel()
hgs
parents:
diff changeset
   328
    {
hgs
parents:
diff changeset
   329
	// day view is removed from the list disconnect for aboutToQuit events
hgs
parents:
diff changeset
   330
    disconnectAboutToQuitEvent();
hgs
parents:
diff changeset
   331
    mAgendaViewWidget->clearListModel();
hgs
parents:
diff changeset
   332
    }
hgs
parents:
diff changeset
   333
hgs
parents:
diff changeset
   334
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   335
// disconnectAboutToQuitEvent disconnects for the aboutToQuit events
hgs
parents:
diff changeset
   336
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   337
// 
hgs
parents:
diff changeset
   338
void CalenAgendaView::disconnectAboutToQuitEvent()
hgs
parents:
diff changeset
   339
    {
hgs
parents:
diff changeset
   340
    if (mIsAboutToQuitEventConnected)
hgs
parents:
diff changeset
   341
        {
hgs
parents:
diff changeset
   342
        disconnect(qobject_cast<HbApplication*>(qApp), SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
hgs
parents:
diff changeset
   343
        mIsAboutToQuitEventConnected = false;
hgs
parents:
diff changeset
   344
        }
hgs
parents:
diff changeset
   345
    }
hgs
parents:
diff changeset
   346
hgs
parents:
diff changeset
   347
// End of file	--Don't remove this.