mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
Reworked the process of the RetroShare links. Now RetroShare asks when adding a file or a person link and shows a detailed result.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4604 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d30c03b183
commit
2fac47293e
@ -227,7 +227,7 @@ void ChannelFeed::copyChannelLink()
|
||||
if (rsChannels->getChannelInfo(mChannelId, ci)) {
|
||||
RetroShareLink link;
|
||||
if (link.createChannel(ci.channelId, "")) {
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
|
@ -749,6 +749,21 @@ void ForumsDialog::fillThreadFinished()
|
||||
CleanupItems (thread->items);
|
||||
}
|
||||
|
||||
if (thread->focusMsgId.empty() == false) {
|
||||
/* Search exisiting item */
|
||||
QTreeWidgetItemIterator itemIterator(ui.threadTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
|
||||
if (item->data(COLUMN_THREAD_DATA, ROLE_THREAD_MSGID).toString().toStdString() == thread->focusMsgId) {
|
||||
ui.threadTreeWidget->setCurrentItem(item);
|
||||
ui.threadTreeWidget->setFocus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QList<QTreeWidgetItem*>::iterator Item;
|
||||
for (Item = thread->itemToExpand.begin(); Item != thread->itemToExpand.end(); Item++) {
|
||||
if ((*Item)->isHidden() == false) {
|
||||
@ -1141,7 +1156,7 @@ void ForumsDialog::downloadAllFiles()
|
||||
return;
|
||||
}
|
||||
|
||||
RetroShareLink::process(urls, RetroShareLink::TYPE_FILE, true);
|
||||
RetroShareLink::process(urls, RetroShareLink::TYPE_FILE/*, true*/);
|
||||
}
|
||||
|
||||
// TODO
|
||||
@ -1319,7 +1334,7 @@ void ForumsDialog::copyForumLink()
|
||||
if (rsForums->getForumInfo(mCurrForumId, fi)) {
|
||||
RetroShareLink link;
|
||||
if (link.createForum(fi.forumId, "")) {
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
@ -1336,7 +1351,7 @@ void ForumsDialog::copyMessageLink()
|
||||
if (rsForums->getForumInfo(mCurrForumId, fi)) {
|
||||
RetroShareLink link;
|
||||
if (link.createForum(mCurrForumId, mCurrThreadId)) {
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
@ -1596,6 +1611,11 @@ bool ForumsDialog::navigate(const std::string& forumId, const std::string& msgId
|
||||
return true;
|
||||
}
|
||||
|
||||
if (fillThread && fillThread->isRunning()) {
|
||||
fillThread->focusMsgId = msgId;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Search exisiting item */
|
||||
QTreeWidgetItemIterator itemIterator(ui.threadTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
|
@ -167,6 +167,7 @@ public:
|
||||
bool fillComplete;
|
||||
int viewType;
|
||||
bool expandNewMessages;
|
||||
std::string focusMsgId;
|
||||
|
||||
QList<QTreeWidgetItem*> items;
|
||||
QList<QTreeWidgetItem*> itemToExpand;
|
||||
|
@ -1227,7 +1227,7 @@ void FriendsDialog::recommendfriend()
|
||||
|
||||
void FriendsDialog::pastePerson()
|
||||
{
|
||||
RSLinkClipboard::process(RetroShareLink::TYPE_PERSON, RSLINK_PROCESS_NOTIFY_ERROR);
|
||||
RSLinkClipboard::process(RetroShareLink::TYPE_PERSON);
|
||||
}
|
||||
|
||||
void FriendsDialog::copyLink()
|
||||
@ -1238,7 +1238,7 @@ void FriendsDialog::copyLink()
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
RetroShareLink link;
|
||||
if (link.createPerson(c->data(COLUMN_DATA, ROLE_ID).toString().toStdString())) {
|
||||
urls.push_back(link);
|
||||
|
@ -1549,5 +1549,7 @@ void MainWindow::linkActivated(const QUrl &url)
|
||||
return;
|
||||
}
|
||||
|
||||
link.process(RSLINK_PROCESS_NOTIFY_ERROR | RSLINK_PROCESS_NOTIFY_SUCCESS);
|
||||
QList<RetroShareLink> links;
|
||||
links.append(link);
|
||||
RetroShareLink::process(links);
|
||||
}
|
||||
|
@ -1030,7 +1030,7 @@ void MessengerWindow::recommendfriend()
|
||||
|
||||
void MessengerWindow::pastePerson()
|
||||
{
|
||||
RSLinkClipboard::process(RetroShareLink::TYPE_PERSON, RSLINK_PROCESS_NOTIFY_ERROR);
|
||||
RSLinkClipboard::process(RetroShareLink::TYPE_PERSON);
|
||||
}
|
||||
#endif // MINIMAL_RSGUI
|
||||
|
||||
|
@ -302,7 +302,7 @@ void NetworkDialog::copyLink()
|
||||
|
||||
std::string peer_id = wi->text(COLUMN_PEERID).toStdString() ;
|
||||
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
RetroShareLink link;
|
||||
if (link.createPerson(peer_id)) {
|
||||
urls.push_back(link);
|
||||
|
@ -624,275 +624,491 @@ bool RetroShareLink::checkHash(const QString& hash)
|
||||
return true ;
|
||||
}
|
||||
|
||||
bool RetroShareLink::process(int flag)
|
||||
static void processList(QStringList &list, const QString &textSingular, const QString &textPlural, QString &result)
|
||||
{
|
||||
if (valid() == false) {
|
||||
std::cerr << " RetroShareLink::process invalid request" << std::endl;
|
||||
return false;
|
||||
if (list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (list.size() == 1) {
|
||||
result += "" + textSingular + ":";
|
||||
} else {
|
||||
result += "" + textPlural + ":";
|
||||
}
|
||||
result += "<p style='margin-left: 5px; margin-top: 0px'>";
|
||||
QStringList::iterator it;
|
||||
for (it = list.begin(); it != list.end(); ++it) {
|
||||
if (it != list.begin()) {
|
||||
result += ", ";
|
||||
}
|
||||
result += *it;
|
||||
}
|
||||
result += "</p>";
|
||||
}
|
||||
|
||||
/*static*/ int RetroShareLink::process(QList<RetroShareLink> &linksIn, uint flag /*= RSLINK_PROCESS_NOTIFY_ALL*/)
|
||||
{
|
||||
QList<RetroShareLink>::iterator linkIt;
|
||||
|
||||
/* filter dublicate links */
|
||||
QList<RetroShareLink> links;
|
||||
for (linkIt = linksIn.begin(); linkIt != linksIn.end(); linkIt++) {
|
||||
if (links.contains(*linkIt)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
links.append(*linkIt);
|
||||
}
|
||||
|
||||
switch (type()) {
|
||||
case TYPE_UNKNOWN:
|
||||
break;
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ASK) {
|
||||
/* ask for some types of link */
|
||||
QStringList fileAdd;
|
||||
QStringList personAdd;
|
||||
|
||||
case TYPE_FILE:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process FileRequest : fileName : " << name().toUtf8().constData() << ". fileHash : " << hash().toStdString() << ". fileSize : " << size() << std::endl;
|
||||
#endif
|
||||
for (linkIt = links.begin(); linkIt != links.end(); linkIt++) {
|
||||
RetroShareLink &link = *linkIt;
|
||||
|
||||
// Get a list of available direct sources, in case the file is browsable only.
|
||||
std::list<std::string> srcIds;
|
||||
FileInfo finfo ;
|
||||
rsFiles->FileDetails(hash().toStdString(), RS_FILE_HINTS_REMOTE,finfo) ;
|
||||
if (link.valid() == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for(std::list<TransferInfo>::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it)
|
||||
switch (link.type()) {
|
||||
case TYPE_UNKNOWN:
|
||||
case TYPE_FORUM:
|
||||
case TYPE_CHANNEL:
|
||||
case TYPE_SEARCH:
|
||||
case TYPE_MESSAGE:
|
||||
// no need to ask
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
fileAdd.append(link.name());
|
||||
break;
|
||||
|
||||
case TYPE_PERSON:
|
||||
personAdd.append(PeerDefs::rsid(link.name().toUtf8().constData(), link.hash().toStdString()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString content;
|
||||
if (fileAdd.size()) {
|
||||
processList(fileAdd, QObject::tr("Add file"), QObject::tr("Add files"), content);
|
||||
}
|
||||
|
||||
if (personAdd.size()) {
|
||||
processList(personAdd, QObject::tr("Add friend"), QObject::tr("Add friends"), content);
|
||||
}
|
||||
|
||||
if (content.isEmpty() == false) {
|
||||
QString question = "<html><body>";
|
||||
if (links.size() == 1) {
|
||||
question += QObject::tr("Do you want to process the link ?");
|
||||
} else {
|
||||
question += QObject::tr("Do you want to process %1 links ?").arg(links.size());
|
||||
}
|
||||
question += "<br><br>" + content + "</body></html>";
|
||||
|
||||
QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
if (mb.exec() == QMessageBox::No) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int countInvalid = 0;
|
||||
int countUnknown = 0;
|
||||
bool needNotifySuccess = false;
|
||||
|
||||
// file
|
||||
QStringList fileAdded;
|
||||
QStringList fileExist;
|
||||
|
||||
// person
|
||||
QStringList personAdded;
|
||||
QStringList personExist;
|
||||
QStringList personFailed;
|
||||
QStringList personNotFound;
|
||||
|
||||
// forum
|
||||
QStringList forumFound;
|
||||
QStringList forumMsgFound;
|
||||
QStringList forumUnknown;
|
||||
QStringList forumMsgUnknown;
|
||||
|
||||
// forum
|
||||
QStringList channelFound;
|
||||
QStringList channelMsgFound;
|
||||
QStringList channelUnknown;
|
||||
QStringList channelMsgUnknown;
|
||||
|
||||
// search
|
||||
QStringList searchStarted;
|
||||
|
||||
// message
|
||||
QStringList messageStarted;
|
||||
QStringList messageReceipientNotAccepted;
|
||||
QStringList messageReceipientUnknown;
|
||||
|
||||
// summary
|
||||
QList<QStringList*> processedList;
|
||||
QList<QStringList*> errorList;
|
||||
|
||||
processedList << &fileAdded << &personAdded << &forumFound << &channelFound << &searchStarted << &messageStarted;
|
||||
errorList << &fileExist << &personExist << &personFailed << &personNotFound << &forumUnknown << &forumMsgUnknown << &channelUnknown << &channelMsgUnknown << &messageReceipientNotAccepted << &messageReceipientUnknown;
|
||||
// not needed: forumFound, channelFound, messageStarted
|
||||
|
||||
for (linkIt = links.begin(); linkIt != links.end(); linkIt++) {
|
||||
RetroShareLink &link = *linkIt;
|
||||
|
||||
if (link.valid() == false) {
|
||||
std::cerr << " RetroShareLink::process invalid request" << std::endl;
|
||||
countInvalid++;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (link.type()) {
|
||||
case TYPE_UNKNOWN:
|
||||
countUnknown++;
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " adding peerid " << (*it).peerId << std::endl ;
|
||||
std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl;
|
||||
#endif
|
||||
srcIds.push_back((*it).peerId) ;
|
||||
}
|
||||
|
||||
if (rsFiles->FileRequest(name().toUtf8().constData(), hash().toStdString(), size(), "", RS_FILE_HINTS_NETWORK_WIDE, srcIds)) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
QMessageBox mb(QObject::tr("File Request Confirmation"), QObject::tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
needNotifySuccess = true;
|
||||
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("File Request canceled"), QObject::tr("The file has not been added to your download list, because you already have it."),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Get a list of available direct sources, in case the file is browsable only.
|
||||
std::list<std::string> srcIds;
|
||||
FileInfo finfo ;
|
||||
rsFiles->FileDetails(link.hash().toStdString(), RS_FILE_HINTS_REMOTE, finfo) ;
|
||||
|
||||
case TYPE_PERSON:
|
||||
{
|
||||
for(std::list<TransferInfo>::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it)
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process FriendRequest : name : " << name().toStdString() << ". id : " << hash().toStdString() << std::endl;
|
||||
std::cerr << " adding peerid " << (*it).peerId << std::endl ;
|
||||
#endif
|
||||
|
||||
RsPeerDetails detail;
|
||||
if (rsPeers->getPeerDetails(hash().toStdString(), detail)) {
|
||||
if (detail.gpg_id == rsPeers->getGPGOwnId()) {
|
||||
// it's me, do nothing
|
||||
return true;
|
||||
srcIds.push_back((*it).peerId) ;
|
||||
}
|
||||
|
||||
if (detail.accept_connection) {
|
||||
// peer connection is already accepted
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
QMessageBox mb(QObject::tr("Friend Request Confirmation"), QObject::tr("The friend is already in your list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (rsPeers->addFriend("", hash().toStdString())) {
|
||||
ConfCertDialog::loadAll();
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
QMessageBox mb(QObject::tr("Friend Request Confirmation"), QObject::tr("The friend has been added to your list."),QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Friend Request canceled"), QObject::tr("The friend could not be added to your list."),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Friend Request canceled"), QObject::tr("The friend could not be found."),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
case TYPE_FORUM:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process ForumRequest : name : " << name().toStdString() << ". id : " << hash().toStdString() << ". msgId : " << msgId().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
ForumInfo fi;
|
||||
if (!rsForums->getForumInfo(id().toStdString(), fi)) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Forum Request canceled"), QObject::tr("The forum \"%1\" could not be found.").arg(name()),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ForumMsgInfo msg;
|
||||
if (!msgId().isEmpty()) {
|
||||
if (!rsForums->getForumMessage(fi.forumId, msgId().toStdString(), msg)) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Forum Request canceled"), QObject::tr("The forum message in forum \"%1\" could not be found.").arg(name()),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::showWindow(MainWindow::Forums);
|
||||
ForumsDialog *forumsDialog = dynamic_cast<ForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
if (!forumsDialog) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return forumsDialog->navigate(fi.forumId, msg.msgId);
|
||||
}
|
||||
|
||||
case TYPE_CHANNEL:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process ChannelRequest : name : " << name().toStdString() << ". id : " << hash().toStdString() << ". msgId : " << msgId().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
ChannelInfo ci;
|
||||
if (!rsChannels->getChannelInfo(id().toStdString(), ci)) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Channel Request canceled"), QObject::tr("The channel \"%1\" could not be found.").arg(name()),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ChannelMsgInfo msg;
|
||||
if (!msgId().isEmpty()) {
|
||||
if (!rsChannels->getChannelMessage(ci.channelId, msgId().toStdString(), msg)) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Channel Request canceled"), QObject::tr("The channel message in channel \"%1\" could not be found.").arg(name()),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::showWindow(MainWindow::Channels);
|
||||
ChannelFeed *channelFeed = dynamic_cast<ChannelFeed*>(MainWindow::getPage(MainWindow::Channels));
|
||||
if (!channelFeed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return channelFeed->navigate(ci.channelId, msg.msgId);
|
||||
}
|
||||
|
||||
case TYPE_SEARCH:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process SearchRequest : string : " << name().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
MainWindow::showWindow(MainWindow::Search);
|
||||
SearchDialog *searchDialog = dynamic_cast<SearchDialog*>(MainWindow::getPage(MainWindow::Search));
|
||||
if (!searchDialog) {
|
||||
return false;
|
||||
}
|
||||
|
||||
searchDialog->searchKeywords(name());
|
||||
return true;
|
||||
}
|
||||
|
||||
case TYPE_MESSAGE:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process MessageRequest : id : " << _hash.toStdString() << ", subject : " << name().toStdString() << std::endl;
|
||||
#endif
|
||||
RsPeerDetails detail;
|
||||
if (rsPeers->getPeerDetails(hash().toStdString(), detail)) {
|
||||
if (detail.accept_connection || detail.id == rsPeers->getOwnId() || detail.id == rsPeers->getGPGOwnId()) {
|
||||
MessageComposer *msg = MessageComposer::newMsg();
|
||||
msg->addRecipient(MessageComposer::TO, detail.id, false);
|
||||
if (subject().isEmpty() == false) {
|
||||
msg->insertTitleText(subject());
|
||||
}
|
||||
msg->show();
|
||||
|
||||
return true;
|
||||
if (rsFiles->FileRequest(link.name().toUtf8().constData(), link.hash().toStdString(), link.size(), "", RS_FILE_HINTS_NETWORK_WIDE, srcIds)) {
|
||||
fileAdded.append(link.name());
|
||||
} else {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Message Request canceled"), QObject::tr("Cannot send a message to a not accepted receipient \"%1\".").arg(hash()), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("Message Request canceled"), QObject::tr("The receipient of the message is unknown."), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
fileExist.append(link.name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
case TYPE_PERSON:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process FriendRequest : name : " << link.name().toStdString() << ". id : " << link.hash().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
needNotifySuccess = true;
|
||||
|
||||
RsPeerDetails detail;
|
||||
if (rsPeers->getPeerDetails(link.hash().toStdString(), detail)) {
|
||||
if (detail.gpg_id == rsPeers->getGPGOwnId()) {
|
||||
// it's me, do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
if (detail.accept_connection) {
|
||||
// peer connection is already accepted
|
||||
personExist.append(PeerDefs::rsid(detail));
|
||||
break;
|
||||
}
|
||||
|
||||
if (rsPeers->addFriend("", link.hash().toStdString())) {
|
||||
ConfCertDialog::loadAll();
|
||||
personAdded.append(PeerDefs::rsid(detail));
|
||||
break;
|
||||
}
|
||||
|
||||
personFailed.append(PeerDefs::rsid(link.name().toUtf8().constData(), link.hash().toStdString()));
|
||||
break;
|
||||
}
|
||||
|
||||
personNotFound.append(PeerDefs::rsid(link.name().toUtf8().constData(), link.hash().toStdString()));
|
||||
break;
|
||||
}
|
||||
|
||||
case TYPE_FORUM:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process ForumRequest : name : " << link.name().toStdString() << ". id : " << link.hash().toStdString() << ". msgId : " << link.msgId().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
ForumInfo fi;
|
||||
if (!rsForums->getForumInfo(link.id().toStdString(), fi)) {
|
||||
if (link.msgId().isEmpty()) {
|
||||
forumUnknown.append(link.name());
|
||||
} else {
|
||||
forumMsgUnknown.append(link.name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ForumMsgInfo msg;
|
||||
if (!link.msgId().isEmpty()) {
|
||||
if (!rsForums->getForumMessage(fi.forumId, link.msgId().toStdString(), msg)) {
|
||||
forumMsgUnknown.append(link.name());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::showWindow(MainWindow::Forums);
|
||||
ForumsDialog *forumsDialog = dynamic_cast<ForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
if (!forumsDialog) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (forumsDialog->navigate(fi.forumId, msg.msgId)) {
|
||||
if (link.msgId().isEmpty()) {
|
||||
forumFound.append(link.name());
|
||||
} else {
|
||||
forumMsgFound.append(link.name());
|
||||
}
|
||||
} else {
|
||||
if (link.msgId().isEmpty()) {
|
||||
forumUnknown.append(link.name());
|
||||
} else {
|
||||
forumMsgUnknown.append(link.name());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TYPE_CHANNEL:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process ChannelRequest : name : " << link.name().toStdString() << ". id : " << link.hash().toStdString() << ". msgId : " << link.msgId().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
ChannelInfo ci;
|
||||
if (!rsChannels->getChannelInfo(link.id().toStdString(), ci)) {
|
||||
if (link.msgId().isEmpty()) {
|
||||
channelUnknown.append(link.name());
|
||||
} else {
|
||||
channelMsgUnknown.append(link.name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ChannelMsgInfo msg;
|
||||
if (!link.msgId().isEmpty()) {
|
||||
if (!rsChannels->getChannelMessage(ci.channelId, link.msgId().toStdString(), msg)) {
|
||||
channelMsgUnknown.append(link.name());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::showWindow(MainWindow::Channels);
|
||||
ChannelFeed *channelFeed = dynamic_cast<ChannelFeed*>(MainWindow::getPage(MainWindow::Channels));
|
||||
if (!channelFeed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (channelFeed->navigate(ci.channelId, msg.msgId)) {
|
||||
if (link.msgId().isEmpty()) {
|
||||
channelFound.append(link.name());
|
||||
} else {
|
||||
channelMsgFound.append(link.name());
|
||||
}
|
||||
} else {
|
||||
if (link.msgId().isEmpty()) {
|
||||
channelUnknown.append(link.name());
|
||||
} else {
|
||||
channelMsgUnknown.append(link.name());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TYPE_SEARCH:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process SearchRequest : string : " << link.name().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
MainWindow::showWindow(MainWindow::Search);
|
||||
SearchDialog *searchDialog = dynamic_cast<SearchDialog*>(MainWindow::getPage(MainWindow::Search));
|
||||
if (!searchDialog) {
|
||||
break;
|
||||
}
|
||||
|
||||
searchDialog->searchKeywords(link.name());
|
||||
searchStarted.append(link.name());
|
||||
break;
|
||||
}
|
||||
|
||||
case TYPE_MESSAGE:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process MessageRequest : id : " << link.hash().toStdString() << ", subject : " << link.name().toStdString() << std::endl;
|
||||
#endif
|
||||
RsPeerDetails detail;
|
||||
if (rsPeers->getPeerDetails(link.hash().toStdString(), detail)) {
|
||||
if (detail.accept_connection || detail.id == rsPeers->getOwnId() || detail.id == rsPeers->getGPGOwnId()) {
|
||||
MessageComposer *msg = MessageComposer::newMsg();
|
||||
msg->addRecipient(MessageComposer::TO, detail.id, false);
|
||||
if (link.subject().isEmpty() == false) {
|
||||
msg->insertTitleText(link.subject());
|
||||
}
|
||||
msg->show();
|
||||
messageStarted.append(PeerDefs::nameWithLocation(detail));
|
||||
} else {
|
||||
messageReceipientNotAccepted.append(PeerDefs::nameWithLocation(detail));
|
||||
}
|
||||
} else {
|
||||
messageReceipientUnknown.append(PeerDefs::rsidFromId(link.hash().toStdString()));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
std::cerr << " RetroShareLink::process unknown type: " << link.type() << std::endl;
|
||||
countUnknown++;
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << " RetroShareLink::process unknown type: " << type() << std::endl;
|
||||
int countProcessed = 0;
|
||||
int countError = 0;
|
||||
|
||||
QList<QStringList*>::iterator listIt;
|
||||
for (listIt = processedList.begin(); listIt != processedList.end(); ++listIt) {
|
||||
countProcessed += (*listIt)->size();
|
||||
}
|
||||
for (listIt = errorList.begin(); listIt != errorList.end(); ++listIt) {
|
||||
countError += (*listIt)->size();
|
||||
}
|
||||
|
||||
// success notify needed ?
|
||||
if (needNotifySuccess == false) {
|
||||
flag &= ~RSLINK_PROCESS_NOTIFY_SUCCESS;
|
||||
}
|
||||
// error notify needed ?
|
||||
if (countError == 0) {
|
||||
flag &= ~RSLINK_PROCESS_NOTIFY_ERROR;
|
||||
}
|
||||
|
||||
QString result;
|
||||
|
||||
if (flag & (RSLINK_PROCESS_NOTIFY_SUCCESS | RSLINK_PROCESS_NOTIFY_ERROR)) {
|
||||
result += (links.count() == 1 ? QObject::tr("%1 of %2 RetroShare link processed.") : QObject::tr("%1 of %2 RetroShare links processed.")).arg(countProcessed).arg(links.count()) + "<br><br>";
|
||||
}
|
||||
|
||||
// file
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
if (fileAdded.size()) {
|
||||
processList(fileAdded, QObject::tr("File added"), QObject::tr("Files added"), result);
|
||||
}
|
||||
}
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (fileExist.size()) {
|
||||
processList(fileExist, QObject::tr("File exist"), QObject::tr("Files exist"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// person
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
if (personAdded.size()) {
|
||||
processList(personAdded, QObject::tr("Friend added"), QObject::tr("Friends added"), result);
|
||||
}
|
||||
}
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (personExist.size()) {
|
||||
processList(personExist, QObject::tr("Friend exist"), QObject::tr("Friends exist"), result);
|
||||
}
|
||||
if (personFailed.size()) {
|
||||
processList(personFailed, QObject::tr("Friend not added"), QObject::tr("Friends not added"), result);
|
||||
}
|
||||
if (personNotFound.size()) {
|
||||
processList(personNotFound, QObject::tr("Friend not found"), QObject::tr("Friends not found"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// forum
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (forumUnknown.size()) {
|
||||
processList(forumUnknown, QObject::tr("Forum not found"), QObject::tr("Forums not found"), result);
|
||||
}
|
||||
if (forumMsgUnknown.size()) {
|
||||
processList(forumMsgUnknown, QObject::tr("Forum message not found"), QObject::tr("Forum messages not found"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// channel
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (channelUnknown.size()) {
|
||||
processList(channelUnknown, QObject::tr("Channel not found"), QObject::tr("Channels not found"), result);
|
||||
}
|
||||
if (channelMsgUnknown.size()) {
|
||||
processList(channelMsgUnknown, QObject::tr("Channel message not found"), QObject::tr("Channel messages not found"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// message
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (messageReceipientNotAccepted.size()) {
|
||||
processList(messageReceipientNotAccepted, QObject::tr("Receipient not accepted"), QObject::tr("Receipients not accepted"), result);
|
||||
}
|
||||
if (messageReceipientUnknown.size()) {
|
||||
processList(messageReceipientUnknown, QObject::tr("Unkown receipient"), QObject::tr("Unkown receipients"), result);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
QMessageBox mb(QObject::tr("File Request Error"), QObject::tr("The file link is malformed."),QMessageBox::Critical,QMessageBox::Ok,0,0);
|
||||
if (countUnknown) {
|
||||
result += QString("<br>%1: %2").arg(QObject::tr("Malformed links")).arg(countUnknown);
|
||||
}
|
||||
if (countInvalid) {
|
||||
result += QString("<br>%1: %2").arg(QObject::tr("Invalid links")).arg(countInvalid);
|
||||
}
|
||||
}
|
||||
|
||||
if (result.isEmpty() == false) {
|
||||
QMessageBox mb(QObject::tr("Result"), "<html><body>" + result + "</body></html>", QMessageBox::Information, QMessageBox::Ok, 0, 0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
return false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*static*/ int RetroShareLink::process(QStringList &urls, RetroShareLink::enumType type /*= RetroShareLink::TYPE_UNKNOWN*/, bool notify /*= true*/)
|
||||
/*static*/ int RetroShareLink::process(QStringList &urls, RetroShareLink::enumType type /*= RetroShareLink::TYPE_UNKNOWN*/, uint flag /*= RSLINK_PROCESS_NOTIFY_ALL*/)
|
||||
{
|
||||
int processed = 0;
|
||||
QList<RetroShareLink> links;
|
||||
|
||||
for (QStringList::iterator it = urls.begin(); it != urls.end(); it++) {
|
||||
RetroShareLink link(*it);
|
||||
if (link.valid() && (type == RetroShareLink::TYPE_UNKNOWN || link.type() == type)) {
|
||||
if (link.process(0)) {
|
||||
processed++;
|
||||
}
|
||||
links.append(link);
|
||||
}
|
||||
}
|
||||
|
||||
if (notify) {
|
||||
QString text = QObject::tr("%1 of %2 RetroShare links processed.").arg(processed).arg(urls.count());
|
||||
QMessageBox mb(QObject::tr("Request Confirmation"), text, QMessageBox::Information, QMessageBox::Ok, 0, 0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
|
||||
return processed;
|
||||
return process(links, flag);
|
||||
}
|
||||
|
||||
void RSLinkClipboard::copyLinks(const std::vector<RetroShareLink>& links)
|
||||
void RSLinkClipboard::copyLinks(const QList<RetroShareLink>& links)
|
||||
{
|
||||
QString res ;
|
||||
for(uint32_t i=0;i<links.size();++i)
|
||||
for (int i = 0; i < links.size(); ++i)
|
||||
res += links[i].toString() + "\n" ;
|
||||
|
||||
QApplication::clipboard()->setText(res) ;
|
||||
}
|
||||
|
||||
void RSLinkClipboard::pasteLinks(std::vector<RetroShareLink> &links)
|
||||
void RSLinkClipboard::pasteLinks(QList<RetroShareLink> &links)
|
||||
{
|
||||
return parseClipboard(links);
|
||||
}
|
||||
|
||||
void RSLinkClipboard::parseClipboard(std::vector<RetroShareLink> &links)
|
||||
void RSLinkClipboard::parseClipboard(QList<RetroShareLink> &links)
|
||||
{
|
||||
// parse clipboard for links.
|
||||
//
|
||||
@ -914,12 +1130,12 @@ void RSLinkClipboard::parseClipboard(std::vector<RetroShareLink> &links)
|
||||
{
|
||||
// check that the link is not already in the list:
|
||||
bool already = false ;
|
||||
for(uint32_t i=0;i<links.size();++i)
|
||||
for (int i = 0; i <links.size(); ++i)
|
||||
if(links[i] == link)
|
||||
{
|
||||
already = true ;
|
||||
break ;
|
||||
}
|
||||
already = true ;
|
||||
break ;
|
||||
}
|
||||
|
||||
if(!already)
|
||||
{
|
||||
@ -940,11 +1156,11 @@ void RSLinkClipboard::parseClipboard(std::vector<RetroShareLink> &links)
|
||||
|
||||
QString RSLinkClipboard::toString()
|
||||
{
|
||||
std::vector<RetroShareLink> links;
|
||||
QList<RetroShareLink> links;
|
||||
parseClipboard(links);
|
||||
|
||||
QString res ;
|
||||
for(uint32_t i=0;i<links.size();++i)
|
||||
for(int i = 0; i < links.size(); ++i)
|
||||
res += links[i].toString() + "\n" ;
|
||||
|
||||
return res ;
|
||||
@ -952,11 +1168,11 @@ QString RSLinkClipboard::toString()
|
||||
|
||||
QString RSLinkClipboard::toHtml()
|
||||
{
|
||||
std::vector<RetroShareLink> links;
|
||||
QList<RetroShareLink> links;
|
||||
parseClipboard(links);
|
||||
|
||||
QString res ;
|
||||
for(uint32_t i=0;i<links.size();++i)
|
||||
for(int i = 0; i < links.size(); ++i)
|
||||
res += links[i].toHtml() + "<br/>" ;
|
||||
|
||||
return res ;
|
||||
@ -964,11 +1180,11 @@ QString RSLinkClipboard::toHtml()
|
||||
|
||||
QString RSLinkClipboard::toHtmlFull()
|
||||
{
|
||||
std::vector<RetroShareLink> links;
|
||||
QList<RetroShareLink> links;
|
||||
parseClipboard(links);
|
||||
|
||||
QString res ;
|
||||
for(uint32_t i=0;i<links.size();++i)
|
||||
for(int i = 0; i < links.size(); ++i)
|
||||
res += links[i].toHtmlFull() + "<br/>" ;
|
||||
|
||||
return res ;
|
||||
@ -976,14 +1192,14 @@ QString RSLinkClipboard::toHtmlFull()
|
||||
|
||||
bool RSLinkClipboard::empty(RetroShareLink::enumType type /*= RetroShareLink::TYPE_UNKNOWN*/)
|
||||
{
|
||||
std::vector<RetroShareLink> links;
|
||||
QList<RetroShareLink> links;
|
||||
parseClipboard(links);
|
||||
|
||||
if (type == RetroShareLink::TYPE_UNKNOWN) {
|
||||
return links.empty();
|
||||
}
|
||||
|
||||
for (std::vector<RetroShareLink>::iterator link = links.begin(); link != links.end(); link++) {
|
||||
for (QList<RetroShareLink>::iterator link = links.begin(); link != links.end(); link++) {
|
||||
if (link->type() == type) {
|
||||
return false;
|
||||
}
|
||||
@ -992,20 +1208,21 @@ bool RSLinkClipboard::empty(RetroShareLink::enumType type /*= RetroShareLink::TY
|
||||
return true;
|
||||
}
|
||||
|
||||
/*static*/ int RSLinkClipboard::process(RetroShareLink::enumType type /*= RetroShareLink::TYPE_UNKNOWN*/, int flag /*= RSLINK_PROCESS_NOTIFY_ALL*/)
|
||||
/*static*/ int RSLinkClipboard::process(RetroShareLink::enumType type /*= RetroShareLink::TYPE_UNKNOWN*/, uint flag /*= RSLINK_PROCESS_NOTIFY_ALL*/)
|
||||
{
|
||||
std::vector<RetroShareLink> links;
|
||||
QList<RetroShareLink> links;
|
||||
pasteLinks(links);
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (uint32_t i = 0; i < links.size(); i++) {
|
||||
QList<RetroShareLink> linksToProcess;
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
if (links[i].valid() && (type == RetroShareLink::TYPE_UNKNOWN || links[i].type() == type)) {
|
||||
if (links[i].process(flag)) {
|
||||
count++;
|
||||
}
|
||||
linksToProcess.append(links[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
if (linksToProcess.size() == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return RetroShareLink::process(linksToProcess, flag);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
#define RSLINK_PROCESS_NOTIFY_SUCCESS 1 // notify on success
|
||||
#define RSLINK_PROCESS_NOTIFY_ERROR 2 // notify on error
|
||||
#define RSLINK_PROCESS_NOTIFY_ASK 4 // ask for add the links
|
||||
|
||||
#define RSLINK_PROCESS_NOTIFY_ALL -1
|
||||
|
||||
@ -91,9 +92,8 @@ class RetroShareLink
|
||||
|
||||
bool operator==(const RetroShareLink& l) const { return _type == l._type && _hash == l._hash ; }
|
||||
|
||||
bool process(int flag);
|
||||
|
||||
static int process(QStringList &urls, RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, bool notify = true);
|
||||
static int process(QStringList &urls, RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||
static int process(QList<RetroShareLink> &links, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||
|
||||
private:
|
||||
void fromString(const QString &url);
|
||||
@ -125,12 +125,12 @@ class RSLinkClipboard
|
||||
public:
|
||||
// Copy these links to the RS clipboard. Also copy them to the system clipboard
|
||||
//
|
||||
static void copyLinks(const std::vector<RetroShareLink>& links) ;
|
||||
static void copyLinks(const QList<RetroShareLink>& links) ;
|
||||
|
||||
// Get the liste of pasted links, either from the internal RS links, or by default
|
||||
// from the clipboard.
|
||||
//
|
||||
static void pasteLinks(std::vector<RetroShareLink> &links) ;
|
||||
static void pasteLinks(QList<RetroShareLink> &links) ;
|
||||
|
||||
// Produces a list of links with no html structure.
|
||||
static QString toString() ;
|
||||
@ -155,10 +155,10 @@ class RSLinkClipboard
|
||||
// Returns the count of processed links
|
||||
// Useful for menus.
|
||||
//
|
||||
static int process(RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, int flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||
static int process(RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
|
||||
|
||||
private:
|
||||
static void parseClipboard(std::vector<RetroShareLink> &links) ;
|
||||
static void parseClipboard(QList<RetroShareLink> &links) ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -507,7 +507,7 @@ void SearchDialog::copySearchLink()
|
||||
|
||||
RetroShareLink link;
|
||||
if (link.createSearch(keywords)) {
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
@ -1305,7 +1305,7 @@ void SearchDialog::copyResultLink()
|
||||
int numdls = itemsForCopy.size();
|
||||
QTreeWidgetItem * item;
|
||||
|
||||
std::vector<RetroShareLink> urls ;
|
||||
QList<RetroShareLink> urls ;
|
||||
|
||||
for (int i = 0; i < numdls; ++i)
|
||||
{
|
||||
|
@ -446,7 +446,7 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
||||
else
|
||||
localModel->getDirDetailsFromSelect(lst, dirVec);
|
||||
|
||||
std::vector<RetroShareLink> urls ;
|
||||
QList<RetroShareLink> urls ;
|
||||
|
||||
for (int i = 0, n = dirVec.size(); i < n; ++i)
|
||||
{
|
||||
|
@ -1131,7 +1131,7 @@ void TransfersDialog::cancel()
|
||||
|
||||
void TransfersDialog::copyLink ()
|
||||
{
|
||||
std::vector<RetroShareLink> links ;
|
||||
QList<RetroShareLink> links ;
|
||||
|
||||
std::set<std::string> items;
|
||||
std::set<std::string>::iterator it;
|
||||
@ -1274,7 +1274,7 @@ void TransfersDialog::updateDetailsDialog()
|
||||
|
||||
void TransfersDialog::pasteLink()
|
||||
{
|
||||
RSLinkClipboard::process(RetroShareLink::TYPE_FILE, RSLINK_PROCESS_NOTIFY_ERROR);
|
||||
RSLinkClipboard::process(RetroShareLink::TYPE_FILE);
|
||||
}
|
||||
|
||||
void TransfersDialog::getSelectedItems(std::set<std::string> *ids, std::set<int> *rows)
|
||||
|
@ -407,7 +407,7 @@ void ChanMsgItem::copyLink()
|
||||
if (rsChannels->getChannelMessage(mChanId, mMsgId, cmi)) {
|
||||
RetroShareLink link;
|
||||
if (link.createChannel(cmi.channelId, cmi.msgId)) {
|
||||
std::vector<RetroShareLink> urls;
|
||||
QList<RetroShareLink> urls;
|
||||
urls.push_back(link);
|
||||
RSLinkClipboard::copyLinks(urls);
|
||||
}
|
||||
|
@ -515,10 +515,10 @@ void MessageComposer::contextMenuMsgSendList(QPoint)
|
||||
|
||||
void MessageComposer::pasteRecommended()
|
||||
{
|
||||
std::vector<RetroShareLink> links;
|
||||
QList<RetroShareLink> links;
|
||||
RSLinkClipboard::pasteLinks(links);
|
||||
|
||||
for (uint32_t i = 0; i < links.size(); i++) {
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
if (links[i].valid() && links[i].type() == RetroShareLink::TYPE_FILE) {
|
||||
FileInfo fileInfo;
|
||||
fileInfo.fname = links[i].name().toStdString();
|
||||
|
Binary file not shown.
@ -6314,7 +6314,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||
<translation>Setzt Schriftart auf Codestil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/msgs/MessageComposer.cpp" line="+1087"/>
|
||||
<location filename="../gui/msgs/MessageComposer.cpp" line="+1094"/>
|
||||
<source>To</source>
|
||||
<translation>An</translation>
|
||||
</message>
|
||||
@ -6399,7 +6399,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||
<translation>Blockquote hinzufügen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/msgs/MessageComposer.cpp" line="-1176"/>
|
||||
<location filename="../gui/msgs/MessageComposer.cpp" line="-1183"/>
|
||||
<source>&Left</source>
|
||||
<translation>&Links</translation>
|
||||
</message>
|
||||
@ -6420,12 +6420,12 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+218"/>
|
||||
<location line="+1653"/>
|
||||
<location line="+1660"/>
|
||||
<source>Save Message</source>
|
||||
<translation>Nachricht speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1652"/>
|
||||
<location line="-1659"/>
|
||||
<source>Message has not been Sent.
|
||||
Do you want to save message to draft box?</source>
|
||||
<translation>Nachricht wurde noch nicht gesendet.
|
||||
@ -6473,7 +6473,7 @@ Möchtest Du die Nachricht in den Entwürfen speichern?</translation>
|
||||
<translation>Fwd:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+75"/>
|
||||
<location line="+82"/>
|
||||
<location line="+119"/>
|
||||
<source>RetroShare</source>
|
||||
<translation></translation>
|
||||
@ -6668,7 +6668,7 @@ Willst Du die Nachricht speichern ?</translation>
|
||||
<translation>Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-2128"/>
|
||||
<location line="-2135"/>
|
||||
<source>Friend Recommendation(s)</source>
|
||||
<translation>Freundempfehlung(en)</translation>
|
||||
</message>
|
||||
@ -7650,7 +7650,7 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>NetworkDialog</name>
|
||||
<message>
|
||||
<location filename="../gui/NetworkDialog.cpp" line="+457"/>
|
||||
<location filename="../gui/NetworkDialog.cpp" line="+461"/>
|
||||
<source>Personal signature</source>
|
||||
<translation>Persönliche Unterschrift</translation>
|
||||
</message>
|
||||
@ -7795,7 +7795,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Leeren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/NetworkDialog.cpp" line="-288"/>
|
||||
<location filename="../gui/NetworkDialog.cpp" line="-292"/>
|
||||
<source>Deny friend</source>
|
||||
<translation>Blockiere Freund</translation>
|
||||
</message>
|
||||
@ -7825,12 +7825,12 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Kopiere RetroShare Link</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+219"/>
|
||||
<location line="+223"/>
|
||||
<source>Unknown</source>
|
||||
<translation>Unbekannt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-323"/>
|
||||
<location line="-326"/>
|
||||
<source>Authentication matrix</source>
|
||||
<translation>Authentifizierungsmatrix</translation>
|
||||
</message>
|
||||
@ -7840,7 +7840,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Netzwerk Ansicht</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+399"/>
|
||||
<location line="+402"/>
|
||||
<source>yourself</source>
|
||||
<translation>selbst</translation>
|
||||
</message>
|
||||
@ -9475,132 +9475,280 @@ Lockdatei:
|
||||
<translation>Vielleicht ist das Passwort falsch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/RetroShareLink.cpp" line="+659"/>
|
||||
<source>File Request Confirmation</source>
|
||||
<translation>Bestätigung der Dateianforderung</translation>
|
||||
<translation type="obsolete">Bestätigung der Dateianforderung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>The file has been added to your download list.</source>
|
||||
<translation>Die Datei wurde zur Downloadliste hinzugefügt.</translation>
|
||||
<translation type="obsolete">Die Datei wurde zur Downloadliste hinzugefügt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+8"/>
|
||||
<location filename="../gui/msgs/MessageWidget.cpp" line="-295"/>
|
||||
<source>File Request canceled</source>
|
||||
<translation>Dateianforderung abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/msgs/MessageWidget.cpp" line="+0"/>
|
||||
<location line="+0"/>
|
||||
<source>The following has not been added to your download list, because you already have it:
|
||||
</source>
|
||||
<translation>Die folgende Datei wurde nicht zur Downloadliste hinzugefügt, da Du diese schon hast:
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/RetroShareLink.cpp" line="+0"/>
|
||||
<source>The file has not been added to your download list, because you already have it.</source>
|
||||
<translation>Die Datei wurde nicht zur Downloadliste hinzugefügt, da Du sie schon hast.</translation>
|
||||
<translation type="obsolete">Die Datei wurde nicht zur Downloadliste hinzugefügt, da Du sie schon hast.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+23"/>
|
||||
<location line="+10"/>
|
||||
<source>Friend Request Confirmation</source>
|
||||
<translation>Freundanfrage bestätigen</translation>
|
||||
<translation type="obsolete">Freundanfrage bestätigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-10"/>
|
||||
<source>The friend is already in your list.</source>
|
||||
<translation>Der Freund ist schon in Deiner Liste.</translation>
|
||||
<translation type="obsolete">Der Freund ist schon in Deiner Liste.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<source>The friend has been added to your list.</source>
|
||||
<translation>Der Freund wurde zu Deiner Liste hinzugefügt.</translation>
|
||||
<translation type="obsolete">Der Freund wurde zu Deiner Liste hinzugefügt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+8"/>
|
||||
<location line="+8"/>
|
||||
<source>Friend Request canceled</source>
|
||||
<translation>Freundanfrage abgebrochen</translation>
|
||||
<translation type="obsolete">Freundanfrage abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-8"/>
|
||||
<source>The friend could not be added to your list.</source>
|
||||
<translation>Der Freund konnte nicht zu Deiner Liste hinzugefügt werden.</translation>
|
||||
<translation type="obsolete">Der Freund konnte nicht zu Deiner Liste hinzugefügt werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+8"/>
|
||||
<source>The friend could not be found.</source>
|
||||
<translation>Der Freund konnte nicht gefunden werden.</translation>
|
||||
<translation type="obsolete">Der Freund konnte nicht gefunden werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+16"/>
|
||||
<location line="+11"/>
|
||||
<source>Forum Request canceled</source>
|
||||
<translation>Forumanfrage abgebrochen</translation>
|
||||
<translation type="obsolete">Forumanfrage abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-11"/>
|
||||
<source>The forum "%1" could not be found.</source>
|
||||
<translation>Das Forum "%1" konnte nicht gefunden werden.</translation>
|
||||
<translation type="obsolete">Das Forum "%1" konnte nicht gefunden werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+11"/>
|
||||
<source>The forum message in forum "%1" could not be found.</source>
|
||||
<translation>Der Forumbeitrag im Forum "%1" konnte nicht gefunden werden.</translation>
|
||||
<translation type="obsolete">Der Forumbeitrag im Forum "%1" konnte nicht gefunden werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+37"/>
|
||||
<source>The channel message in channel "%1" could not be found.</source>
|
||||
<translation>Der Kanalbeitrag im Kanal "%1" konnte nicht gefunden werden.</translation>
|
||||
<translation type="obsolete">Der Kanalbeitrag im Kanal "%1" konnte nicht gefunden werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+58"/>
|
||||
<source>The receipient of the message is unknown.</source>
|
||||
<translation>Der Empfänger der Nachricht ist unbekannt.</translation>
|
||||
<translation type="obsolete">Der Empfänger der Nachricht ist unbekannt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+34"/>
|
||||
<location filename="../gui/RetroShareLink.cpp" line="+695"/>
|
||||
<source>Add file</source>
|
||||
<translation>Datei hinzufügen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Add files</source>
|
||||
<translation>Dateien hinzufügen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+4"/>
|
||||
<source>Add friend</source>
|
||||
<translation>Freund hinzufügen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Add friends</source>
|
||||
<translation>Freunde hinzufügen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+6"/>
|
||||
<source>Do you want to process the link ?</source>
|
||||
<translation>Möchtest du den Link verarbeiten ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+2"/>
|
||||
<source>Do you want to process %1 links ?</source>
|
||||
<translation>Möchtest du %1 Links verarbeiten ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+4"/>
|
||||
<source>Confirmation</source>
|
||||
<translation>Bestätigung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+291"/>
|
||||
<source>%1 of %2 RetroShare links processed.</source>
|
||||
<translation>%1 von %2 RetroShare Links verarbeitet.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1"/>
|
||||
<source>Request Confirmation</source>
|
||||
<translation>Anfrage bestätigen</translation>
|
||||
<location line="+0"/>
|
||||
<source>%1 of %2 RetroShare link processed.</source>
|
||||
<translation>%1 von %2 RetroShare Link verarbeitet.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-104"/>
|
||||
<location line="+11"/>
|
||||
<source>Channel Request canceled</source>
|
||||
<translation>Kanalanfrage abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-11"/>
|
||||
<source>The channel "%1" could not be found.</source>
|
||||
<translation>Der Kanal "%1" konnte nicht gefunden werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+62"/>
|
||||
<source>Cannot send a message to a not accepted receipient "%1".</source>
|
||||
<translation>Nachricht kann nicht an den nicht akzeptierten Empfänger "%1" senden.</translation>
|
||||
<location line="+6"/>
|
||||
<source>File added</source>
|
||||
<translation>Datei hinzugefügt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Files added</source>
|
||||
<translation>Dateien hinzugefügt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+5"/>
|
||||
<source>File exist</source>
|
||||
<translation>Datei vorhanden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Files exist</source>
|
||||
<translation>Dateien vorhanden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7"/>
|
||||
<source>Message Request canceled</source>
|
||||
<translation>Nachrichtenanfrage abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+13"/>
|
||||
<source>File Request Error</source>
|
||||
<translation>Fehler bei der Dateianforderung</translation>
|
||||
<source>Friend added</source>
|
||||
<translation>Freund hinzugefügt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Friends added</source>
|
||||
<translation>Freunde hinzugefügt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+5"/>
|
||||
<source>Friend exist</source>
|
||||
<translation>Freund vorhanden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Friends exist</source>
|
||||
<translation>Freunde vorhanden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+3"/>
|
||||
<source>Friend not added</source>
|
||||
<translation>Freund nicht hinzugefügt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Friends not added</source>
|
||||
<translation>Freunde nicht hinzugefügt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+3"/>
|
||||
<source>Friend not found</source>
|
||||
<translation>Freund nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Friends not found</source>
|
||||
<translation>Freunde nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7"/>
|
||||
<source>Forum not found</source>
|
||||
<translation>Forum nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Forums not found</source>
|
||||
<translation>Foren nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+3"/>
|
||||
<source>Forum message not found</source>
|
||||
<translation>Forumbeitrag nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Forum messages not found</source>
|
||||
<translation>Forenbeiträge nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7"/>
|
||||
<source>Channel not found</source>
|
||||
<translation>Kanal nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Channels not found</source>
|
||||
<translation>Kanäle nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+3"/>
|
||||
<source>Channel message not found</source>
|
||||
<translation>Kanalbeitrag nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Channel messages not found</source>
|
||||
<translation>Kanalbeiträge nicht gefunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7"/>
|
||||
<source>Receipient not accepted</source>
|
||||
<translation>Empfänger nicht akzeptiert</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Receipients not accepted</source>
|
||||
<translation>Empfänger nicht akzeptiert</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+3"/>
|
||||
<source>Unkown receipient</source>
|
||||
<translation>Unbekannter Empfänger</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Unkown receipients</source>
|
||||
<translation>Unbekannte Empfänger</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+6"/>
|
||||
<source>Malformed links</source>
|
||||
<translation>Unbekannte Links</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+3"/>
|
||||
<source>Invalid links</source>
|
||||
<translation>Ungültige Links</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+5"/>
|
||||
<source>Result</source>
|
||||
<translation>Ergebnis</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Request Confirmation</source>
|
||||
<translation type="obsolete">Anfrage bestätigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Channel Request canceled</source>
|
||||
<translation type="obsolete">Kanalanfrage abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The channel "%1" could not be found.</source>
|
||||
<translation type="obsolete">Der Kanal "%1" konnte nicht gefunden werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot send a message to a not accepted receipient "%1".</source>
|
||||
<translation type="obsolete">Nachricht kann nicht an den nicht akzeptierten Empfänger "%1" senden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Message Request canceled</source>
|
||||
<translation type="obsolete">Nachrichtenanfrage abgebrochen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>File Request Error</source>
|
||||
<translation type="obsolete">Fehler bei der Dateianforderung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The file link is malformed.</source>
|
||||
<translation>Link ist fehlerhaft.</translation>
|
||||
<translation type="obsolete">Link ist fehlerhaft.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/elastic/node.cpp" line="+346"/>
|
||||
|
Loading…
Reference in New Issue
Block a user