phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginview.cpp
changeset 21 92ab7f8d0eab
child 27 2f8f8080a020
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*
       
     2  * Copyright (c) 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:  
       
    15  *
       
    16  */
       
    17 
       
    18 #include "cpnetworkpluginview.h"
       
    19 #include <QApplication>
       
    20 #include <QLocale>
       
    21 #include <QTranslator>
       
    22 #include "cpnetworkpluginform.h"
       
    23 #include "cppluginlogging.h"
       
    24 
       
    25 /*!
       
    26   CpNetworkPluginView::CpNetworkPluginView
       
    27  */
       
    28 CpNetworkPluginView::CpNetworkPluginView(QGraphicsItem *parent) :
       
    29     CpBaseSettingView(0, parent),
       
    30     m_networkSettingsForm(0)
       
    31 {
       
    32     DPRINT << ": IN";
       
    33     
       
    34     // Localization file loading
       
    35     QTranslator translator; 
       
    36     QString lang = QLocale::system().name();
       
    37     QString path = "z:/resource/qt/translations/";
       
    38     DPRINT << ": loading translation: " << QString(path + "telephone_cp_" + lang);
       
    39     bool translatorLoaded = translator.load(path + "telephone_cp_" + lang);
       
    40     DPRINT << ": translator loaded: " << translatorLoaded; 
       
    41     if (translatorLoaded) {
       
    42         qApp->installTranslator(&translator);
       
    43         DPRINT << ": translator installed"; 
       
    44     }
       
    45     
       
    46     m_networkSettingsForm = new CpNetworkPluginForm();
       
    47     // base class takes ownership of the form
       
    48     this->setSettingForm(m_networkSettingsForm);
       
    49     
       
    50     DPRINT << ": OUT";
       
    51     }
       
    52 
       
    53 /*!
       
    54   CpNetworkPluginView::~CpNetworkPluginView
       
    55  */
       
    56 CpNetworkPluginView::~CpNetworkPluginView()
       
    57 {
       
    58     DPRINT << ": IN";
       
    59     
       
    60     DPRINT << ": OUT";
       
    61 }
       
    62 
       
    63 // End of File.