phonebookui/pbkcommonui/src/cntaddressmodel.cpp
changeset 37 fd64c38c277d
parent 31 2a11b5b00470
child 40 b46a585f6909
equal deleted inserted replaced
31:2a11b5b00470 37:fd64c38c277d
    25 mAddress(NULL),
    25 mAddress(NULL),
    26 mAddressHome(NULL),
    26 mAddressHome(NULL),
    27 mAddressWork(NULL),
    27 mAddressWork(NULL),
    28 mIsLocationPickerEnabled( false )
    28 mIsLocationPickerEnabled( false )
    29     {
    29     {
    30     HbDataFormModelItem* address = appendDataFormGroup(qtTrId("Address"), invisibleRootItem());
    30     HbDataFormModelItem* address = appendDataFormGroup(hbTrId("txt_phob_formlabel_address"), invisibleRootItem());
    31     HbDataFormModelItem* addressHome = appendDataFormGroup(qtTrId("Address (home)"), invisibleRootItem());
    31     HbDataFormModelItem* addressHome = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_home"), invisibleRootItem());
    32     HbDataFormModelItem* addressWork = appendDataFormGroup(qtTrId("Address (work)"), invisibleRootItem());
    32     HbDataFormModelItem* addressWork = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_work"), invisibleRootItem());
    33     
    33     
    34     foreach ( QContactAddress a, mContact->details<QContactAddress>() )
    34     foreach ( QContactAddress a, mContact->details<QContactAddress>() )
    35         {
    35         {
    36         QStringList context = a.contexts();
    36         QStringList context = a.contexts();
    37         if ( context.isEmpty() && !mAddress ) // no context
    37         if ( context.isEmpty() && !mAddress ) // no context
    96         appendDataFormItem( mapButton, aGroup );
    96         appendDataFormItem( mapButton, aGroup );
    97         mIsLocationPickerEnabled = true;
    97         mIsLocationPickerEnabled = true;
    98     }
    98     }
    99     
    99     
   100     // default items for rest of fields
   100     // default items for rest of fields
   101     HbDataFormModelItem* street = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Street"));
   101     HbDataFormModelItem* street = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_street"));
   102     street->setContentWidgetData( "text", aAddress->street() );
   102     street->setContentWidgetData( "text", aAddress->street() );
   103     street->setContentWidgetData( "maxLength", CNT_STREET_MAXLENGTH );
   103     street->setContentWidgetData( "maxLength", CNT_STREET_MAXLENGTH );
   104     
   104     
   105     HbDataFormModelItem* postal = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Post code"));
   105     HbDataFormModelItem* postal = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_postal_codezip_code"));
   106     postal->setContentWidgetData( "text", aAddress->postcode() );
   106     postal->setContentWidgetData( "text", aAddress->postcode() );
   107     postal->setContentWidgetData( "maxLength", CNT_POSTCODE_MAXLENGTH );
   107     postal->setContentWidgetData( "maxLength", CNT_POSTCODE_MAXLENGTH );
   108     
   108     
   109     HbDataFormModelItem* city = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("City"));
   109     HbDataFormModelItem* city = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_city"));
   110     city->setContentWidgetData( "text", aAddress->locality() );
   110     city->setContentWidgetData( "text", aAddress->locality() );
   111     city->setContentWidgetData( "maxLength", CNT_LOCALITY_MAXLENGTH );
   111     city->setContentWidgetData( "maxLength", CNT_LOCALITY_MAXLENGTH );
   112     
   112     
   113     HbDataFormModelItem* region = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Province"));
   113     HbDataFormModelItem* region = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_province"));
   114     region->setContentWidgetData( "text", aAddress->region() );
   114     region->setContentWidgetData( "text", aAddress->region() );
   115     region->setContentWidgetData( "maxLength", CNT_REGION_MAXLENGTH );
   115     region->setContentWidgetData( "maxLength", CNT_REGION_MAXLENGTH );
   116     
   116     
   117     HbDataFormModelItem* country = new HbDataFormModelItem( HbDataFormModelItem::TextItem, qtTrId("Country"));
   117     HbDataFormModelItem* country = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_phob_formlabel_countryregion"));
   118     country->setContentWidgetData( "text", aAddress->country() );
   118     country->setContentWidgetData( "text", aAddress->country() );
   119     country->setContentWidgetData( "maxLength", CNT_COUNTRY_MAXLENGTH );
   119     country->setContentWidgetData( "maxLength", CNT_COUNTRY_MAXLENGTH );
   120     
   120     
   121     appendDataFormItem( street, aGroup );
   121     appendDataFormItem( street, aGroup );
   122     appendDataFormItem( postal, aGroup );
   122     appendDataFormItem( postal, aGroup );