Changeset 6101 for trunk/qt4-gui/src/userevents
- Timestamp:
- 03/15/08 22:51:25 (9 months ago)
- Location:
- trunk/qt4-gui/src/userevents
- Files:
-
- 2 modified
-
usersendcommon.cpp (modified) (5 diffs)
-
usersendcommon.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/userevents/usersendcommon.cpp
r6097 r6101 103 103 { 104 104 grpMR = NULL; 105 lblPicture = NULL; 105 106 clearDelay = 250; 106 107 … … 421 422 } 422 423 423 QSplitter* bottom= new QSplitter(splView);424 425 mleSend = new MLEdit(true, bottom, true);424 splPicture = new QSplitter(splView); 425 426 mleSend = new MLEdit(true, splPicture, true); 426 427 mleSend->setSizeHintLines(3); 427 428 mleSend->setCheckSpellingEnabled(Config::Chat::instance()->checkSpelling()); 428 429 mleSend->installEventFilter(this); // Enables send with enter 429 430 430 if (Config::Chat::instance()->showUserPic())431 {432 u = gUserManager.FetchUser(myUsers.front().c_str(), myPpid, LOCK_R);433 if (u != NULL)434 {435 if (u->GetPicturePresent())436 {437 QString picPath = QString(BASE_DIR) + USER_DIR + "/" + u->IdString() + ".pic";438 QMovie* picMovie = new QMovie(picPath);439 if (picMovie->isValid())440 {441 QLabel* picLabel = new QLabel(bottom);442 picLabel->setMovie(picMovie);443 picMovie->start();444 picLabel->setFixedWidth(picLabel->sizeHint().width());445 if (Config::Chat::instance()->showUserPicHidden())446 bottom->setSizes(QList<int>() << 1 << 0);447 }448 }449 gUserManager.DropUser(u);450 }451 }452 453 431 if (Config::Chat::instance()->msgChatView()) 454 432 { 455 433 splView->setStretchFactor(splView->indexOf(mleHistory), 1); 456 splView->setStretchFactor(splView->indexOf( bottom), 0);434 splView->setStretchFactor(splView->indexOf(splPicture), 0); 457 435 458 436 connect(mleHistory, SIGNAL(quote(const QString&)), … … 472 450 473 451 updateIcons(); 452 updatePicture(); 474 453 475 454 connect(mleSend, SIGNAL(ctrlEnterPressed()), btnSend, SIGNAL(clicked())); … … 527 506 foreach (QAction* a, grpSendType->actions()) 528 507 a->setIcon(iconForType(a->data().toInt())); 508 } 509 510 void UserSendCommon::updatePicture(ICQUser* u) 511 { 512 bool fetched = false; 513 514 if (u == NULL) 515 { 516 u = gUserManager.FetchUser(myUsers.front().c_str(), myPpid, LOCK_R); 517 fetched = true; 518 } 519 if (u == NULL) 520 return; 521 522 if (lblPicture != NULL) 523 { 524 delete lblPicture; 525 lblPicture = NULL; 526 } 527 528 if (Config::Chat::instance()->showUserPic() && 529 u->GetPicturePresent()) 530 { 531 QString picPath = QString(BASE_DIR) + USER_DIR + "/" + u->IdString() + ".pic"; 532 QMovie* picMovie = new QMovie(picPath); 533 if (picMovie->isValid()) 534 { 535 lblPicture = new QLabel(); 536 splPicture->insertWidget(1, lblPicture); 537 lblPicture->setMovie(picMovie); 538 picMovie->start(); 539 lblPicture->setFixedWidth(lblPicture->sizeHint().width()); 540 if (Config::Chat::instance()->showUserPicHidden()) 541 splPicture->setSizes(QList<int>() << 1 << 0); 542 } 543 else 544 delete picMovie; 545 } 546 547 if (fetched) 548 gUserManager.DropUser(u); 529 549 } 530 550 … … 955 975 } 956 976 break; 977 978 case USER_PICTURE: 979 updatePicture(u); 957 980 } 958 981 -
trunk/qt4-gui/src/userevents/usersendcommon.h
r5822 r6101 27 27 28 28 class QGroupBox; 29 class QLabel; 29 30 class QPushButton; 30 31 class QSplitter; … … 32 33 class CICQSignal; 33 34 class ICQEvent; 35 class ICQUser; 34 36 35 37 namespace LicqQtGui … … 74 76 QActionGroup* grpSendType; 75 77 QGroupBox* grpMR; 78 QLabel* lblPicture; 76 79 QPushButton* btnClose; 77 80 QPushButton* btnSend; 78 81 QSplitter* splView; 82 QSplitter* splPicture; 79 83 QString strTempMsg; 80 84 QTimer* tmrSendTyping; … … 83 87 void retrySend(ICQEvent* e, bool online, unsigned short level); 84 88 virtual void userUpdated(CICQSignal* sig, QString id = QString::null, unsigned long ppid = 0); 89 void updatePicture(ICQUser* u = NULL); 85 90 bool checkSecure(); 86 91
