Changeset 4452

Show
Ignore:
Timestamp:
06/27/06 00:49:31 (2 years ago)
Author:
erijo
Message:

This makes the Send button (instead of the Close button) be the Cancel
button when sending messages. Implements ticket #641, except the last item.
I'm closing it, so if anyone wants the last item on zloba_org's list, please
open a new ticket.

Location:
trunk/qt-gui/src
Files:
2 modified

Legend:

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

    r4443 r4452  
    15101510 
    15111511  QAccel *a = new QAccel( this ); 
    1512   a->connectItem(a->insertItem(Key_Escape), this, SLOT(cancelSend())); 
     1512  a->connectItem(a->insertItem(Key_Escape), this, SLOT(slot_cancelSend())); 
    15131513#if QT_VERSION >= 300 
    15141514  if (mainwin->userEventTabDlg && 
     
    15931593  connect( btnSend, SIGNAL( clicked() ), this, SLOT( trySecure() ) ); 
    15941594 
    1595   btnCancel = new QPushButton(tr("&Close"), this); 
    1596   w = QMAX(btnCancel->sizeHint().width(), w); 
     1595  btnClose = new QPushButton(tr("&Close"), this); 
     1596  w = QMAX(btnClose->sizeHint().width(), w); 
    15971597  btnSend->setFixedWidth(w); 
    1598   btnCancel->setFixedWidth(w); 
     1598  btnClose->setFixedWidth(w); 
    15991599  h_lay->addWidget(btnSend); 
    1600   h_lay->addWidget(btnCancel); 
    1601   connect(btnCancel, SIGNAL(clicked()), this, SLOT(cancelSend())); 
     1600  h_lay->addWidget(btnClose); 
     1601  connect(btnClose, SIGNAL(clicked()), this, SLOT(slot_close())); 
    16021602  splView = new QSplitter(Vertical, mainWidget); 
    16031603  //splView->setOpaqueResize(); 
     
    17861786  setFocusProxy(mleSend); 
    17871787  setTabOrder(mleSend, btnSend); 
    1788   setTabOrder(btnSend, btnCancel); 
     1788  setTabOrder(btnSend, btnClose); 
    17891789  icqColor.SetToDefault(); 
    17901790  mleSend->setBackground(QColor(icqColor.BackRed(), icqColor.BackGreen(), icqColor.BackBlue())); 
     
    22322232    setCaption(title); 
    22332233    setCursor(waitCursor); 
    2234     btnSend->setEnabled(false); 
    2235     btnCancel->setText(tr("&Cancel")); 
     2234    btnSend->setText(tr("&Cancel")); 
     2235    btnClose->setEnabled(false); 
     2236    disconnect(btnSend, SIGNAL(clicked()), this, SLOT(sendButton())); 
     2237    connect(btnSend, SIGNAL(clicked()), this, SLOT(slot_cancelSend())); 
     2238 
    22362239    connect (sigman, SIGNAL(signal_doneUserFcn(ICQEvent *)), this, SLOT(sendDone_common(ICQEvent *))); 
    22372240  } 
     
    23122315 
    23132316  setCursor(arrowCursor); 
    2314   btnSend->setEnabled(true); 
    2315   btnCancel->setText(tr("&Close")); 
     2317  btnSend->setText(tr("&Send")); 
     2318  btnClose->setEnabled(true); 
     2319  disconnect(btnSend, SIGNAL(clicked()), this, SLOT(slot_cancelSend())); 
     2320  connect(btnSend, SIGNAL(clicked()), this, SLOT(sendButton())); 
     2321 
    23162322  // If cancelled automatically check "Send through Server" 
    23172323  if (mainwin->m_bAutoSendThroughServer && e->Result() == EVENT_CANCELLED) 
     
    25462552 
    25472553 
    2548 //-----UserSendCommon::cancelSend-------------------------------------------- 
    2549 void UserSendCommon::cancelSend() 
     2554//-----UserSendCommon::slot_close-------------------------------------------- 
     2555void UserSendCommon::slot_close() 
     2556{ 
     2557  if (mainwin->m_bMsgChatView) 
     2558  { 
     2559    // the window is at the front, if the timer has not expired and we close 
     2560    // the window, then the new events will stay there 
     2561    slot_ClearNewEvents(); 
     2562  } 
     2563#if QT_VERSION >= 300 
     2564  if (mainwin->userEventTabDlg && 
     2565      mainwin->userEventTabDlg->tabExists(this)) 
     2566    mainwin->userEventTabDlg->removeTab(this); 
     2567  else 
     2568#endif 
     2569    close(); 
     2570} 
     2571 
     2572//-----UserSendCommon::slot_cancelSend-------------------------------------------- 
     2573void UserSendCommon::slot_cancelSend() 
    25502574{ 
    25512575  unsigned long icqEventTag = 0; 
     
    25542578 
    25552579  if (!icqEventTag) 
    2556   { 
    2557     if (mainwin->m_bMsgChatView) 
    2558     { 
    2559       // the window is at the front, if the timer has not expired and we close 
    2560       // the window, then the new events will stay there 
    2561       slot_ClearNewEvents(); 
    2562     } 
    2563 #if QT_VERSION >= 300 
    2564     if (mainwin->userEventTabDlg && 
    2565         mainwin->userEventTabDlg->tabExists(this)) 
    2566       mainwin->userEventTabDlg->removeTab(this); 
    2567     else 
    2568 #endif 
    2569       close(); 
    25702580    return; 
    2571   } 
    25722581 
    25732582#if QT_VERSION >= 300 
     
    25762585    mainwin->userEventTabDlg->setCaption(m_sBaseTitle); 
    25772586#endif 
    2578   setCaption(m_sBaseTitle); 
    25792587  server->CancelEvent(icqEventTag); 
    2580   icqEventTag = 0; 
    2581   btnSend->setEnabled(true); 
    2582   btnCancel->setText(tr("&Close")); 
    2583   setCursor(arrowCursor); 
    25842588} 
    25852589 
  • trunk/qt-gui/src/usereventdlg.h

    r4443 r4452  
    277277  QSplitter * splView; 
    278278  QCheckBox *chkSendServer, *chkUrgent, *chkMass; 
    279   QPushButton *btnSend, *btnCancel; 
     279  QPushButton *btnSend, *btnClose; 
    280280  QGroupBox *grpMR; 
    281281  QButtonGroup *grpCmd; 
     
    299299  virtual void sendDone_common(ICQEvent *); 
    300300 
    301   void cancelSend(); 
     301  void slot_close(); 
     302  void slot_cancelSend(); 
    302303  void massMessageToggled(bool); 
    303304  void slot_resettitle();