[prev in list] [next in list] [prev in thread] [next in thread] 

List:       licq-cvs
Subject:    [Licq-cvs] r4452 - trunk/qt-gui/src
From:       erijo () users ! sourceforge ! net
Date:       2006-06-26 15:49:31
Message-ID: 20060626154931.1393.qmail () mail ! thejon ! org
[Download RAW message or body]

Author: erijo
Date: 2006-06-27 00:49:31 +0900 (Tue, 27 Jun 2006)
New Revision: 4452

Modified:
   trunk/qt-gui/src/usereventdlg.cpp
   trunk/qt-gui/src/usereventdlg.h
Log:
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.


Modified: trunk/qt-gui/src/usereventdlg.cpp
===================================================================
--- trunk/qt-gui/src/usereventdlg.cpp	2006-06-20 14:52:00 UTC (rev 4451)
+++ trunk/qt-gui/src/usereventdlg.cpp	2006-06-26 15:49:31 UTC (rev 4452)
@@ -1509,7 +1509,7 @@
   clearDelay = 250;
 
   QAccel *a = new QAccel( this );
-  a->connectItem(a->insertItem(Key_Escape), this, SLOT(cancelSend()));
+  a->connectItem(a->insertItem(Key_Escape), this, SLOT(slot_cancelSend()));
 #if QT_VERSION >= 300
   if (mainwin->userEventTabDlg &&
       parent == mainwin->userEventTabDlg)
@@ -1592,13 +1592,13 @@
   // tries to establish a secure connection first.
   connect( btnSend, SIGNAL( clicked() ), this, SLOT( trySecure() ) );
 
-  btnCancel = new QPushButton(tr("&Close"), this);
-  w = QMAX(btnCancel->sizeHint().width(), w);
+  btnClose = new QPushButton(tr("&Close"), this);
+  w = QMAX(btnClose->sizeHint().width(), w);
   btnSend->setFixedWidth(w);
-  btnCancel->setFixedWidth(w);
+  btnClose->setFixedWidth(w);
   h_lay->addWidget(btnSend);
-  h_lay->addWidget(btnCancel);
-  connect(btnCancel, SIGNAL(clicked()), this, SLOT(cancelSend()));
+  h_lay->addWidget(btnClose);
+  connect(btnClose, SIGNAL(clicked()), this, SLOT(slot_close()));
   splView = new QSplitter(Vertical, mainWidget);
   //splView->setOpaqueResize();
   
@@ -1785,7 +1785,7 @@
   }
   setFocusProxy(mleSend);
   setTabOrder(mleSend, btnSend);
-  setTabOrder(btnSend, btnCancel);
+  setTabOrder(btnSend, btnClose);
   icqColor.SetToDefault();
   mleSend->setBackground(QColor(icqColor.BackRed(), icqColor.BackGreen(), icqColor.BackBlue()));
   mleSend->setForeground(QColor(icqColor.ForeRed(), icqColor.ForeGreen(), icqColor.ForeBlue()));
@@ -2231,8 +2231,11 @@
 #endif
     setCaption(title);
     setCursor(waitCursor);
-    btnSend->setEnabled(false);
-    btnCancel->setText(tr("&Cancel"));
+    btnSend->setText(tr("&Cancel"));
+    btnClose->setEnabled(false);
+    disconnect(btnSend, SIGNAL(clicked()), this, SLOT(sendButton()));
+    connect(btnSend, SIGNAL(clicked()), this, SLOT(slot_cancelSend()));
+
     connect (sigman, SIGNAL(signal_doneUserFcn(ICQEvent *)), this, SLOT(sendDone_common(ICQEvent *)));
   }
 }
@@ -2311,8 +2314,11 @@
   setCaption(title);
 
   setCursor(arrowCursor);
-  btnSend->setEnabled(true);
-  btnCancel->setText(tr("&Close"));
+  btnSend->setText(tr("&Send"));
+  btnClose->setEnabled(true);
+  disconnect(btnSend, SIGNAL(clicked()), this, SLOT(slot_cancelSend()));
+  connect(btnSend, SIGNAL(clicked()), this, SLOT(sendButton()));
+
   // If cancelled automatically check "Send through Server"
   if (mainwin->m_bAutoSendThroughServer && e->Result() == EVENT_CANCELLED)
     chkSendServer->setChecked(true);
@@ -2545,42 +2551,40 @@
 }
 
 
-//-----UserSendCommon::cancelSend--------------------------------------------
-void UserSendCommon::cancelSend()
+//-----UserSendCommon::slot_close--------------------------------------------
+void UserSendCommon::slot_close()
 {
+  if (mainwin->m_bMsgChatView)
+  {
+    // the window is at the front, if the timer has not expired and we close
+    // the window, then the new events will stay there
+    slot_ClearNewEvents();
+  }
+#if QT_VERSION >= 300
+  if (mainwin->userEventTabDlg &&
+      mainwin->userEventTabDlg->tabExists(this))
+    mainwin->userEventTabDlg->removeTab(this);
+  else
+#endif
+    close();
+}
+
+//-----UserSendCommon::slot_cancelSend--------------------------------------------
+void UserSendCommon::slot_cancelSend()
+{
   unsigned long icqEventTag = 0;
   if (m_lnEventTag.size())
     icqEventTag = m_lnEventTag.front();
 
   if (!icqEventTag)
-  {
-    if (mainwin->m_bMsgChatView)
-    {
-      // the window is at the front, if the timer has not expired and we close
-      // the window, then the new events will stay there
-      slot_ClearNewEvents();
-    }
-#if QT_VERSION >= 300
-    if (mainwin->userEventTabDlg &&
-        mainwin->userEventTabDlg->tabExists(this))
-      mainwin->userEventTabDlg->removeTab(this);
-    else
-#endif
-      close();
     return;
-  }
 
 #if QT_VERSION >= 300
   if (mainwin->userEventTabDlg &&
       mainwin->userEventTabDlg->tabIsSelected(this))
     mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
 #endif
-  setCaption(m_sBaseTitle);
   server->CancelEvent(icqEventTag);
-  icqEventTag = 0;
-  btnSend->setEnabled(true);
-  btnCancel->setText(tr("&Close"));
-  setCursor(arrowCursor);
 }
 
 

Modified: trunk/qt-gui/src/usereventdlg.h
===================================================================
--- trunk/qt-gui/src/usereventdlg.h	2006-06-20 14:52:00 UTC (rev 4451)
+++ trunk/qt-gui/src/usereventdlg.h	2006-06-26 15:49:31 UTC (rev 4452)
@@ -276,7 +276,7 @@
   CMessageViewWidget *mleHistory;
   QSplitter * splView;
   QCheckBox *chkSendServer, *chkUrgent, *chkMass;
-  QPushButton *btnSend, *btnCancel;
+  QPushButton *btnSend, *btnClose;
   QGroupBox *grpMR;
   QButtonGroup *grpCmd;
   QComboBox* cmbSendType;
@@ -298,7 +298,8 @@
   virtual void sendButton();
   virtual void sendDone_common(ICQEvent *);
 
-  void cancelSend();
+  void slot_close();
+  void slot_cancelSend();
   void massMessageToggled(bool);
   void slot_resettitle();
   void slot_Emoticon();


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Licq-cvs mailing list
Licq-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/licq-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic