added ability for plugins to return their own PopupChatDialog class

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4988 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-02-25 12:17:36 +00:00
parent 63cd9d65f2
commit 96fd780502
6 changed files with 32 additions and 4 deletions

View file

@ -34,6 +34,7 @@
#include <retroshare/rsiface.h>
#include <retroshare/rsnotify.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsplugin.h>
static std::map<std::string, ChatDialog*> chatDialogs;
@ -110,7 +111,14 @@ void ChatDialog::init(const std::string &peerId, const QString &title)
} else {
RsPeerDetails sslDetails;
if (rsPeers->getPeerDetails(peerId, sslDetails)) {
cd = new PopupChatDialog();
for(int i=0;i<rsPlugins->nbPlugins();++i)
if(rsPlugins->plugin(i) != NULL && (cd = rsPlugins->plugin(i)->qt_allocate_new_popup_chat_dialog()) != NULL)
break ;
if(cd == NULL)
cd = new PopupChatDialog();
chatDialogs[peerId] = cd;
cd->init(peerId, PeerDefs::nameWithLocation(sslDetails));
}