Show
Ignore:
Timestamp:
01/27/07 17:56:03 (23 months ago)
Author:
flynd
Message:

Created a spinbox for editing timezones and changed the user info dialog to allow timezone of contacts to be changed.
This implements one part of the feature in #1.
Changing the owners timezone is disabled as licq uses system setting instead.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt-gui/src/userinfodlg.cpp

    r4791 r4837  
    308308  lay->addWidget(nfoStatus, CR, 1); 
    309309  lay->addWidget(new QLabel(tr("Timezone:"), p), CR, 3); 
    310   nfoTime = new CInfoField(p, true); 
    311   lay->addWidget(nfoTime, CR, 4); 
     310  tznZone = new CTimeZoneField(p); 
     311  lay->addWidget(tznZone, CR, 4); 
    312312 
    313313  lay->addWidget(new QLabel(tr("Name:"), p), ++CR, 0); 
     
    414414  } 
    415415  nfoIp->setData(ip); 
    416   if (u->GetTimezone() == TIMEZONE_UNKNOWN) 
    417     nfoTime->setText(tr("Unknown")); 
    418   else 
    419   { 
    420     nfoTime->setText(tr("GMT%1%1%1") 
    421        .arg(u->GetTimezone() > 0 ? "-" : "+") 
    422        .arg(abs(u->GetTimezone() / 2)).arg(u->GetTimezone() % 2 ? "30" : "00") ); 
    423   } 
     416  tznZone->setData(u->GetTimezone()); 
    424417  nfoStatus->setData(u->StatusStr()); 
    425418  if (m_bOwner) 
    426419  { 
     420    // Owner timezone is not editable, it is taken from system timezone instead 
     421    tznZone->setEnabled(false); 
     422 
    427423    const SCountry *c = GetCountryByCode(u->GetCountryCode()); 
    428424    if (c == NULL) 
     
    491487    u->SetCountryCode(GetCountryByIndex(i)->nCode); 
    492488  } 
     489  u->SetTimezone(tznZone->data()); 
    493490 
    494491  u->SetEnableSave(true);