Bug 132094 - show DCC SEND status events in channel
Summary: show DCC SEND status events in channel
Status: RESOLVED WORKSFORME
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 00:15 UTC by Niek Beernink
Modified: 2010-07-01 16:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niek Beernink 2006-08-09 00:15:14 UTC
Version:           0.19+ #3119 (using KDE KDE 3.5.4)
Compiler:          gcc (GCC) 4.1.2 20060715 (prerelease) (Ubuntu 4.1.1-9ubuntu1)  
OS:                Linux

Currently when you send a file, you get a notification that the file has been offered but you get none about if it got accepted or when it is completed. In order to find that out, you have to switch to the DCC status window. Nothing wrong with that window, but it's kindof slow if you quickly want to know what the status of your file transfer is and don't want to switch to the transfer tab to check and then switch back.

In order to remove that step, I would like these status messages to also be printed to the server/channel/query tab I'm currently viewing. Hopefully this stops me (and other users) from having to guess what the status of the file transfer is without having to switch windows.

Possible scenarios;
[DCC] Offering "$file.ext" to $nickname for upload...
[DCC] "$file.ext" accepted by $nickname...
[DCC] DCC send of "$file.ext" to $nickname completed.

[DCC] Offering "$file.ext" to $nickname for upload...
[DCC] $nickname requested DCC RESUME of "$file.ext"
[DCC] Resuming "$file.ext" from "% of file complete" (written in kilo/mega/gigabytes?)
[DCC] DCC send of "$file.ext" to $nickname completed.

[DCC] Offering "$file.ext" to $nickname for upload...
[DCC] $nickname has declined transfer of "file.ext".

[DCC] Offering "$file.ext" to $nickname for upload...
[DCC] "$file.ext" accepted by $nickname...
[DCC] DCC transfer of "$file" aborted by $nickname.
Comment 1 Shintaro Matsuoka 2006-08-14 23:26:17 UTC
SVN commit 573102 by shin:

slot/signal connection fix: put a notification into the current view correctly when a dcc transfer is finished.
CCBUG: 132094

 M  +1 -1      dcctransfer.h  
 M  +2 -2      server.cpp  


--- trunk/extragear/network/konversation/src/dcctransfer.h #573101:573102
@@ -98,7 +98,7 @@
         void closeDetailDialog();
 
         signals:
-        void done( const QString& filename, DccTransfer::DccStatus status = DccTransfer::Done, const QString& errorMessage = QString::null );
+        void done( const QString& filename, int status = DccTransfer::Done, const QString& errorMessage = QString::null );
         void statusChanged( const DccTransfer* item );
 
     public slots:
--- trunk/extragear/network/konversation/src/server.cpp #573101:573102
@@ -1766,7 +1766,7 @@
 
     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&,DccTransfer::DccStatus,const QString&)),this,SLOT (dccSendDone(const QString&,int,const QString&)) );
+    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*)) );
     newDcc->start();
@@ -1801,7 +1801,7 @@
 
     connect(newDcc,SIGNAL (resumeRequest(const QString&,const QString&,const QString&,KIO::filesize_t)),this,
         SLOT (dccResumeGetRequest(const QString&,const QString&,const QString&,KIO::filesize_t)) );
-    connect(newDcc,SIGNAL (done(const QString&,DccTransfer::DccStatus,const QString&)),
+    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*)) );
Comment 2 Shintaro Matsuoka 2006-08-14 23:45:42 UTC
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);
Comment 3 Niek Beernink 2006-08-20 04:52:13 UTC
Ok, this can be resolved now. The messages are printed to the front most tab, are more user friendly and useful (resume messages show percentage complete instead of bytecount positions).
Comment 4 Shintaro Matsuoka 2010-07-01 16:18:39 UTC
commit 38154d1acd12daebdb59b172f9f7f39878d80ba8
Author: Shintaro Matsuoka <shin@shoegazed.org>
Date:   Mon Aug 14 21:26:09 2006 +0000

    slot/signal connection fix: put a notification into the current view correctly when a dcc transfer is finished.
    CCBUG: 132094
    
    svn path=/trunk/extragear/network/konversation/; revision=573102

diff --git a/src/dcctransfer.h b/src/dcctransfer.h
index ca6e0aa..04d92f1 100644
--- a/src/dcctransfer.h
+++ b/src/dcctransfer.h
@@ -98,7 +98,7 @@ class DccTransfer : public QObject, public KListViewItem
         void closeDetailDialog();
 
         signals:
-        void done( const QString& filename, DccTransfer::DccStatus status = DccTransfer::Done, const QString& errorMessage = QString::null );
+        void done( const QString& filename, int status = DccTransfer::Done, const QString& errorMessage = QString::null );
         void statusChanged( const DccTransfer* item );
 
     public slots:
diff --git a/src/server.cpp b/src/server.cpp
index a9febf7..67d4765 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -1766,7 +1766,7 @@ void Server::addDccSend(const QString &recipient,KURL fileURL, const QString &al
 
     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&,DccTransfer::DccStatus,const QString&)),this,SLOT (dccSendDone(const QString&,int,const QString&)) );
+    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*)) );
     newDcc->start();
@@ -1801,7 +1801,7 @@ void Server::addDccGet(const QString &sourceNick, const QStringList &dccArgument
 
     connect(newDcc,SIGNAL (resumeRequest(const QString&,const QString&,const QString&,KIO::filesize_t)),this,
         SLOT (dccResumeGetRequest(const QString&,const QString&,const QString&,KIO::filesize_t)) );
-    connect(newDcc,SIGNAL (done(const QString&,DccTransfer::DccStatus,const QString&)),
+    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*)) );