calendarui/views/src/calensettingsview.cpp
changeset 18 c198609911f9
child 26 a949c2543c15
child 45 b6db4fd4947b
equal deleted inserted replaced
0:f979ecb2b13e 18:c198609911f9
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Source file for the class CalenSettingsView
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <QGraphicsItem>
       
    20 #include <QtGui>
       
    21 #include <QTimer>
       
    22 #include <hbdataform.h>
       
    23 #include <hblabel.h>
       
    24 #include <hbaction.h>
       
    25 #include <hbmainwindow.h>
       
    26 #include <HbInstance>
       
    27 
       
    28 #include <CalenUid.h>
       
    29 #include "calensettingsview.h"
       
    30 #include "calenservices.h"
       
    31 #include "calensettings.h"
       
    32 
       
    33 CalenSettingsView::CalenSettingsView(MCalenServices& services, QGraphicsItem *parent)
       
    34 :HbView(parent), mServices(services)
       
    35 {
       
    36 
       
    37 	mCalenSettingsForm = new HbDataForm(this);
       
    38 
       
    39 	// Set the title text.
       
    40 	setTitle(hbTrId("txt_calendar_title_calendar"));
       
    41 
       
    42 	// Construct the settings utility.
       
    43 	mCalenSettings = new CalenSettings(mCalenSettingsForm);
       
    44 	mCalenSettings->createModel();
       
    45 
       
    46 
       
    47 	setWidget(mCalenSettingsForm);
       
    48 	
       
    49 }
       
    50 
       
    51 CalenSettingsView::~CalenSettingsView()
       
    52 {
       
    53 	// Nothing yet.
       
    54 }
       
    55 
       
    56 void CalenSettingsView::launchPreviousView()
       
    57 {
       
    58 	// Remove the view from mainwindow
       
    59 
       
    60 	disconnect(mSoftKeyAction, SIGNAL(triggered()), 
       
    61 											this, SLOT(launchPreviousView()));
       
    62 	mServices.MainWindow().removeView(this);
       
    63 	mServices.IssueNotificationL(ECalenNotifySettingsClosed);
       
    64    
       
    65     //TODO :: For ART3 we are launching agenda view later we have to use week view
       
    66     // GEt the current orientation
       
    67    /* Qt::Orientation orientation = mServices.MainWindow().orientation();
       
    68     if(orientation == Qt::Vertical)
       
    69         {
       
    70         mServices.IssueCommandL(ECalenDayView);
       
    71         }
       
    72     else if(orientation == Qt::Horizontal)
       
    73         {
       
    74         mServices.IssueCommandL(ECalenLandscapeDayView);
       
    75         }*/
       
    76 }
       
    77 
       
    78 void CalenSettingsView::initializeForm()
       
    79     {
       
    80     mCalenSettings->populateSettingList();
       
    81     
       
    82     // Add view on main window and set back softkey
       
    83 	mServices.MainWindow().addView(this);
       
    84 	mSoftKeyAction = new HbAction(Hb::BackAction);
       
    85 	setNavigationAction(mSoftKeyAction);
       
    86 	connect(mSoftKeyAction, SIGNAL(triggered()), 
       
    87 											this, SLOT(launchPreviousView()));
       
    88     }
       
    89 
       
    90 // End of file