phonesettings/cpphonesettingsplugins/telephonyplugin/src/cptelephonypluginview.cpp
changeset 30 ebdbd102c78a
parent 27 2f8f8080a020
child 51 f39ed5e045e0
equal deleted inserted replaced
27:2f8f8080a020 30:ebdbd102c78a
    16 */
    16 */
    17 
    17 
    18 #include "cptelephonypluginview.h"
    18 #include "cptelephonypluginview.h"
    19 #include "cppluginlogging.h"
    19 #include "cppluginlogging.h"
    20 #include <QPluginLoader>
    20 #include <QPluginLoader>
    21 #include <QApplication>
       
    22 #include <QLocale>
       
    23 #include <QTranslator>
       
    24 #include <hbdataformmodel.h>
    21 #include <hbdataformmodel.h>
    25 #include <cpplugininterface.h>
    22 #include <cpplugininterface.h>
    26 #include <cpsettingformitemdata.h>
    23 #include <cpsettingformitemdata.h>
    27 #include <cpitemdatahelper.h>
    24 #include <cpitemdatahelper.h>
    28 #include <cppluginutility.h>
    25 #include <cppluginutility.h>
    29 #include <cppluginloader.h>
    26 #include <cppluginloader.h>
    30 
    27 
       
    28 
       
    29 /*!
       
    30     CpTelephonyPluginView::CpTelephonyPluginView()
       
    31 */
    31 CpTelephonyPluginView::CpTelephonyPluginView() : 
    32 CpTelephonyPluginView::CpTelephonyPluginView() : 
    32     CpBaseSettingView(0,0),
    33     CpBaseSettingView(0,0),
    33     m_helper(NULL)
    34     m_helper(NULL)
    34 {
    35 {
    35     DPRINT << ": IN";
    36     DPRINT << ": IN";
    36     
       
    37     // Localization file loading
       
    38     QTranslator translator; 
       
    39     QString lang = QLocale::system().name();
       
    40     QString path = "z:/resource/qt/translations/";
       
    41     DPRINT << ": loading translation: " << QString(path + "telephone_cp_" + lang);
       
    42     bool translatorLoaded = translator.load(path + "telephone_cp_" + lang);
       
    43     DPRINT << ": translator loaded: " << translatorLoaded; 
       
    44     if (translatorLoaded) {
       
    45         qApp->installTranslator(&translator);
       
    46         DPRINT << ": translator installed"; 
       
    47     }
       
    48     
    37     
    49     HbDataForm *form = qobject_cast<HbDataForm*>(widget());
    38     HbDataForm *form = qobject_cast<HbDataForm*>(widget());
    50     if (form) {
    39     if (form) {
    51         HbDataFormModel *model = new HbDataFormModel;
    40         HbDataFormModel *model = new HbDataFormModel;
    52         form->setHeading(hbTrId("txt_phone_subhead_telephone"));
    41         form->setHeading(hbTrId("txt_phone_subhead_telephone"));
    79     }
    68     }
    80     
    69     
    81     DPRINT << ": OUT";
    70     DPRINT << ": OUT";
    82 }
    71 }
    83 
    72 
       
    73 /*!
       
    74     CpTelephonyPluginView::~CpTelephonyPluginView()
       
    75 */
    84 CpTelephonyPluginView::~CpTelephonyPluginView()
    76 CpTelephonyPluginView::~CpTelephonyPluginView()
    85 {
    77 {
    86     DPRINT << ": IN";
    78     DPRINT << ": IN";
    87     
    79     
    88     delete m_helper;
    80     delete m_helper;
    89     
    81     
    90     DPRINT << ": OUT";
    82     DPRINT << ": OUT";
    91 }
    83 }
    92 
    84 
       
    85 /*!
       
    86     CpTelephonyPluginView::groupItemFromPlugin()
       
    87 */
    93 QList<CpSettingFormItemData*> CpTelephonyPluginView::groupItemFromPlugin( const QString& plugin )
    88 QList<CpSettingFormItemData*> CpTelephonyPluginView::groupItemFromPlugin( const QString& plugin )
    94 {
    89 {
    95     DPRINT << ": IN";
    90     DPRINT << ": IN";
    96  
    91  
    97     QList<CpSettingFormItemData*> items;
    92     QList<CpSettingFormItemData*> items;
   108     
   103     
   109     DPRINT << ": OUT";
   104     DPRINT << ": OUT";
   110     return items;
   105     return items;
   111 }
   106 }
   112 
   107 
       
   108 /*!
       
   109     CpTelephonyPluginView::initializeItemDataHelper()
       
   110 */
   113 CpItemDataHelper* CpTelephonyPluginView::initializeItemDataHelper()
   111 CpItemDataHelper* CpTelephonyPluginView::initializeItemDataHelper()
   114 {
   112 {
   115     DPRINT;
   113     DPRINT;
   116     return new CpItemDataHelper(qobject_cast<HbDataForm*>(widget()));
   114     return new CpItemDataHelper(qobject_cast<HbDataForm*>(widget()));
   117 }
   115 }