Changed the generation of the gpg key and location to utf8.

The existing gpg keys and locations with umlauts are now shown wrong. The changes are not backward compatible.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4460 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-07-17 23:07:29 +00:00
parent 7d4b8288ca
commit 8d4a4db027
32 changed files with 103 additions and 118 deletions

View File

@ -1744,7 +1744,7 @@ void ForumsFillThread::run()
item->setText(COLUMN_THREAD_TITLE, QString::fromStdWString(tit->title));
text = QString::fromStdString(rsPeers->getPeerName(msginfo.srcId));
text = QString::fromUtf8(rsPeers->getPeerName(msginfo.srcId).c_str());
if (text.isEmpty())
{
item->setText(COLUMN_THREAD_AUTHOR, tr("Anonymous"));
@ -1858,7 +1858,7 @@ void ForumsFillThread::run()
child->setText(COLUMN_THREAD_TITLE, QString::fromStdWString(mit->title));
text = QString::fromStdString(rsPeers->getPeerName(msginfo.srcId));
text = QString::fromUtf8(rsPeers->getPeerName(msginfo.srcId).c_str());
if (text.isEmpty())
{
child->setText(COLUMN_THREAD_AUTHOR, tr("Anonymous"));

View File

@ -256,7 +256,7 @@ FriendsDialog::FriendsDialog(QWidget *parent)
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
QString titleStr("<span style=\"font-size:16pt; font-weight:500;"
"color:#32cd32;\">%1</span>");
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + " (" + tr("me") + ") " + QString::fromUtf8(pd.location.c_str())));
ui.nicklabel->setText(titleStr.arg(QString::fromUtf8(pd.name.c_str()) + " (" + tr("me") + ") " + QString::fromUtf8(pd.location.c_str())));
}
/* Hide platform specific features */
@ -842,7 +842,7 @@ void FriendsDialog::insertPeers()
availableCount++;
QString gpgItemText = QString::fromStdString(detail.name);
QString gpgItemText = QString::fromUtf8(detail.name.c_str());
// remove items that are not friends anymore
int childCount = gpgItem->childCount();
@ -1397,7 +1397,7 @@ void FriendsDialog::updateStatusString(const QString& peer_id, const QString& st
std::cerr << "FriendsDialog: received group chat typing info. updating gui." << std::endl ;
#endif
QString status = QString::fromStdString(rsPeers->getPeerName(peer_id.toStdString())) + " " + tr(status_string.toAscii());
QString status = QString::fromUtf8(rsPeers->getPeerName(peer_id.toStdString()).c_str()) + " " + tr(status_string.toAscii());
ui.statusStringLabel->setText(status) ; // displays info for 5 secs.
QTimer::singleShot(5000,this,SLOT(resetStatusBar())) ;
@ -1496,7 +1496,7 @@ void FriendsDialog::insertChat()
QDateTime sendTime = QDateTime::fromTime_t(it->sendTime);
QDateTime recvTime = QDateTime::fromTime_t(it->recvTime);
QString name = QString::fromStdString(rsPeers->getPeerName(it->rsid));
QString name = QString::fromUtf8(rsPeers->getPeerName(it->rsid).c_str());
QString msg = QString::fromStdWString(it->msg);
#ifdef FRIENDS_DEBUG

View File

@ -114,13 +114,6 @@ void GenCertDialog::show()
}
}
void GenCertDialog::closeEvent (QCloseEvent * event)
{
QDialog::closeEvent(event);
}
void GenCertDialog::closeinfodlg()
{
close();
@ -163,11 +156,11 @@ void GenCertDialog::genPerson()
{
/* Check the data from the GUI. */
std::string genLoc = ui.location_input->text().toStdString();
std::string genLoc = ui.location_input->text().toUtf8().constData();
std::string PGPId;
if (!genNewGPGKey) {
if (ui.location_input->text().length() < 3) {
if (genLoc.length() < 3) {
/* Message Dialog */
QMessageBox::warning ( NULL,
tr("Generate GPG key Failure"),
@ -226,7 +219,7 @@ void GenCertDialog::genPerson()
QCoreApplication::processEvents();
while(QAbstractEventDispatcher::instance()->processEvents(QEventLoop::AllEvents)) ;
RsInit::GeneratePGPCertificate(ui.name_input->text().toStdString(), ui.email_input->text().toStdString(), ui.password_input->text().toStdString(), PGPId, err_string);
RsInit::GeneratePGPCertificate(ui.name_input->text().toUtf8().constData(), ui.email_input->text().toUtf8().constData(), ui.password_input->text().toStdString(), PGPId, err_string);
setCursor(Qt::ArrowCursor) ;
}

View File

@ -44,9 +44,6 @@ public slots:
/** Overloaded QWidget.show */
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void closeinfodlg();

View File

@ -1081,7 +1081,7 @@ void MessagesDialog::insertMessages()
// From ....
{
if (msgbox == RS_MSG_INBOX || msgbox == RS_MSG_OUTBOX) {
text = QString::fromStdString(rsPeers->getPeerName(it->srcId));
text = QString::fromUtf8(rsPeers->getPeerName(it->srcId).c_str());
} else {
if (bGotInfo || rsMsgs->getMessage(it->msgId, msgInfo)) {
bGotInfo = true;
@ -1099,7 +1099,7 @@ void MessagesDialog::insertMessages()
if (peerName.empty()) {
text += PeerDefs::rsid("", *pit);
} else {
text += QString::fromStdString(peerName);
text += QString::fromUtf8(peerName.c_str());
}
}
} else {

View File

@ -763,7 +763,7 @@ void MessengerWindow::insertPeers()
gpgIcon = QIcon(StatusDefs::imageIM(bestRSState));
gpg_item->setText(COLUMN_NAME, QString::fromStdString(detail.name));
gpg_item->setText(COLUMN_NAME, QString::fromUtf8(detail.name.c_str()));
gpg_item -> setToolTip(COLUMN_NAME, StatusDefs::tooltip(bestRSState));
std::map<std::string, QString>::iterator customStateString = sslCustomStateStrings.find(bestSslId);
@ -783,14 +783,14 @@ void MessengerWindow::insertPeers()
if (stateString.isEmpty()) {
/* show only the name */
gpg_item->setText(COLUMN_NAME, QString::fromStdString(detail.name));
gpg_item->setText(COLUMN_NAME, QString::fromUtf8(detail.name.c_str()));
} else {
/* show the name with location */
gpg_item->setText(COLUMN_NAME, QString::fromStdString(detail.name) + "\n" + stateString);
gpg_item->setText(COLUMN_NAME, QString::fromUtf8(detail.name.c_str()) + "\n" + stateString);
}
} else {
/* show the name with custom state string */
gpg_item->setText(COLUMN_NAME, QString::fromStdString(detail.name) + "\n" + customStateString->second);
gpg_item->setText(COLUMN_NAME, QString::fromUtf8(detail.name.c_str()) + "\n" + customStateString->second);
}
gpg_item->setData(COLUMN_NAME, ROLE_SORT, BuildStateSortString(sortState, gpg_item->text(COLUMN_NAME), bestPeerState));
@ -798,7 +798,7 @@ void MessengerWindow::insertPeers()
#endif // MINIMAL_RSGUI
} else if (gpg_online) {
gpg_item->setHidden(hideOfflineFriends);
gpg_item->setText(COLUMN_NAME, QString::fromStdString(detail.name));
gpg_item->setText(COLUMN_NAME, QString::fromUtf8(detail.name.c_str()));
gpgIcon = QIcon(IMAGE_AVAIBLE);
gpg_item->setData(COLUMN_NAME, ROLE_SORT, BuildStateSortString(sortState, gpg_item->text(COLUMN_NAME), PEER_STATE_AVAILABLE));
QFont font;
@ -809,7 +809,7 @@ void MessengerWindow::insertPeers()
}
} else {
gpg_item->setHidden(hideOfflineFriends);
gpg_item->setText(COLUMN_NAME, QString::fromStdString(detail.name));
gpg_item->setText(COLUMN_NAME, QString::fromUtf8(detail.name.c_str()));
gpgIcon = QIcon(StatusDefs::imageIM(RS_STATUS_OFFLINE));
gpg_item->setData(COLUMN_NAME, ROLE_SORT, BuildStateSortString(sortState, gpg_item->text(COLUMN_NAME), PEER_STATE_OFFLINE));

View File

@ -442,7 +442,7 @@ void NetworkDialog::insertConnect()
item -> setSizeHint(0, QSize( 18,18 ) );
/* (1) Person */
item -> setText(COLUMN_PEERNAME, QString::fromStdString(detail.name));
item -> setText(COLUMN_PEERNAME, QString::fromUtf8(detail.name.c_str()));
/* (4) key id */
item -> setText(COLUMN_PEERID, QString::fromStdString(detail.id));
@ -505,7 +505,7 @@ void NetworkDialog::insertConnect()
backgrndcolor=QColor("#B242B2"); //kind of purple
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
for(int k=0;k<8;++k)
item -> setToolTip(k, QString::fromStdString(detail.name) + tr(" has authenticated you. \nRight-click and select 'make friend' to be able to connect."));
item -> setToolTip(k, QString::fromUtf8(detail.name.c_str()) + tr(" has authenticated you. \nRight-click and select 'make friend' to be able to connect."));
}
else
{
@ -546,7 +546,7 @@ void NetworkDialog::insertConnect()
}
self_item -> setText(0, "0");
self_item->setIcon(0,(QIcon(IMAGE_AUTHED)));
self_item->setText(COLUMN_PEERNAME, QString::fromStdString(ownGPGDetails.name) + " (" + tr("yourself") + ")");
self_item->setText(COLUMN_PEERNAME, QString::fromUtf8(ownGPGDetails.name.c_str()) + " (" + tr("yourself") + ")");
self_item->setText(2,"N/A");
self_item->setText(COLUMN_PEERID, QString::fromStdString(ownGPGDetails.id));

View File

@ -391,7 +391,7 @@ QString FlatStyle_RDM::computeDirectoryPath(const DirDetails& details) const
do
{
#endif
dir = QString::fromStdString(det.name)+"/"+dir ;
dir = QString::fromUtf8(det.name.c_str())+"/"+dir ;
#ifdef SHOW_TOTAL_PATH
if(!requestDirDetails(det.parent,det,flags))
@ -411,7 +411,7 @@ QVariant FlatStyle_RDM::displayRole(const DirDetails& details,int coln) const
case 0: return QString::fromUtf8(details.name.c_str());
case 1: return misc::friendlyUnit(details.count);
case 2: return misc::userFriendlyDuration(details.age);
case 3: return QString::fromStdString(rsPeers->getPeerName(details.id));
case 3: return QString::fromUtf8(rsPeers->getPeerName(details.id).c_str());
case 4: return computeDirectoryPath(details);
default:
return QVariant() ;
@ -497,7 +497,7 @@ QVariant FlatStyle_RDM::sortRole(const QModelIndex& index,const DirDetails& deta
case 0: return QString::fromUtf8(details.name.c_str());
case 1: return (qulonglong) details.count;
case 2: return details.age;
case 3: return QString::fromStdString(rsPeers->getPeerName(details.id));
case 3: return QString::fromUtf8(rsPeers->getPeerName(details.id).c_str());
case 4: return _ref_entries[index.row()].second ;
}
}

View File

@ -549,7 +549,7 @@ QString RetroShareLink::toString(bool encoded /*= true*/) const
QString RetroShareLink::niceName() const
{
if (type() == TYPE_PERSON) {
return PeerDefs::rsid(name().toStdString(), hash().toStdString());
return PeerDefs::rsid(name().toUtf8().constData(), hash().toStdString());
}
return name();

View File

@ -76,7 +76,7 @@ StartDialog::StartDialog(QWidget *parent, Qt::WFlags flags)
const QVariant & userData = QVariant(QString::fromStdString(*it));
std::string gpgid, name, email, location;
RsInit::getAccountDetails(*it, gpgid, name, email, location);
QString accountName = QString::fromStdString(name + " (") + QString::fromStdString(gpgid).right(8) + ") - " + QString::fromStdString(location);
QString accountName = QString::fromUtf8(name.c_str()) + " (" + QString::fromStdString(gpgid).right(8) + ") - " + QString::fromUtf8(location.c_str());
ui.loadName->addItem(accountName, userData);
if (preferedId == *it)

View File

@ -1047,7 +1047,7 @@ void TransfersDialog::insertTransfers()
QString TransfersDialog::getPeerName(const std::string& id) const
{
QString res = QString::fromStdString(rsPeers->getPeerName(id)) ;
QString res = QString::fromUtf8(rsPeers->getPeerName(id).c_str()) ;
// This is because turtle tunnels have no name (I didn't want to bother with
// connect mgr). In such a case their id can suitably hold for a name.

View File

@ -116,10 +116,10 @@ int TrustView::getRowColId(const string& peerid)
peeridToRow[peerid] = i ;
std::string name = rsPeers->getPeerName(peerid) ;
QString name = QString::fromUtf8(rsPeers->getPeerName(peerid).c_str()) ;
trustTableTW->setHorizontalHeaderItem(i,new QTableWidgetItem(QString(name.c_str()))) ;
trustTableTW->setVerticalHeaderItem(i,new QTableWidgetItem(QString(name.c_str()))) ;
trustTableTW->setHorizontalHeaderItem(i,new QTableWidgetItem(name)) ;
trustTableTW->setVerticalHeaderItem(i,new QTableWidgetItem(name)) ;
trustTableTW->setColumnWidth(i,_base_cell_width) ;
trustTableTW->setRowHeight(i,_base_cell_height) ;

View File

@ -100,7 +100,7 @@ QString TurtleRouterDialog::getPeerName(const std::string& peer_id)
if(!rsPeers->getPeerDetails(peer_id,detail))
return "unknown peer";
return (names[peer_id] = QString::fromStdString(detail.name)) ;
return (names[peer_id] = QString::fromUtf8(detail.name.c_str())) ;
}
}
@ -136,7 +136,7 @@ void TurtleRouterDialog::updateTunnelRequests( const std::vector<std::vector<std
if(parent->text(0).left(14) == QString("Unknown hashes"))
unknown_hash_found = true ;
QString str = QString::fromStdString( "Tunnel id: " + tunnels_info[i][0] + "\t [" + tunnels_info[i][2] + "] --> [" + tunnels_info[i][1] + "]\t\t last transfer: " + tunnels_info[i][4] + "\t Speed: " + tunnels_info[i][5] ) ;
QString str = "Tunnel id: " + QString::fromUtf8(tunnels_info[i][0].c_str()) + "\t [" + QString::fromUtf8(tunnels_info[i][2].c_str()) + "] --> [" + QString::fromUtf8(tunnels_info[i][1].c_str()) + "]\t\t last transfer: " + QString::fromStdString(tunnels_info[i][4]) + "\t Speed: " + QString::fromStdString(tunnels_info[i][5]) ;
stl.clear() ;
stl.push_back(str) ;

View File

@ -256,7 +256,7 @@ QString TurtleRouterStatistics::getPeerName(const std::string& peer_id)
if(!rsPeers->getPeerDetails(peer_id,detail))
return "unknown peer";
return (names[peer_id] = QString::fromStdString(detail.name)) ;
return (names[peer_id] = QString::fromUtf8(detail.name.c_str())) ;
}
}

View File

@ -473,7 +473,7 @@ void PopupChatDialog::updateStatusTyping()
//
void PopupChatDialog::updateStatusString(const QString& peer_id, const QString& status_string)
{
QString status = QString::fromStdString(rsPeers->getPeerName(peer_id.toStdString())) + " " + tr(status_string.toAscii());
QString status = QString::fromUtf8(rsPeers->getPeerName(peer_id.toStdString()).c_str()) + " " + tr(status_string.toAscii());
ui.statusLabel->setText(status); // displays info for 5 secs.
ui.typingpixmapLabel->setPixmap(QPixmap(":images/typing.png") );
@ -601,7 +601,7 @@ void PopupChatDialog::insertChatMsgs()
continue;
}
addChatMsg(true, it->rsid, QString::fromStdString(rsPeers->getPeerName(it->rsid)), QDateTime::fromTime_t(it->sendTime), QDateTime::fromTime_t(it->recvTime), QString::fromStdWString(it->msg), TYPE_NORMAL, true);
addChatMsg(true, it->rsid, QString::fromUtf8(rsPeers->getPeerName(it->rsid).c_str()), QDateTime::fromTime_t(it->sendTime), QDateTime::fromTime_t(it->recvTime), QString::fromStdWString(it->msg), TYPE_NORMAL, true);
}
rsMsgs->clearPrivateChatQueue(true, dialogId);
@ -726,7 +726,7 @@ void PopupChatDialog::sendChat()
if (rsMsgs->sendPrivateChat(dialogId, msg)) {
QDateTime currentTime = QDateTime::currentDateTime();
addChatMsg(false, ownId, QString::fromStdString(rsPeers->getPeerName(ownId)), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL, true);
addChatMsg(false, ownId, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL, true);
}
chatWidget->clear();
@ -1018,7 +1018,7 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
if (rsMsgs->sendPrivateChat(dialogId, msg)) {
QDateTime currentTime = QDateTime::currentDateTime();
addChatMsg(false, ownId, QString::fromStdString(rsPeers->getPeerName(ownId)), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL, true);
addChatMsg(false, ownId, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL, true);
}
}

View File

@ -136,7 +136,7 @@ void ConfCertDialog::load()
return;
}
ui.name->setText(QString::fromStdString(detail.name));
ui.name->setText(QString::fromUtf8(detail.name.c_str()));
ui.peerid->setText(QString::fromStdString(detail.id));
RetroShareLink link;
@ -325,7 +325,7 @@ void ConfCertDialog::load()
font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch);
font.setStyle(QFont::StyleNormal);
ui.userCertificateText->setFont(font);
ui.userCertificateText->setText(QString::fromStdString(invite));
ui.userCertificateText->setText(QString::fromUtf8(invite.c_str()));
}

View File

@ -347,7 +347,7 @@ void TextPage::updateOwnCert()
font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch);
font.setStyle(QFont::StyleNormal);
userCertEdit->setFont(font);
userCertEdit->setText(QString::fromStdString(invite));
userCertEdit->setText(QString::fromUtf8(invite.c_str()));
}
//
@ -369,7 +369,7 @@ static void sendMail (std::string sAddress, std::string sSubject, std::string sB
std::cerr << "MAIL STRING:" << mailstr.c_str() << std::endl;
/* pass the url directly to QDesktopServices::openUrl */
QDesktopServices::openUrl (QUrl (QString::fromStdString(mailstr)));
QDesktopServices::openUrl (QUrl (QString::fromUtf8(mailstr.c_str())));
}
void
@ -380,7 +380,7 @@ TextPage::runEmailClient()
void TextPage::cleanFriendCert()
{
std::string cert = friendCertEdit->toPlainText().toStdString();
std::string cert = friendCertEdit->toPlainText().toUtf8().constData();
std::string cleanCert;
if (rsPeers->cleanCertificate(cert, cleanCert)) {
@ -462,7 +462,7 @@ void TextPage::setCurrentFileName(const QString &fileName)
int TextPage::nextId() const {
std::string certstr;
certstr = friendCertEdit->toPlainText().toStdString();
certstr = friendCertEdit->toPlainText().toUtf8().constData();
std::string error_string ;
RsPeerDetails pd;
if ( rsPeers->loadDetailsFromStringCert(certstr, pd,error_string) ) {
@ -611,7 +611,7 @@ void FofPage::updatePeersList(int e) {
_gpg_id_boxes[cb] = details.gpg_id ;
selectedPeersTW->setCellWidget(row,0,cb) ;
selectedPeersTW->setItem(row,1,new QTableWidgetItem(QString::fromStdString(details.name))) ;
selectedPeersTW->setItem(row,1,new QTableWidgetItem(QString::fromUtf8(details.name.c_str()))) ;
QComboBox *qcb = new QComboBox ;
@ -1098,16 +1098,16 @@ void ConclusionPage::initializePage() {
QString ts;
std::list<std::string>::iterator it;
for(it = detail.gpgSigners.begin(); it != detail.gpgSigners.end(); it++) {
ts.append(QString::fromStdString( rsPeers->getPeerName(*it) ));
ts.append(QString::fromUtf8( rsPeers->getPeerName(*it).c_str() ));
ts.append( "<" ) ;
ts.append( QString::fromStdString(*it) );
ts.append( ">" );
ts.append( "\n" );
}
nameEdit->setText( QString::fromStdString( detail.name ) ) ;
nameEdit->setText( QString::fromUtf8( detail.name.c_str() ) ) ;
trustEdit->setText(QString::fromStdString( trustString ) ) ;
emailEdit->setText(QString::fromStdString( detail.email ) );
emailEdit->setText(QString::fromUtf8( detail.email.c_str() ) );
locEdit->setText( QString::fromUtf8( detail.location.c_str() ) );
signersEdit->setPlainText( ts );

View File

@ -163,7 +163,7 @@ void GraphWidget::clearGraph()
GraphWidget::NodeId GraphWidget::addNode(const std::string& node_short_string,const std::string& node_complete_string,NodeType type,AuthType auth,const std::string& ssl_id,const std::string& gpg_id)
{
Node *node = new Node(node_short_string,type,auth,this,ssl_id,gpg_id);
node->setToolTip(QString::fromStdString(node_complete_string)) ;
node->setToolTip(QString::fromUtf8(node_complete_string.c_str())) ;
_nodes.push_back(node) ;
scene()->addItem(node);

View File

@ -265,11 +265,11 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
painter->setBrush(gradient);
painter->setPen(QPen(Qt::black, 0));
painter->drawEllipse(-10, -10, 20, 20);
painter->drawText(-10, 0, QString::fromStdString(_desc_string));
painter->drawText(-10, 0, QString::fromUtf8(_desc_string.c_str()));
if (!mDeterminedBB)
{
QRect textBox = painter->boundingRect(-10, 0, 400, 20, 0, QString::fromStdString(_desc_string));
QRect textBox = painter->boundingRect(-10, 0, 400, 20, 0, QString::fromUtf8(_desc_string.c_str()));
mBBWidth = textBox.width();
mDeterminedBB = true;
}

View File

@ -85,7 +85,7 @@ void ChatMsgItem::updateItemStatic()
"color:#990033;\">%1</span>");
/* set Peer name */
QString peername = QString::fromStdString(details.name);
QString peername = QString::fromUtf8(details.name.c_str());
peernameLabel->setText(nameStr.arg(peername));
}
else

View File

@ -85,7 +85,7 @@ void MsgItem::updateItemStatic()
QString title;
QString timestamp;
QString srcName = QString::fromStdString(rsPeers->getPeerName(mi.srcId));
QString srcName = QString::fromUtf8(rsPeers->getPeerName(mi.srcId).c_str());
{
QDateTime qtime;

View File

@ -120,7 +120,7 @@ void PeerItem::updateItemStatic()
"color:#990033;\">%1</span>");
/* set Blog name */
QString peername = QString::fromStdString(details.name);
QString peername = QString::fromUtf8(details.name.c_str());
peernameLabel->setText(nameStr.arg(peername));
QDateTime date = QDateTime::fromTime_t(details.lastConnect);

View File

@ -60,7 +60,7 @@ void SubDestItem::updateItemStatic()
typeLabel->setText("Message To: ");
if (rsPeers)
{
name = QString::fromStdString(rsPeers->getPeerName(mGroupId));
name = QString::fromUtf8(rsPeers->getPeerName(mGroupId).c_str());
}
}
break;

View File

@ -131,7 +131,7 @@ std::string NotifyQt::askForPassword(const std::string& key_details,bool prev_is
QInputDialog dialog;
dialog.setWindowTitle(tr("GPG key passphrase"));
dialog.setLabelText((prev_is_bad?tr("Wrong password !") + "\n\n" : QString()) +
tr("Please enter the password to unlock the following GPG key:") + "\n" + QString::fromStdString(key_details));
tr("Please enter the password to unlock the following GPG key:") + "\n" + QString::fromUtf8(key_details.c_str()));
dialog.setTextEchoMode(QLineEdit::Password);
dialog.setWindowIcon(QIcon(":/images/rstray3.png"));
@ -454,16 +454,14 @@ void NotifyQt::UpdateGUI()
Toaster *toaster = NULL;
/* id the name */
std::string name;
std::string realmsg;
QString name;
unsigned char *data = NULL;
int size = 0 ;
if (type == RS_POPUP_DOWNLOAD) {
/* id = file hash */
} else {
name = rsPeers->getPeerName(id);
realmsg = "<strong>" + name + "</strong>";
name = QString::fromUtf8(rsPeers->getPeerName(id).c_str());
rsMsgs->getAvatarData(id,data,size);
}
@ -473,7 +471,7 @@ void NotifyQt::UpdateGUI()
case RS_POPUP_MSG:
if (popupflags & RS_POPUP_MSG)
{
toaster = new Toaster(new MessageToaster(QString::fromStdString(realmsg), QString::fromStdString(title), QString::fromStdString(msg)));
toaster = new Toaster(new MessageToaster(name, QString::fromUtf8(title.c_str()), QString::fromStdString(msg)));
}
break;
case RS_POPUP_CONNECT:
@ -490,7 +488,7 @@ void NotifyQt::UpdateGUI()
avatar = QPixmap(":/images/user/personal64.png");
}
toaster = new Toaster(new OnlineToaster(id, QString::fromStdString(realmsg), avatar));
toaster = new Toaster(new OnlineToaster(id, name, avatar));
}
break;
case RS_POPUP_DOWNLOAD:

View File

@ -187,7 +187,7 @@ void ProfileView::update()
ui.idLineEdit->setText(QString::fromStdString(pId));
ui.nameLineEdit->setText(QString::fromStdString(detail.name));
ui.nameLineEdit->setText(QString::fromUtf8(detail.name.c_str()));
{
std::ostringstream out;
out << PostTs;

View File

@ -65,7 +65,7 @@ CryptoPage::load()
QFont font("Courier New",9,50,false) ;
ui.certtextEdit->setFont(font) ;
ui.certtextEdit->setPlainText(QString::fromStdString(rsPeers->GetRetroshareInvite(true)));
ui.certtextEdit->setPlainText(QString::fromUtf8(rsPeers->GetRetroshareInvite(true).c_str()));
ui.certtextEdit->setReadOnly(true);
ui.certtextEdit->setMinimumHeight(200);
}

View File

@ -35,7 +35,7 @@ MessageToaster::MessageToaster(const QString &name, const QString &title, const
ui.subjectline->setToolTip(title);
ui.contentBrowser->setText(message);
ui.contentBrowser->setToolTip(message);
ui.namelabel->setText(name);
ui.lblTitle->setText(ui.lblTitle->text() + " " + name);
}
void MessageToaster::openmessageClicked()

View File

@ -10,19 +10,6 @@
<height>100</height>
</rect>
</property>
<widget class="QLabel" name="namelabel">
<property name="geometry">
<rect>
<x>150</x>
<y>0</y>
<width>16</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="background">
<property name="geometry">
<rect>
@ -77,8 +64,14 @@
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&lt;b&gt;1 new Message from&lt;/b&gt;</string>
<string>1 new Message from</string>
</property>
</widget>
<widget class="QLabel" name="label">

View File

@ -141,7 +141,7 @@ void GamesDialog::updateGameList()
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
std::string serverName = rsPeers->getPeerName(it->serverId);
item -> setText(GAME_LIST_TYPE, QString::fromStdString(it->gameType));
item -> setText(GAME_LIST_SERVER, QString::fromStdString(serverName));
item -> setText(GAME_LIST_SERVER, QString::fromUtf8(serverName.c_str()));
item -> setText(GAME_LIST_NAME, QString::fromStdWString(it->gameName));
item -> setText(GAME_LIST_STATUS, QString::fromStdString(it->status));
item -> setText(GAME_LIST_ID, QString::fromStdString(it->gameId));
@ -245,7 +245,7 @@ void GamesDialog::updateGameDetails()
name = "Yourself";
}
item -> setText(GAME_PEER_PLAYER, QString::fromStdString(name));
item -> setText(GAME_PEER_PLAYER, QString::fromUtf8(name.c_str()));
if (it->second.invite)
item -> setText(GAME_PEER_INVITE, "Yes");
@ -294,7 +294,7 @@ void GamesDialog::updateGameDetails()
/* make a widget per friend */
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
item -> setText(GAME_PEER_PLAYER, QString::fromStdString(name));
item -> setText(GAME_PEER_PLAYER, QString::fromUtf8(name.c_str()));
item -> setText(GAME_PEER_INVITE, "No");
item -> setText(GAME_PEER_INTEREST, "?");
item -> setText(GAME_PEER_PLAY, "?");

View File

@ -286,7 +286,7 @@ void PhotoDialog::addShows(std::string id)
std::list<std::string>::iterator it;
QTreeWidgetItem *peerItem = new QTreeWidgetItem((QTreeWidget*)0);
peerItem->setText(PHOTO_PEER_COL_NAME, QString::fromStdString(rsPeers->getPeerName(id)));
peerItem->setText(PHOTO_PEER_COL_NAME, QString::fromUtf8(rsPeers->getPeerName(id).c_str()));
peerItem->setText(PHOTO_PEER_COL_PID, QString::fromStdString(id));
peerItem->setText(PHOTO_PEER_COL_SID, "");
peerItem->setText(PHOTO_PEER_COL_PHOTOID, "");

View File

@ -4759,7 +4759,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>GenCertDialog</name>
<message>
<location filename="../gui/GenCertDialog.cpp" line="+173"/>
<location filename="../gui/GenCertDialog.cpp" line="+166"/>
<location line="+22"/>
<source>Generate GPG key Failure</source>
<translation>Fehler beim Generieren des GPG Schlüssels</translation>
@ -4817,8 +4817,8 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="-192"/>
<location filename="../gui/GenCertDialog.cpp" line="-194"/>
<location line="+53"/>
<location filename="../gui/GenCertDialog.cpp" line="-187"/>
<location line="+46"/>
<source>Create new Profile</source>
<translation>Erstelle neues Profil</translation>
</message>
@ -4903,32 +4903,32 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;Arial&apos;; font-size:8pt; font-weight:600;&quot;&gt;Du kannst RetroShare an mehreren Standorten installieren und das selbe Profil (GPG Schlüssel) verwenden.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="../gui/GenCertDialog.cpp" line="-62"/>
<location line="+75"/>
<location filename="../gui/GenCertDialog.cpp" line="-55"/>
<location line="+68"/>
<source>Create new Location</source>
<translation>Erstelle neuen Ort</translation>
</message>
<message>
<location line="-74"/>
<location line="+75"/>
<location line="-67"/>
<location line="+68"/>
<source>Generate new Location</source>
<translation>Erstelle neues Ort</translation>
</message>
<message>
<location line="-74"/>
<location line="+75"/>
<location line="-67"/>
<location line="+68"/>
<source>Create a new Location</source>
<translation>Erstelle einen neuen Ort</translation>
</message>
<message>
<location line="-67"/>
<location line="+53"/>
<location line="-60"/>
<location line="+46"/>
<source>Generate new Profile</source>
<translation>Generiere neues Profil</translation>
</message>
<message>
<location line="-52"/>
<location line="+53"/>
<location line="-45"/>
<location line="+46"/>
<source>Create a new Profile</source>
<translation>Erstelle neues Profil</translation>
</message>
@ -5927,7 +5927,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Chat</translation>
</message>
<message>
<location line="+217"/>
<location line="+198"/>
<location line="+42"/>
<location line="+42"/>
<location line="+73"/>
@ -6001,12 +6001,12 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../gui/MainWindow.ui" line="+88"/>
<location filename="../gui/MainWindow.cpp" line="-748"/>
<location filename="../gui/MainWindow.cpp" line="-729"/>
<source>Options</source>
<translation>Optionen</translation>
</message>
<message>
<location filename="../gui/MainWindow.cpp" line="+781"/>
<location filename="../gui/MainWindow.cpp" line="+762"/>
<source>Hide</source>
<translation>Verbergen</translation>
</message>
@ -6016,7 +6016,7 @@ p, li { white-space: pre-wrap; }
<translation>Zeigen</translation>
</message>
<message>
<location line="-770"/>
<location line="-751"/>
<source>RetroShare</source>
<translation></translation>
</message>
@ -6072,7 +6072,7 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Schliessen</translation>
</message>
<message>
<location line="+191"/>
<location line="+172"/>
<location line="+42"/>
<location line="+42"/>
<location line="+188"/>
@ -6088,7 +6088,7 @@ p, li { white-space: pre-wrap; }
<translation>Du hast %1 neue Nachricht</translation>
</message>
<message>
<location line="-479"/>
<location line="-460"/>
<source>Bandwidth Graph</source>
<translation>Bandbreiten-Graph</translation>
</message>
@ -6162,7 +6162,7 @@ p, li { white-space: pre-wrap; }
<translation></translation>
</message>
<message>
<location line="+867"/>
<location line="+848"/>
<source>Do you really want to exit RetroShare ?</source>
<translation>Willst Du RetroShare wirklich beenden?</translation>
</message>
@ -6172,7 +6172,7 @@ p, li { white-space: pre-wrap; }
<translation>Wirklich beenden?</translation>
</message>
<message>
<location line="-767"/>
<location line="-748"/>
<source>Low disk space warning</source>
<translation>Wenig Festplatenspeicher</translation>
</message>
@ -6796,9 +6796,13 @@ Willst Du die Nachricht speichern ?</translation>
<context>
<name>MessageToaster</name>
<message>
<location filename="../gui/toaster/MessageToaster.ui" line="+81"/>
<source>&lt;b&gt;1 new Message from&lt;/b&gt;</source>
<translation>&lt;b&gt;1 neue Nachricht von&lt;/b&gt;</translation>
<translation type="obsolete">&lt;b&gt;1 neue Nachricht von&lt;/b&gt;</translation>
</message>
<message>
<location filename="../gui/toaster/MessageToaster.ui" line="+74"/>
<source>1 new Message from</source>
<translation>1 neue Nachricht von</translation>
</message>
<message>
<location line="+35"/>
@ -8167,7 +8171,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+7"/>
<location line="+97"/>
<location line="+90"/>
<source>Download completed</source>
<translation>Download fertig</translation>
</message>
@ -8176,7 +8180,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Kombiniertes Icon</translation>
</message>
<message>
<location line="-90"/>
<location line="-83"/>
<location line="+7"/>
<location line="+7"/>
<location line="+7"/>
@ -8185,7 +8189,7 @@ p, li { white-space: pre-wrap; }
<translation>Kombiniert</translation>
</message>
<message>
<location line="+36"/>
<location line="+29"/>
<source>Toasters</source>
<translation></translation>
</message>
@ -8245,7 +8249,7 @@ p, li { white-space: pre-wrap; }
<translation>Zeige Systemabschnitts-Nachricht an</translation>
</message>
<message>
<location line="-268"/>
<location line="-261"/>
<source>Add feeds at end</source>
<translation>Feeds am Ende anfügen</translation>
</message>