[Konversation-devel] [Bug 132094] show DCC SEND status events in channel
Shintaro Matsuoka
shin at shoegazed.org
Mon Aug 14 23:45:44 CEST 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=132094
------- Additional Comments From shin shoegazed org 2006-08-14 23:45 -------
SVN commit 573107 by shin:
add a DCC SEND notification message: notify user when the receiver accepts a transfer.
CCBUG: 132094
M +2 -1 dcctransfer.cpp
M +1 -1 dcctransfer.h
M +14 -5 server.cpp
M +1 -1 server.h
--- trunk/extragear/network/konversation/src/dcctransfer.cpp #573106:573107
@ -335,10 +335,11 @
void DccTransfer::setStatus( DccStatus status, const QString& statusDetail )
{
bool changed = ( status != m_dccStatus );
+ DccStatus oldStatus = m_dccStatus;
m_dccStatus = status;
m_dccStatusDetail = statusDetail;
if ( changed )
- emit statusChanged( this );
+ emit statusChanged( this, m_dccStatus, oldStatus );
}
void DccTransfer::updateTransferMeters()
--- trunk/extragear/network/konversation/src/dcctransfer.h #573106:573107
@ -99,7 +99,7 @
signals:
void done( const QString& filename, int status = DccTransfer::Done, const QString& errorMessage = QString::null );
- void statusChanged( const DccTransfer* item );
+ void statusChanged( const DccTransfer* item, int newStatus, int oldStatus );
public slots:
virtual void start() = 0;
--- trunk/extragear/network/konversation/src/server.cpp #573106:573107
@ -1767,8 +1767,8 @
connect(newDcc,SIGNAL (sendReady(const QString&,const QString&,const QString&,const QString&,unsigned long)),
this,SLOT (dccSendRequest(const QString&,const QString&,const QString&,const QString&,unsigned long)) );
connect(newDcc,SIGNAL (done(const QString&,int,const QString&)),this,SLOT (dccSendDone(const QString&,int,const QString&)) );
- connect(newDcc,SIGNAL (statusChanged(const DccTransfer* )), this,
- SLOT(dccStatusChanged(const DccTransfer*)) );
+ connect(newDcc,SIGNAL (statusChanged(const DccTransfer*,int,int)), this,
+ SLOT(dccStatusChanged(const DccTransfer*,int,int)) );
newDcc->start();
}
@ -1803,8 +1803,8 @
SLOT (dccResumeGetRequest(const QString&,const QString&,const QString&,KIO::filesize_t)) );
connect(newDcc,SIGNAL (done(const QString&,int,const QString&)),
this,SLOT (dccGetDone(const QString&,int,const QString&)) );
- connect(newDcc,SIGNAL (statusChanged(const DccTransfer* )), this,
- SLOT(dccStatusChanged(const DccTransfer*)) );
+ connect(newDcc,SIGNAL (statusChanged(const DccTransfer*,int,int)), this,
+ SLOT(dccStatusChanged(const DccTransfer*,int,int)) );
if(Preferences::dccAutoGet()) newDcc->start();
}
@ -1921,9 +1921,18 @
appendMessageToFrontmost(i18n("DCC"),i18n("DCC upload of file \"%1\" failed. reason: %2").arg(fileName).arg(errorMessage));
}
-void Server::dccStatusChanged(const DccTransfer *item)
+void Server::dccStatusChanged(const DccTransfer *item, int newStatus, int oldStatus)
{
getMainWindow()->getDccPanel()->dccStatusChanged(item);
+
+ if ( item->getType() == DccTransfer::Send )
+ {
+ if ( newStatus == DccTransfer::Sending && oldStatus == DccTransfer::WaitingRemote )
+ appendMessageToFrontmost( i18n( "DCC" ), i18n( "DCC upload of file \"%1\" were accepted by %2." ).arg( item->getFileName(), item->getPartnerNick() ) );
+ }
+ else
+ {
+ }
}
void Server::removeQuery(class Query* query)
--- trunk/extragear/network/konversation/src/server.h #573106:573107
@ -471,7 +471,7 @
void dccResumeGetRequest(const QString& sender,const QString& fileName,const QString& port,KIO::filesize_t startAt);
void dccGetDone(const QString& fileName, int status, const QString &errorMessage);
void dccSendDone(const QString& fileName, int status, const QString &errorMessage);
- void dccStatusChanged(const DccTransfer* item);
+ void dccStatusChanged(const DccTransfer* item, int newStatus, int oldStatus);
void away();
void unAway();
void scriptNotFound(const QString& name);
More information about the Konversation-devel
mailing list