Changeset 6474
- Timestamp:
- 08/07/08 03:51:16 (4 months ago)
- Location:
- trunk/qt4-gui/src
- Files:
-
- 6 added
- 4 modified
- 2 moved
-
CMakeLists.txt (modified) (1 diff)
-
core/licqgui.cpp (modified) (7 diffs)
-
core/licqgui.h (modified) (4 diffs)
-
dialogs/CMakeLists.txt (modified) (1 diff)
-
userdlg (added)
-
userdlg/CMakeLists.txt (added)
-
userdlg/info.cpp (moved) (moved from trunk/qt4-gui/src/dialogs/userinfodlg.cpp) (54 diffs, 1 prop)
-
userdlg/info.h (moved) (moved from trunk/qt4-gui/src/dialogs/userinfodlg.h) (8 diffs, 1 prop)
-
userdlg/modes.cpp (added)
-
userdlg/modes.h (added)
-
userdlg/userdlg.cpp (added)
-
userdlg/userdlg.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/CMakeLists.txt
r5777 r6474 7 7 helpers 8 8 settings 9 userdlg 9 10 userevents 10 11 views -
trunk/qt4-gui/src/core/licqgui.cpp
r6466 r6474 86 86 87 87 #include "dialogs/logwindow.h" 88 #include "dialogs/userinfodlg.h"89 88 90 89 #include "dockicons/dockicon.h" … … 96 95 97 96 #include "helpers/support.h" 97 98 #include "userdlg/userdlg.h" 98 99 99 100 #include "userevents/usereventcommon.h" … … 745 746 if (id.isEmpty() || ppid == 0) return; 746 747 747 User InfoDlg* f = NULL;748 749 for (int i = 0; i < myUser InfoList.size(); ++i)750 { 751 User InfoDlg* 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) 753 754 { 754 755 f = item; … … 757 758 } 758 759 759 int tab = UserInfoDlg::GeneralInfo;760 UserDlg::UserPage tab = UserDlg::GeneralPage; 760 761 761 762 if (f != NULL) 762 763 { 763 if (toggle && f-> isTabShown(tab))764 if (toggle && f->currentPage() == tab) 764 765 { 765 766 delete f; // will notify us about deletion … … 774 775 else 775 776 { 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*))); 779 779 f->show(); 780 myUser InfoList.append(f);781 } 782 783 f->show Tab(tab);780 myUserDlgList.append(f); 781 } 782 783 f->showPage(tab); 784 784 f->show(); 785 785 f->raise(); … … 1022 1022 } 1023 1023 1024 void LicqGui::user InfoDlgFinished(UserInfoDlg* dialog)1025 { 1026 if (myUser InfoList.removeAll(dialog) > 0)1024 void LicqGui::userDlgFinished(UserDlg* dialog) 1025 { 1026 if (myUserDlgList.removeAll(dialog) > 0) 1027 1027 return; 1028 1028 1029 1029 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()); 1031 1031 } 1032 1032 … … 1359 1359 } 1360 1360 // if their info box is open, kill it 1361 for (int i = 0; i < myUser InfoList.size(); ++i)1361 for (int i = 0; i < myUserDlgList.size(); ++i) 1362 1362 { 1363 User InfoDlg* 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()) 1365 1365 { 1366 1366 item->close(); 1367 myUser InfoList.removeAll(item);1367 myUserDlgList.removeAll(item); 1368 1368 break; 1369 1369 } -
trunk/qt4-gui/src/core/licqgui.h
r6424 r6474 49 49 class UserEventCommon; 50 50 class UserEventTabDlg; 51 class User InfoDlg;51 class UserDlg; 52 52 class UserMenu; 53 53 class UserSendCommon; … … 55 55 56 56 typedef QList<UserViewEvent*> UserViewEventList; 57 typedef QList<User InfoDlg*> UserInfoList;57 typedef QList<UserDlg*> UserDlgList; 58 58 typedef QList<UserSendCommon*> UserSendEventList; 59 59 … … 234 234 #endif 235 235 236 void user InfoDlgFinished(UserInfoDlg* dialog);236 void userDlgFinished(UserDlg* dialog); 237 237 void userEventTabDlgDone(); 238 238 void userEventFinished(QString id, unsigned long ppid); … … 291 291 UserEventTabDlg* myUserEventTabDlg; 292 292 UserViewEventList myUserViewList; 293 User InfoList myUserInfoList;293 UserDlgList myUserDlgList; 294 294 UserSendEventList myUserSendList; 295 295 -
trunk/qt4-gui/src/dialogs/CMakeLists.txt
r5999 r6474 32 32 skinbrowser.cpp 33 33 statsdlg.cpp 34 userinfodlg.cpp35 34 userselectdlg.cpp 36 35 utilitydlg.cpp -
trunk/qt4-gui/src/userdlg/info.cpp
r6466 r6474 19 19 */ 20 20 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" 25 22 26 23 #include "config.h" … … 30 27 #include <QCheckBox> 31 28 #include <QComboBox> 32 #include <QDate Time>29 #include <QDate> 33 30 #include <QGridLayout> 34 #include <Q HBoxLayout>31 #include <QGroupBox> 35 32 #include <QHeaderView> 36 33 #include <QLabel> … … 40 37 #include <QSpinBox> 41 38 #include <QTextCodec> 42 #include <QTimer>43 39 #include <QTreeWidget> 44 40 #include <QVBoxLayout> … … 52 48 //#include <kabc/addressee.h> 53 49 //#include <kabc/addresseedialog.h> 54 //#include " licqkimiface.h"50 //#include "core/licqkimiface.h" 55 51 //#define USE_KABC 56 52 #else … … 58 54 #endif 59 55 56 #include <licq_backgroundcodes.h> 60 57 #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> 61 64 #include <licq_occupationcodes.h> 62 #include <licq_homepagecodes.h>63 #include <licq_events.h>64 #include <licq_languagecodes.h>65 #include <licq_interestcodes.h>66 65 #include <licq_organizationcodes.h> 67 #include <licq_backgroundcodes.h>68 66 #include <licq_providers.h> 69 #include <licq_icqd.h>70 #include <licq_socket.h>71 #include <licq_log.h>72 67 #include <licq_user.h> 73 68 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" 74 75 #include "widgets/infofield.h" 75 76 #include "widgets/mledit.h" 76 77 #include "widgets/mlview.h" 77 #include "widgets/tabwidget.h"78 78 #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 95 85 96 86 using 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 89 UserPages::Info::Info(bool isOwner, UserDlg* parent) 90 : QObject(parent), 91 m_bOwner(isOwner) 92 { 109 93 m_Interests = m_Organizations = m_Backgrounds = NULL; 110 94 m_PhoneBook = NULL; 111 95 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")); 120 112 #ifdef USE_KABC 121 CreateKABCInfo(); 113 parent->addPage(UserDlg::KabcPage, createPageKabc(parent), 114 tr("KDE Adressbook")); 122 115 #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 118 void 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); 138 132 #ifdef USE_KABC 139 tabs->addTab(tabList[KABCInfo].tab, tabList[KABCInfo].label);133 loadPageKabc(user); 140 134 #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 137 void 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 148 void 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 160 QWidget* UserPages::Info::createPageGeneral(QWidget* parent) 161 { 162 QWidget* w = new QWidget(parent); 163 myPageGeneralLayout = new QVBoxLayout(w); 164 myPageGeneralLayout->setContentsMargins(0, 0, 0, 0); 254 165 255 166 unsigned short CR = 0; 256 167 257 QGridLayout* lay = new QGridLayout(p); 168 myGeneralBox = new QGroupBox(tr("General Information")); 169 QGridLayout* lay = new QGridLayout(myGeneralBox); 258 170 lay->setColumnMinimumWidth(2, 10); 259 lay->setRowStretch(9, 1);260 171 261 172 lay->addWidget(new QLabel(tr("Alias:")), CR, 0); 262 173 nfoAlias = new InfoField(false); 263 174 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 } 268 185 269 186 lay->addWidget(new QLabel(tr("ID:")), ++CR, 0); … … 310 227 nfoState->setMaxLength(3); 311 228 lay->addWidget(nfoState, CR, 1); 312 setTabOrder(nfoAddress, nfoState);229 w->setTabOrder(nfoAddress, nfoState); 313 230 lay->addWidget(new QLabel(tr("Fax:")), CR, 3); 314 231 nfoFax = new InfoField(false);//!m_bOwner); 315 232 lay->addWidget(nfoFax, CR, 4); 316 setTabOrder(nfoPhone, nfoFax);233 w->setTabOrder(nfoPhone, nfoFax); 317 234 318 235 lay->addWidget(new QLabel(tr("City:")), ++CR, 0); 319 236 nfoCity = new InfoField(!m_bOwner); 320 237 lay->addWidget(nfoCity, CR, 1); 321 setTabOrder(nfoState, nfoCity);238 w->setTabOrder(nfoState, nfoCity); 322 239 lay->addWidget(new QLabel(tr("Cellular:")), CR, 3); 323 240 nfoCellular = new InfoField(false);//!m_bOwner); 324 241 lay->addWidget(nfoCellular, CR, 4); 325 setTabOrder(nfoFax, nfoCellular);242 w->setTabOrder(nfoFax, nfoCellular); 326 243 327 244 lay->addWidget(new QLabel(tr("Zip:")), ++CR, 0); 328 245 nfoZipCode = new InfoField(!m_bOwner); 329 246 lay->addWidget(nfoZipCode, CR, 1); 330 setTabOrder(nfoCity, nfoZipCode);247 w->setTabOrder(nfoCity, nfoZipCode); 331 248 lay->addWidget(new QLabel(tr("Country:")), CR, 3); 332 249 if (m_bOwner) 333 250 { 334 cmbCountry = new QComboBox( tabList[GeneralInfo].tab);251 cmbCountry = new QComboBox(); 335 252 //cmbCountry->addItem(tr("Unspecified")); 336 253 cmbCountry->setMaximumWidth(cmbCountry->sizeHint().width()+20); … … 346 263 347 264 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 272 void UserPages::Info::loadPageGeneral(const ICQUser* u) 273 { 353 274 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()); 368 278 nfoAlias->setText(QString::fromUtf8(u->GetAlias())); 369 connect(nfoAlias, SIGNAL(textChanged(const QString&)), SLOT(slot_aliasChanged(const QString&)));370 279 nfoFirstName->setText(codec->toUnicode(u->GetFirstName())); 371 280 nfoLastName->setText(codec->toUnicode(u->GetLastName())); … … 373 282 nfoEmailSecondary->setText(codec->toUnicode(u->GetEmailSecondary())); 374 283 nfoEmailOld->setText(codec->toUnicode(u->GetEmailOld())); 375 nfoUin->setText( u->IdString());284 nfoUin->setText(myId); 376 285 QString ip = QString(u->IpStr(buf)); 377 286 if (u->Ip() != u->IntIp() && u->IntIp() != 0) … … 412 321 nfoCellular->setText(codec->toUnicode(u->GetCellularNumber())); 413 322 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 325 void UserPages::Info::savePageGeneral(ICQUser* u) 326 { 440 327 u->SetAlias(nfoAlias->text().toUtf8()); 441 u->SetKeepAliasOnUpdate(chkKeepAliasOnUpdate->isChecked()); 328 if (!m_bOwner) 329 u->SetKeepAliasOnUpdate(chkKeepAliasOnUpdate->isChecked()); 442 330 u->SetFirstName(codec->fromUnicode(nfoFirstName->text())); 443 331 u->SetLastName(codec->fromUnicode(nfoLastName->text())); … … 458 346 } 459 347 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 350 QWidget* UserPages::Info::createPageMore(QWidget* parent) 351 { 352 QWidget* w = new QWidget(parent); 353 myPageMoreLayout = new QVBoxLayout(w); 354 myPageMoreLayout->setContentsMargins(0, 0, 0, 0); 479 355 480 356 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); 483 359 lay->setRowMinimumHeight(6, 5); 484 lay->setRowStretch(3, 1);485 360 486 361 lay->addWidget(new QLabel(tr("Age:")), CR, 0); … … 585 460 CR++; 586 461 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 469 void UserPages::Info::loadPageMore(const ICQUser* u) 470 { 603 471 // Gender 604 472 if (m_bOwner) … … 717 585 { 718 586 QString url; 719 url.sprintf("(http://%s.homepage.icq.com/)", u->IdString());587 url.sprintf("(http://%s.homepage.icq.com/)", myId.toLatin1().data()); 720 588 lblICQHomepage->setText(tr("User has an ICQ Homepage ") + url);
