Changeset 6185

Show
Ignore:
Timestamp:
2008-05-06 04:50:29 (2 months ago)
Author:
flynd
Message:

Moved eventSent signal from mainwin to licqgui.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/qt4-gui/src/core/licqgui.cpp

    r6160 r6185  
    994994  } 
    995995 
     996  // Since daemon doesn't notify us when an event is sent we need to take care of it ourselfs 
     997  // Get signals from event dialog and forward it to anyone who needs it 
     998  connect(e, SIGNAL(eventSent(const ICQEvent*)), SIGNAL(eventSent(const ICQEvent*))); 
     999 
    9961000  // there might be more than one send window open 
    9971001  // make sure we only remember one, or it will get complicated 
     
    10071011    disconnect(oldDialog, SIGNAL(finished(QString, unsigned long)), this, SLOT(sendEventFinished(QString, unsigned long))); 
    10081012    sendEventFinished(id, ppid); 
     1013  connect(newDialog, SIGNAL(eventSent(const ICQEvent*)), SIGNAL(eventSent(const ICQEvent*))); 
    10091014    connect(newDialog, SIGNAL(finished(QString, unsigned long)), SLOT(sendEventFinished(QString, unsigned long))); 
    10101015    myUserSendList.append(newDialog); 
  • trunk/qt4-gui/src/core/licqgui.h

    r6160 r6185  
    3737class CICQDaemon; 
    3838class CICQSignal; 
     39class ICQEvent; 
    3940 
    4041namespace LicqQtGui 
     
    230231  void sendChatRequest(QString id, unsigned long ppid); 
    231232 
     233signals: 
     234  /** 
     235   * Since daemon doesn't notify us when an event is sent we'll have to handle 
     236   * it ourselfs. This is used by event dialog to notify other dialogs when a 
     237   * message has been sent. 
     238   * 
     239   * @param event Event object that was sent 
     240   */ 
     241  void eventSent(const ICQEvent* event); 
     242 
    232243private slots: 
    233244#ifdef Q_WS_X11 
  • trunk/qt4-gui/src/core/mainwin.h

    r6152 r6185  
    9797  virtual void closeEvent(QCloseEvent*); 
    9898 
    99 signals: 
    100   void signal_sentevent(ICQEvent* e); 
    101  
    10299public slots: 
    103100  void slot_shutdown(); 
     
    159156  void callUserFunction(QAction* action); 
    160157  void checkUserAutoResponse(); 
    161  
    162   friend class UserSendCommon; 
    163158}; 
    164159 
  • trunk/qt4-gui/src/userevents/usersendcommon.cpp

    r6182 r6185  
    404404    gUserManager.DropUser(u); 
    405405 
    406     connect(gMainWindow, SIGNAL(signal_sentevent(ICQEvent*)), 
    407         myHistoryView, SLOT(addMsg(ICQEvent*))); 
     406    connect(LicqGui::instance(), SIGNAL(eventSent(const ICQEvent*)), 
     407        myHistoryView, SLOT(addMsg(const ICQEvent*))); 
    408408    //myViewSplitter->setResizeMode(myHistoryView, QSplitter::FollowSizeHint); 
    409409  } 
     
    12001200    if (sendDone(e)) 
    12011201    { 
    1202       emit gMainWindow->signal_sentevent(e); 
     1202      emit eventSent(e); 
    12031203      if (Config::Chat::instance()->msgChatView() && myHistoryView != NULL) 
    12041204      { 
  • trunk/qt4-gui/src/userevents/usersendcommon.h

    r6108 r6185  
    6161  void updateUser(CICQSignal* sig); 
    6262  void msgTypeChanged(UserSendCommon* from, UserSendCommon* to); 
     63 
     64  /** 
     65   * Since daemon doesn't notify us when an event is sent we'll have to handle 
     66   * it ourselfs. This signal is sent to notify other windows about the event 
     67   * that was sent. 
     68   * 
     69   * @param event Event object that was sent 
     70   */ 
     71  void eventSent(const ICQEvent* event); 
    6372 
    6473public slots: 
  • trunk/qt4-gui/src/userevents/userviewevent.cpp

    r6166 r6185  
    2323#include "config.h" 
    2424 
     25#include <QAction> 
    2526#include <QApplication> 
    2627#include <QCheckBox> 
     
    4849#include "core/gui-defines.h" 
    4950#include "core/licqgui.h" 
    50 #include "core/mainwin.h" 
    5151#include "core/messagebox.h" 
    5252#include "core/signalmanager.h" 
     
    9090  connect(myMessageList, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), 
    9191      SLOT(printMessage(QTreeWidgetItem*))); 
    92   connect(gMainWindow, SIGNAL(signal_sentevent(ICQEvent*)), 
    93       SLOT(sentEvent(ICQEvent*))); 
     92  connect(LicqGui::instance(), SIGNAL(eventSent(const ICQEvent*)), 
     93      SLOT(sentEvent(const ICQEvent*))); 
    9494 
    9595  myActionsBox = new QGroupBox(); 
     
    779779} 
    780780 
    781 void UserViewEvent::sentEvent(ICQEvent* e) 
     781void UserViewEvent::sentEvent(const ICQEvent* e) 
    782782{ 
    783783  if (e->PPID() != myPpid || strcmp(myUsers.front().c_str(), e->Id()) != 0) 
     
    785785 
    786786  if (!Config::Chat::instance()->msgChatView()) 
    787     new MessageListItem(e->GrabUserEvent(), myCodec, myMessageList); 
     787    new MessageListItem(e->UserEvent(), myCodec, myMessageList); 
    788788} 
    789789 
  • trunk/qt4-gui/src/userevents/userviewevent.h

    r6166 r6185  
    8282  void msgTypeChanged(UserSendCommon* from, UserSendCommon* to); 
    8383  void printMessage(QTreeWidgetItem* item); 
    84   void sentEvent(ICQEvent* e); 
     84  void sentEvent(const ICQEvent* e); 
    8585  void setEncoding(); 
    8686}; 
  • trunk/qt4-gui/src/widgets/historyview.cpp

    r6180 r6185  
    239239} 
    240240 
    241 void HistoryView::addMsg(ICQEvent* event) 
     241void HistoryView::addMsg(const ICQEvent* event) 
    242242{ 
    243243  if (event->Id() == myId && event->PPID() == myPpid && event->UserEvent() != NULL) 
  • trunk/qt4-gui/src/widgets/historyview.h

    r6180 r6185  
    6262public slots: 
    6363  void addMsg(const CUserEvent* event, QString id = QString(), unsigned long ppid = 0); 
    64   void addMsg(ICQEvent* event); 
     64  void addMsg(const ICQEvent* event); 
    6565  void setColors(); 
    6666 
  • trunk/qt4-gui/src/widgets/messagelist.cpp

    r5837 r6185  
    3939/* TRANSLATOR LicqQtGui::MessageListItem */ 
    4040 
    41 MessageListItem::MessageListItem(CUserEvent* theMsg, QTextCodec* codec, QTreeWidget* parent) 
     41MessageListItem::MessageListItem(const CUserEvent* theMsg, QTextCodec* codec, QTreeWidget* parent) 
    4242  : QTreeWidgetItem(parent) 
    4343{ 
    44   if (theMsg->Direction() == D_SENDER) 
    45     myMsg = theMsg; 
    46   else 
    47     myMsg = theMsg->Copy(); 
     44  // Keep a copy of the event 
     45  myMsg = theMsg->Copy(); 
    4846 
    4947  myCodec = codec; 
  • trunk/qt4-gui/src/widgets/messagelist.h

    r5837 r6185  
    3232{ 
    3333public: 
    34   MessageListItem(CUserEvent* theMsg, QTextCodec* codec, QTreeWidget* parent); 
     34  MessageListItem(const CUserEvent* theMsg, QTextCodec* codec, QTreeWidget* parent); 
    3535  ~MessageListItem(void); 
    3636  void MarkRead();