fixed whitespaces in strings (patch from Henry)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8421 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-06-12 08:27:26 +00:00
parent dd4760c25f
commit d9e1473533
33 changed files with 181 additions and 181 deletions

View File

@ -136,13 +136,13 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
/** Setup the actions for the header context menu */
showUserCountAct= new QAction(headerItem->text(COLUMN_USER_COUNT),this);
showUserCountAct->setCheckable(true); showUserCountAct->setToolTip(tr("Show ")+showUserCountAct->text()+tr(" Column"));
showUserCountAct->setCheckable(true); showUserCountAct->setToolTip(tr("Show")+" "+showUserCountAct->text()+" "+tr("column"));
connect(showUserCountAct,SIGNAL(triggered(bool)),this,SLOT(setShowUserCountColumn(bool))) ;
showTopicAct= new QAction(headerItem->text(COLUMN_TOPIC),this);
showTopicAct->setCheckable(true); showTopicAct->setToolTip(tr("Show ")+showTopicAct->text()+tr(" Column"));
showTopicAct->setCheckable(true); showTopicAct->setToolTip(tr("Show")+" "+showTopicAct->text()+" "+tr("column"));
connect(showTopicAct,SIGNAL(triggered(bool)),this,SLOT(setShowTopicColumn(bool))) ;
showSubscribeAct= new QAction(headerItem->text(COLUMN_SUBSCRIBED),this);
showSubscribeAct->setCheckable(true); showSubscribeAct->setToolTip(tr("Show ")+showSubscribeAct->text()+tr(" Column"));
showSubscribeAct->setCheckable(true); showSubscribeAct->setToolTip(tr("Show")+" "+showSubscribeAct->text()+" "+tr("column"));
connect(showSubscribeAct,SIGNAL(triggered(bool)),this,SLOT(setShowSubscribeColumn(bool))) ;
// Set initial size of the splitter
@ -334,10 +334,10 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby
for (int column = 0; column < COLUMN_COUNT; ++column) {
item->setTextColor(column, color);
}
item->setToolTip(0,QObject::tr("Subject: ")+item->text(COLUMN_TOPIC)+"\n"
+QObject::tr("Participants: ")+QString::number(count)+"\n"
+QObject::tr("Auto Subscribe: ")+(autoSubscribe? QObject::tr("enabled"): QObject::tr("disabled"))+"\n"
+QObject::tr("Id: ")+QString::number(id,16)) ;
item->setToolTip(0,QObject::tr("Subject:")+" "+item->text(COLUMN_TOPIC)+"\n"
+QObject::tr("Participants:")+" "+QString::number(count)+"\n"
+QObject::tr("Auto Subscribe:")+" "+(autoSubscribe? QObject::tr("enabled"): QObject::tr("disabled"))+"\n"
+QObject::tr("Id:")+" "+QString::number(id,16)) ;
}
void ChatLobbyWidget::addChatPage(ChatLobbyDialog *d)

View File

@ -1039,7 +1039,7 @@ int TransfersDialog::addItem(int row, const FileInfo &fileInfo)
std::string rsversion;
if (rsDisc->getPeerVersion(transferInfo.peerId, rsversion))
{
version = tr("version: ") + QString::fromStdString(rsversion);
version = tr("version:")+" " + QString::fromStdString(rsversion);
}
double peerDlspeed = 0;

View File

@ -253,7 +253,7 @@ QString GetStartedDialog::GetInviteText()
text += tr("You can get RetroShare here: %1").arg(URL_DOWNLOAD) + "\n";
text += "\n";
text += tr("RetroShare is a private Friend-2-Friend sharing network.") + "\n";
text += tr("It has many features, including built-in chat, messaging, ") + "\n";
text += tr("It has many features, including built-in chat, messaging,") + "\n";
text += tr("forums and channels, all of which are as secure as the file-sharing.") + "\n";
text += "\n";
text += "\n";
@ -274,7 +274,7 @@ void GetStartedDialog::emailSubscribe()
// when translation is needed, replace QString by tr
QString text = QString("Please let me know when RetroShare has a new release, or exciting news") + "\n";
text += "\n";
text += QString("Furthermore, I'd like to say ... ") + "\n";
text += QString("Furthermore, I'd like to say ...") + "\n";
text += "\n";
sendMail(EMAIL_SUBSCRIBE, "Subscribe", text);

View File

@ -187,11 +187,11 @@ IdDialog::IdDialog(QWidget *parent) :
/** Setup the actions for the header context menu */
hideIdAct= new QAction(headerItem->text(RSID_COL_KEYID),this);
hideIdAct->setCheckable(true); hideIdAct->setToolTip(tr("Show ")+hideIdAct->text()+tr(" Column"));
hideIdAct->setCheckable(true); hideIdAct->setToolTip(tr("Show")+" "+hideIdAct->text()+" "+tr("column"));
connect(hideIdAct,SIGNAL(triggered(bool)),this,SLOT(setHideIdColumn(bool))) ;
hideTypeAct= new QAction(headerItem->text(RSID_COL_IDTYPE),this);
hideTypeAct->setCheckable(true); hideTypeAct->setToolTip(tr("Show ")+hideTypeAct->text()+tr(" Column"));
hideTypeAct->setCheckable(true); hideTypeAct->setToolTip(tr("Show")+" "+hideTypeAct->text()+" "+tr("column"));
connect(hideTypeAct,SIGNAL(triggered(bool)),this,SLOT(setHideIdTypeColumn(bool))) ;
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
@ -431,8 +431,8 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item,
item->setToolTip(RSID_COL_IDTYPE,QString::fromStdString(data.mPgpId.toStdString())) ;
tooltip += tr("Node name: ") + QString::fromUtf8(details.name.c_str()) + "\n";
tooltip += tr("Node Id : ") + QString::fromStdString(data.mPgpId.toStdString()) ;
tooltip += tr("Node name:")+" " + QString::fromUtf8(details.name.c_str()) + "\n";
tooltip += tr("Node Id :")+" " + QString::fromStdString(data.mPgpId.toStdString()) ;
item->setToolTip(RSID_COL_KEYID,tooltip) ;
}
else
@ -864,7 +864,7 @@ void IdDialog::removeIdentity()
return;
}
if ((QMessageBox::question(this, tr("Really delete? "), tr("Do you really want to delete this identity?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No))== QMessageBox::Yes)
if ((QMessageBox::question(this, tr("Really delete?"), tr("Do you really want to delete this identity?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No))== QMessageBox::Yes)
{
std::string keyId = item->text(RSID_COL_KEYID).toStdString();

View File

@ -581,7 +581,7 @@ void MainWindow::displayDiskSpaceWarning(int loc,int size_limit_mb)
return ;
}
QMessageBox::critical(NULL,tr("Low disk space warning"),
tr("The disk space in your ")+locString +tr(" directory is running low (current limit is ")+QString::number(size_limit_mb)+tr("MB). \n\n RetroShare will now safely suspend any disk access to this directory. \n\n Please make some free space and click Ok.")) ;
tr("The disk space in your")+" "+locString +" "+tr("directory is running low (current limit is")+" "+QString::number(size_limit_mb)+tr("MB). \n\n RetroShare will now safely suspend any disk access to this directory. \n\n Please make some free space and click Ok.")) ;
}
/** Creates a tray icon with a context menu and adds it to the system
@ -1121,7 +1121,7 @@ void MainWindow::doQuit()
queryWrn.clear();
queryWrn.append(tr("Do you really want to exit RetroShare ?"));
if ((QMessageBox::question(this, tr("Really quit ? "),queryWrn,QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes)
if ((QMessageBox::question(this, tr("Really quit ?"),queryWrn,QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes)
{
qApp->quit();
}

View File

@ -284,7 +284,7 @@ void NetworkDialog::removeUnusedKeys()
break ;
}
QMessageBox::warning(NULL,tr("Keyring info"),tr("Key removal has failed. Your keyring remains intact.\n\nReported error: ")+error_string ) ;
QMessageBox::warning(NULL,tr("Keyring info"),tr("Key removal has failed. Your keyring remains intact.\n\nReported error:")+" "+error_string ) ;
}
insertConnect() ;
}

View File

@ -63,16 +63,16 @@ void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info)
m_myName = QString::fromUtf8(_group_info.mMeta.mGroupName.c_str());
ui->labelName->setText(m_myName);
if (_havePGPDetail) {
ui->labelName->setToolTip(tr("GXS name: ").append(m_myName).append("\n")
.append(tr("PGP name: ").append(_nickname)));
ui->labelName->setToolTip(tr("GXS name:").append(" "+m_myName).append("\n")
.append(tr("PGP name:").append(" "+_nickname)));
} else {//if (m_myName != _nickname)
ui->labelName->setToolTip(tr("GXS name: ").append(m_myName));
ui->labelName->setToolTip(tr("GXS name:").append(" "+m_myName));
}//else (m_myName != _nickname)
_gxsId = QString::fromStdString(_group_info.mMeta.mGroupId.toStdString());
ui->labelGXSId->setText(_gxsId);
ui->labelGXSId->setToolTip(tr("GXS id: ").append(_gxsId));
ui->labelGXSId->setToolTip(tr("GXS id:").append(" "+_gxsId));
if (!_havePGPDetail) {
QFont font = ui->labelName->font();
@ -81,7 +81,7 @@ void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info)
_keyId=QString::fromStdString(_group_info.mMeta.mGroupId.toStdString());
ui->labelKeyId->setText(_keyId);
ui->labelKeyId->setToolTip(tr("GXS id: ").append(_keyId));
ui->labelKeyId->setToolTip(tr("GXS id:").append(" "+_keyId));
ui->labelKeyId->setVisible(false);
/// (TODO) Get real ident icon
@ -107,10 +107,10 @@ void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
if (!_haveGXSId) m_myName = _nickname;
ui->labelName->setText(m_myName);
if (_haveGXSId) {
ui->labelName->setToolTip(tr("GXS name: ").append(m_myName).append("\n")
.append(tr("PGP name: ").append(_nickname)));
ui->labelName->setToolTip(tr("GXS name:").append(" "+m_myName).append("\n")
.append(tr("PGP name:").append(" "+_nickname)));
} else {//if (m_myName != _nickname)
ui->labelName->setToolTip(tr("PGP name: ").append(_nickname));
ui->labelName->setToolTip(tr("PGP name:").append(" "+_nickname));
}//else (m_myName != _nickname)
QFont font = ui->labelName->font();
@ -119,7 +119,7 @@ void IdentityWidget::updateData(const RsPeerDetails &pgp_details)
_keyId = QString::fromStdString(_details.gpg_id.toStdString());
ui->labelKeyId->setText(_keyId);
ui->labelKeyId->setToolTip(tr("PGP id: ").append(_keyId));
ui->labelKeyId->setToolTip(tr("PGP id:").append(" "+_keyId));
QPixmap avatar;
AvatarDefs::getAvatarFromGpgId(_details.gpg_id.toStdString(), avatar);

View File

@ -239,7 +239,7 @@ void QuickStartWizard::on_pushButtonSharesRemove_clicked()
QString queryWrn;
queryWrn.clear();
queryWrn.append(tr("Do you really want to stop sharing this directory ? "));
queryWrn.append(tr("Do you really want to stop sharing this directory ?"));
if (qdir)
{

View File

@ -621,10 +621,10 @@ QString RetroShareLink::title() const
uint32_t error_code ;
if(!rsPeers->loadDetailsFromStringCert(_radix.toStdString(),details,error_code))
return QObject::tr("This cert is malformed. Error code: ")+QString::number(error_code) ;
return QObject::tr("This cert is malformed. Error code:")+" "+QString::number(error_code) ;
else
return QObject::tr("Click to add this RetroShare cert to your PGP keyring\nand open the Make Friend Wizard.\n")
+ QString("PGP Id = ") + QString::fromStdString(details.gpg_id.toStdString()) + QString("\nSSLId = ")+QString::fromStdString(details.id.toStdString());
+ QString("PGP Id =")+" " + QString::fromStdString(details.gpg_id.toStdString()) + QString("\nSSLId =")+" "+QString::fromStdString(details.id.toStdString());
}
return "";
@ -757,7 +757,7 @@ QString RetroShareLink::niceName() const
uint32_t error_code ;
if(!rsPeers->loadDetailsFromStringCert(_radix.toStdString(),details,error_code))
return QObject::tr("This cert is malformed. Error code: ")+QString::number(error_code) ;
return QObject::tr("This cert is malformed. Error code:")+" "+QString::number(error_code) ;
else
return QObject::tr("RetroShare Certificate (%1, @%2)").arg(QString::fromUtf8(details.name.c_str()), QString::fromUtf8(details.location.c_str())); // should add SSL id there
}

View File

@ -54,7 +54,7 @@ ShareDialog::ShareDialog(std::string filename, QWidget *parent)
QVBoxLayout *vbox = new QVBoxLayout() ;
QHBoxLayout *hb2 = new QHBoxLayout() ;
hb2->addWidget(new QLabel(tr("Share flags and groups: "))) ;
hb2->addWidget(new QLabel(tr("Share flags and groups:")+" ")) ;
groupflagsbox = new GroupFlagsWidget(ui.shareflags_GB) ;
groupflagsbox->setFlags(DIR_FLAGS_NETWORK_WIDE_OTHERS) ; // default value

View File

@ -197,7 +197,7 @@ void TrustView::update()
if(i_ji == NULL)
{
i_ij->setBackgroundColor(Qt::yellow) ;
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" is authenticated (one way) by " )+trustTableTW->verticalHeaderItem(j)->text()) ;
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() +" "+ tr("is authenticated (one way) by" )+" "+trustTableTW->verticalHeaderItem(j)->text()) ;
i_ij->setText(tr("Half")) ;
}
else
@ -205,22 +205,22 @@ void TrustView::update()
if(i==j)
{
i_ij->setBackgroundColor(Qt::red) ;
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" authenticated himself") ) ;
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() +" "+ tr("authenticated himself") ) ;
}
else
{
i_ij->setBackgroundColor(Qt::green) ;
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + " and " +trustTableTW->verticalHeaderItem(j)->text() + tr(" authenticated each other") ) ;
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + " "+tr("and")+" " +trustTableTW->verticalHeaderItem(j)->text() +" "+ tr("authenticated each other") ) ;
i_ij->setText(tr("Full")) ;
}
}
}
}
for(int i=0;i<trustTableTW->rowCount();++i)
trustTableTW->verticalHeaderItem(i)->setToolTip(trustTableTW->verticalHeaderItem(i)->text()+ tr(" is authenticated by ") + QString::number(ni[i]) + tr(" peers, including him(her)self.")) ;
trustTableTW->verticalHeaderItem(i)->setToolTip(trustTableTW->verticalHeaderItem(i)->text()+" "+ tr("is authenticated by")+" " + QString::number(ni[i]) +" "+ tr("peers, including him(her)self.")) ;
for(int j=0;j<trustTableTW->columnCount();++j)
trustTableTW->horizontalHeaderItem(j)->setToolTip(trustTableTW->horizontalHeaderItem(j)->text()+ tr(" authenticated ") + QString::number(nj[j]) + tr(" peers, including him(her)self.")) ;
trustTableTW->horizontalHeaderItem(j)->setToolTip(trustTableTW->horizontalHeaderItem(j)->text()+" "+ tr("authenticated")+" " + QString::number(nj[j]) +" "+ tr("peers, including him(her)self.")) ;
}
@ -256,7 +256,7 @@ void TrustView::hideShowPeers(int col)
trustTableTW->setRowHidden(i,false) ;
}
last_col = col ;
showingLabel->setText(tr("Showing: peers connected to ")+trustTableTW->verticalHeaderItem(col)->text()) ;
showingLabel->setText(tr("Showing: peers connected to")+" "+trustTableTW->verticalHeaderItem(col)->text()) ;
}
}

View File

@ -107,7 +107,7 @@ void ChatDialog::init(ChatId id, const QString &title)
} else if(id.isGxsId()) {
PopupDistantChatDialog* pdcd = new PopupDistantChatDialog();
QString peer_name = pdcd->getPeerName(id) ;
pdcd->init(id.toGxsId(), tr("Talking to ")+peer_name) ;
pdcd->init(id.toGxsId(), tr("Talking to")+" "+peer_name) ;
cd = pdcd;
} else {
RsPeerDetails sslDetails;

View File

@ -90,7 +90,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
cFoundColor=Settings->getChatSearchFoundColor();
ui->actionSearchWithoutLimit->setText(tr("Don't stop to color after ")+QString::number(uiMaxSearchLimitColor)+tr(" items found (need more CPU)"));
ui->actionSearchWithoutLimit->setText(tr("Don't stop to color after")+" "+QString::number(uiMaxSearchLimitColor)+" "+tr("items found (need more CPU)"));
ui->leSearch->setVisible(false);
ui->searchBefore->setVisible(false);
@ -1033,7 +1033,7 @@ void ChatWidget::updateLenOfChatTextEdit()
}
ui->sendButton->setEnabled(!msgToLarge);
text = tr("%1This message consists of %2 characters.").arg(msgToLarge ? tr("Warning: ") : "").arg(msg.length());
text = tr("%1This message consists of %2 characters.").arg(msgToLarge ? tr("Warning:")+" " : "").arg(msg.length());
ui->sendButton->setToolTip(text);
ui->chatTextEdit->setToolTip(msgToLarge?text:"");
}

View File

@ -168,7 +168,7 @@ QString GroupFlagsWidget::groupInfoString(FileStorageFlags flags, const QList<QS
if(flags & DIR_FLAGS_NETWORK_WIDE_OTHERS)
res += tr("All friend nodes can relay anonymous tunnels to this directory") ;
else if(flags & DIR_FLAGS_NETWORK_WIDE_GROUPS)
res += tr("Only friend nodes in groups ") + groups_string + tr(" can relay anonymous tunnels to this directory") ;
res += tr("Only friend nodes in groups")+" " + groups_string +" "+ tr("can relay anonymous tunnels to this directory") ;
else
res += tr("No one can anonymously access this directory.") ;

View File

@ -309,11 +309,11 @@ void ConfCertDialog::loadInvitePage()
infotext += tr("<p>This certificate contains:") ;
infotext += "<UL>" ;
infotext += "<li> a <b>PGP public key</b>";
infotext += " (" + QString::fromUtf8(detail.name.c_str()) + "@" + detail.gpg_id.toStdString().c_str()+")" ;
infotext += " (" + QString::fromUtf8(detail.name.c_str()) + "@" + detail.gpg_id.toStdString().c_str()+") " ;
if(ui._shouldAddSignatures_CB->isChecked())
infotext += tr(" with ")+QString::number(detail.gpgSigners.size()-1)+" external signatures</li> " ;
infotext += tr("with")+" "+QString::number(detail.gpgSigners.size()-1)+" "+tr("external signatures</li>") ;
else
infotext += tr("</li> ") ;
infotext += "</li>" ;
infotext += tr("<li>a <b>node ID</b> and <b>name</b>") +" (" + detail.id.toStdString().c_str() + ", " + QString::fromUtf8(detail.location.c_str()) +")" ;
infotext += "</li>" ;

View File

@ -633,7 +633,7 @@ bool ConnectFriendWizard::validateCurrentPage()
}
if (certstr.empty()) {
setField("errorMessage", QString(tr("Certificate Load Failed:can't read from file %1 ")).arg(fn) );
setField("errorMessage", QString(tr("Certificate Load Failed:can't read from file %1")).arg(fn+" ") );
error = false;
break;
}
@ -645,7 +645,7 @@ bool ConnectFriendWizard::validateCurrentPage()
std::cerr << "ConnectFriendWizard got id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
#endif
} else {
setField("errorMessage", QString(tr("Certificate Load Failed:something is wrong with %1 ")).arg(fn) + ": " + getErrorString(cert_error_code));
setField("errorMessage", QString(tr("Certificate Load Failed:something is wrong with %1")).arg(fn) + " : " + getErrorString(cert_error_code));
error = false;
}
} else {

View File

@ -195,7 +195,7 @@ void PGPKeyDialog::load()
ui.trustlevel_CB->hide();
ui.is_signing_me->hide();
ui.signersBox->setTitle(tr("This is your own PGP key, and it is signed by : "));
ui.signersBox->setTitle(tr("This is your own PGP key, and it is signed by :")+" ");
}
else
@ -203,7 +203,7 @@ void PGPKeyDialog::load()
ui.web_of_trust_label->show();
ui.trustlevel_CB->show();
ui.is_signing_me->show();
ui.signersBox->setTitle(tr("This key is signed by : "));
ui.signersBox->setTitle(tr("This key is signed by :")+" ");
if (detail.accept_connection)
{

View File

@ -139,7 +139,7 @@ void SecurityItem::updateItemStatic()
{
RsPeerDetails details ;
if(rsPeers->getGPGDetails(mGpgId, details))
title = tr("Missing/Damaged SSL certificate for key ") + QString::fromStdString(mGpgId.toStdString()) ;
title = tr("Missing/Damaged SSL certificate for key")+" " + QString::fromStdString(mGpgId.toStdString()) ;
else
title = tr("Missing/Damaged certificate. Not a real Retroshare user.");
requestLabel->hide();

View File

@ -314,7 +314,7 @@ void CreateGxsForumMsg::createMsg()
default:
std::cerr << "CreateGxsForumMsg::createMsg() ERROR GETTING AuthorId!";
std::cerr << std::endl;
QMessageBox::warning(this, tr("RetroShare"),tr("Congrats, you found a bug! ")+QString(__FILE__)+":"+QString(__LINE__), QMessageBox::Ok, QMessageBox::Ok);
QMessageBox::warning(this, tr("RetroShare"),tr("Congrats, you found a bug!")+" "+QString(__FILE__)+":"+QString(__LINE__), QMessageBox::Ok, QMessageBox::Ok);
return;
}//switch (ui.idChooser->getChosenId(authorId))

View File

@ -134,12 +134,12 @@ HelpBrowser::loadContentsFromXml(QString xmlFile)
/* Load the XML contents into the DOM document */
if (!document.setContent(&file, true, &errorString)) {
ui.txtBrowser->setPlainText(tr("Error Loading Help Contents: ")+errorString);
ui.txtBrowser->setPlainText(tr("Error Loading Help Contents:")+" "+errorString);
return;
}
/* Load the DOM document contents into the tree view */
if (!loadContents(&document, errorString)) {
ui.txtBrowser->setPlainText(tr("Error Loading Help Contents: ")+errorString);
ui.txtBrowser->setPlainText(tr("Error Loading Help Contents:")+" "+errorString);
return;
}
}

View File

@ -1,110 +1,110 @@
/****************************************************************
/****************************************************************
* This file is distributed under the following license:
*
* Copyright (c) 2008, defnax
* Copyright (c) 2008, Matt Edman, Justin Hipple
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
/*
** \file helptextbrowser.cpp
** \version $Id: helptextbrowser.cpp 2679 2008-06-10 03:07:10Z edmanm $
** \brief Displays an HTML-based help document
*/
#include <QDir>
#include <QFile>
#include <QDesktopServices>
#include "gui/common/vmessagebox.h"
#include "gui/common/html.h"
#include <rshare.h>
#include "helptextbrowser.h"
/** Default constructor. */
HelpTextBrowser::HelpTextBrowser(QWidget *parent)
: QTextBrowser(parent)
{
setOpenExternalLinks(false);
}
/** Loads a resource into the browser. If it is an HTML resource, we'll load
* it as UTF-8, so the special characters in our translations appear properly. */
QVariant
HelpTextBrowser::loadResource(int type, const QUrl &name)
{
/* If it's an HTML file, we'll handle it ourselves */
if (type == QTextDocument::HtmlResource) {
QString helpPath = ":/help/";
/* Fall back to English if there is no translation of the specified help
* page in the current language. */
if (!name.path().contains("/")) {
QString language = Rshare::language();
if (!QDir(":/help/" + language).exists())
language = "en";
helpPath += language + "/";
}
QFile file(helpPath + name.path());
if (!file.open(QIODevice::ReadOnly)) {
return tr("Error opening help file: ") + name.path();
}
return QString::fromUtf8(file.readAll());
}
/* Everything else, just let QTextBrowser take care of it. */
return QTextBrowser::loadResource(type, name);
}
/** Called when the displayed document is changed. If <b>url</b> specifies
* an external link, then the user will be prompted for whether they want to
* open the link in their default browser or not. */
void
HelpTextBrowser::setSource(const QUrl &url)
{
if (url.scheme() != "qrc" && !url.isRelative()) {
/* External link. Prompt the user for a response. */
int ret = VMessageBox::question(this,
tr("Opening External Link"),
p(tr("RetroShare can open the link you selected in your default "
"Web browser. If your browser is not currently "
"configured to use Tor then the request will not be "
"anonymous.")) +
p(tr("Do you want Retroshare to open the link in your Web "
"browser?")),
VMessageBox::Yes|VMessageBox::Default,
VMessageBox::Cancel|VMessageBox::Cancel);
if (ret == VMessageBox::Cancel)
return;
bool ok = QDesktopServices::openUrl(url);
if (!ok) {
VMessageBox::information(this,
tr("Unable to Open Link"),
tr("RetroShare was unable to open the selected link in your Web browser. "
"You can still copy the URL and paste it into your browser."),
VMessageBox::Ok);
}
} else {
/* Internal link. Just load it like normal. */
QTextBrowser::setSource(url);
}
}
* Copyright (c) 2008, Matt Edman, Justin Hipple
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
/*
** \file helptextbrowser.cpp
** \version $Id: helptextbrowser.cpp 2679 2008-06-10 03:07:10Z edmanm $
** \brief Displays an HTML-based help document
*/
#include <QDir>
#include <QFile>
#include <QDesktopServices>
#include "gui/common/vmessagebox.h"
#include "gui/common/html.h"
#include <rshare.h>
#include "helptextbrowser.h"
/** Default constructor. */
HelpTextBrowser::HelpTextBrowser(QWidget *parent)
: QTextBrowser(parent)
{
setOpenExternalLinks(false);
}
/** Loads a resource into the browser. If it is an HTML resource, we'll load
* it as UTF-8, so the special characters in our translations appear properly. */
QVariant
HelpTextBrowser::loadResource(int type, const QUrl &name)
{
/* If it's an HTML file, we'll handle it ourselves */
if (type == QTextDocument::HtmlResource) {
QString helpPath = ":/help/";
/* Fall back to English if there is no translation of the specified help
* page in the current language. */
if (!name.path().contains("/")) {
QString language = Rshare::language();
if (!QDir(":/help/" + language).exists())
language = "en";
helpPath += language + "/";
}
QFile file(helpPath + name.path());
if (!file.open(QIODevice::ReadOnly)) {
return tr("Error opening help file:")+" "+ name.path();
}
return QString::fromUtf8(file.readAll());
}
/* Everything else, just let QTextBrowser take care of it. */
return QTextBrowser::loadResource(type, name);
}
/** Called when the displayed document is changed. If <b>url</b> specifies
* an external link, then the user will be prompted for whether they want to
* open the link in their default browser or not. */
void
HelpTextBrowser::setSource(const QUrl &url)
{
if (url.scheme() != "qrc" && !url.isRelative()) {
/* External link. Prompt the user for a response. */
int ret = VMessageBox::question(this,
tr("Opening External Link"),
p(tr("RetroShare can open the link you selected in your default "
"Web browser. If your browser is not currently "
"configured to use Tor then the request will not be "
"anonymous.")) +
p(tr("Do you want Retroshare to open the link in your Web "
"browser?")),
VMessageBox::Yes|VMessageBox::Default,
VMessageBox::Cancel|VMessageBox::Cancel);
if (ret == VMessageBox::Cancel)
return;
bool ok = QDesktopServices::openUrl(url);
if (!ok) {
VMessageBox::information(this,
tr("Unable to Open Link"),
tr("RetroShare was unable to open the selected link in your Web browser. "
"You can still copy the URL and paste it into your browser."),
VMessageBox::Ok);
}
} else {
/* Internal link. Just load it like normal. */
QTextBrowser::setSource(url);
}
}

View File

@ -329,7 +329,7 @@ void MessageWidget::getcurrentrecommended()
std::cout << "Requesting file " << fi.fname << ", size=" << fi.size << ", hash=" << fi.hash << std::endl ;
if (rsFiles->FileRequest(fi.fname, fi.hash, fi.size, "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds) == false) {
QMessageBox mb(QObject::tr("File Request canceled"), QObject::tr("The following has not been added to your download list, because you already have it:\n ") + QString::fromUtf8(fi.fname.c_str()), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
QMessageBox mb(QObject::tr("File Request canceled"), QObject::tr("The following has not been added to your download list, because you already have it:")+"\n " + QString::fromUtf8(fi.fname.c_str()), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
mb.exec();
}
}

View File

@ -491,7 +491,7 @@ void NotifyQt::handleChatLobbyTimeShift(int /*shift*/)
{
already = true ;
QString string = tr("For the chat lobbies to work properly, the time of your computer needs to be correct. Please check that this is the case (A possible time shift of several minutes was detected with your friends). ") ;
QString string = tr("For the chat lobbies to work properly, the time of your computer needs to be correct. Please check that this is the case (A possible time shift of several minutes was detected with your friends).") ;
QMessageBox::warning(NULL,tr("Please check your system clock."),string) ;
}

View File

@ -290,12 +290,12 @@ ChatPage::load()
for()
{
QListWidgetItem *item = new QListWidgetItem;
item->setData(Qt::DisplayRole,tr("Private chat invite from ")+QString::fromUtf8(detail.name.c_str())) ;
item->setData(Qt::DisplayRole,tr("Private chat invite from")+" "+QString::fromUtf8(detail.name.c_str())) ;
QString tt ;
tt += tr("Name : ") + QString::fromUtf8(detail.name.c_str()) ;
tt += "\n" + tr("PGP id : ") + QString::fromStdString(invites[i].destination_pgp_id.toStdString()) ;
tt += "\n" + tr("Valid until : ") + QDateTime::fromTime_t(invites[i].time_of_validity).toString() ;
tt += tr("Name :")+" " + QString::fromUtf8(detail.name.c_str()) ;
tt += "\n" + tr("PGP id :")+" " + QString::fromStdString(invites[i].destination_pgp_id.toStdString()) ;
tt += "\n" + tr("Valid until :")+" " + QDateTime::fromTime_t(invites[i].time_of_validity).toString() ;
item->setData(Qt::UserRole,QString::fromStdString(invites[i].pid.toStdString())) ;
item->setToolTip(tt) ;

View File

@ -435,10 +435,10 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
rsServiceControl->getServicePermissions(service_ids[n_col_selected],service_perms) ;
QString service_name = tr("Service name: ")+QString::fromUtf8(service_perms.mServiceName.c_str()) ;
QString service_name = tr("Service name:")+" "+QString::fromUtf8(service_perms.mServiceName.c_str()) ;
QString service_default = service_perms.mDefaultAllowed?tr("Allowed by default"):tr("Denied by default");
QString peer_name = tr("Peer name: ") + names[n_row_selected] ;
QString peer_id = tr("Peer Id: ")+QString::fromStdString(_current_peer_id.toStdString()) ;
QString peer_name = tr("Peer name:")+" " + names[n_row_selected] ;
QString peer_id = tr("Peer Id:")+" "+QString::fromStdString(_current_peer_id.toStdString()) ;
RsPeerServiceInfo pserv_info ;
rsServiceControl->getServicesAllowed(_current_peer_id,pserv_info) ;

View File

@ -216,7 +216,7 @@ RSettingsWin::saveChanges()
/* Show the user what went wrong */
QMessageBox::warning(this,
tr("Error Saving Configuration on page ")+QString::number(i), errmsg,
tr("Error Saving Configuration on page")+" "+QString::number(i), errmsg,
QMessageBox::Ok, QMessageBox::NoButton);
/* Don't process the rest of the pages */

View File

@ -374,10 +374,10 @@ void DhtWindow::updateNetPeers()
cpmstr = tr("Direct");
break;
case RSDHT_TOU_MODE_PROXY:
cpmstr = tr("Proxy VIA ") + QString::fromStdString(status.mPeerConnectProxyId);
cpmstr = tr("Proxy VIA")+" " + QString::fromStdString(status.mPeerConnectProxyId);
break;
case RSDHT_TOU_MODE_RELAY:
cpmstr = tr("Relay VIA ") + QString::fromStdString(status.mPeerConnectProxyId);
cpmstr = tr("Relay VIA")+" " + QString::fromStdString(status.mPeerConnectProxyId);
break;
default:
case RSDHT_TOU_MODE_NONE:

View File

@ -174,7 +174,7 @@ void GlobalRouterStatisticsWidget::updateContent()
{
QString packet_string ;
packet_string += QString::fromStdString(it->second.authentication_key.toStdString()) ;
packet_string += tr(" : Service ID = ")+QString::number(it->second.service_id,16) ;
packet_string += tr(" : Service ID =")+" "+QString::number(it->second.service_id,16) ;
packet_string += " \""+QString::fromUtf8(it->second.description_string.c_str()) + "\"" ;
painter.drawText(ox+2*cellx,oy+celly,packet_string ) ; oy += celly ;

View File

@ -81,8 +81,8 @@ void OutQueueStatisticsWidget::updateStatistics(OutQueueStatistics& stats)
by_service_string += QString::number(it->second) + " (" + serviceName(it->first) + ") " ;
painter.drawText(ox,oy+celly,tr("Outqueue statistics")+":") ; oy += celly*2 ;
painter.drawText(ox+2*cellx,oy+celly,tr("By priority: ") + by_priority_string); oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("By service : ") + by_service_string); oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("By priority:")+" " + by_priority_string); oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("By service :")+" " + by_service_string); oy += celly ;
oy += celly ;

View File

@ -313,7 +313,7 @@ void TurtleRouterStatisticsWidget::updateTunnelStatistics(const std::vector<std:
painter.drawText(ox+2*cellx,oy+celly,tr("Tunnel requests Up")+"\t: " + speedString(info.tr_up_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Incoming file data")+"\t: " + speedString(info.data_dn_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Outgoing file data")+"\t: " + speedString(info.data_up_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Forwarded data ")+"\t: " + speedString(info.unknown_updn_Bps) ) ; oy += celly ;
painter.drawText(ox+2*cellx,oy+celly,tr("Forwarded data")+" \t: " + speedString(info.unknown_updn_Bps) ) ; oy += celly ;
QString prob_string ;

View File

@ -39,7 +39,7 @@ RatesStatus::RatesStatus(QWidget *parent)
// iconLabel doesn't change over time, so we didn't need a minimum size
hbox->addWidget(iconLabel);
statusRates = new QLabel( tr("<strong>Down:</strong> 0.00 (kB/s) | <strong>Up:</strong> 0.00 (kB/s) "), this );
statusRates = new QLabel( tr("<strong>Down:</strong> 0.00 (kB/s) | <strong>Up:</strong> 0.00 (kB/s)")+" ", this );
// statusPeers->setMinimumSize( statusPeers->frameSize().width() + 0, 0 );
hbox->addWidget(statusRates);

View File

@ -114,7 +114,7 @@ void StatisticDialog::timerEvent( QTimerEvent * )
QTime elapsed;
elapsed= QTime(0,0,0).addMSecs(UpTime.elapsed());
if( UpDays>0)
model->setData(ind1,QString(tr("%1 days ")).arg(UpDays)+elapsed.toString("hh:mm:ss"));
model->setData(ind1,QString(tr("%1 days")).arg(UpDays)+" "+elapsed.toString("hh:mm:ss"));
else
model->setData(ind1,elapsed.toString("hh:mm:ss"));

View File

@ -312,20 +312,20 @@ Rshare::validateArguments(QString &errmsg)
/* Check for a language that Retroshare recognizes. */
if (_args.contains(ARG_LANGUAGE) &&
!LanguageSupport::isValidLanguageCode(_args.value(ARG_LANGUAGE))) {
errmsg = tr("Invalid language code specified: ") + _args.value(ARG_LANGUAGE);
errmsg = tr("Invalid language code specified:")+" " + _args.value(ARG_LANGUAGE);
return false;
}
/* Check for a valid GUI style */
if (_args.contains(ARG_GUISTYLE) &&
!QStyleFactory::keys().contains(_args.value(ARG_GUISTYLE),
Qt::CaseInsensitive)) {
errmsg = tr("Invalid GUI style specified: ") + _args.value(ARG_GUISTYLE);
errmsg = tr("Invalid GUI style specified:")+" " + _args.value(ARG_GUISTYLE);
return false;
}
/* Check for a valid log level */
if (_args.contains(ARG_LOGLEVEL) &&
!Log::logLevels().contains(_args.value(ARG_LOGLEVEL))) {
errmsg = tr("Invalid log level specified: ") + _args.value(ARG_LOGLEVEL);
errmsg = tr("Invalid log level specified:")+" " + _args.value(ARG_LOGLEVEL);
return false;
}
/* Check for a writable log file */