[prev in list] [next in list] [prev in thread] [next in thread]
List: licq-cvs
Subject: [Licq-cvs] qt-gui/src
From: Jon Keating <emostar () users ! sourceforge ! net>
Date: 2003-10-16 4:53:08
[Download RAW message or body]
Update of /cvsroot/licq/qt-gui/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1612
Modified Files:
mainwin.cpp mainwin.h randomchatdlg.cpp reqauthdlg.h
sigman.cpp sigman.h usereventdlg.cpp usereventdlg.h
userinfodlg.cpp userinfodlg.h
Log Message:
Patch from Juan to fix the deadlock mentioned on the ML.
Stuff from my tree that looks like it works. It's from July.. maybe it has bugs. Let \
me know if it's ok or not....
Index: mainwin.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/mainwin.cpp,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -d -r1.294 -r1.295
--- mainwin.cpp 9 Jul 2003 16:33:26 -0000 1.294
+++ mainwin.cpp 16 Oct 2003 04:53:05 -0000 1.295
@@ -599,8 +599,8 @@
this, SLOT(slot_logon()));
// connect (licqSigMan, SIGNAL(signal_ui_viewevent(unsigned long)),
// this, SLOT(slot_ui_viewevent(unsigned long)));
- connect (licqSigMan, SIGNAL(signal_ui_message(unsigned long)),
- this, SLOT(slot_ui_message(unsigned long)));
+ connect (licqSigMan, SIGNAL(signal_ui_message(const char *,unsigned long)),
+ this, SLOT(slot_ui_message(const char *, unsigned long)));
connect (licqSigMan, SIGNAL(signal_ui_viewevent(const char *)),
this, SLOT(slot_ui_viewevent(const char *)));
connect (licqSigMan, SIGNAL(signal_protocolPlugin(unsigned long)),
@@ -2124,184 +2124,7 @@
else
{
f = new UserInfoDlg(licqDaemon, licqSigMan, this, szId, nPPID);
- connect(f, SIGNAL(finished(const char *, unsigned long)), this,
- SLOT(UserInfoDlg_finished(const char *,unsigned long)));
- f->show();
- licqUserInfo.append(f);
- }
-
- switch(fcn)
- {
- case mnuUserHistory:
- f->showTab(UserInfoDlg::HistoryInfo);
- break;
- case mnuUserGeneral:
- f->showTab(UserInfoDlg::GeneralInfo);
- break;
- case mnuUserMore:
- f->showTab(UserInfoDlg::MoreInfo);
- break;
- case mnuUserWork:
- f->showTab(UserInfoDlg::WorkInfo);
- break;
- case mnuUserAbout:
- f->showTab(UserInfoDlg::AboutInfo);
- break;
- case mnuUserLast:
- f->showTab(UserInfoDlg::LastCountersInfo);
- break;
- }
- f->show();
- f->raise();
-}
-
-#ifdef QT_PROTOCOL_PLUGIN
-void CMainWindow::callInfoTab(int fcn, const char *szId, unsigned long nPPID,
- bool toggle)
-{
- if(szId == 0 || nPPID == 0) return;
-
- UserInfoDlg *f = NULL;
-#if QT_VERSION < 300
- QListIterator<UserInfoDlg> it(licqUserInfo);
-#else
- QPtrListIterator<UserInfoDlg> it(licqUserInfo);
-#endif
-
- for(; it.current(); ++it)
- {
- if(strcmp((*it)->Id(), szId) == 0 && (*it)->PPID() == nPPID)
- {
- f = *it;
- break;
- }
- }
-
- if (f)
- {
- int tab = UserInfoDlg::WorkInfo;
- switch(fcn) {
- case mnuUserHistory:
- tab = UserInfoDlg::HistoryInfo;
- break;
- case mnuUserGeneral:
- tab = UserInfoDlg::GeneralInfo;
- break;
- case mnuUserMore:
- tab = UserInfoDlg::MoreInfo;
- break;
- case mnuUserWork:
- tab = UserInfoDlg::WorkInfo;
- break;
- case mnuUserAbout:
- tab = UserInfoDlg::AboutInfo;
- break;
- case mnuUserLast:
- tab = UserInfoDlg::LastCountersInfo;
- break;
- }
- if(toggle && f->isTabShown(tab))
- {
- delete f; // will notify us about deletion
- return;
- }
- else {
- f->show();
- f->raise();
- }
- }
- else
- {
- f = new UserInfoDlg(licqDaemon, licqSigMan, this, szId, nPPID);
- connect(f, SIGNAL(finished(unsigned long)), this, SLOT(UserInfoDlg_finished(
-unsigned long)));
- f->show();
- licqUserInfo.append(f);
- }
-
- switch(fcn)
- {
- case mnuUserHistory:
- f->showTab(UserInfoDlg::HistoryInfo);
- break;
- case mnuUserGeneral:
- f->showTab(UserInfoDlg::GeneralInfo);
- break;
- case mnuUserMore:
- f->showTab(UserInfoDlg::MoreInfo);
- break;
- case mnuUserWork:
- f->showTab(UserInfoDlg::WorkInfo);
- break;
- case mnuUserAbout:
- f->showTab(UserInfoDlg::AboutInfo);
- break;
- case mnuUserLast:
- f->showTab(UserInfoDlg::LastCountersInfo);
- break;
- }
- f->show();
- f->raise();
-}
-#endif
-
-void CMainWindow::callInfoTab(int fcn, unsigned long nUin, bool toggle)
-{
- if(nUin == 0) return;
-
- UserInfoDlg *f = NULL;
-#if QT_VERSION < 300
- QListIterator<UserInfoDlg> it(licqUserInfo);
-#else
- QPtrListIterator<UserInfoDlg> it(licqUserInfo);
-#endif
-
- for(; it.current(); ++it)
- {
- if((*it)->Uin() == nUin)
- {
- f = *it;
- break;
- }
- }
-
- if (f)
- {
- int tab = UserInfoDlg::WorkInfo;
- switch(fcn) {
- case mnuUserHistory:
- tab = UserInfoDlg::HistoryInfo;
- break;
- case mnuUserGeneral:
- tab = UserInfoDlg::GeneralInfo;
- break;
- case mnuUserMore:
- tab = UserInfoDlg::MoreInfo;
- break;
- case mnuUserWork:
- tab = UserInfoDlg::WorkInfo;
- break;
- case mnuUserAbout:
- tab = UserInfoDlg::AboutInfo;
- break;
- case mnuUserLast:
- tab = UserInfoDlg::LastCountersInfo;
- break;
- }
- if(toggle && f->isTabShown(tab))
- {
- delete f; // will notify us about deletion
- return;
- }
- else {
- f->show();
- f->raise();
- }
- }
- else
- {
- f = new UserInfoDlg(licqDaemon, licqSigMan, this, nUin);
- connect(f, SIGNAL(finished(unsigned long)), this, \
SLOT(UserInfoDlg_finished(unsigned long))); + connect(f, SIGNAL(finished(const \
char *, unsigned long)), this, SLOT(UserInfoDlg_finished(const char *, unsigned \
long))); f->show();
licqUserInfo.append(f);
}
@@ -2503,190 +2326,6 @@
return e;
}
-//-----CMainWindow::callICQFunction-------------------------------------------
-UserEventCommon *CMainWindow::callFunction(int fcn, unsigned long nUin)
-{
- if (nUin == 0) return NULL;
-
- UserEventCommon *e = NULL;
-
- switch (fcn)
- {
- case mnuUserView:
- {
-#if QT_VERSION < 300
- QListIterator<UserViewEvent> it(licqUserView);
-#else
- QPtrListIterator<UserViewEvent> it(licqUserView);
-#endif
-
- for (; it.current(); ++it)
- if ((*it)->Uin() == nUin) {
- e = *it;
- e->show();
- if(!qApp->activeWindow() || \
!qApp->activeWindow()->inherits("UserEventCommon"))
- {
- e->raise();
-#ifdef USE_KDE
- KWin::setActiveWindow(e->winId());
-#endif
- }
- return e;
- }
- }
- break;
- case mnuUserSendMsg:
- case mnuUserSendUrl:
- case mnuUserSendChat:
- case mnuUserSendFile:
- case mnuUserSendContact:
- case mnuUserSendSms:
- {
-#if QT_VERSION < 300
- QListIterator<UserSendCommon> it(licqUserSend);
-#else
- QPtrListIterator<UserSendCommon> it(licqUserSend);
-#endif
-
- if (!m_bMsgChatView) break;
-
- UserSendCommon *e = NULL;
- for (; it.current(); ++it)
- if ((*it)->Uin() == nUin)
- {
- e = static_cast<UserSendCommon*>(*it);
-// e->changeEventType(fcn - 1);
- break;
- }
-
- if (e != NULL)
- {
-#if QT_VERSION < 300
- QListIterator<UserSendCommon> it(licqUserSend);
-#else
- QPtrListIterator<UserSendCommon> it(licqUserSend);
-#endif
- for (; it.current(); ++it)
- if ((*it)->Uin() == nUin)
- {
- e = static_cast<UserSendCommon*>(*it);
-#if QT_VERSION >= 300
- if (userEventTabDlg && userEventTabDlg->tabExists(e))
- {
- userEventTabDlg->show();
- userEventTabDlg->selectTab(e);
- userEventTabDlg->raise();
-
-#ifdef USE_KDE
- KWin::setActiveWindow(userEventTabDlg->winId());
-#endif
- }
- else
-#endif
- {
- e->show();
- if (!qApp->activeWindow() || \
!qApp->activeWindow()->inherits("UserEventCommon"))
- {
- e->raise();
-#ifdef USE_KDE
- KWin::setActiveWindow(e->winId());
-#endif
- }
- }
- return e;
- }
- }
- }
- default:
- break;
- }
-
- QWidget *parent = NULL;
-#if QT_VERSION >= 300
- if (m_bTabbedChatting)
- {
- if (userEventTabDlg != NULL)
- userEventTabDlg->raise();
- else
- {
- // create the tab dialog if it does not exist
- userEventTabDlg = new UserEventTabDlg();
- connect(userEventTabDlg, SIGNAL(signal_done()), this, \
SLOT(slot_doneUserEventTabDlg()));
- }
- parent = userEventTabDlg;
- }
-#endif
- switch (fcn)
- {
- case mnuUserView:
- {
- e = new UserViewEvent(licqDaemon, licqSigMan, this, nUin);
- break;
- }
- case mnuUserSendMsg:
- {
- e = new UserSendMsgEvent(licqDaemon, licqSigMan, this, nUin, parent);
- break;
- }
- case mnuUserSendUrl:
- {
- e = new UserSendUrlEvent(licqDaemon, licqSigMan, this, nUin, parent);
- break;
- }
- case mnuUserSendChat:
- {
- e = new UserSendChatEvent(licqDaemon, licqSigMan, this, nUin, parent);
- break;
- }
- case mnuUserSendFile:
- {
- e = new UserSendFileEvent(licqDaemon, licqSigMan, this, nUin, parent);
- break;
- }
- case mnuUserSendContact:
- {
- e = new UserSendContactEvent(licqDaemon, licqSigMan, this, nUin, parent);
- break;
- }
- case mnuUserSendSms:
- {
- e = new UserSendSmsEvent(licqDaemon, licqSigMan, this, nUin, parent);
- break;
- }
- default:
- gLog.Warn("%sunknown callFunction() fcn: %d\n", L_WARNxSTR, fcn);
- }
- if (e == NULL) return NULL;
-
- connect(e, SIGNAL(viewurl(QWidget*, QString)), this, SLOT(slot_viewurl(QWidget *, \
QString)));
-#if QT_VERSION >= 300
- if (m_bTabbedChatting && fcn != mnuUserView)
- {
- userEventTabDlg->addTab(e);
- userEventTabDlg->show();
- }
- else
-#endif
- e->show();
-
- // there might be more than one send window open
- // make sure we only remember one, or it will get complicated
- if (fcn == mnuUserView)
- {
- slot_userfinished(nUin);
- connect(e, SIGNAL(finished(unsigned long)), SLOT(slot_userfinished(unsigned \
long)));
- licqUserView.append(static_cast<UserViewEvent*>(e));
- }
- else
- {
- slot_sendfinished(nUin);
- connect(e, SIGNAL(finished(unsigned long)), SLOT(slot_sendfinished(unsigned \
long)));
- licqUserSend.append(static_cast<UserSendCommon*>(e));
- }
- return e;
-}
-
-
// -----------------------------------------------------------------------------
void CMainWindow::UserInfoDlg_finished(const char *szId, unsigned long nPPID)
{
@@ -2704,25 +2343,9 @@
return;
}
}
-}
-void CMainWindow::UserInfoDlg_finished(unsigned long nUin)
-{
-#if QT_VERSION < 300
- QListIterator<UserInfoDlg> it(licqUserInfo);
-#else
- QPtrListIterator<UserInfoDlg> it(licqUserInfo);
-#endif
-
- for( ; it.current(); ++it){
- if((*it)->Uin() == nUin) {
- licqUserInfo.remove(*it);
- return;
- }
- }
-
- gLog.Warn("%sUser Info finished signal for user with no window (%ld)!\n",
- L_WARNxSTR, nUin);
+ gLog.Warn("%sUser Info finished signal for user with no window (%s)!\n",
+ L_WARNxSTR, szId);
}
@@ -2753,26 +2376,6 @@
}
}
-void CMainWindow::slot_userfinished(unsigned long nUin)
-{
-#if QT_VERSION < 300
- QListIterator<UserViewEvent> it(licqUserView);
-#else
- QPtrListIterator<UserViewEvent> it(licqUserView);
-#endif
-
- for ( ; it.current(); ++it)
- {
- if ((*it)->Uin() == nUin)
- {
- licqUserView.remove(*it);
- return;
- }
- }
- //gLog.Warn("%sUser finished signal for user with no window (%ld)!\n",
- // L_WARNxSTR, nUin);
-}
-
void CMainWindow::slot_sendfinished(const char *szId, unsigned long nPPID)
{
#if QT_VERSION < 300
@@ -2788,21 +2391,6 @@
licqUserSend.remove(*it);
}
-void CMainWindow::slot_sendfinished(unsigned long nUin)
-{
-#if QT_VERSION < 300
- QListIterator<UserSendCommon> it(licqUserSend);
-#else
- QPtrListIterator<UserSendCommon> it(licqUserSend);
-#endif
- // go through the whole list, there might be more than
- // one hit
- for ( ; it.current(); ++it)
- if ((*it)->Uin() == nUin)
- licqUserSend.remove(*it);
-}
-
-
void CMainWindow::slot_shutdown()
{
licqDaemon->Shutdown();
@@ -2878,9 +2466,9 @@
}
//-----CMainWindow::slot_ui_message---------------------------------------------
-void CMainWindow::slot_ui_message(unsigned long nUin)
+void CMainWindow::slot_ui_message(const char *szId, unsigned long nPPID)
{
- callFunction(mnuUserSendMsg, nUin);
+ callFunction(mnuUserSendMsg, szId, nPPID);
}
//-----slot_protocolPlugin------------------------------------------------------
@@ -2963,10 +2551,13 @@
registerUserDlg = NULL;
if (e->Result() == EVENT_SUCCESS)
{
+ char sz[20];
+ //TODO which owner
+ sprintf(sz, "%lu", gUserManager.OwnerUin());
InformUser(this, tr("Successfully registered, your user identification\n"
"number (UIN) is %1.\n"
"Now set your personal \
information.").arg(gUserManager.OwnerUin()));
- callInfoTab(mnuUserGeneral, gUserManager.OwnerUin());
+ callInfoTab(mnuUserGeneral, sz, LICQ_PPID);
}
else
{
Index: mainwin.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/mainwin.h,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- mainwin.h 8 Jul 2003 11:37:52 -0000 1.112
+++ mainwin.h 16 Oct 2003 04:53:05 -0000 1.113
@@ -75,7 +75,6 @@
const char *skinName, const char *iconsName,
const char *extendedIconsName, QWidget *parent = 0);
virtual ~CMainWindow();
- UserEventCommon *callFunction(int fcn, unsigned long nUin);
bool RemoveUserFromList(unsigned long, QWidget *);
bool RemoveUserFromGroup(GroupType gtype, unsigned long group, unsigned long, \
QWidget *); UserEventCommon *callFunction(int fcn, const char *, unsigned long);
@@ -151,7 +150,6 @@
QString usprintfHelp;
public slots:
- void callInfoTab(int, unsigned long, bool toggle=false);
void callInfoTab(int, const char *, unsigned long, bool toggle=false);
public:
@@ -285,13 +283,10 @@
//void callUserFunction(const char *, unsigned long);
void slot_userfinished(const char *, unsigned long);
void slot_sendfinished(const char *, unsigned long);
- //void slot_ui_message(const char *, unsigned long);
- void slot_userfinished(unsigned long);
- void slot_sendfinished(unsigned long);
+ void slot_ui_message(const char *, unsigned long);
void slot_usermenu();
void slot_logon();
//void slot_ui_viewevent(unsigned long);
- void slot_ui_message(unsigned long);
void slot_ui_viewevent(const char *);
void slot_protocolPlugin(unsigned long);
void slot_register();
@@ -327,7 +322,6 @@
void slot_updateAllUsersInGroup();
void slot_popupall();
void slot_aboutToQuit();
- void UserInfoDlg_finished(unsigned long);
void UserInfoDlg_finished(const char *, unsigned long);
void slot_doneUserEventTabDlg();
Index: randomchatdlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/randomchatdlg.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- randomchatdlg.cpp 16 Apr 2003 19:03:53 -0000 1.11
+++ randomchatdlg.cpp 16 Oct 2003 04:53:05 -0000 1.12
@@ -136,7 +136,8 @@
break;
default:
//TODO when CSearchAck changes
- mainwin->callFunction(mnuUserSendChat, e->SearchAck()->Uin());
+ mainwin->callFunction(mnuUserSendChat, e->SearchAck()->Id(),
+ e->SearchAck()->PPID() );
close();
return;
}
Index: reqauthdlg.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/reqauthdlg.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- reqauthdlg.h 2 Jul 2003 04:41:02 -0000 1.5
+++ reqauthdlg.h 16 Oct 2003 04:53:05 -0000 1.6
@@ -16,7 +16,7 @@
Q_OBJECT
public:
ReqAuthDlg (CICQDaemon *s, unsigned long nUin = 0, QWidget *parent = 0);
- ReqAuthDlg(CICQDaemon *s, const char *szId, unsigned long nPPID,
+ ReqAuthDlg(CICQDaemon *s, const char *szId, unsigned long nPPID,
QWidget *parent = 0);
protected:
Index: sigman.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/sigman.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- sigman.cpp 2 Jul 2003 04:41:02 -0000 1.25
+++ sigman.cpp 16 Oct 2003 04:53:05 -0000 1.26
@@ -108,7 +108,7 @@
break;
case SIGNAL_UI_MESSAGE:
//TODO
- emit signal_ui_message(s->Uin());
+ emit signal_ui_message(s->Id(), s->PPID());
break;
case SIGNAL_ADDxSERVERxLIST:
//TODO
Index: sigman.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/sigman.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- sigman.h 2 Jul 2003 04:41:02 -0000 1.8
+++ sigman.h 16 Oct 2003 04:53:05 -0000 1.9
@@ -35,7 +35,7 @@
void signal_logoff();
void signal_ui_viewevent(unsigned long);
void signal_ui_viewevent(const char *);
- void signal_ui_message(unsigned long);
+ void signal_ui_message(const char *, unsigned long);
void signal_protocolPlugin(unsigned long);
// Event signals
Index: usereventdlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/usereventdlg.cpp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- usereventdlg.cpp 2 Jul 2003 15:58:31 -0000 1.134
+++ usereventdlg.cpp 16 Oct 2003 04:53:05 -0000 1.135
@@ -359,113 +359,6 @@
// -----------------------------------------------------------------------------
-UserEventCommon::UserEventCommon(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin,
- QWidget* parent, const char* name)
- : QWidget(parent, name, WDestructiveClose), m_highestEventId(-1)
-{
- char szUin[24];
- sprintf(szUin, "%lu", _nUin);
- m_szId = strdup(szUin);
- m_nPPID = LICQ_PPID;
-
- server = s;
- mainwin = m;
- sigman = theSigMan;
- m_nUin = _nUin;
- m_bOwner = (m_nUin == gUserManager.OwnerUin());
- m_bDeleteUser = false;
-
- top_hlay = new QHBoxLayout(this, 6);
- top_lay = new QVBoxLayout(top_hlay);
- top_hlay->setStretchFactor(top_lay, 1);
-
- // initalize codec
- codec = QTextCodec::codecForLocale();
-
- QBoxLayout *layt = new QHBoxLayout(top_lay, 8);
- layt->addWidget(new QLabel(tr("Status:"), this));
- nfoStatus = new CInfoField(this, true);
- nfoStatus->setMinimumWidth(nfoStatus->sizeHint().width()+30);
- layt->addWidget(nfoStatus);
- layt->addWidget(new QLabel(tr("Time:"), this));
- nfoTimezone = new CInfoField(this, true);
- nfoTimezone->setMinimumWidth(nfoTimezone->sizeHint().width()/2+10);
- layt->addWidget(nfoTimezone);
-
- popupEncoding = new QPopupMenu(this);
- btnSecure = new QPushButton(this);
- QToolTip::add(btnSecure, tr("Open / Close secure channel"));
- layt->addWidget(btnSecure);
- connect(btnSecure, SIGNAL(clicked()), this, SLOT(slot_security()));
- btnHistory = new QPushButton(this);
- btnHistory->setPixmap(mainwin->pmHistory);
- QToolTip::add(btnHistory, tr("Show User History"));
- connect(btnHistory, SIGNAL(clicked()), this, SLOT(showHistory()));
- layt->addWidget(btnHistory);
- btnInfo = new QPushButton(this);
- btnInfo->setPixmap(mainwin->pmInfo);
- QToolTip::add(btnInfo, tr("Show User Info"));
- connect(btnInfo, SIGNAL(clicked()), this, SLOT(showUserInfo()));
- layt->addWidget(btnInfo);
- btnEncoding = new QPushButton(this);
- btnEncoding->setPixmap(mainwin->pmEncoding);
- QToolTip::add(btnEncoding, tr("Change user text encoding"));
- QWhatsThis::add(btnEncoding, tr("This button selects the text encoding used when \
communicating with this user. You might need to change the encoding to communicate in \
a different language."));
- btnEncoding->setPopup(popupEncoding);
-
- layt->addWidget(btnEncoding);
-
- tmrTime = NULL;
-
- ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
- if (u != NULL)
- {
- nfoStatus->setData(u->StatusStr());
- if (u->NewMessages() == 0)
- setIcon(CMainWindow::iconForStatus(u->StatusFull()));
- else
- setIcon(CMainWindow::iconForEvent(ICQ_CMDxSUB_MSG));
- SetGeneralInfo(u);
-
- // restore prefered encoding
- codec = UserCodec::codecForICQUser(u);
-
- gUserManager.DropUser(u);
- }
-
- QString codec_name = QString::fromLatin1( codec->name() ).lower();
- popupEncoding->setCheckable(true);
-
- // populate the popup menu
- UserCodec::encoding_t *it = &UserCodec::m_encodings[0];
- while(it->encoding != NULL) {
-
- if (QString::fromLatin1(it->encoding).lower() == codec_name) {
- if (mainwin->m_bShowAllEncodings || it->isMinimal) {
- popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, \
SLOT(slot_setEncoding(int)), 0, it->mib);
- } else {
- // if the current encoding does not appear in the minimal list
- popupEncoding->insertSeparator(0);
- popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, \
SLOT(slot_setEncoding(int)), 0, it->mib, 0);
- }
- popupEncoding->setItemChecked(it->mib, true);
- } else {
- if (mainwin->m_bShowAllEncodings || it->isMinimal) {
- popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, \
SLOT(slot_setEncoding(int)), 0, it->mib);
- }
- }
-
- ++it;
- }
-
- connect (sigman, SIGNAL(signal_updatedUser(CICQSignal *)),
- this, SLOT(slot_userupdated(CICQSignal *)));
-
- mainWidget = new QWidget(this);
- top_lay->addWidget(mainWidget);
-}
-
void UserEventCommon::slot_setEncoding(int encodingMib) {
/* initialize a codec according to the encoding menu item id */
QString encoding( UserCodec::encodingForMib(encodingMib) );
@@ -745,128 +638,6 @@
connect(this, SIGNAL(encodingChanged()), this, SLOT(slot_setEncoding()));
}
-UserViewEvent::UserViewEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin, QWidget* parent)
- : UserEventCommon(s, theSigMan, m, _nUin, parent, "UserViewEvent")
-{
- QBoxLayout* lay = new QVBoxLayout(mainWidget);
- splRead = new QSplitter(Vertical, mainWidget);
- lay->addWidget(splRead);
- splRead->setOpaqueResize();
-
- QAccel *a = new QAccel( this );
- a->connectItem(a->insertItem(Key_Escape), this, SLOT(close()));
-
- msgView = new MsgView(splRead);
- mlvRead = new MLView(splRead, "mlvRead");
-#if QT_VERSION < 300
- mlvRead->setFormatQuoted(true);
-#else
- connect(mlvRead, SIGNAL(viewurl(QWidget*, QString)), mainwin, \
SLOT(slot_viewurl(QWidget *, QString)));
-#endif
- splRead->setResizeMode(msgView, QSplitter::FollowSizeHint);
- splRead->setResizeMode(mlvRead, QSplitter::Stretch);
-
- connect (msgView, SIGNAL(currentChanged(QListViewItem *)), this, \
SLOT(slot_printMessage(QListViewItem *)));
- connect (mainwin, SIGNAL(signal_sentevent(ICQEvent *)), this, \
SLOT(slot_sentevent(ICQEvent *)));
-
- QHGroupBox *h_action = new QHGroupBox(mainWidget);
- lay->addSpacing(10);
- lay->addWidget(h_action);
- btnRead1 = new CEButton(h_action);
- btnRead2 = new QPushButton(h_action);
- btnRead3 = new QPushButton(h_action);
- btnRead4 = new QPushButton(h_action);
-
- btnRead1->setEnabled(false);
- btnRead2->setEnabled(false);
- btnRead3->setEnabled(false);
- btnRead4->setEnabled(false);
-
- connect(btnRead1, SIGNAL(clicked()), this, SLOT(slot_btnRead1()));
- connect(btnRead2, SIGNAL(clicked()), this, SLOT(slot_btnRead2()));
- connect(btnRead3, SIGNAL(clicked()), this, SLOT(slot_btnRead3()));
- connect(btnRead4, SIGNAL(clicked()), this, SLOT(slot_btnRead4()));
-
- QBoxLayout *h_lay = new QHBoxLayout(top_lay, 4);
- if (!m_bOwner)
- {
- QPushButton *btnMenu = new QPushButton(tr("&Menu"), this);
- h_lay->addWidget(btnMenu);
- connect(btnMenu, SIGNAL(pressed()), this, SLOT(slot_usermenu()));
- btnMenu->setPopup(mainwin->UserMenu());
- chkAutoClose = new QCheckBox(tr("Aut&o Close"), this);
- chkAutoClose->setChecked(mainwin->m_bAutoClose);
- h_lay->addWidget(chkAutoClose);
- }
- h_lay->addStretch(1);
- int bw = 75;
- btnReadNext = new QPushButton(tr("Nex&t"), this);
- setTabOrder(btnRead4, btnReadNext);
- btnClose = new CEButton(tr("&Close"), this);
- QToolTip::add(btnClose, tr("Normal Click - Close Window\n<CTRL>+Click - also \
delete User"));
- setTabOrder(btnReadNext, btnClose);
- bw = QMAX(bw, btnReadNext->sizeHint().width());
- bw = QMAX(bw, btnClose->sizeHint().width());
- btnReadNext->setFixedWidth(bw);
- btnClose->setFixedWidth(bw);
- h_lay->addWidget(btnReadNext);
- btnReadNext->setEnabled(false);
- connect(btnReadNext, SIGNAL(clicked()), this, SLOT(slot_btnReadNext()));
- connect(btnClose, SIGNAL(clicked()), SLOT(slot_close()));
- h_lay->addWidget(btnClose);
-
- ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
- if (u != NULL && u->NewMessages() > 0)
- {
- unsigned short i;
- /*
- Create an item for the message we're currently viewing.
- */
- if (mainwin->m_bMsgChatView)
- {
- for (i = 0; i < u->NewMessages(); i++)
- if (u->EventPeek(i)->SubCommand() != ICQ_CMDxSUB_MSG)
- break;
- if (i == u->NewMessages())
- i = 0;
- }
- else
- i = 0;
-
- MsgViewItem *e = new MsgViewItem(u->EventPeek(i), codec, msgView);
- m_highestEventId = u->EventPeek(i)->Id();
- /*
- Create items for all the messages which already await
- in the queue. We cannot rely on getting CICQSignals for them
- since they might've arrived before the dialog appeared,
- possibly being undisplayed messages from previous licq session.
- */
- for (i++; i < u->NewMessages(); i++)
- {
- CUserEvent* event = u->EventPeek(i);
- if (!mainwin->m_bMsgChatView ||
- event->SubCommand() != ICQ_CMDxSUB_MSG)
- {
- new MsgViewItem(event, codec, msgView);
- // Make sure we don't add this message again, even if we'll
- // receive an userUpdated signal for it.
- if (m_highestEventId < event->Id())
- m_highestEventId = event->Id();
- }
- }
- gUserManager.DropUser(u);
- slot_printMessage(e);
- msgView->setSelected(e, true);
- msgView->ensureItemVisible(e);
- }
- else
- gUserManager.DropUser(u);
-
- connect(this, SIGNAL(encodingChanged()), this, SLOT(slot_setEncoding()));
-}
-
-
void UserViewEvent::slot_setEncoding() {
/* if we have an open view, refresh it */
if (this->msgView) {
@@ -1533,129 +1304,6 @@
connect(this, SIGNAL(updateUser(CICQSignal*)), mainwin, \
SLOT(slot_updatedUser(CICQSignal*))); }
-UserSendCommon::UserSendCommon(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin, QWidget* parent, \
const char* name)
- : UserEventCommon(s, theSigMan, m, _nUin, parent, name)
-{
- grpMR = NULL;
- tmpWidgetWidth = 0;
- m_bGrpMRIsVisible = false;
- clearDelay = 250;
-
- QAccel *a = new QAccel( this );
- a->connectItem(a->insertItem(Key_Escape), this, SLOT(cancelSend()));
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- parent == mainwin->userEventTabDlg)
- {
- a->connectItem(a->insertItem(ALT + Key_Left), mainwin->userEventTabDlg, \
SLOT(moveLeft()));
- a->connectItem(a->insertItem(ALT + Key_Right), mainwin->userEventTabDlg, \
SLOT(moveRight()));
- }
-#endif
-
- QGroupBox *box = new QGroupBox(this);
- top_lay->addWidget(box);
- QBoxLayout *vlay = new QVBoxLayout(box, 10, 5);
- QBoxLayout *hlay = new QHBoxLayout(vlay);
- chkSendServer = new QCheckBox(tr("Se&nd through server"), box);
- ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
- chkSendServer->setChecked(u->SendServer() || (u->StatusOffline() && \
u->SocketDesc() == -1));
-
- if( (u->GetInGroup(GROUPS_SYSTEM, GROUP_INVISIBLE_LIST)) ||
- (u->Port() == 0 && u->SocketDesc() == -1))
- {
- chkSendServer->setChecked(true);
- chkSendServer->setEnabled(false);
- }
- gUserManager.DropUser(u);
- hlay->addWidget(chkSendServer);
- chkUrgent = new QCheckBox(tr("U&rgent"), box);
- hlay->addWidget(chkUrgent);
- chkMass = new QCheckBox(tr("M&ultiple recipients"), box);
- hlay->addWidget(chkMass);
- connect(chkMass, SIGNAL(toggled(bool)), this, SLOT(massMessageToggled(bool)));
- btnForeColor = new QPushButton(box);
- btnForeColor->setPixmap(chatChangeFg_xpm);
- connect(btnForeColor, SIGNAL(clicked()), this, \
SLOT(slot_SetForegroundICQColor()));
- hlay->addWidget(btnForeColor);
- btnBackColor = new QPushButton(box);
- btnBackColor->setPixmap(chatChangeBg_xpm);
- connect(btnBackColor, SIGNAL(clicked()), this, \
SLOT(slot_SetBackgroundICQColor()));
- hlay->addWidget(btnBackColor);
-
- QBoxLayout *h_lay = new QHBoxLayout(top_lay);
- if (!m_bOwner)
- {
- QPushButton *btnMenu = new QPushButton(tr("&Menu"), this);
- h_lay->addWidget(btnMenu);
- connect(btnMenu, SIGNAL(pressed()), this, SLOT(slot_usermenu()));
- btnMenu->setPopup(mainwin->UserMenu());
- }
- cmbSendType = new QComboBox(this);
- cmbSendType->insertItem(tr("Message"));
- cmbSendType->insertItem(tr("URL"));
- cmbSendType->insertItem(tr("Chat Request"));
- cmbSendType->insertItem(tr("File Transfer"));
- cmbSendType->insertItem(tr("Contact List"));
- cmbSendType->insertItem(tr("SMS"));
- connect(cmbSendType, SIGNAL(activated(int)), this, SLOT(changeEventType(int)));
- h_lay->addWidget(cmbSendType);
- h_lay->addStretch(1);
- btnSend = new QPushButton(tr("&Send"), this);
- int w = QMAX(btnSend->sizeHint().width(), 75);
- // add a wrapper around the send button that
- // 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);
- btnSend->setFixedWidth(w);
- btnCancel->setFixedWidth(w);
- h_lay->addWidget(btnSend);
- h_lay->addWidget(btnCancel);
- connect(btnCancel, SIGNAL(clicked()), this, SLOT(cancelSend()));
- splView = new QSplitter(Vertical, mainWidget);
- //splView->setOpaqueResize();
- mleHistory=0;
- if (mainwin->m_bMsgChatView) {
- mleHistory = new CMessageViewWidget(_nUin, mainwin, splView);
- // add all unread messages.
- ICQUser *u = gUserManager.FetchUser(_nUin, LOCK_R);
- if (u != NULL && u->NewMessages() > 0)
- {
- for (unsigned short i = 0; i < u->NewMessages(); i++)
- {
- CUserEvent *e = u->EventPeek(i);
- if (e->Id() > m_highestEventId)
- m_highestEventId = e->Id();
-
- mleHistory->addMsg(e);
- }
- }
- gUserManager.DropUser(u);
-
-#if QT_VERSION >= 300
- connect(mleHistory, SIGNAL(viewurl(QWidget*, QString)), mainwin, \
SLOT(slot_viewurl(QWidget *, QString)));
-#endif
- connect (mainwin, SIGNAL(signal_sentevent(ICQEvent *)), mleHistory, \
SLOT(addMsg(ICQEvent *)));
- //splView->setResizeMode(mleHistory, QSplitter::FollowSizeHint);
- }
- mleSend = new MLEditWrap(true, splView, true);
- if (mainwin->m_bMsgChatView)
- {
- splView->setResizeMode(mleSend, QSplitter::KeepSize);
- mleSend->resize(mleSend->width(), 90);
- }
- setTabOrder(mleSend, btnSend);
- setTabOrder(btnSend, btnCancel);
- icqColor.SetToDefault();
- mleSend->setBackground(QColor(icqColor.BackRed(), icqColor.BackGreen(), \
icqColor.BackBlue()));
- mleSend->setForeground(QColor(icqColor.ForeRed(), icqColor.ForeGreen(), \
icqColor.ForeBlue()));
- connect (mleSend, SIGNAL(signal_CtrlEnterPressed()), btnSend, SIGNAL(clicked()));
- connect(this, SIGNAL(updateUser(CICQSignal*)), mainwin, \
SLOT(slot_updatedUser(CICQSignal*)));
-}
-
-
UserSendCommon::~UserSendCommon()
{
}
@@ -1775,7 +1423,7 @@
#endif
switch(id)
{
-#ifdef QT_PROTOCOL_PLUGIN
+
case 0:
e = new UserSendMsgEvent(server, sigman, mainwin, m_szId, m_nPPID);
break;
@@ -1794,26 +1442,6 @@
case 5:
e = new UserSendSmsEvent(server, sigman, mainwin, m_szId, m_nPPID);
break;
-#else
- case 0:
- e = new UserSendMsgEvent(server, sigman, mainwin, m_szId, m_nPPID, parent);
- break;
- case 1:
- e = new UserSendUrlEvent(server, sigman, mainwin, m_szId, m_nPPID, parent);
- break;
- case 2:
- e = new UserSendChatEvent(server, sigman, mainwin, m_szId, m_nPPID, parent);
- break;
- case 3:
- e = new UserSendFileEvent(server, sigman, mainwin, m_szId, m_nPPID, parent);
- break;
- case 4:
- e = new UserSendContactEvent(server, sigman, mainwin, m_szId, m_nPPID, parent);
- break;
- case 5:
- e = new UserSendSmsEvent(server, sigman, mainwin, m_szId, m_nPPID, parent);
- break;
-#endif
}
if (e != NULL)
@@ -1834,9 +1462,11 @@
e->move(p);
}
- disconnect(this, SIGNAL(finished(unsigned long)), mainwin, \
SLOT(slot_sendfinished(unsigned long)));
- mainwin->slot_sendfinished(m_nUin);
- connect(e, SIGNAL(finished(unsigned long)), mainwin, \
SLOT(slot_sendfinished(unsigned long))); + disconnect(this, SIGNAL(finished(const \
char *, unsigned long)), + mainwin, SLOT(slot_sendfinished(const char \
*,unsigned long))); + mainwin->slot_sendfinished(m_szId, m_nPPID);
+ connect(e, SIGNAL(finished(const char *, unsigned long)), mainwin,
+ SLOT(slot_sendfinished(const char *, unsigned long)));
mainwin->licqUserSend.append(e);
emit signal_msgtypechanged(this, e);
@@ -1876,14 +1506,9 @@
top_hlay->addWidget(grpMR);
(void) new QLabel(tr("Drag Users Here\nRight Click for Options"), grpMR);
-#ifdef QT_PROTOCOL_PLUGIN
//TODO in CMMUserView
lstMultipleRecipients = new CMMUserView(mainwin->colInfo, \
mainwin->m_bShowHeader,
strtoul(m_szId, (char **)NULL, 10), mainwin, \
grpMR);
-#else
- lstMultipleRecipients = new CMMUserView(mainwin->colInfo, \
mainwin->m_bShowHeader,
- m_nUin, mainwin, grpMR);
-#endif
lstMultipleRecipients->setFixedWidth(mainwin->UserView()->width());
}
grpMR->show();
@@ -2369,8 +1994,15 @@
bool UserSendCommon::checkSecure()
{
ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R);
+ if (u == 0)
+ return false;
+
+ bool secure = u->Secure() || u->AutoSecure();
bool send_ok = true;
- if (chkSendServer->isChecked() && ( u->Secure() || u->AutoSecure()) )
+
+ gUserManager.DropUser(u);
+
+ if (chkSendServer->isChecked() && secure)
{
if (!QueryUser(this, tr("Warning: Message can't be sent securely\n"
"through the server!"),
@@ -2379,9 +2011,13 @@
send_ok = false;
}
else
- u->SetAutoSecure( false );
+ {
+ ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R);
+ if (u)
+ u->SetAutoSecure(false);
+ gUserManager.DropUser(u);
+ }
}
- gUserManager.DropUser(u);
return send_ok;
}
@@ -2405,26 +2041,6 @@
cmbSendType->setCurrentItem(0);
}
-UserSendMsgEvent::UserSendMsgEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long nUin, QWidget *parent)
- : UserSendCommon(s, theSigMan, m, nUin, parent, "UserSendMsgEvent")
-{
- QBoxLayout* lay = new QVBoxLayout(mainWidget);
- lay->addWidget(splView);
- if (!m->m_bMsgChatView) mleSend->setMinimumHeight(150);
- mleSend->setFocus ();
-
- m_sBaseTitle += tr(" - Message");
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- mainwin->userEventTabDlg->tabIsSelected(this))
- mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
-#endif
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(0);
-}
-
-
UserSendMsgEvent::~UserSendMsgEvent()
{
}
@@ -2548,29 +2164,6 @@
massMessageToggled( false );
}
-//=====UserSendUrlEvent======================================================
-#ifdef QT_PROTOCOL_PLUGIN
-UserSendUrlEvent::UserSendUrlEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, const char *szId,
- unsigned long nPPID, QWidget* parent)
- : UserSendCommon(s, theSigMan, m, szId, nPPID, parent, "UserSendUrlEvent")
-{
- QBoxLayout* lay = new QVBoxLayout(mainWidget, 4);
- lay->addWidget(splView);
- mleSend->setFocus ();
-
- QBoxLayout* h_lay = new QHBoxLayout(lay);
- lblItem = new QLabel(tr("URL : "), mainWidget);
- h_lay->addWidget(lblItem);
- edtItem = new CInfoField(mainWidget, false);
- h_lay->addWidget(edtItem);
-
- m_sBaseTitle += tr(" - URL");
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(1);
-}
-#endif
-
UserSendUrlEvent::UserSendUrlEvent(CICQDaemon *s, CSignalManager *theSigMan,
CMainWindow *m, const char *szId,
unsigned long nPPID, QWidget* parent)
@@ -2596,31 +2189,6 @@
cmbSendType->setCurrentItem(1);
}
-UserSendUrlEvent::UserSendUrlEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin, QWidget* \
parent)
- : UserSendCommon(s, theSigMan, m, _nUin, parent, "UserSendUrlEvent")
-{
- QBoxLayout* lay = new QVBoxLayout(mainWidget, 4);
- lay->addWidget(splView);
- mleSend->setFocus ();
-
- QBoxLayout* h_lay = new QHBoxLayout(lay);
- lblItem = new QLabel(tr("URL : "), mainWidget);
- h_lay->addWidget(lblItem);
- edtItem = new CInfoField(mainWidget, false);
- h_lay->addWidget(edtItem);
-
- m_sBaseTitle += tr(" - URL");
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- mainwin->userEventTabDlg->tabIsSelected(this))
- mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
-#endif
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(1);
-}
-
-
UserSendUrlEvent::~UserSendUrlEvent()
{
}
@@ -2689,45 +2257,6 @@
return true;
}
-
-//=====UserSendFileEvent=====================================================
-#ifdef QT_PROTOCOL_PLUGIN
-UserSendFileEvent::UserSendFileEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, const char *szId,
- unsigned long nPPID, QWidget* parent)
- : UserSendCommon(s, theSigMan, m, szId, nPPID, parent, "UserSendFileEvent")
-{
- chkMass->setChecked(false);
- chkMass->setEnabled(false);
- btnForeColor->setEnabled(false);
- btnBackColor->setEnabled(false);
-
- QBoxLayout* lay = new QVBoxLayout(mainWidget, 4);
- lay->addWidget(splView);
-
- QBoxLayout* h_lay = new QHBoxLayout(lay);
- lblItem = new QLabel(tr("File(s): "), mainWidget);
- h_lay->addWidget(lblItem);
-
- edtItem = new CInfoField(mainWidget, false);
- edtItem->SetReadOnly(true);
- h_lay->addWidget(edtItem);
-
- btnBrowse = new QPushButton(tr("Browse"), mainWidget);
- connect(btnBrowse, SIGNAL(clicked()), this, SLOT(browseFile()));
- h_lay->addWidget(btnBrowse);
-
- btnEdit = new QPushButton(tr("Edit"), mainWidget);
- btnEdit->setEnabled(false);
- connect(btnEdit, SIGNAL(clicked()), this, SLOT(editFileList()));
- h_lay->addWidget(btnEdit);
-
- m_sBaseTitle += tr(" - File Transfer");
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(3);
-}
-#endif
-
UserSendFileEvent::UserSendFileEvent(CICQDaemon *s, CSignalManager *theSigMan,
CMainWindow *m, const char *szId,
unsigned long nPPID, QWidget* parent)
@@ -2768,46 +2297,6 @@
cmbSendType->setCurrentItem(3);
}
-UserSendFileEvent::UserSendFileEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin, QWidget* \
parent)
- : UserSendCommon(s, theSigMan, m, _nUin, parent, "UserSendFileEvent")
-{
- chkMass->setChecked(false);
- chkMass->setEnabled(false);
- btnForeColor->setEnabled(false);
- btnBackColor->setEnabled(false);
-
- QBoxLayout* lay = new QVBoxLayout(mainWidget, 4);
- lay->addWidget(splView);
-
- QBoxLayout* h_lay = new QHBoxLayout(lay);
- lblItem = new QLabel(tr("File(s): "), mainWidget);
- h_lay->addWidget(lblItem);
-
- edtItem = new CInfoField(mainWidget, false);
- edtItem->SetReadOnly(true);
- h_lay->addWidget(edtItem);
-
- btnBrowse = new QPushButton(tr("Browse"), mainWidget);
- connect(btnBrowse, SIGNAL(clicked()), this, SLOT(browseFile()));
- h_lay->addWidget(btnBrowse);
-
- btnEdit = new QPushButton(tr("Edit"), mainWidget);
- btnEdit->setEnabled(false);
- connect(btnEdit, SIGNAL(clicked()), this, SLOT(editFileList()));
- h_lay->addWidget(btnEdit);
-
- m_sBaseTitle += tr(" - File Transfer");
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- mainwin->userEventTabDlg->tabIsSelected(this))
- mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
-#endif
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(3);
-}
-
-
void UserSendFileEvent::browseFile()
{
#ifdef USE_KDE
@@ -2982,43 +2471,6 @@
cmbSendType->setCurrentItem(2);
}
-UserSendChatEvent::UserSendChatEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin, QWidget* \
parent)
- : UserSendCommon(s, theSigMan, m, _nUin, parent, "UserSendChatEvent")
-{
- m_nMPChatPort = 0;
- chkMass->setChecked(false);
- chkMass->setEnabled(false);
- btnForeColor->setEnabled(false);
- btnBackColor->setEnabled(false);
-
- QBoxLayout *lay = new QVBoxLayout(mainWidget, 9);
- lay->addWidget(splView);
-
- if (!m->m_bMsgChatView) mleSend->setMinimumHeight(150);
-
- QBoxLayout* h_lay = new QHBoxLayout(lay);
- lblItem = new QLabel(tr("Multiparty: "), mainWidget);
- h_lay->addWidget(lblItem);
-
- edtItem = new CInfoField(mainWidget, false);
- h_lay->addWidget(edtItem);
-
- btnBrowse = new QPushButton(tr("Invite"), mainWidget);
- connect(btnBrowse, SIGNAL(clicked()), this, SLOT(InviteUser()));
- h_lay->addWidget(btnBrowse);
-
- m_sBaseTitle += tr(" - Chat Request");
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- mainwin->userEventTabDlg->tabIsSelected(this))
- mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
-#endif
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(2);
-}
-
-
UserSendChatEvent::~UserSendChatEvent()
{
}
@@ -3125,32 +2577,7 @@
lay->addWidget(lblContact);
lstContacts = new CMMUserView(mainwin->colInfo, mainwin->m_bShowHeader,
- m_nUin, mainwin, mainWidget);
- lay->addWidget(lstContacts);
-
- m_sBaseTitle += tr(" - Contact List");
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- mainwin->userEventTabDlg->tabIsSelected(this))
- mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
-#endif
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(4);
-}
-
-UserSendContactEvent::UserSendContactEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long _nUin, \
QWidget* parent)
- : UserSendCommon(s, theSigMan, m, _nUin, parent, "UserSendContactEvent")
-{
- delete mleSend; mleSend = NULL;
-
- QBoxLayout* lay = new QVBoxLayout(mainWidget);
- lay->addWidget(splView);
- QLabel* lblContact = new QLabel(tr("Drag Users Here - Right Click for Options"), \
mainWidget);
- lay->addWidget(lblContact);
-
- lstContacts = new CMMUserView(mainwin->colInfo, mainwin->m_bShowHeader,
- m_nUin, mainwin, mainWidget);
+ m_szId, nPPID, mainwin, mainWidget);
lay->addWidget(lstContacts);
m_sBaseTitle += tr(" - Contact List");
@@ -3163,7 +2590,6 @@
cmbSendType->setCurrentItem(4);
}
-
UserSendContactEvent::~UserSendContactEvent()
{
}
@@ -3278,57 +2704,6 @@
connect(mleSend, SIGNAL(textChanged()), this, SLOT(slot_count()));
ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_W);
- if (u != NULL)
- {
- nfoNumber->setData(codec->toUnicode(u->GetCellularNumber()));
- gUserManager.DropUser(u);
- }
-
- m_sBaseTitle += tr(" - SMS");
-#if QT_VERSION >= 300
- if (mainwin->userEventTabDlg &&
- mainwin->userEventTabDlg->tabIsSelected(this))
- mainwin->userEventTabDlg->setCaption(m_sBaseTitle);
-#endif
- setCaption(m_sBaseTitle);
- cmbSendType->setCurrentItem(5);
-}
-
-UserSendSmsEvent::UserSendSmsEvent(CICQDaemon *s, CSignalManager *theSigMan,
- CMainWindow *m, unsigned long nUin, QWidget *parent)
- : UserSendCommon(s, theSigMan, m, nUin, parent, "UserSendSmsEvent")
-{
- chkSendServer->setChecked(true);
- chkSendServer->setEnabled(false);
- chkUrgent->setChecked(false);
- chkUrgent->setEnabled(false);
- chkMass->setChecked(false);
- chkMass->setEnabled(false);
- btnForeColor->setEnabled(false);
- btnBackColor->setEnabled(false);
- btnEncoding->setEnabled(false); // SMSs are always UTF-8
-
- QBoxLayout* lay = new QVBoxLayout(mainWidget, 4);
- lay->addWidget(splView);
- mleSend->setFocus();
-
- QBoxLayout* h_lay = new QHBoxLayout(lay);
- lblNumber = new QLabel(tr("Phone : "), mainWidget);
- h_lay->addWidget(lblNumber);
- nfoNumber = new CInfoField(mainWidget, false);
- h_lay->addWidget(nfoNumber);
- nfoNumber->setFixedWidth(QMAX(140, nfoNumber->sizeHint().width()));
- h_lay->addStretch(1);
- lblCount = new QLabel(tr("Chars left : "), mainWidget);
- h_lay->addWidget(lblCount);
- nfoCount = new CInfoField(mainWidget, false);
- h_lay->addWidget(nfoCount);
- nfoCount->setFixedWidth(40);
- nfoCount->setAlignment(AlignCenter);
- slot_count();
- connect(mleSend, SIGNAL(textChanged()), this, SLOT(slot_count()));
-
- ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);
if (u != NULL)
{
nfoNumber->setData(codec->toUnicode(u->GetCellularNumber()));
Index: usereventdlg.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/usereventdlg.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- usereventdlg.h 2 Jul 2003 04:41:02 -0000 1.56
+++ usereventdlg.h 16 Oct 2003 04:53:06 -0000 1.57
@@ -88,22 +88,17 @@
{
Q_OBJECT
public:
-
- UserEventCommon(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0, const char* name =0);
UserEventCommon(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0,
const char *name = 0);
virtual ~UserEventCommon();
- unsigned long Uin() { return m_nUin; }
char *Id() { return m_szId; }
unsigned long PPID() { return m_nPPID; }
protected:
QTextCodec *codec;
bool m_bOwner;
- unsigned long m_nUin;
char *m_szId;
unsigned long m_nPPID;
QBoxLayout* top_lay, *top_hlay;
@@ -133,13 +128,12 @@
void slot_updatetime();
void showHistory();
void showUserInfo();
- void slot_usermenu() { gMainWindow->SetUserMenuUin(m_nUin); }
+ void slot_usermenu() { gMainWindow->SetUserMenuUser(m_szId, m_nPPID); }
void slot_security();
void slot_setEncoding(int encodingMib);
signals:
void finished(const char *, unsigned long);
- void finished(unsigned long);
void encodingChanged();
void viewurl(QWidget*, QString);
};
@@ -153,8 +147,6 @@
public:
UserViewEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0);
- UserViewEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0);
virtual ~UserViewEvent();
@@ -201,8 +193,6 @@
public:
UserSendCommon(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0, const char* name=0);
- UserSendCommon(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0,
const char *name = 0);
virtual ~UserSendCommon();
@@ -292,8 +282,6 @@
public:
UserSendUrlEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0);
- UserSendUrlEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0);
virtual ~UserSendUrlEvent();
@@ -319,8 +307,6 @@
public:
UserSendFileEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0);
- UserSendFileEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0);
virtual ~UserSendFileEvent();
@@ -351,8 +337,6 @@
public:
UserSendChatEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0);
- UserSendChatEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0);
virtual ~UserSendChatEvent();
@@ -407,8 +391,6 @@
Q_OBJECT
public:
- UserSendSmsEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0);
UserSendSmsEvent(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *_szId, unsigned long _nPPID, QWidget *parent = 0);
virtual ~UserSendSmsEvent();
Index: userinfodlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/userinfodlg.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- userinfodlg.cpp 7 Jul 2003 21:13:00 -0000 1.72
+++ userinfodlg.cpp 16 Oct 2003 04:53:06 -0000 1.73
@@ -162,113 +162,7 @@
setTabOrder (btnMain3, btnMain4);
}
-UserInfoDlg::UserInfoDlg(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent)
- : QWidget(parent, "UserInfoDialog", WStyle_ContextHelp | WDestructiveClose)
-{
- server = s;
- mainwin = m;
- sigman = theSigMan;
- icqEventTag = 0;
- m_nUin = _nUin;
- m_bOwner = (m_nUin == gUserManager.OwnerUin());
-
- CreateGeneralInfo();
- CreateMoreInfo();
- CreateWorkInfo();
- CreateAbout();
- CreateHistory();
- CreateLastCountersInfo();
-
- QBoxLayout *lay = new QVBoxLayout(this, 8);
-
- tabs = new QTabWidget(this);
- lay->addWidget(tabs, 2);
-
- tabs->addTab(tabList[GeneralInfo].tab, tabList[GeneralInfo].label);
- tabs->addTab(tabList[MoreInfo].tab, tabList[MoreInfo].label);
- tabs->addTab(tabList[WorkInfo].tab, tabList[WorkInfo].label);
- tabs->addTab(tabList[AboutInfo].tab, tabList[AboutInfo].label);
- tabs->addTab(tabList[HistoryInfo].tab, tabList[HistoryInfo].label);
- tabs->addTab(tabList[LastCountersInfo].tab, tabList[LastCountersInfo].label);
-
- connect (tabs, SIGNAL(selected(const QString &)), this, SLOT(updateTab(const \
QString &)));
- connect (sigman, SIGNAL(signal_updatedUser(CICQSignal *)),
- this, SLOT(updatedUser(CICQSignal *)));
-
- btnMain4 = new QPushButton(tr("&Close"), this);
- connect(btnMain4, SIGNAL(clicked()), this, SLOT(close()));
-
- if (m_bOwner)
- {
- btnMain1 = new QPushButton(tr("&Save"), this);
- btnMain2 = new QPushButton(tr("&Retrieve"), this);
- btnMain3 = new QPushButton(tr("S&end"), this);
- connect(btnMain1, SIGNAL(clicked()), this, SLOT(SaveSettings()));
- connect(btnMain2, SIGNAL(clicked()), this, SLOT(slotRetrieve()));
- connect(btnMain3, SIGNAL(clicked()), this, SLOT(slotUpdate()));
- }
- else
- {
- btnMain1 = new QPushButton(tr("&Menu"), this);
- btnMain2 = new QPushButton(tr("&Save"), this);
- btnMain3 = new QPushButton(tr("&Update"), this);
- connect(btnMain1, SIGNAL(pressed()), this, SLOT(ShowUsermenu()));
- btnMain1->setPopup(gMainWindow->UserMenu());
- connect(btnMain2, SIGNAL(clicked()), this, SLOT(SaveSettings()));
- connect(btnMain3, SIGNAL(clicked()), this, SLOT(slotRetrieve()));
- }
-
- int bw = 80;
- bw = QMAX(bw, btnMain1->sizeHint().width());
- bw = QMAX(bw, btnMain2->sizeHint().width());
- bw = QMAX(bw, btnMain3->sizeHint().width());
- bw = QMAX(bw, btnMain4->sizeHint().width());
- btnMain1->setFixedWidth(bw);
- btnMain2->setFixedWidth(bw);
- btnMain3->setFixedWidth(bw);
- btnMain4->setFixedWidth(bw);
-
- QBoxLayout* l = new QHBoxLayout(lay);
-
- l->addWidget(btnMain1);
- l->addStretch(2);
- l->addWidget(btnMain2);
- l->addWidget(btnMain3);
- l->addSpacing(35);
- l->addWidget(btnMain4);
- btnMain4->setDefault(true);
-
- // prepare the timer for the history filter
- timer = new QTimer(this, "history_filterTimer");
- connect(timer, SIGNAL(timeout()), this, SLOT(ShowHistory()));
-
- ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);
- if (u == NULL)
- {
- m_sBasic = tr("Licq - Info ") + tr("INVALID USER");
- resetCaption();
- setIconText(tr("INVALID USER"));
- }
- else
- {
- QTextCodec * codec = UserCodec::codecForICQUser(u);
- m_sBasic = tr("Licq - Info ") + codec->toUnicode(u->GetAlias()) + " (" + \
codec->toUnicode(u->GetFirstName()) + " " + \
codec->toUnicode(u->GetLastName()) + ")";
- resetCaption();
- setIconText(codec->toUnicode(u->GetAlias()));
- gUserManager.DropUser(u);
- }
-
- // Set Tab Order
- setTabOrder (tabs, btnMain1);
- setTabOrder (btnMain1, btnMain2);
- setTabOrder (btnMain2, btnMain3);
- setTabOrder (btnMain3, btnMain4);
-}
-
-
// -----------------------------------------------------------------------------
-
UserInfoDlg::~UserInfoDlg()
{
if (icqEventTag != 0)
@@ -341,7 +235,7 @@
"Check this if you want to keep your \
changes to the Alias.")); lay->addMultiCellWidget(chkKeepAliasOnUpdate, CR, CR, \
3,4);
- lay->addWidget(new QLabel(tr("UIN:"), p), ++CR, 0);
+ lay->addWidget(new QLabel(tr("ID:"), p), ++CR, 0);
nfoUin = new CInfoField(p, true);
lay->addWidget(nfoUin, CR, 1);
lay->addWidget(new QLabel(tr("IP:"), p), CR, 3);
@@ -447,7 +341,7 @@
nfoEmailPrimary->setData(codec->toUnicode(u->GetEmailPrimary()));
nfoEmailSecondary->setData(codec->toUnicode(u->GetEmailSecondary()));
nfoEmailOld->setData(codec->toUnicode(u->GetEmailOld()));
- nfoUin->setData(u->Uin());
+ nfoUin->setData(u->IdString());
QString ip = QString(u->IpStr(buf));
if (u->Ip() != u->IntIp() && u->IntIp() != 0)
{
Index: userinfodlg.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/userinfodlg.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- userinfodlg.h 2 Jul 2003 04:41:02 -0000 1.23
+++ userinfodlg.h 16 Oct 2003 04:53:06 -0000 1.24
@@ -56,12 +56,9 @@
};
UserInfoDlg(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
- unsigned long _nUin, QWidget* parent = 0);
- UserInfoDlg(CICQDaemon *s, CSignalManager *theSigMan, CMainWindow *m,
const char *szId, unsigned long nPPID, QWidget *parent = 0);
virtual ~UserInfoDlg();
- unsigned long Uin() { return m_nUin; }
char *Id() { return m_szId; }
unsigned long PPID() { return m_nPPID; }
void showTab(int);
@@ -76,7 +73,6 @@
} tabList[InfoTabCount];
bool m_bOwner;
int currentTab;
- unsigned long m_nUin;
char *m_szId;
unsigned long m_nPPID;
QString m_sProgressMsg;
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
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