- Timestamp:
- 04/15/03 11:12:20 (6 years ago)
- Location:
- trunk/qt-gui/src
- Files:
-
- 8 modified
-
ewidgets.cpp (modified) (3 diffs)
-
ewidgets.h (modified) (2 diffs)
-
mainwin.cpp (modified) (13 diffs)
-
mainwin.h (modified) (4 diffs)
-
optionsdlg.cpp (modified) (4 diffs)
-
optionsdlg.h (modified) (2 diffs)
-
usereventdlg.cpp (modified) (23 diffs)
-
usereventdlg.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/ewidgets.cpp
r3294 r3437 26 26 #include "ewidgets.h" 27 27 #include "usercodec.h" 28 #include "usereventdlg.h" 28 29 29 30 using namespace std; … … 517 518 //- Message View Widget --------------------------------------------------------- 518 519 519 CMessageViewWidget::CMessageViewWidget(unsigned long _nUin, QWidget* parent, const char * name)520 CMessageViewWidget::CMessageViewWidget(unsigned long _nUin, CMainWindow *m, QWidget* parent, const char * name) 520 521 :CHistoryWidget(parent,name) 521 522 { 522 523 m_nUin= _nUin; 523 parentWidget = parent;524 mainwin = m; 524 525 525 526 // add all unread messages. … … 629 630 GotoEnd(); 630 631 632 QWidget *parent = NULL; 633 if (parentWidget() && 634 parentWidget()->parentWidget() && 635 parentWidget()->parentWidget()->parentWidget()) 636 parent = parentWidget()->parentWidget()->parentWidget(); 631 637 if ( 632 638 #if QT_VERSION >= 300 633 parentWidget && parentWidget->isActiveWindow() && 639 parent && parent->isActiveWindow() && 640 (!mainwin->m_bTabbedChatting || (mainwin->m_bTabbedChatting && 641 mainwin->userEventTabDlg->tabIsSelected(parent))) && 634 642 #endif 635 643 e->Direction() == D_RECEIVER && e->SubCommand() == ICQ_CMDxSUB_MSG) { -
trunk/qt-gui/src/ewidgets.h
r3294 r3437 14 14 class CUserEvent; 15 15 class ICQEvent; 16 class CMainWindow; 16 17 17 18 bool QueryUser(QWidget *, QString, QString, QString); … … 129 130 private: 130 131 unsigned long m_nUin; 131 QWidget *parentWidget;132 CMainWindow *mainwin; 132 133 public: 133 CMessageViewWidget(unsigned long _nUin, QWidget* parent=0, const char * name =0); 134 CMessageViewWidget(unsigned long _nUin, CMainWindow *m, 135 QWidget* parent=0, const char * name =0); 134 136 virtual ~CMessageViewWidget(){}; 135 137 public slots: -
trunk/qt-gui/src/mainwin.cpp
r3431 r3437 42 42 #include <qtextview.h> 43 43 #include <qpainter.h> 44 #include <qtabwidget.h> 44 45 #if QT_VERSION >= 300 45 46 #include <qstylefactory.h> … … 346 347 licqConf.ReadBool("SendFromClipboard", m_bSendFromClipboard, true); 347 348 licqConf.ReadBool("MsgChatView", m_bMsgChatView, true ); 349 #if QT_VERSION < 300 350 m_bTabbedChatting = false; 351 #else 352 licqConf.ReadBool("TabbedChatting", m_bTabbedChatting, true); 353 #endif 348 354 licqConf.ReadBool("AutoPosReplyWin", m_bAutoPosReplyWin, true); 349 355 licqConf.ReadBool("AutoSendThroughServer", m_bAutoSendThroughServer, false); … … 454 460 optionsDlg = NULL; 455 461 registerUserDlg = NULL; 462 #if QT_VERSION >= 300 463 userEventTabDlg = NULL; 464 #endif 456 465 m_nRealHeight = 0; 457 466 … … 641 650 XSetClassHint(x11Display(), winId(), &ClassHint); 642 651 #endif 652 643 653 } 644 654 … … 1258 1268 } 1259 1269 1270 #if QT_VERSION >= 300 1271 // update the tab icon of this user 1272 if (m_bTabbedChatting && userEventTabDlg) 1273 userEventTabDlg->updateTabLabel(u); 1274 #endif 1260 1275 gUserManager.DropUser(u); 1261 1276 … … 2027 2042 { 2028 2043 #if QT_VERSION < 300 2029 QListIterator<UserSendCommon> it(licqUserSend );2044 QListIterator<UserSendCommon> it(licqUserSend); 2030 2045 #else 2031 2046 QPtrListIterator<UserSendCommon> it(licqUserSend); … … 2053 2068 if ((*it)->Uin() == nUin) 2054 2069 { 2055 e = static_cast<UserSendCommon*>(*it); 2056 e->show(); 2057 if(!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon")) 2058 { 2059 e->raise(); 2070 e = static_cast<UserSendCommon*>(*it); 2071 #if QT_VERSION >= 300 2072 if (userEventTabDlg && userEventTabDlg->tabExists(e)) 2073 { 2074 userEventTabDlg->show(); 2075 userEventTabDlg->selectTab(e); 2076 userEventTabDlg->raise(); 2060 2077 #ifdef USE_KDE 2061 KWin::setActiveWindow(e->winId()); 2062 #endif 2063 } 2064 return e; 2065 } 2066 } 2078 KWin::setActiveWindow(userEventTabDlg->winId()); 2079 #endif 2080 } 2081 #endif 2082 else 2083 { 2084 e->show(); 2085 if (!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon")) 2086 { 2087 e->raise(); 2088 #ifdef USE_KDE 2089 KWin::setActiveWindow(e->winId()); 2090 #endif 2091 } 2092 } 2093 return e; 2094 } 2095 } 2067 2096 } 2068 2097 default: … … 2070 2099 } 2071 2100 2101 QWidget *parent = NULL; 2102 #if QT_VERSION >= 300 2103 if (m_bTabbedChatting) 2104 { 2105 if (userEventTabDlg != NULL) 2106 userEventTabDlg->raise(); 2107 else 2108 { 2109 // create the tab dialog if it does not exist 2110 userEventTabDlg = new UserEventTabDlg(); 2111 connect(userEventTabDlg, SIGNAL(signal_done()), this, SLOT(slot_doneUserEventTabDlg())); 2112 } 2113 parent = userEventTabDlg; 2114 } 2115 #endif 2072 2116 switch (fcn) 2073 2117 { … … 2079 2123 case mnuUserSendMsg: 2080 2124 { 2081 e = new UserSendMsgEvent(licqDaemon, licqSigMan, this, nUin );2125 e = new UserSendMsgEvent(licqDaemon, licqSigMan, this, nUin, parent); 2082 2126 break; 2083 2127 } 2084 2128 case mnuUserSendUrl: 2085 2129 { 2086 e = new UserSendUrlEvent(licqDaemon, licqSigMan, this, nUin );2130 e = new UserSendUrlEvent(licqDaemon, licqSigMan, this, nUin, parent); 2087 2131 break; 2088 2132 } 2089 2133 case mnuUserSendChat: 2090 2134 { 2091 e = new UserSendChatEvent(licqDaemon, licqSigMan, this, nUin );2135 e = new UserSendChatEvent(licqDaemon, licqSigMan, this, nUin, parent); 2092 2136 break; 2093 2137 } 2094 2138 case mnuUserSendFile: 2095 2139 { 2096 e = new UserSendFileEvent(licqDaemon, licqSigMan, this, nUin );2140 e = new UserSendFileEvent(licqDaemon, licqSigMan, this, nUin, parent); 2097 2141 break; 2098 2142 } 2099 2143 case mnuUserSendContact: 2100 2144 { 2101 e = new UserSendContactEvent(licqDaemon, licqSigMan, this, nUin );2145 e = new UserSendContactEvent(licqDaemon, licqSigMan, this, nUin, parent); 2102 2146 break; 2103 2147 } 2104 2148 case mnuUserSendSms: 2105 2149 { 2106 e = new UserSendSmsEvent(licqDaemon, licqSigMan, this, nUin );2150 e = new UserSendSmsEvent(licqDaemon, licqSigMan, this, nUin, parent); 2107 2151 break; 2108 2152 } … … 2110 2154 gLog.Warn("%sunknown callFunction() fcn: %d\n", L_WARNxSTR, fcn); 2111 2155 } 2112 if(e) { 2113 connect(e, SIGNAL(viewurl(QWidget*, QString)), this, SLOT(slot_viewurl(QWidget *, QString))); 2156 if (e == NULL) return NULL; 2157 2158 connect(e, SIGNAL(viewurl(QWidget*, QString)), this, SLOT(slot_viewurl(QWidget *, QString))); 2159 #if QT_VERSION >= 300 2160 if (m_bTabbedChatting && fcn != mnuUserView) 2161 { 2162 userEventTabDlg->addTab(e); 2163 userEventTabDlg->show(); 2164 } 2165 else 2166 #endif 2114 2167 e->show(); 2115 // there might be more than one send window open 2116 // make sure we only remember one, or it will get compliated 2117 if (fcn == mnuUserView) 2118 { 2119 slot_userfinished(nUin); 2120 connect(e, SIGNAL(finished(unsigned long)), SLOT(slot_userfinished(unsigned long))); 2121 licqUserView.append(static_cast<UserViewEvent*>(e)); 2122 } 2123 else 2124 { 2125 slot_sendfinished(nUin); 2126 connect(e, SIGNAL(finished(unsigned long)), SLOT(slot_sendfinished(unsigned long))); 2127 licqUserSend.append(static_cast<UserSendCommon*>(e)); 2128 } 2129 } 2130 2168 2169 // there might be more than one send window open 2170 // make sure we only remember one, or it will get complicated 2171 if (fcn == mnuUserView) 2172 { 2173 slot_userfinished(nUin); 2174 connect(e, SIGNAL(finished(unsigned long)), SLOT(slot_userfinished(unsigned long))); 2175 licqUserView.append(static_cast<UserViewEvent*>(e)); 2176 } 2177 else 2178 { 2179 slot_sendfinished(nUin); 2180 connect(e, SIGNAL(finished(unsigned long)), SLOT(slot_sendfinished(unsigned long))); 2181 licqUserSend.append(static_cast<UserSendCommon*>(e)); 2182 } 2131 2183 return e; 2132 2184 } … … 2156 2208 2157 2209 // ----------------------------------------------------------------------------- 2210 #if QT_VERSION >= 300 2211 void CMainWindow::slot_doneUserEventTabDlg() 2212 { 2213 userEventTabDlg = NULL; 2214 } 2215 #endif 2158 2216 2159 2217 void CMainWindow::slot_userfinished(unsigned long nUin) … … 2184 2242 QPtrListIterator<UserSendCommon> it(licqUserSend); 2185 2243 #endif 2186 2187 2244 // go through the whole list, there might be more than 2188 2245 // one hit … … 2582 2639 licqConf.WriteBool("SendFromClipboard", m_bSendFromClipboard); 2583 2640 licqConf.WriteBool("MsgChatView", m_bMsgChatView); 2641 licqConf.WriteBool("TabbedChatting", m_bTabbedChatting); 2584 2642 licqConf.WriteBool("AutoPosReplyWin", m_bAutoPosReplyWin); 2585 2643 licqConf.WriteBool("AutoSendThroughServer", m_bAutoSendThroughServer); -
trunk/qt-gui/src/mainwin.h
r3376 r3437 50 50 class CICQSignal; 51 51 class UserInfoDlg; 52 #if QT_VERSION >= 300 53 class UserEventTabDlg; 54 #endif 52 55 53 56 #if QT_VERSION < 300 … … 119 122 m_bPopOnlineSince, 120 123 m_bPopIdleTime, 121 m_bShowAllEncodings; 124 m_bShowAllEncodings, 125 m_bTabbedChatting; 122 126 123 127 QString m_MsgAutopopupKey; … … 150 154 OptionsDlg *optionsDlg; 151 155 RegisterUserDlg *registerUserDlg; 156 #if QT_VERSION >= 300 157 UserEventTabDlg *userEventTabDlg; 158 #endif 152 159 153 160 // Widgets … … 293 300 void slot_aboutToQuit(); 294 301 void UserInfoDlg_finished(unsigned long); 302 #if QT_VERSION >= 300 303 void slot_doneUserEventTabDlg(); 304 #endif 295 305 296 306 signals: -
trunk/qt-gui/src/optionsdlg.cpp
r3380 r3437 208 208 chkSendFromClipboard->setChecked(mainwin->m_bSendFromClipboard); 209 209 chkMsgChatView->setChecked( mainwin->m_bMsgChatView ); 210 #if QT_VERSION >= 300 211 chkTabbedChatting->setChecked(mainwin->m_bTabbedChatting); 212 #endif 210 213 chkAutoPosReplyWin->setChecked(mainwin->m_bAutoPosReplyWin); 211 214 chkAutoSendThroughServer->setChecked(mainwin->m_bAutoSendThroughServer); … … 459 462 mainwin->m_bSendFromClipboard = chkSendFromClipboard->isChecked(); 460 463 mainwin->m_bMsgChatView = chkMsgChatView->isChecked(); 464 #if QT_VERSION >= 300 465 mainwin->m_bTabbedChatting = chkTabbedChatting->isChecked(); 466 #endif 461 467 mainwin->m_bAutoPosReplyWin = chkAutoPosReplyWin->isChecked(); 462 468 mainwin->m_bAutoSendThroughServer = chkAutoSendThroughServer->isChecked(); … … 710 716 QWhatsThis::add(chkMsgChatView, tr("Show the current chat history in Send Window")); 711 717 718 #if QT_VERSION >= 300 719 chkTabbedChatting = new QCheckBox(tr("Tabbed Chatting"), boxMainWin); 720 QWhatsThis::add(chkTabbedChatting, tr("Use tabs in Send Window")); 721 connect(chkMsgChatView, SIGNAL(toggled(bool)), this, SLOT(slot_useMsgChatView(bool))); 722 #endif 723 712 724 l = new QVBoxLayout(l); 713 725 boxLocale = new QGroupBox(1, Horizontal, tr("Localization"), w); … … 974 986 spnPortLow->setEnabled(b); 975 987 spnPortHigh->setEnabled(b); 988 } 989 990 void OptionsDlg::slot_useMsgChatView(bool b) 991 { 992 if (!b) chkTabbedChatting->setChecked(false); 993 chkTabbedChatting->setEnabled(b); 976 994 } 977 995 -
trunk/qt-gui/src/optionsdlg.h
r3376 r3437 78 78 *chkAlwaysShowONU, *chkScrollBar, *chkShowExtIcons, 79 79 *chkSysBack, *chkSendFromClipboard, *chkMsgChatView, *chkAutoPosReplyWin, 80 *chkAutoSendThroughServer, 80 *chkAutoSendThroughServer, *chkTabbedChatting, 81 81 *chkEnableMainwinMouseMovement; 82 82 QRadioButton *rdbDockDefault, *rdbDockThemed; … … 146 146 void slot_useFirewall(bool); 147 147 void slot_usePortRange(bool b); 148 void slot_useMsgChatView(bool); 148 149 void slot_ok(); 149 150 }; -
trunk/qt-gui/src/usereventdlg.cpp
r3429 r3437 38 38 #include <qtextcodec.h> 39 39 #include <qwhatsthis.h> 40 #include <qtabwidget.h> 40 41 41 42 #ifdef USE_KDE … … 72 73 #include "xpm/chatChangeFg.xpm" 73 74 #include "xpm/chatChangeBg.xpm" 75 76 // ----------------------------------------------------------------------------- 77 #if QT_VERSION >= 300 78 UserEventTabDlg::UserEventTabDlg(QWidget *parent, const char *name) 79 : QWidget(parent, name, WDestructiveClose) 80 { 81 QBoxLayout *lay = new QVBoxLayout(this); 82 tabw = new QTabWidget(this); 83 lay->addWidget(tabw); 84 connect(tabw, SIGNAL(currentChanged(QWidget *)), 85 this, SLOT(updateTitle(QWidget *))); 86 connect(tabw, SIGNAL(currentChanged(QWidget *)), 87 this, SLOT(clearEvents(QWidget *))); 88 } 89 90 UserEventTabDlg::~UserEventTabDlg() 91 { 92 emit signal_done(); 93 } 94 95 void UserEventTabDlg::addTab(UserEventCommon *tab, int index) 96 { 97 QString label; 98 ICQUser *u = gUserManager.FetchUser(tab->Uin(), LOCK_W); 99 if (u == NULL) return; 100 101 // initalize codec 102 QTextCodec *codec = QTextCodec::codecForLocale(); 103 label = codec->toUnicode(u->GetAlias()); 104 tabw->insertTab(tab, label, index); 105 updateTabLabel(u); 106 gUserManager.DropUser(u); 107 tabw->showPage(tab); 108 } 109 110 void UserEventTabDlg::removeTab(QWidget *tab) 111 { 112 if (tabw->count() > 1) 113 { 114 tabw->removePage(tab); 115 tab->close(true); 116 } 117 else 118 close(); 119 } 120 121 void UserEventTabDlg::selectTab(QWidget *tab) 122 { 123 tabw->showPage(tab); 124 updateTitle(tab); 125 } 126 127 void UserEventTabDlg::replaceTab(QWidget *oldTab, 128 UserEventCommon *newTab) 129 { 130 addTab(newTab, tabw->indexOf(oldTab)); 131 removeTab(oldTab); 132 } 133 134 bool UserEventTabDlg::tabIsSelected(QWidget *tab) 135 { 136 if (tabw->currentPageIndex() == tabw->indexOf(tab)) 137 return true; 138 else 139 return false; 140 } 141 142 bool UserEventTabDlg::tabExists(QWidget *tab) 143 { 144 if (tabw->indexOf(tab) != -1) 145 return true; 146 else return false; 147 } 148 149 void UserEventTabDlg::updateTabLabel(ICQUser *u) 150 { 151 for (int index = 0; index < tabw->count(); index++) 152 { 153 UserEventCommon *tab = static_cast<UserEventCommon*>(tabw->page(index)); 154 if (tab->Uin() == u->Uin()) 155 { 156 if (u->NewMessages() > 0) 157 { 158 // use an event icon 159 unsigned short SubCommand = 0; 160 for (unsigned short i = 0; i < u->NewMessages(); i++) 161 { 162 switch(u->EventPeek(i)->SubCommand()) 163 { 164 case ICQ_CMDxSUB_FILE: 165 SubCommand = ICQ_CMDxSUB_FILE; 166 break; 167 case ICQ_CMDxSUB_CHAT: 168 if (SubCommand != ICQ_CMDxSUB_FILE) SubCommand = ICQ_CMDxSUB_CHAT; 169 break; 170 case ICQ_CMDxSUB_URL: 171 if (SubCommand != ICQ_CMDxSUB_FILE && SubCommand != ICQ_CMDxSUB_CHAT) 172 SubCommand = ICQ_CMDxSUB_URL; 173 break; 174 case ICQ_CMDxSUB_CONTACTxLIST: 175 if(SubCommand != ICQ_CMDxSUB_FILE && SubCommand != ICQ_CMDxSUB_CHAT 176 && SubCommand != ICQ_CMDxSUB_URL) 177 SubCommand = ICQ_CMDxSUB_CONTACTxLIST; 178 case ICQ_CMDxSUB_MSG: 179 default: 180 if (SubCommand == 0) SubCommand = ICQ_CMDxSUB_MSG; 181 break; 182 } 183 } 184 if(SubCommand) 185 tabw->setTabIconSet(tab, CMainWindow::iconForEvent(SubCommand)); 186 } 187 // use status icon 188 else tabw->setTabIconSet(tab, CMainWindow::iconForStatus(u->StatusFull())); 189 return; 190 } 191 } 192 } 193 194 void UserEventTabDlg::updateTitle(QWidget *tab) 195 { 196 if (tab->caption()) 197 setCaption(tab->caption()); 198 } 199 200 void UserEventTabDlg::clearEvents(QWidget *tab) 201 { 202 if (!isActiveWindow()) return; 203 UserEventCommon *e = static_cast<UserEventCommon*>(tab); 204 ICQUser *u = gUserManager.FetchUser(e->Uin(), LOCK_R); 205 if (u != NULL && u->NewMessages() > 0) 206 { 207 std::vector<int> idList; 208 for (unsigned short i = 0; i < u->NewMessages(); i++) 209 { 210 CUserEvent *e = u->EventPeek(i); 211 if (e->Direction() == D_RECEIVER && e->SubCommand() == ICQ_CMDxSUB_MSG) 212 idList.push_back(e->Id()); 213 } 214 215 for (unsigned short i = 0; i < idList.size(); i++) 216 u->EventClearId(idList[i]); 217 } 218 gUserManager.DropUser(u); 219 } 220 221 void UserEventTabDlg::moveLeft() 222 { 223 int index = tabw->currentPageIndex(); 224 if (index > 0) 225 tabw->setCurrentPage(index - 1); 226 } 227 228 void UserEventTabDlg::moveRight() 229 { 230 int index = tabw->currentPageIndex(); 231 if (index < tabw->count() - 1) 232 tabw->setCurrentPage(index + 1); 233 } 234 #endif 74 235 75 236 // ----------------------------------------------------------------------------- … … 246 407 codec->toUnicode(u->GetFirstName()) + " " + 247 408 codec->toUnicode(u->GetLastName())+ ")"; 409 #if QT_VERSION >= 300 410 if (mainwin->userEventTabDlg && 411 mainwin->userEventTabDlg->tabIsSelected(this)) 412 mainwin->userEventTabDlg->setCaption(m_sBaseTitle); 413 #endif 248 414 setCaption(m_sBaseTitle); 249 415 setIconText(codec->toUnicode(u->GetAlias())); … … 945 1111 QAccel *a = new QAccel( this ); 946 1112 a->connectItem(a->insertItem(Key_Escape), this, SLOT(cancelSend())); 1113 #if QT_VERSION >= 300 1114 if (mainwin->userEventTabDlg && 1115 parent == mainwin->userEventTabDlg) 1116 { 1117 a->connectItem(a->insertItem(ALT + Key_Left), 1118 mainwin->userEventTabDlg, SLOT(moveLeft())); 1119 a->connectItem(a->insertItem(ALT + Key_Right), 1120 mainwin->userEventTabDlg, SLOT(moveRight())); 1121 } 1122 #endif 947 1123 948 1124 QGroupBox *box = new QGroupBox(this); … … 1011 1187 mleHistory=0; 1012 1188 if (mainwin->m_bMsgChatView) { 1013 mleHistory = new CMessageViewWidget(_nUin, splView);1189 mleHistory = new CMessageViewWidget(_nUin, mainwin, splView); 1014 1190 #if QT_VERSION >= 300 1015 1191 connect(mleHistory, SIGNAL(viewurl(QWidget*, QString)), mainwin, SLOT(slot_viewurl(QWidget *, QString))); … … 1042 1218 void UserSendCommon::windowActivationChange(bool oldActive) 1043 1219 { 1044 if (isActiveWindow() && mainwin->m_bMsgChatView) 1045 { 1220 if (isActiveWindow() && mainwin->m_bMsgChatView && 1221 (!mainwin->userEventTabDlg || 1222 (mainwin->userEventTabDlg && 1223 (!mainwin->userEventTabDlg->tabExists(this) || 1224 mainwin->userEventTabDlg->tabIsSelected(this))))) 1225 { 1046 1226 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R); 1047 1227 if (u != NULL && u->NewMessages() > 0) … … 1063 1243 } 1064 1244 #endif 1245 1246 //-----UserSendCommon::slot_resettitle--------------------------------------- 1247 void UserSendCommon::slot_resettitle() 1248 { 1249 #if QT_VERSION >= 300 1250 if (mainwin->userEventTabDlg && 1251 mainwin->userEventTabDlg->tabIsSelected(this)) 1252 mainwin->userEventTabDlg->setCaption(m_sBaseTitle); 1253 #endif 1254 setCaption(m_sBaseTitle); 1255 } 1065 1256 1066 1257 //-----UserSendCommon::slot_SetForegroundColor------------------------------- … … 1116 1307 { 1117 1308 UserSendCommon* e = NULL; 1309 QWidget *parent = NULL; 1310 #if QT_VERSION >= 300 1311 if (mainwin->userEventTabDlg && 1312 mainwin->userEventTabDlg->tabIsSelected(this)) 1313 parent = mainwin->userEventTabDlg; 1314 #endif 1118 1315 switch(id) 1119 1316 { 1120 1317 case 0: 1121 e = new UserSendMsgEvent(server, sigman, mainwin, m_nUin );1318 e = new UserSendMsgEvent(server, sigman, mainwin, m_nUin, parent); 1122 1319 break; 1123 1320 case 1: 1124 e = new UserSendUrlEvent(server, sigman, mainwin, m_nUin );1321 e = new UserSendUrlEvent(server, sigman, mainwin, m_nUin, parent); 1125 1322 break; 1126 1323 case 2: 1127 e = new UserSendChatEvent(server, sigman, mainwin, m_nUin );1324 e = new UserSendChatEvent(server, sigman, mainwin, m_nUin, parent); 1128 1325 break; 1129 1326 case 3: 1130 e = new UserSendFileEvent(server, sigman, mainwin, m_nUin );1327 e = new UserSendFileEvent(server, sigman, mainwin, m_nUin, parent); 1131 1328 break; 1132 1329 case 4: 1133 e = new UserSendContactEvent(server, sigman, mainwin, m_nUin );1330 e = new UserSendContactEvent(server, sigman, mainwin, m_nUin, parent); 1134 1331 break; 1135 1332 case 5: 1136 e = new UserSendSmsEvent(server, sigman, mainwin, m_nUin );1333 e = new UserSendSmsEvent(server, sigman, mainwin, m_nUin, parent); 1137 1334 break; 1138 1335 } … … 1140 1337 if (e != NULL) 1141 1338 { 1142 QPoint p = topLevelWidget()->pos();1143 1339 if (e->mleSend && mleSend) 1144 1340 { … … 1150 1346 e->mleHistory->GotoEnd(); 1151 1347 } 1152 e->move(p); 1348 1349 if (!parent) 1350 { 1351 QPoint p = topLevelWidget()->pos(); 1352 e->move(p); 1353 } 1153 1354 1154 1355 disconnect(this, SIGNAL(finished(unsigned long)), mainwin, SLOT(slot_sendfinished(unsigned long))); … … 1159 1360 emit signal_msgtypechanged(this, e); 1160 1361 1161 QTimer::singleShot( 10, e, SLOT( show() ) ); 1162 1163
