clock/clockui/clocksettingsview/src/clocksettingsview.cpp
changeset 63 a3cb48f6c889
parent 57 bb2d3e476f29
child 70 a5ed90760192
equal deleted inserted replaced
57:bb2d3e476f29 63:a3cb48f6c889
    54 /*!
    54 /*!
    55 	Constructor.
    55 	Constructor.
    56 
    56 
    57 	\param parent The parent of type QGraphicsWidget.
    57 	\param parent The parent of type QGraphicsWidget.
    58  */
    58  */
    59 ClockSettingsView::ClockSettingsView(QObject *parent)
    59 ClockSettingsView::ClockSettingsView(QObject *parent, HbTranslator *translator, bool launchedByClock)
    60 :QObject(parent)
    60 :QObject(parent), mTranslator(0), mLaunchedByClock(launchedByClock)
    61 {
    61 {
    62 	OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_ENTRY );
    62 	OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_ENTRY );
    63 	
    63 	
    64 	// Load the translation file and install the editor specific translator
    64 	// Load the translation file and install the editor specific translator
    65     mTranslator = new HbTranslator("clocksettingsview");
    65     if(!translator) {
    66     mTranslator->loadCommon();
    66         mTranslator = new HbTranslator("clocksettingsview");
       
    67         mTranslator->loadCommon();   
       
    68     }
    67 
    69 
    68 	// Construct the settings utility.
    70 	// Construct the settings utility.
    69 	mSettingsUtility = new SettingsUtility();
    71 	mSettingsUtility = new SettingsUtility();
    70 
    72 
    71 	// Construct the timezone client.
    73 	// Construct the timezone client.
   290 	\param docLoader Pointer to ClockSettingsDocLoader object.
   292 	\param docLoader Pointer to ClockSettingsDocLoader object.
   291  */
   293  */
   292 void ClockSettingsView::setupView()
   294 void ClockSettingsView::setupView()
   293 {
   295 {
   294 	OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_SETUPVIEW_ENTRY );
   296 	OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_SETUPVIEW_ENTRY );
       
   297 	
       
   298 	if(!mLaunchedByClock) {
       
   299 	    mSettingsView->setTitle(hbTrId("txt_clock_title_control_panel"));
       
   300 	}
       
   301 	
   295 	HbMainWindow *window = hbInstance->allMainWindows().first();
   302 	HbMainWindow *window = hbInstance->allMainWindows().first();
   296 	window->addView(mSettingsView);
   303 	window->addView(mSettingsView);
   297 	window->setCurrentView(mSettingsView);
   304 	window->setCurrentView(mSettingsView);
   298 
   305 
   299 	// Add the back softkey.
   306 	// Add the back softkey.
   307 	mSettingsForm = static_cast<HbDataForm *> (
   314 	mSettingsForm = static_cast<HbDataForm *> (
   308 			mDocLoader->findWidget(CLOCK_SETTINGS_DATA_FORM));
   315 			mDocLoader->findWidget(CLOCK_SETTINGS_DATA_FORM));
   309 
   316 
   310 	// Create the custom prototype.
   317 	// Create the custom prototype.
   311 	QList <HbAbstractViewItem*> prototypes = mSettingsForm->itemPrototypes();
   318 	QList <HbAbstractViewItem*> prototypes = mSettingsForm->itemPrototypes();
   312 	SettingsCustomItem *customPrototype = new SettingsCustomItem(mSettingsForm);
   319 	SettingsCustomItem *customPrototype = new SettingsCustomItem(mSettingsForm, mLaunchedByClock);
   313 	prototypes.append(customPrototype);
   320 	prototypes.append(customPrototype);
   314 	mSettingsForm->setItemPrototypes(prototypes);
   321 	mSettingsForm->setItemPrototypes(prototypes);
   315 
   322 
   316 	// Create the model.
   323 	// Create the model.
   317 	createModel();
   324 	createModel();