Changeset 6474 for trunk/qt4-gui/src

Show
Ignore:
Timestamp:
08/07/08 03:51:16 (4 months ago)
Author:
flynd
Message:

Remake of user dialog to have same page handling as settings dialog. Added pages for other user settings and group membership as well.

Location:
trunk/qt4-gui/src
Files:
6 added
4 modified
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/CMakeLists.txt

    r5777 r6474  
    77  helpers 
    88  settings 
     9  userdlg 
    910  userevents 
    1011  views 
  • trunk/qt4-gui/src/core/licqgui.cpp

    r6466 r6474  
    8686 
    8787#include "dialogs/logwindow.h" 
    88 #include "dialogs/userinfodlg.h" 
    8988 
    9089#include "dockicons/dockicon.h" 
     
    9695 
    9796#include "helpers/support.h" 
     97 
     98#include "userdlg/userdlg.h" 
    9899 
    99100#include "userevents/usereventcommon.h" 
     
    745746  if (id.isEmpty() || ppid == 0) return; 
    746747 
    747   UserInfoDlg* f = NULL; 
    748  
    749   for (int i = 0; i < myUserInfoList.size(); ++i) 
    750   { 
    751     UserInfoDlg* item = myUserInfoList.at(i); 
    752     if (item->Id() == id && item->PPID() == ppid) 
     748  UserDlg* f = NULL; 
     749 
     750  for (int i = 0; i < myUserDlgList.size(); ++i) 
     751  { 
     752    UserDlg* item = myUserDlgList.at(i); 
     753    if (item->id() == id && item->ppid() == ppid) 
    753754    { 
    754755      f = item; 
     
    757758  } 
    758759 
    759   int tab = UserInfoDlg::GeneralInfo; 
     760  UserDlg::UserPage tab = UserDlg::GeneralPage; 
    760761 
    761762  if (f != NULL) 
    762763  { 
    763     if (toggle && f->isTabShown(tab)) 
     764    if (toggle && f->currentPage() == tab) 
    764765    { 
    765766      delete f; // will notify us about deletion 
     
    774775  else 
    775776  { 
    776     f = new UserInfoDlg(id, ppid); 
    777     connect(f, SIGNAL(finished(UserInfoDlg*)), 
    778         SLOT(userInfoDlgFinished(UserInfoDlg*))); 
     777    f = new UserDlg(id, ppid); 
     778    connect(f, SIGNAL(finished(UserDlg*)), SLOT(userDlgFinished(UserDlg*))); 
    779779    f->show(); 
    780     myUserInfoList.append(f); 
    781   } 
    782  
    783   f->showTab(tab); 
     780    myUserDlgList.append(f); 
     781  } 
     782 
     783  f->showPage(tab); 
    784784  f->show(); 
    785785  f->raise(); 
     
    10221022} 
    10231023 
    1024 void LicqGui::userInfoDlgFinished(UserInfoDlg* dialog) 
    1025 { 
    1026   if (myUserInfoList.removeAll(dialog) > 0) 
     1024void LicqGui::userDlgFinished(UserDlg* dialog) 
     1025{ 
     1026  if (myUserDlgList.removeAll(dialog) > 0) 
    10271027    return; 
    10281028 
    10291029  gLog.Warn("%sUser Info finished signal for user with no window (%s)!\n", 
    1030       L_WARNxSTR, dialog->Id().toLatin1().data()); 
     1030      L_WARNxSTR, dialog->id().toLatin1().data()); 
    10311031} 
    10321032 
     
    13591359      } 
    13601360      // if their info box is open, kill it 
    1361       for (int i = 0; i < myUserInfoList.size(); ++i) 
     1361      for (int i = 0; i < myUserDlgList.size(); ++i) 
    13621362      { 
    1363         UserInfoDlg* item = myUserInfoList.at(i); 
    1364         if (item->Id() == sig->Id() && item->PPID() == sig->PPID()) 
     1363        UserDlg* item = myUserDlgList.at(i); 
     1364        if (item->id() == sig->Id() && item->ppid() == sig->PPID()) 
    13651365        { 
    13661366          item->close(); 
    1367           myUserInfoList.removeAll(item); 
     1367          myUserDlgList.removeAll(item); 
    13681368          break; 
    13691369        } 
  • trunk/qt4-gui/src/core/licqgui.h

    r6424 r6474  
    4949class UserEventCommon; 
    5050class UserEventTabDlg; 
    51 class UserInfoDlg; 
     51class UserDlg; 
    5252class UserMenu; 
    5353class UserSendCommon; 
     
    5555 
    5656typedef QList<UserViewEvent*> UserViewEventList; 
    57 typedef QList<UserInfoDlg*> UserInfoList; 
     57typedef QList<UserDlg*> UserDlgList; 
    5858typedef QList<UserSendCommon*> UserSendEventList; 
    5959 
     
    234234#endif 
    235235 
    236   void userInfoDlgFinished(UserInfoDlg* dialog); 
     236  void userDlgFinished(UserDlg* dialog); 
    237237  void userEventTabDlgDone(); 
    238238  void userEventFinished(QString id, unsigned long ppid); 
     
    291291  UserEventTabDlg* myUserEventTabDlg; 
    292292  UserViewEventList myUserViewList; 
    293   UserInfoList myUserInfoList; 
     293  UserDlgList myUserDlgList; 
    294294  UserSendEventList myUserSendList; 
    295295 
  • trunk/qt4-gui/src/dialogs/CMakeLists.txt

    r5999 r6474  
    3232  skinbrowser.cpp 
    3333  statsdlg.cpp 
    34   userinfodlg.cpp 
    3534  userselectdlg.cpp 
    3635  utilitydlg.cpp 
  • trunk/qt4-gui/src/userdlg/info.cpp

    r6466 r6474  
    1919 */ 
    2020 
    21 // written by Graham Roff <graham@licq.org> 
    22 // contributions by Dirk A. Mueller <dirk@licq.org> 
    23  
    24 #include "userinfodlg.h" 
     21#include "info.h" 
    2522 
    2623#include "config.h" 
     
    3027#include <QCheckBox> 
    3128#include <QComboBox> 
    32 #include <QDateTime> 
     29#include <QDate> 
    3330#include <QGridLayout> 
    34 #include <QHBoxLayout> 
     31#include <QGroupBox> 
    3532#include <QHeaderView> 
    3633#include <QLabel> 
     
    4037#include <QSpinBox> 
    4138#include <QTextCodec> 
    42 #include <QTimer> 
    4339#include <QTreeWidget> 
    4440#include <QVBoxLayout> 
     
    5248//#include <kabc/addressee.h> 
    5349//#include <kabc/addresseedialog.h> 
    54 //#include "licqkimiface.h" 
     50//#include "core/licqkimiface.h" 
    5551//#define USE_KABC 
    5652#else 
     
    5854#endif 
    5955 
     56#include <licq_backgroundcodes.h> 
    6057#include <licq_countrycodes.h> 
     58#include <licq_homepagecodes.h> 
     59#include <licq_interestcodes.h> 
     60#include <licq_icq.h> 
     61#include <licq_icqd.h> 
     62#include <licq_languagecodes.h> 
     63#include <licq_log.h> 
    6164#include <licq_occupationcodes.h> 
    62 #include <licq_homepagecodes.h> 
    63 #include <licq_events.h> 
    64 #include <licq_languagecodes.h> 
    65 #include <licq_interestcodes.h> 
    6665#include <licq_organizationcodes.h> 
    67 #include <licq_backgroundcodes.h> 
    6866#include <licq_providers.h> 
    69 #include <licq_icqd.h> 
    70 #include <licq_socket.h> 
    71 #include <licq_log.h> 
    7267#include <licq_user.h> 
    7368 
     69#include "config/iconmanager.h" 
     70#include "core/messagebox.h" 
     71#include "dialogs/editcategorydlg.h" 
     72#include "dialogs/phonedlg.h" 
     73#include "helpers/licqstrings.h" 
     74#include "helpers/usercodec.h" 
    7475#include "widgets/infofield.h" 
    7576#include "widgets/mledit.h" 
    7677#include "widgets/mlview.h" 
    77 #include "widgets/tabwidget.h" 
    7878#include "widgets/timezoneedit.h" 
    79  
    80 #include "config/chat.h" 
    81 #include "config/iconmanager.h" 
    82  
    83 #include "core/licqgui.h" 
    84 #include "core/messagebox.h" 
    85 #include "core/signalmanager.h" 
    86 #include "core/usermenu.h" 
    87  
    88 #include "helpers/eventdesc.h" 
    89 #include "helpers/licqstrings.h" 
    90 #include "helpers/usercodec.h" 
    91  
    92 #include "editcategorydlg.h" 
    93 #include "editfiledlg.h" 
    94 #include "phonedlg.h" 
     79#include "userdlg.h" 
     80 
     81#ifdef USE_KABC 
     82#include "core/mainwin.h" 
     83#endif 
     84 
    9585 
    9686using namespace LicqQtGui; 
    97 /* TRANSLATOR LicqQtGui::UserInfoDlg */ 
    98  
    99 UserInfoDlg::UserInfoDlg(QString id, unsigned long ppid, QWidget* parent) 
    100   : QDialog(parent), 
    101     myId(id), 
    102     m_nPPID(ppid), 
    103     icqEventTag(0) 
    104 { 
    105   setObjectName("UserInfoDialog"); 
    106   setAttribute(Qt::WA_DeleteOnClose, true); 
    107  
    108   m_bOwner = (gUserManager.FindOwner(myId.toLatin1(), m_nPPID) != NULL); 
     87/* TRANSLATOR LicqQtGui::UserPages::Info */ 
     88 
     89UserPages::Info::Info(bool isOwner, UserDlg* parent) 
     90  : QObject(parent), 
     91    m_bOwner(isOwner) 
     92{ 
    10993  m_Interests = m_Organizations = m_Backgrounds = NULL; 
    11094  m_PhoneBook = NULL; 
    11195 
    112   CreateGeneralInfo(); 
    113   CreateMoreInfo(); 
    114   CreateMore2Info(); 
    115   CreateWorkInfo(); 
    116   CreateAbout(); 
    117   CreatePhoneBook(); 
    118   CreatePicture(); 
    119   CreateLastCountersInfo(); 
     96  parent->addPage(UserDlg::GeneralPage, createPageGeneral(parent), 
     97      tr("General")); 
     98  parent->addPage(UserDlg::MorePage, createPageMore(parent), 
     99      tr("More")); 
     100  parent->addPage(UserDlg::More2Page, createPageMore2(parent), 
     101      tr("More II")); 
     102  parent->addPage(UserDlg::WorkPage, createPageWork(parent), 
     103      tr("Work")); 
     104  parent->addPage(UserDlg::AboutPage, createPageAbout(parent), 
     105      tr("About")); 
     106  parent->addPage(UserDlg::PhonePage, createPagePhoneBook(parent), 
     107      tr("Phone Book")); 
     108  parent->addPage(UserDlg::PicturePage, createPagePicture(parent), 
     109      tr("Picture")); 
     110  parent->addPage(UserDlg::CountersPage, createPageCounters(parent), 
     111      tr("Last")); 
    120112#ifdef USE_KABC 
    121   CreateKABCInfo(); 
     113  parent->addPage(UserDlg::KabcPage, createPageKabc(parent), 
     114      tr("KDE Adressbook")); 
    122115#endif 
    123  
    124   QVBoxLayout* lay = new QVBoxLayout(this); 
    125  
    126   lay->setContentsMargins(2, 2, 2, 2); 
    127   tabs = new TabWidget(); 
    128   lay->addWidget(tabs, 2); 
    129  
    130   tabs->addTab(tabList[GeneralInfo].tab, tabList[GeneralInfo].label); 
    131   tabs->addTab(tabList[MoreInfo].tab, tabList[MoreInfo].label); 
    132   tabs->addTab(tabList[More2Info].tab, tabList[More2Info].label); 
    133   tabs->addTab(tabList[WorkInfo].tab, tabList[WorkInfo].label); 
    134   tabs->addTab(tabList[AboutInfo].tab, tabList[AboutInfo].label); 
    135   tabs->addTab(tabList[PhoneInfo].tab, tabList[PhoneInfo].label); 
    136   tabs->addTab(tabList[PictureInfo].tab, tabList[PictureInfo].label); 
    137   tabs->addTab(tabList[LastCountersInfo].tab, tabList[LastCountersInfo].label); 
     116} 
     117 
     118void UserPages::Info::load(const ICQUser* user) 
     119{ 
     120  myId = user->IdString(); 
     121  myPpid = user->PPID(); 
     122  codec = UserCodec::codecForICQUser(user); 
     123 
     124  loadPageGeneral(user); 
     125  loadPageMore(user); 
     126  loadPageMore2(user); 
     127  loadPageWork(user); 
     128  loadPageAbout(user); 
     129  loadPagePhoneBook(user); 
     130  loadPagePicture(user); 
     131  loadPageCounters(user); 
    138132#ifdef USE_KABC 
    139   tabs->addTab(tabList[KABCInfo].tab, tabList[KABCInfo].label); 
     133  loadPageKabc(user); 
    140134#endif 
    141  
    142   connect(tabs, SIGNAL(currentChanged(int)), SLOT(updateTab(int))); 
    143   connect(LicqGui::instance()->signalManager(), 
    144       SIGNAL(updatedUser(CICQSignal*)), SLOT(updatedUser(CICQSignal*))); 
    145  
    146   btnMain3 = new QPushButton(tr("&Update")); 
    147   btnMain4 = new QPushButton(tr("&Close")); 
    148   connect(btnMain4, SIGNAL(clicked()), SLOT(close())); 
    149  
    150   if (m_bOwner) 
    151   { 
    152     btnMain1 = new QPushButton(tr("&Save")); 
    153     btnMain2 = new QPushButton(tr("Retrieve")); 
    154     connect(btnMain1, SIGNAL(clicked()), SLOT(SaveSettings())); 
    155     connect(btnMain2, SIGNAL(clicked()), SLOT(slotRetrieve())); 
    156     connect(btnMain3, SIGNAL(clicked()), SLOT(slotUpdate())); 
    157   } 
    158   else 
    159   { 
    160     btnMain1 = new QPushButton(tr("&Menu")); 
    161     btnMain2 = new QPushButton(tr("&Save")); 
    162     connect(btnMain1, SIGNAL(pressed()), SLOT(ShowUsermenu())); 
    163     btnMain1->setMenu(LicqGui::instance()->userMenu()); 
    164     connect(btnMain2, SIGNAL(clicked()), SLOT(SaveSettings())); 
    165     connect(btnMain3, SIGNAL(clicked()), SLOT(slotRetrieve())); 
    166   } 
    167  
    168   QHBoxLayout* l = new QHBoxLayout(); 
    169  
    170   l->setContentsMargins(10, 0, 10, 5); 
    171   l->addWidget(btnMain1); 
    172   l->addStretch(2); 
    173   l->addWidget(btnMain2); 
    174   l->addWidget(btnMain3); 
    175   l->addSpacing(35); 
    176   l->addWidget(btnMain4); 
    177   btnMain4->setDefault(true); 
    178  
    179   lay->addLayout(l); 
    180  
    181   const ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), m_nPPID, LOCK_R); 
    182   if (u == NULL) 
    183   { 
    184     m_sBasic = tr("Licq - Info ") + tr("INVALID USER"); 
    185     resetCaption(); 
    186     setWindowIconText(tr("INVALID USER")); 
    187   } 
    188   else 
    189   { 
    190     QTextCodec* codec = UserCodec::codecForICQUser(u); 
    191     QString tmp = codec->toUnicode(u->GetFirstName()); 
    192     QString lastname = codec->toUnicode(u->GetLastName()); 
    193     if ((!tmp.isEmpty()) && (!lastname.isEmpty())) 
    194       tmp = tmp + " " + lastname; 
    195     else 
    196       tmp = tmp + lastname; 
    197     if (!tmp.isEmpty()) tmp = " (" + tmp + ")"; 
    198     m_sBasic = tr("Licq - Info ") + QString::fromUtf8(u->GetAlias()) + tmp; 
    199     resetCaption(); 
    200     setWindowIconText(u->GetAlias()); 
    201     SetGeneralInfo(u); 
    202     gUserManager.DropUser(u); 
    203   } 
    204  
    205   // Set Tab Order 
    206   setTabOrder (tabs, btnMain1); 
    207   setTabOrder (btnMain1, btnMain2); 
    208   setTabOrder (btnMain2, btnMain3); 
    209   setTabOrder (btnMain3, btnMain4); 
    210 } 
    211  
    212 // ----------------------------------------------------------------------------- 
    213 UserInfoDlg::~UserInfoDlg() 
    214 { 
    215   if (icqEventTag != 0) 
    216   { 
    217     gLicqDaemon->CancelEvent(icqEventTag); 
    218     icqEventTag = 0; 
    219   } 
    220  
    221   if (m_Interests != NULL) 
    222     delete m_Interests; 
    223   if (m_Organizations != NULL) 
    224     delete m_Organizations; 
    225   if (m_Backgrounds != NULL) 
    226     delete m_Backgrounds; 
    227   if (m_PhoneBook != NULL) 
    228     delete m_PhoneBook; 
    229  
    230   emit finished(this); 
    231 } 
    232  
    233 // ----------------------------------------------------------------------------- 
    234 void UserInfoDlg::showTab(int tab) 
    235 { 
    236   tabs->setCurrentWidget(tabList[tab].tab); 
    237 } 
    238  
    239 bool UserInfoDlg::isTabShown(int tab) 
    240 { 
    241   return (tabs->currentWidget() == tabList[tab].tab); 
    242 } 
    243  
    244  
    245 // ----------------------------------------------------------------------------- 
    246  
    247 void UserInfoDlg::CreateGeneralInfo() 
    248 { 
    249   tabList[GeneralInfo].label = tr("&General"); 
    250   QWidget* p = new QWidget(this); 
    251   tabList[GeneralInfo].tab = p; 
    252   p->setObjectName(tabList[GeneralInfo].label); 
    253   tabList[GeneralInfo].loaded = false; 
     135} 
     136 
     137void UserPages::Info::apply(ICQUser* user) 
     138{ 
     139  savePageGeneral(user); 
     140  savePageMore(user); 
     141  savePageMore2(user); 
     142  savePageWork(user); 
     143  savePageAbout(user); 
     144  savePagePhoneBook(user); 
     145  savePagePicture(user); 
     146} 
     147 
     148void UserPages::Info::apply2(const QString& id, unsigned long ppid) 
     149{ 
     150  if (!m_bOwner) 
     151  { 
     152    gLicqDaemon->ProtoRenameUser(id.toLatin1(), ppid); 
     153  } 
     154 
     155#ifdef USE_KABC 
     156  savePageKabc(); 
     157#endif 
     158} 
     159 
     160QWidget* UserPages::Info::createPageGeneral(QWidget* parent) 
     161{ 
     162  QWidget* w = new QWidget(parent); 
     163  myPageGeneralLayout = new QVBoxLayout(w); 
     164  myPageGeneralLayout->setContentsMargins(0, 0, 0, 0); 
    254165 
    255166  unsigned short CR = 0; 
    256167 
    257   QGridLayout* lay = new QGridLayout(p); 
     168  myGeneralBox = new QGroupBox(tr("General Information")); 
     169  QGridLayout* lay = new QGridLayout(myGeneralBox); 
    258170  lay->setColumnMinimumWidth(2, 10); 
    259   lay->setRowStretch(9, 1); 
    260171 
    261172  lay->addWidget(new QLabel(tr("Alias:")), CR, 0); 
    262173  nfoAlias = new InfoField(false); 
    263174  lay->addWidget(nfoAlias, CR, 1); 
    264   chkKeepAliasOnUpdate = new QCheckBox(tr("Keep Alias on Update")); 
    265   chkKeepAliasOnUpdate->setToolTip(tr("Normally Licq overwrites the Alias when updating user details.\n" 
    266                                            "Check this if you want to keep your changes to the Alias.")); 
    267   lay->addWidget(chkKeepAliasOnUpdate, CR, 3, 1, 2); 
     175 
     176  if (!m_bOwner) 
     177  { 
     178    chkKeepAliasOnUpdate = new QCheckBox(tr("Keep Alias on Update")); 
     179    chkKeepAliasOnUpdate->setToolTip(tr( 
     180        "Normally Licq overwrites the Alias when updating user details.\n" 
     181        "Check this if you want to keep your changes to the Alias.")); 
     182    lay->addWidget(chkKeepAliasOnUpdate, CR, 3, 1, 2); 
     183    connect(nfoAlias, SIGNAL(textChanged(const QString&)), SLOT(aliasChanged())); 
     184  } 
    268185 
    269186  lay->addWidget(new QLabel(tr("ID:")), ++CR, 0); 
     
    310227  nfoState->setMaxLength(3); 
    311228  lay->addWidget(nfoState, CR, 1); 
    312   setTabOrder(nfoAddress, nfoState); 
     229  w->setTabOrder(nfoAddress, nfoState); 
    313230  lay->addWidget(new QLabel(tr("Fax:")), CR, 3); 
    314231  nfoFax = new InfoField(false);//!m_bOwner); 
    315232  lay->addWidget(nfoFax, CR, 4); 
    316   setTabOrder(nfoPhone, nfoFax); 
     233  w->setTabOrder(nfoPhone, nfoFax); 
    317234 
    318235  lay->addWidget(new QLabel(tr("City:")), ++CR, 0); 
    319236  nfoCity = new InfoField(!m_bOwner); 
    320237  lay->addWidget(nfoCity, CR, 1); 
    321   setTabOrder(nfoState, nfoCity); 
     238  w->setTabOrder(nfoState, nfoCity); 
    322239  lay->addWidget(new QLabel(tr("Cellular:")), CR, 3); 
    323240  nfoCellular = new InfoField(false);//!m_bOwner); 
    324241  lay->addWidget(nfoCellular, CR, 4); 
    325   setTabOrder(nfoFax, nfoCellular); 
     242  w->setTabOrder(nfoFax, nfoCellular); 
    326243 
    327244  lay->addWidget(new QLabel(tr("Zip:")), ++CR, 0); 
    328245  nfoZipCode = new InfoField(!m_bOwner); 
    329246  lay->addWidget(nfoZipCode, CR, 1); 
    330   setTabOrder(nfoCity, nfoZipCode); 
     247  w->setTabOrder(nfoCity, nfoZipCode); 
    331248  lay->addWidget(new QLabel(tr("Country:")), CR, 3); 
    332249  if (m_bOwner) 
    333250  { 
    334     cmbCountry = new QComboBox(tabList[GeneralInfo].tab); 
     251    cmbCountry = new QComboBox(); 
    335252    //cmbCountry->addItem(tr("Unspecified")); 
    336253    cmbCountry->setMaximumWidth(cmbCountry->sizeHint().width()+20); 
     
    346263 
    347264  lay->setRowStretch(++CR, 5); 
    348 } 
    349  
    350 void UserInfoDlg::SetGeneralInfo(const ICQUser* u) 
    351 { 
    352   tabList[GeneralInfo].loaded = true; 
     265 
     266  myPageGeneralLayout->addWidget(myGeneralBox); 
     267  myPageGeneralLayout->addStretch(1); 
     268 
     269  return w; 
     270} 
     271 
     272void UserPages::Info::loadPageGeneral(const ICQUser* u) 
     273{ 
    353274  char buf[32]; 
    354   bool bDropUser = false; 
    355  
    356   if (u == NULL) 
    357   { 
    358     u = gUserManager.FetchUser(myId.toLatin1(), m_nPPID, LOCK_R); 
    359     if (u == NULL) return; 
    360     bDropUser = true; 
    361   } 
    362  
    363   QTextCodec* codec = UserCodec::codecForICQUser(u); 
    364  
    365   if(m_bOwner) 
    366     chkKeepAliasOnUpdate->hide(); 
    367   chkKeepAliasOnUpdate->setChecked(u->KeepAliasOnUpdate()); 
     275 
     276  if (!m_bOwner) 
     277    chkKeepAliasOnUpdate->setChecked(u->KeepAliasOnUpdate()); 
    368278  nfoAlias->setText(QString::fromUtf8(u->GetAlias())); 
    369   connect(nfoAlias, SIGNAL(textChanged(const QString&)), SLOT(slot_aliasChanged(const QString&))); 
    370279  nfoFirstName->setText(codec->toUnicode(u->GetFirstName())); 
    371280  nfoLastName->setText(codec->toUnicode(u->GetLastName())); 
     
    373282  nfoEmailSecondary->setText(codec->toUnicode(u->GetEmailSecondary())); 
    374283  nfoEmailOld->setText(codec->toUnicode(u->GetEmailOld())); 
    375   nfoUin->setText(u->IdString()); 
     284  nfoUin->setText(myId); 
    376285  QString ip = QString(u->IpStr(buf)); 
    377286  if (u->Ip() != u->IntIp() && u->IntIp() != 0) 
     
    412321  nfoCellular->setText(codec->toUnicode(u->GetCellularNumber())); 
    413322  nfoZipCode->setText(codec->toUnicode(u->GetZipCode())); 
    414  
    415   if (!u->StatusOffline()) 
    416     nfoLastOnline->setText(tr("Now")); 
    417   else if (u->LastOnline() == 0) 
    418     nfoLastOnline->setText(tr("Unknown")); 
    419   else 
    420   { 
    421     QDateTime t; 
    422     t.setTime_t(u->LastOnline()); 
    423     QString ds = t.toString(); 
    424     ds.truncate(ds.length() - 8); 
    425     nfoLastOnline->setText(ds); 
    426   } 
    427  
    428   if (bDropUser) gUserManager.DropUser(u); 
    429 } 
    430  
    431 void UserInfoDlg::SaveGeneralInfo() 
    432 { 
    433   ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), m_nPPID, LOCK_W); 
    434   if (u == NULL) return; 
    435  
    436   QTextCodec* codec = UserCodec::codecForICQUser(u); 
    437  
    438   u->SetEnableSave(false); 
    439  
     323} 
     324 
     325void UserPages::Info::savePageGeneral(ICQUser* u) 
     326{ 
    440327  u->SetAlias(nfoAlias->text().toUtf8()); 
    441   u->SetKeepAliasOnUpdate(chkKeepAliasOnUpdate->isChecked()); 
     328  if (!m_bOwner) 
     329    u->SetKeepAliasOnUpdate(chkKeepAliasOnUpdate->isChecked()); 
    442330  u->SetFirstName(codec->fromUnicode(nfoFirstName->text())); 
    443331  u->SetLastName(codec->fromUnicode(nfoLastName->text())); 
     
    458346  } 
    459347  u->SetTimezone(tznZone->data()); 
    460  
    461   u->SetEnableSave(true); 
    462   u->SaveGeneralInfo(); 
    463  
    464   gUserManager.DropUser(u); 
    465  
    466   if (!m_bOwner) 
    467     gLicqDaemon->ProtoRenameUser(myId.toLatin1(), m_nPPID); 
    468 } 
    469  
    470 // ----------------------------------------------------------------------------- 
    471  
    472 void UserInfoDlg::CreateMoreInfo() 
    473 { 
    474   tabList[MoreInfo].label = tr("&More"); 
    475   QWidget* p = new QWidget(this); 
    476   tabList[MoreInfo].tab = p; 
    477   p->setObjectName(tabList[MoreInfo].label); 
    478   tabList[MoreInfo].loaded = false; 
     348} 
     349 
     350QWidget* UserPages::Info::createPageMore(QWidget* parent) 
     351{ 
     352  QWidget* w = new QWidget(parent); 
     353  myPageMoreLayout = new QVBoxLayout(w); 
     354  myPageMoreLayout->setContentsMargins(0, 0, 0, 0); 
    479355 
    480356  unsigned short CR = 0; 
    481   QGridLayout* lay = new QGridLayout(p); 
    482   lay->setColumnMinimumWidth(2, 10); 
     357  myMoreBox = new QGroupBox(tr("More")); 
     358  QGridLayout* lay = new QGridLayout(myMoreBox); 
    483359  lay->setRowMinimumHeight(6, 5); 
    484   lay->setRowStretch(3, 1); 
    485360 
    486361  lay->addWidget(new QLabel(tr("Age:")), CR, 0); 
     
    585460  CR++; 
    586461  lay->addWidget(lblICQHomepage, CR, 0, 1, 5); 
    587 } 
    588  
    589 void UserInfoDlg::SetMoreInfo(const ICQUser* u) 
    590 { 
    591   tabList[MoreInfo].loaded = true; 
    592   bool bDropUser = false; 
    593  
    594   if (u == NULL) 
    595   { 
    596     u = gUserManager.FetchUser(myId.toLatin1(), m_nPPID, LOCK_R); 
    597     if (u == NULL) return; 
    598     bDropUser = true; 
    599   } 
    600  
    601   QTextCodec* codec = UserCodec::codecForICQUser(u); 
    602  
     462 
     463  myPageMoreLayout->addWidget(myMoreBox); 
     464  myPageMoreLayout->addStretch(1); 
     465 
     466  return w; 
     467} 
     468 
     469void UserPages::Info::loadPageMore(const ICQUser* u) 
     470{ 
    603471  // Gender 
    604472  if (m_bOwner) 
     
    717585  { 
    718586    QString url; 
    719     url.sprintf("(http://%s.homepage.icq.com/)", u->IdString()); 
     587    url.sprintf("(http://%s.homepage.icq.com/)", myId.toLatin1().data());