mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-17 10:31:05 -04:00
Added "peer is typing" functionality to private chat. This shoudld be extended to additional stuff like "idle", and to public chat. Also the display is the status bar of the chat window could be made nicer, e.g. directly in the msg window. Suppressed ChatDialog class that is not more used
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1164 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ce3db07a63
commit
e144e75ba6
18 changed files with 495 additions and 975 deletions
|
@ -39,16 +39,19 @@ void NotifyQt::notifyErrorMsg(int list, int type, std::string msg)
|
|||
return;
|
||||
}
|
||||
|
||||
void NotifyQt::notifyChatStatus(const std::string& peer_id,const std::string& status_string)
|
||||
{
|
||||
std::cerr << "Received chat status string: " << status_string << std::endl ;
|
||||
emit chatStatusChanged(QString::fromStdString(peer_id),QString::fromStdString(status_string)) ;
|
||||
}
|
||||
|
||||
#ifdef TURTLE_HOPPING
|
||||
void NotifyQt::notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files)
|
||||
{
|
||||
std::cerr << "in notify search result..." << std::endl ;
|
||||
|
||||
// QList<TurtleFileInfo> qfiles ;
|
||||
|
||||
for(std::list<TurtleFileInfo>::const_iterator it(files.begin());it!=files.end();++it)
|
||||
emit gotTurtleSearchResult(search_id,*it) ;
|
||||
// qfiles.push_back(*it) ;
|
||||
}
|
||||
#endif
|
||||
void NotifyQt::notifyHashingInfo(std::string fileinfo)
|
||||
|
@ -56,10 +59,11 @@ void NotifyQt::notifyHashingInfo(std::string fileinfo)
|
|||
emit hashingInfoChanged(QString::fromStdString(fileinfo)) ;
|
||||
}
|
||||
|
||||
void NotifyQt::notifyChat()
|
||||
{
|
||||
return;
|
||||
}
|
||||
//void NotifyQt::notifyChat()
|
||||
//{
|
||||
// std::cerr << "Received chat notification" << std::endl ;
|
||||
// return;
|
||||
//}
|
||||
|
||||
void NotifyQt::notifyListChange(int list, int type)
|
||||
{
|
||||
|
@ -90,7 +94,6 @@ void NotifyQt::notifyListChange(int list, int type)
|
|||
emit filesPostModChanged(true) ; /* Local */
|
||||
break;
|
||||
case NOTIFY_LIST_SEARCHLIST:
|
||||
//displaySearch();
|
||||
break;
|
||||
case NOTIFY_LIST_MESSAGELIST:
|
||||
#ifdef DEBUG
|
||||
|
@ -99,7 +102,6 @@ void NotifyQt::notifyListChange(int list, int type)
|
|||
emit messagesChanged() ;
|
||||
break;
|
||||
case NOTIFY_LIST_CHANNELLIST:
|
||||
//displayChannels();
|
||||
break;
|
||||
case NOTIFY_LIST_TRANSFERLIST:
|
||||
#ifdef DEBUG
|
||||
|
@ -128,7 +130,6 @@ void NotifyQt::notifyListPreChange(int list, int type)
|
|||
switch(list)
|
||||
{
|
||||
case NOTIFY_LIST_NEIGHBOURS:
|
||||
//preDisplayNeighbours();
|
||||
break;
|
||||
case NOTIFY_LIST_FRIENDS:
|
||||
emit friendsChanged() ;
|
||||
|
@ -138,16 +139,12 @@ void NotifyQt::notifyListPreChange(int list, int type)
|
|||
emit filesPreModChanged(true) ; /* local */
|
||||
break;
|
||||
case NOTIFY_LIST_SEARCHLIST:
|
||||
//preDisplaySearch();
|
||||
break;
|
||||
case NOTIFY_LIST_MESSAGELIST:
|
||||
//preDisplayMessages();
|
||||
break;
|
||||
case NOTIFY_LIST_CHANNELLIST:
|
||||
//preDisplayChannels();
|
||||
break;
|
||||
case NOTIFY_LIST_TRANSFERLIST:
|
||||
//preDisplayTransfers();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -176,7 +173,7 @@ void NotifyQt::UpdateGUI()
|
|||
|
||||
if (time(NULL) > lastTs + 5) // update every 5 seconds. I don't know what to do with these.
|
||||
{
|
||||
displayChannels();
|
||||
// displayChannels();
|
||||
}
|
||||
|
||||
lastTs = time(NULL) ;
|
||||
|
@ -273,88 +270,88 @@ void NotifyQt::UpdateGUI()
|
|||
}
|
||||
}
|
||||
|
||||
void NotifyQt::displaySearch()
|
||||
{
|
||||
iface->lockData(); /* Lock Interface */
|
||||
//void NotifyQt::displaySearch()
|
||||
//{
|
||||
// iface->lockData(); /* Lock Interface */
|
||||
//
|
||||
//#ifdef NOTIFY_DEBUG
|
||||
// std::ostringstream out;
|
||||
// std::cerr << out.str();
|
||||
//#endif
|
||||
//
|
||||
// iface->unlockData(); /* UnLock Interface */
|
||||
//}
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::ostringstream out;
|
||||
std::cerr << out.str();
|
||||
#endif
|
||||
// void NotifyQt::displayChat()
|
||||
// {
|
||||
// iface->lockData(); /* Lock Interface */
|
||||
//
|
||||
// #ifdef NOTIFY_DEBUG
|
||||
// std::ostringstream out;
|
||||
// std::cerr << out.str();
|
||||
// #endif
|
||||
//
|
||||
// iface->unlockData(); /* UnLock Interface */
|
||||
//
|
||||
// if (hDialog)
|
||||
// hDialog -> insertChat();
|
||||
// }
|
||||
//
|
||||
//
|
||||
//void NotifyQt::displayChannels()
|
||||
//{
|
||||
// iface->lockData(); /* Lock Interface */
|
||||
//
|
||||
//#ifdef NOTIFY_DEBUG
|
||||
// std::ostringstream out;
|
||||
// std::cerr << out.str();
|
||||
//#endif
|
||||
//
|
||||
// iface->unlockData(); /* UnLock Interface */
|
||||
//
|
||||
// if (sDialog)
|
||||
// sDialog -> insertChannels();
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void NotifyQt::displayTransfers()
|
||||
//{
|
||||
// /* Do the GUI */
|
||||
// if (tDialog)
|
||||
// tDialog->insertTransfers();
|
||||
//}
|
||||
//
|
||||
//
|
||||
//void NotifyQt::preDisplayNeighbours()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//void NotifyQt::preDisplayFriends()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
|
||||
iface->unlockData(); /* UnLock Interface */
|
||||
}
|
||||
|
||||
void NotifyQt::displayChat()
|
||||
{
|
||||
iface->lockData(); /* Lock Interface */
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::ostringstream out;
|
||||
std::cerr << out.str();
|
||||
#endif
|
||||
|
||||
iface->unlockData(); /* UnLock Interface */
|
||||
|
||||
if (hDialog)
|
||||
hDialog -> insertChat();
|
||||
}
|
||||
|
||||
|
||||
void NotifyQt::displayChannels()
|
||||
{
|
||||
iface->lockData(); /* Lock Interface */
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::ostringstream out;
|
||||
std::cerr << out.str();
|
||||
#endif
|
||||
|
||||
iface->unlockData(); /* UnLock Interface */
|
||||
|
||||
if (sDialog)
|
||||
sDialog -> insertChannels();
|
||||
}
|
||||
|
||||
|
||||
void NotifyQt::displayTransfers()
|
||||
{
|
||||
/* Do the GUI */
|
||||
if (tDialog)
|
||||
tDialog->insertTransfers();
|
||||
}
|
||||
|
||||
|
||||
void NotifyQt::preDisplayNeighbours()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NotifyQt::preDisplayFriends()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NotifyQt::preDisplaySearch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NotifyQt::preDisplayMessages()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NotifyQt::preDisplayChannels()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NotifyQt::preDisplayTransfers()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
//void NotifyQt::preDisplaySearch()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//void NotifyQt::preDisplayMessages()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//void NotifyQt::preDisplayChannels()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//void NotifyQt::preDisplayTransfers()
|
||||
//{
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -26,29 +26,30 @@ class NotifyQt: public QObject, public NotifyBase
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NotifyQt() : cDialog(NULL), pDialog(NULL),
|
||||
dDialog(NULL), tDialog(NULL),
|
||||
hDialog(NULL), mDialog(NULL),
|
||||
sDialog(NULL), mWindow(NULL)
|
||||
{ return; }
|
||||
NotifyQt() {}
|
||||
// : cDialog(NULL), pDialog(NULL),
|
||||
// dDialog(NULL), tDialog(NULL),
|
||||
// hDialog(NULL), mDialog(NULL),
|
||||
// sDialog(NULL), mWindow(NULL)
|
||||
// { return; }
|
||||
|
||||
virtual ~NotifyQt() { return; }
|
||||
|
||||
void setNetworkDialog(NetworkDialog *c) { cDialog = c; }
|
||||
void setPeersDialog(PeersDialog *p) { pDialog = p; }
|
||||
void setDirDialog(SharedFilesDialog *d) { dDialog = d; }
|
||||
void setTransfersDialog(TransfersDialog *t) { tDialog = t; }
|
||||
void setChatDialog(ChatDialog *m) { hDialog = m; }
|
||||
void setMessagesDialog(MessagesDialog *m) { mDialog = m; }
|
||||
void setChannelsDialog(ChannelsDialog *s) { sDialog = s; }
|
||||
void setMessengerWindow(MessengerWindow *mw) { mWindow = mw; }
|
||||
|
||||
void setRsIface(RsIface *i) { iface = i; }
|
||||
// void setNetworkDialog(NetworkDialog *c) { cDialog = c; }
|
||||
// void setPeersDialog(PeersDialog *p) { pDialog = p; }
|
||||
// void setDirDialog(SharedFilesDialog *d) { dDialog = d; }
|
||||
// void setTransfersDialog(TransfersDialog *t) { tDialog = t; }
|
||||
// void setChatDialog(ChatDialog *m) { hDialog = m; }
|
||||
// void setMessagesDialog(MessagesDialog *m) { mDialog = m; }
|
||||
// void setChannelsDialog(ChannelsDialog *s) { sDialog = s; }
|
||||
// void setMessengerWindow(MessengerWindow *mw) { mWindow = mw; }
|
||||
// void setRsIface(RsIface *i) { iface = i; }
|
||||
|
||||
virtual void notifyListPreChange(int list, int type);
|
||||
virtual void notifyListChange(int list, int type);
|
||||
virtual void notifyErrorMsg(int list, int sev, std::string msg);
|
||||
virtual void notifyChat();
|
||||
// virtual void notifyChat();
|
||||
virtual void notifyChatStatus(const std::string& peer_id,const std::string& status_string);
|
||||
virtual void notifyHashingInfo(std::string fileinfo);
|
||||
#ifdef TURTLE_HOPPING
|
||||
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& found_files);
|
||||
|
@ -66,6 +67,7 @@ class NotifyQt: public QObject, public NotifyBase
|
|||
void neighborsChanged() const ;
|
||||
void messagesChanged() const ;
|
||||
void configChanged() const ;
|
||||
void chatStatusChanged(const QString&,const QString&) const ;
|
||||
#ifdef TURTLE_HOPPING
|
||||
void gotTurtleSearchResult(qulonglong search_id,TurtleFileInfo file) const ;
|
||||
#endif
|
||||
|
@ -76,34 +78,34 @@ class NotifyQt: public QObject, public NotifyBase
|
|||
|
||||
private:
|
||||
|
||||
void displayNeighbours();
|
||||
void displayFriends();
|
||||
// void displayNeighbours();
|
||||
// void displayFriends();
|
||||
// void displayDirectories();
|
||||
void displaySearch();
|
||||
void displayChat();
|
||||
void displayMessages();
|
||||
void displayChannels();
|
||||
void displayTransfers();
|
||||
// void displaySearch();
|
||||
// void displayChat();
|
||||
// void displayMessages();
|
||||
// void displayChannels();
|
||||
// void displayTransfers();
|
||||
|
||||
void preDisplayNeighbours();
|
||||
void preDisplayFriends();
|
||||
// void preDisplayNeighbours();
|
||||
// void preDisplayFriends();
|
||||
// void preDisplayDirectories();
|
||||
void preDisplaySearch();
|
||||
void preDisplayMessages();
|
||||
void preDisplayChannels();
|
||||
void preDisplayTransfers();
|
||||
// void preDisplaySearch();
|
||||
// void preDisplayMessages();
|
||||
// void preDisplayChannels();
|
||||
// void preDisplayTransfers();
|
||||
|
||||
/* so we can update windows */
|
||||
NetworkDialog *cDialog;
|
||||
PeersDialog *pDialog;
|
||||
SharedFilesDialog *dDialog;
|
||||
TransfersDialog *tDialog;
|
||||
ChatDialog *hDialog;
|
||||
MessagesDialog *mDialog;
|
||||
ChannelsDialog *sDialog;
|
||||
MessengerWindow *mWindow;
|
||||
// NetworkDialog *cDialog;
|
||||
// PeersDialog *pDialog;
|
||||
// SharedFilesDialog *dDialog;
|
||||
// TransfersDialog *tDialog;
|
||||
// ChatDialog *hDialog;
|
||||
// MessagesDialog *mDialog;
|
||||
// ChannelsDialog *sDialog;
|
||||
// MessengerWindow *mWindow;
|
||||
|
||||
RsIface *iface;
|
||||
// RsIface *iface;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -200,6 +200,7 @@ class NotifyBase
|
|||
virtual void notifyListChange(int list, int type) { (void) list; (void) type; return; }
|
||||
virtual void notifyErrorMsg(int list, int sev, std::string msg) { (void) list; (void) sev; (void) msg; return; }
|
||||
virtual void notifyChat() { return; }
|
||||
virtual void notifyChatStatus(const std::string& peer_id,const std::string& status_string) {}
|
||||
virtual void notifyHashingInfo(std::string fileinfo) { (void)fileinfo; return ; }
|
||||
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; }
|
||||
};
|
||||
|
|
|
@ -131,6 +131,7 @@ virtual bool MessageRead(std::string mid) = 0;
|
|||
virtual bool chatAvailable() = 0;
|
||||
virtual bool ChatSend(ChatInfo &ci) = 0;
|
||||
virtual bool getNewChat(std::list<ChatInfo> &chats) = 0;
|
||||
virtual void sendStatusString(const std::string& id,const std::string& status_string) = 0 ;
|
||||
|
||||
// get avatar data for peer pid
|
||||
virtual void getAvatarData(std::string pid,unsigned char *& data,int& size) = 0 ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue