ConnectFriendWizard

- Cleaned includes
- Corrected call of mailto, certificate now has new lines in mail body

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3264 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-07-07 18:40:38 +00:00
parent 9495648d16
commit 3f7ad6ebd9

View File

@ -24,7 +24,6 @@
#include "rsiface/rspeers.h" //for rsPeers variable #include "rsiface/rspeers.h" //for rsPeers variable
#include "rsiface/rsiface.h" #include "rsiface/rsiface.h"
#include <QtGui>
#include <QLineEdit> #include <QLineEdit>
#include <QTextEdit> #include <QTextEdit>
#include <QLabel> #include <QLabel>
@ -33,25 +32,21 @@
#include <QCheckBox> #include <QCheckBox>
#include <QGroupBox> #include <QGroupBox>
#include <QComboBox> #include <QComboBox>
#include <QtGui>
#include <QClipboard> #include <QClipboard>
#include <QTableWidget> #include <QTableWidget>
#include <QHeaderView> #include <QHeaderView>
#include <QApplication>
#include <QFileDialog> #include <QFileDialog>
#include <QTextCodec>
#include <QGridLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHBoxLayout>
#include <QMessageBox> #include <QMessageBox>
#include <QDesktopServices>
#include <QRegExpValidator> #include <QFile>
#include <QRegExp> #include <QUrl>
#include <QTextStream>
#include <QDragEnterEvent>
#include <QDebug> #include <QDebug>
#include <sstream>
#include <iostream>
#include <set> #include <set>
#define SSL_ID_FIELD_CONNECT_FRIEND_WIZARD "idField" #define SSL_ID_FIELD_CONNECT_FRIEND_WIZARD "idField"
@ -291,30 +286,24 @@ TextPage::TextPage(QWidget *parent)
//============================================================================ //============================================================================
// //
#include <iostream>
//#include <windows.h>
void void
TextPage::runEmailClient() TextPage::runEmailClient()
{ {
std::string mailstr = "mailto:";
mailstr += "?subject=RetroShare Invite";
mailstr += "&body=";
mailstr += (userCertEdit->toPlainText()).toStdString();
/* search and replace the end of lines with: "%0D%0A" */ /* search and replace the end of lines with: "%0D%0A" */
std::cerr << "MAIL STRING:" << mailstr.c_str() << std::endl;
size_t loc; size_t loc;
while((loc = mailstr.find("\n")) != mailstr.npos) std::string cert = userCertEdit->toPlainText().toStdString();
{ while ((loc = cert.find("\n")) != cert.npos) {
/* sdfkasdflkjh */ cert.replace(loc, 1, "%0D%0A");
mailstr.replace(loc, 1, "%0D%0A");
} }
QDesktopServices::openUrl( QUrl::fromEncoded( mailstr.c_str() ) ); std::string mailstr = "mailto:";
mailstr += "?subject=RetroShare Invite";
mailstr += "&body=" + cert;
std::cerr << "MAIL STRING:" << mailstr.c_str() << std::endl;
/* pass the url directly to QDesktopServices::openUrl */
QDesktopServices::openUrl (QUrl (QString::fromStdString(mailstr)));
} }
// //