messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp
changeset 70 a15d9966050f
parent 52 12db4185673b
equal deleted inserted replaced
61:8ba0afbb4637 70:a15d9966050f
    28 #include <qvariant.h>
    28 #include <qvariant.h>
    29 #include <xqaiwrequest.h>
    29 #include <xqaiwrequest.h>
    30 #include <xqappmgr.h>
    30 #include <xqappmgr.h>
    31 #include <ccsdefs.h>
    31 #include <ccsdefs.h>
    32 
    32 
    33 
    33 #include <QTranslator>
       
    34 #include <QLocale>
       
    35 #include <hbapplication.h>
    34 //Localized Constants
    36 //Localized Constants
    35 #define LOC_UNREAD_MESSAGES hbTrId("txt_messaging_list_ln")
    37 #define LOC_UNREAD_MESSAGES hbTrId("txt_messaging_list_ln")
    36 #define LOC_NEW_MESSAGES hbTrId("txt_common_opt_ln_new_messages")
    38 #define LOC_NEW_MESSAGES hbTrId("txt_common_opt_ln_new_messages")
    37 #define LOC_RECEIVED_FILES hbTrId("Received files")
    39 #define LOC_RECEIVED_FILES hbTrId("txt_messaging_title_received_files")
    38 #define LOC_UNREAD_SINGLE_MESSAGE hbTrId("Unread Message")
    40 #define LOC_UNREAD_MULTIPLE_MESSAGES hbTrId("txt_messaging_list_ln_new_messages") // for unread messages
    39 #define LOC_UNREAD_MULTIPLE_MESSAGES hbTrId("Unread Messages")
    41 #define LOC_FAILED_SINGLE_MESSAGE hbTrId("txt_messaging_list_failed_message")
    40 #define LOC_FAILED_SINGLE_MESSAGE hbTrId("Failed Message")
    42 #define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("txt_messaging_dpophead_ln_failed_messages")
    41 #define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("Failed Messages")
    43 #define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("txt_messaging_indimenu_list_outgoing_message")
    42 #define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("Outgoing Message")
    44 #define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("txt_messaging_dpophead_ln_outgoing_messages")  
    43 #define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("Outgoing Messages")
       
    44 #define STATUS_MONO_NEW_MESSAGE QString("qtg_status_new_message")
    45 #define STATUS_MONO_NEW_MESSAGE QString("qtg_status_new_message")
    45 #define LOC_BUSINESSCARD hbTrId("Business card")
    46 #define LOC_BUSINESSCARD hbTrId("txt_messaging_menu_business_card")
    46 #define LOC_MULTIMEDIA_MSG hbTrId("txt_messaging_list_indimenu_multimedia_message")
    47 #define LOC_MULTIMEDIA_MSG hbTrId("txt_messaging_list_indimenu_multimedia_message")
    47 /**
    48 /**
    48  * The number of indicators.
    49  * The number of indicators.
    49  */
    50  */
    50 static const int MsgIndicatorCount = 4;
    51 static const int MsgIndicatorCount = 4;
   120 MsgIndicator::MsgIndicator(const QString &indicatorType) :
   121 MsgIndicator::MsgIndicator(const QString &indicatorType) :
   121     HbIndicatorInterface(indicatorType, HbIndicatorInterface::NotificationCategory,
   122     HbIndicatorInterface(indicatorType, HbIndicatorInterface::NotificationCategory,
   122         InteractionActivated),
   123         InteractionActivated),
   123 		mIndicatorType(NULL)
   124 		mIndicatorType(NULL)
   124 {
   125 {
       
   126     QString locale = QLocale::system().name();
       
   127     QString path = "z:/resource/qt/translations/";
       
   128         
       
   129     mTranslator = new QTranslator();
       
   130     mTranslator_comm = new QTranslator();
       
   131     mTranslator->load(path + QString("messaging_") + locale);
       
   132     mTranslator_comm->load(path + QString("common_") + locale);
       
   133     qApp->installTranslator(mTranslator);
       
   134     qApp->installTranslator(mTranslator_comm);
       
   135     
   125     d_ptr = q_check_ptr(new MsgIndicatorPrivate(this));
   136     d_ptr = q_check_ptr(new MsgIndicatorPrivate(this));
   126 }
   137 }
   127 
   138 
   128 // ----------------------------------------------------------------------------
   139 // ----------------------------------------------------------------------------
   129 // MsgIndicator::~MsgIndicator
   140 // MsgIndicator::~MsgIndicator
   130 // @see msgindicator.h
   141 // @see msgindicator.h
   131 // ----------------------------------------------------------------------------
   142 // ----------------------------------------------------------------------------
   132 MsgIndicator::~MsgIndicator()
   143 MsgIndicator::~MsgIndicator()
   133 {
   144 {
   134     delete d_ptr;
   145     delete d_ptr;
       
   146     delete mTranslator;
       
   147     delete mTranslator_comm;
   135 }
   148 }
   136 
   149 
   137 // ----------------------------------------------------------------------------
   150 // ----------------------------------------------------------------------------
   138 // MsgIndicator::handleInteraction
   151 // MsgIndicator::handleInteraction
   139 // @see msgindicator.h
   152 // @see msgindicator.h