Changeset 5779 for trunk/qt-gui

Show
Ignore:
Timestamp:
11/08/07 06:27:03 (13 months ago)
Author:
flynd
Message:

Merged some fixes from qt4-gui:

  • r5676 - Made sure that network window has proper size.
  • r5672 - Fixed mainwin minimum height calculation.
  • r5665 - About page shows nothing for msn contacts so only use it as default for aim contacts.
  • r5653 - Be more failsafe.
  • r5601 - Made notice strings translatable; take the usereventcommon private PPID instead of a constant one to generate the real user id; revised the convo(Join|Leave) logic, which must fix #1392.
  • r5591 - Don't let the fetched user remain undropped. Fixes #1558.
  • r5540 - Made setMiniMode() more failsafe; Made skin changing in minimode resize the window properly.
  • r5538 - Revised setMiniMode logic a bit.
  • r5505 - Funny, isn't it?
  • r5466 - Don't just hide the dialog, really delete it.
  • r5392 - We have a constant for filename length, so let's use it.
Location:
trunk/qt-gui/src
Files:
7 modified

Legend:

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

    r4699 r5779  
    9191    connect (btnOk, SIGNAL(clicked()), SLOT(ok()) ); 
    9292    connect (edtUin, SIGNAL(returnPressed()), SLOT(ok()) ); 
    93     connect (btnCancel, SIGNAL(clicked()), SLOT(reject()) ); 
     93  connect (btnCancel, SIGNAL(clicked()), SLOT(close()) ); 
    9494 
    9595    // Set Tab Order 
  • trunk/qt-gui/src/licqgui.cpp

    r5501 r5779  
    274274 
    275275#ifndef USE_KDE 
    276   char buf[500]; 
    277   snprintf(buf, sizeof(buf), "%s/licq_qt-gui.style", BASE_DIR); 
    278   buf[sizeof(buf) - 1] = '\0'; 
     276  char buf[MAX_FILENAME_LEN]; 
     277  snprintf(buf, MAX_FILENAME_LEN, "%s/licq_qt-gui.style", BASE_DIR); 
     278  buf[MAX_FILENAME_LEN - 1] = '\0'; 
    279279 
    280280  QStyle *style = SetStyle(styleName); 
  • trunk/qt-gui/src/mainwin.cpp

    r5644 r5779  
    604604  pluginDlg = NULL; 
    605605  userEventTabDlg = NULL; 
    606   m_nRealHeight = 0; 
     606  m_nRealHeight = hVal; 
    607607 
    608608  ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 
     
    954954  } 
    955955 
    956    
     956  unsigned minHeight = skin->frame.border.top + skin->frame.border.bottom; 
     957  setMinimumHeight(minHeight); 
     958  setMaximumHeight(m_bInMiniMode ? minHeight : QWIDGETSIZE_MAX); 
     959 
    957960  // Message Label 
    958961  delete lblMsg; 
     
    17661769} 
    17671770 
    1768 void CMainWindow::slot_socket(const char *szId, unsigned long nPPID, unsigned long nConvoId) 
    1769 { 
    1770   // Add the user to an ongoing conversation 
     1771void CMainWindow::slot_socket(const char *szId, unsigned long nPPID, unsigned long convoId) 
     1772{ 
    17711773  QPtrListIterator<UserSendCommon> it(licqUserSend); 
    17721774 
     
    17751777    if (strcmp((*it)->Id(), szId) == 0 && (*it)->PPID() == nPPID) 
    17761778    { 
    1777       (*it)->SetConvoId(nConvoId); 
    1778       break; 
    1779     } 
    1780   } 
    1781 } 
    1782  
    1783 void CMainWindow::slot_convoJoin(const char *szId, unsigned long /* nPPID */, unsigned long nConvoId) 
    1784 { 
    1785   // Add the user to an ongoing conversation 
     1779      (*it)->SetConvoId(convoId); 
     1780      break; 
     1781    } 
     1782  } 
     1783} 
     1784 
     1785void CMainWindow::slot_convoJoin(const char *szId, unsigned long ppid, unsigned long convoId) 
     1786{ 
    17861787  QPtrListIterator<UserSendCommon> it(licqUserSend); 
    17871788 
    17881789  for (; it.current(); ++it) 
    17891790  { 
    1790     if ((*it)->ConvoId() == nConvoId) 
    1791     { 
    1792       (*it)->convoJoin(szId, nConvoId); 
    1793       return; 
    1794     } 
    1795   } 
    1796    
    1797   // No conversation shown, so make one 
    1798    
    1799 } 
    1800  
    1801 void CMainWindow::slot_convoLeave(const char *szId, unsigned long /* nPPID */, unsigned long nConvoId) 
    1802 { 
    1803   // Add the user to an ongoing conversation 
     1791    if ((*it)->PPID() == ppid && (*it)->ConvoId() == convoId) 
     1792    { 
     1793      (*it)->convoJoin(szId, convoId); 
     1794      break; 
     1795    } 
     1796  } 
     1797} 
     1798 
     1799void CMainWindow::slot_convoLeave(const char *szId, unsigned long ppid, unsigned long convoId) 
     1800{ 
    18041801  QPtrListIterator<UserSendCommon> it(licqUserSend); 
    18051802 
    18061803  for (; it.current(); ++it) 
    18071804  { 
    1808     if ((*it)->ConvoId() == nConvoId) 
    1809     { 
    1810       (*it)->convoLeave(szId, nConvoId); 
    1811       return; 
     1805    if ((*it)->PPID() == ppid && (*it)->ConvoId() == convoId && (*it)->FindUserInConvo(szId)) 
     1806    { 
     1807      (*it)->convoLeave(szId, convoId); 
     1808      break; 
    18121809    } 
    18131810  } 
     
    26352632      break; 
    26362633    case mnuUserGeneral: 
    2637       if (isalpha(szId[0])) 
     2634      if (nPPID == LICQ_PPID && isalpha(szId[0])) 
    26382635        tab = UserInfoDlg::AboutInfo; 
    26392636      else 
     
    26652662      break; 
    26662663    case mnuUserGeneral: 
    2667       if (isalpha(szId[0])) 
     2664      if (nPPID == LICQ_PPID && isalpha(szId[0])) 
    26682665        f->showTab(UserInfoDlg::AboutInfo); 
    26692666      else 
     
    37693766void CMainWindow::ToggleMiniMode() 
    37703767{ 
    3771  
    3772    if (m_bInMiniMode) 
    3773    { 
    3774       userView->show(); 
    3775       setMaximumHeight(4096); 
    3776       resize(width(), m_nRealHeight); 
    3777       setMinimumHeight(100); 
    3778    } 
    3779    else 
    3780    { 
    3781       userView->QWidget::hide(); 
    3782       m_nRealHeight = height(); 
    3783       unsigned short newH = skin->frame.border.top + skin->frame.border.bottom; 
    3784       setMinimumHeight(newH); 
    3785       resize(width(), newH); 
    3786       setMaximumHeight(newH); 
    3787    } 
    3788    m_bInMiniMode = !m_bInMiniMode; 
    3789    mnuSystem->setItemChecked(mnuSystem->idAt(MNUxITEM_MINIxMODE), m_bInMiniMode); 
     3768  m_bInMiniMode = !m_bInMiniMode; 
     3769 
     3770  if (m_bInMiniMode) 
     3771  { 
     3772    m_nRealHeight = height(); 
     3773    setMaximumHeight(minimumHeight()); 
     3774    userView->QWidget::hide(); 
     3775  } 
     3776  else 
     3777  { 
     3778    setMaximumHeight(QWIDGETSIZE_MAX); 
     3779    resize(width(), m_nRealHeight); 
     3780    userView->show(); 
     3781  } 
     3782 
     3783  mnuSystem->setItemChecked(mnuSystem->idAt(MNUxITEM_MINIxMODE), m_bInMiniMode); 
    37903784} 
    37913785 
  • trunk/qt-gui/src/outputwin.cpp

    r5328 r5779  
    5151 
    5252  outputBox = new CLogWidget(this); 
    53   outputBox->setMinimumHeight(outputBox->frameWidth()*2 
    54                               + 16*outputBox->fontMetrics().lineSpacing()); 
    55   outputBox->setMinimumWidth(outputBox->minimumHeight()*2); 
     53  outputBox->setMinimumHeight(outputBox->frameWidth() * 2 
     54      + 16 * outputBox->fontMetrics().lineSpacing()); 
     55  outputBox->setMinimumWidth(outputBox->minimumHeight() * 2); 
    5656  top_lay->addWidget(outputBox); 
    5757 
     
    7777  lay->addWidget(btnClear); 
    7878  lay->addWidget(btnHide); 
     79 
     80  adjustSize(); 
    7981 
    8082  sn = new QSocketNotifier(Pipe(), QSocketNotifier::Read, this); 
  • trunk/qt-gui/src/support.cpp

    r5640 r5779  
    6262 
    6363    if (retFormat != 32 || retNItems != 1 || retMoreBytes != 0) 
     64    { 
    6465      gLog.Info("Error reading current desktop property."); 
     66      *current = 0UL; 
     67    } 
    6568  } 
    6669 
  • trunk/qt-gui/src/usereventdlg.cpp

    r5626 r5779  
    621621} 
    622622 
    623 bool UserEventCommon::FindUserInConvo(char *szId) 
     623bool UserEventCommon::FindUserInConvo(const char *szId) 
    624624{ 
    625625  char *szRealId; 
     
    18181818    gUserManager.DropUser(u); 
    18191819 
    1820     QString strMsg = QString("%1 has joined the conversation.") 
     1820    QString strMsg = QString(tr("%1 has joined the conversation.")) 
    18211821      .arg(userName); 
    18221822    mleHistory->addNotice(QDateTime::currentDateTime(), strMsg); 
     
    18261826  { 
    18271827    char *szRealId; 
    1828     //XXX The PPID? 
    1829     ICQUser::MakeRealId(szId, LICQ_PPID, szRealId); 
     1828    ICQUser::MakeRealId(szId, m_nPPID, szRealId); 
    18301829    m_lUsers.push_back(szRealId); 
    18311830    delete [] szRealId; 
     
    18521851      userName = szId; 
    18531852 
    1854     QString strMsg = QString("%1 has left the conversation.") 
     1853    QString strMsg = QString(tr("%1 has left the conversation.")) 
    18551854      .arg(userName); 
    18561855    mleHistory->addNotice(QDateTime::currentDateTime(), strMsg); 
    18571856     
    18581857    // Remove the typing notification if active 
    1859     if (u && u->GetTyping() == ICQ_TYPING_ACTIVE) 
    1860     { 
    1861       u->SetTyping(ICQ_TYPING_INACTIVEx0); 
    1862       nfoStatus->unsetPalette(); 
    1863       if (mainwin->m_bTabbedChatting && mainwin->userEventTabDlg) 
    1864         mainwin->userEventTabDlg->updateTabLabel(u);   
     1858    if (u != 0) 
     1859    { 
     1860      if (u->GetTyping() == ICQ_TYPING_ACTIVE) 
     1861      { 
     1862        u->SetTyping(ICQ_TYPING_INACTIVEx0); 
     1863        nfoStatus->unsetPalette(); 
     1864        if (mainwin->m_bTabbedChatting && mainwin->userEventTabDlg) 
     1865          mainwin->userEventTabDlg->updateTabLabel(u);   
     1866      } 
    18651867    } 
    18661868    gUserManager.DropUser(u); 
     
    19161918  QWidget *desktop = qApp->desktop(); 
    19171919  QSize s = p->sizeHint(); 
    1918   s = p->sizeHint(); 
    19191920  QPoint pos = QPoint(0, btnEmoticon->height()); 
    19201921  pos = btnEmoticon->mapToGlobal(pos); 
  • trunk/qt-gui/src/usereventdlg.h

    r5441 r5779  
    144144  void SetConvoId(unsigned long n)  { m_nConvoId = n; } 
    145145   
    146   bool FindUserInConvo(char *); 
     146  bool FindUserInConvo(const char* id); 
    147147  void AddEventTag(unsigned long n)  { if (n) m_lnEventTag.push_back(n); } 
    148148  void gotTyping(unsigned short);