Fixed display of version information.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7998 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-03-08 13:31:44 +00:00
parent 2664cf2f9a
commit 400d3179e8
9 changed files with 33 additions and 68 deletions

View File

@ -31,7 +31,7 @@ E [ ] when adding a friend through clicking on cert links, the add friend
M [X] add a flag in friends option to allow auto-download of recommended files M [X] add a flag in friends option to allow auto-download of recommended files
M [ ] sound is not working for some users on linux. We also need a "test sound" button in config->sound M [ ] sound is not working for some users on linux. We also need a "test sound" button in config->sound
E [ ] some widgets in the GUI do not follow the system style => GUI looks bad on these systems E [ ] some widgets in the GUI do not follow the system style => GUI looks bad on these systems
E [ ] display version ID in windows version [X] display version ID in windows version
E [ ] recommended friends messages have embedded buttons of wrong size. Use RSLinks instead! E [ ] recommended friends messages have embedded buttons of wrong size. Use RSLinks instead!
Messages Messages

View File

@ -22,6 +22,7 @@
#include "AboutDialog.h" #include "AboutDialog.h"
#include "HelpDialog.h" #include "HelpDialog.h"
#include "rshare.h"
#include <retroshare/rsdisc.h> #include <retroshare/rsdisc.h>
#include <retroshare/rspeers.h> #include <retroshare/rspeers.h>
@ -47,17 +48,9 @@ AboutDialog::AboutDialog(QWidget* parent)
frame->setLayout(l); frame->setLayout(l);
tWidget = NULL; tWidget = NULL;
installAWidget(); installAWidget();
QString title = tr("About RetroShare "); updateTitle();
/* get libretroshare version */
std::string version;
if (rsDisc->getPeerVersion(rsPeers->getOwnId(), version))
{
title += QString::fromStdString(version);
}
setWindowTitle(title);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint); setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
#endif #endif
@ -130,22 +123,14 @@ void AboutDialog::sl_levelChanged(int level) {
emit si_levelChanged(tr("Level: %1").arg(level)); emit si_levelChanged(tr("Level: %1").arg(level));
} }
void AboutDialog::updateTitle()
void AboutDialog::updateTitle() { {
if (tWidget == NULL) if (tWidget == NULL)
{ {
QString title = tr("About RetroShare "); setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), Rshare::retroshareVersion(true)));
}
/* get libretroshare version */ else
std::string version; {
if (rsDisc->getPeerVersion(rsPeers->getOwnId(), version))
{
title += QString::fromStdString(version);
}
setWindowTitle(title);
}
else
{
setWindowTitle(tr("Have fun ;-)")); setWindowTitle(tr("Have fun ;-)"));
} }
} }
@ -182,25 +167,17 @@ AWidget::AWidget() {
p.setPen(Qt::black); p.setPen(Qt::black);
QFont font = p.font(); QFont font = p.font();
font.setBold(true); font.setBold(true);
font.setPointSizeF(11); font.setPointSizeF(font.pointSizeF() + 2);
p.setFont(font); p.setFont(font);
QString title = tr("About RetroShare "); /* Draw RetroShare version */
p.drawText(QRect(10, 10, width()-10, 60), QString("%1 : \n%2").arg(tr("RetroShare version"), Rshare::retroshareVersion(true)));
/* get libretroshare version */
std::string version;
if (rsDisc->getPeerVersion(rsPeers->getOwnId(), version))
{
QString versionq = QString::fromStdString("RetroShare version : \n") + QString::fromStdString(version);
p.drawText(QRect(10, 10, width()-10, 60), versionq);
}
/* Draw Qt's version number */ /* Draw Qt's version number */
p.drawText(QRect(10, 50, width()-10, 60), QString("Qt %1 : \n%2").arg(tr("version"), QT_VERSION_STR)); p.drawText(QRect(10, 50, width()-10, 60), QString("Qt %1 : \n%2").arg(tr("version"), QT_VERSION_STR));
p.end(); p.end();
image1 = image2 = image; image1 = image2 = image;
setFixedSize(image1.size()); setFixedSize(image1.size());

View File

@ -26,6 +26,7 @@
#include "retroshare/rsconfig.h" #include "retroshare/rsconfig.h"
#include "retroshare-gui/RsAutoUpdatePage.h" #include "retroshare-gui/RsAutoUpdatePage.h"
#include "rshare.h"
#include <QDesktopServices> #include <QDesktopServices>
@ -330,12 +331,10 @@ void GetStartedDialog::emailSupport()
return; return;
} }
std::string versionString;
uint32_t userLevel; uint32_t userLevel;
{ {
RsAutoUpdatePage::lockAllEvents(); RsAutoUpdatePage::lockAllEvents();
rsDisc->getPeerVersion(rsPeers->getOwnId(), versionString);
userLevel = rsConfig->getUserLevel(); userLevel = rsConfig->getUserLevel();
RsAutoUpdatePage::unlockAllEvents() ; RsAutoUpdatePage::unlockAllEvents() ;
@ -434,7 +433,7 @@ void GetStartedDialog::emailSupport()
sysVersion = "Linux"; sysVersion = "Linux";
#endif #endif
#endif #endif
text += QString("My RetroShare Configuration is: (%1, %2, 0x60%3)").arg(QString::fromStdString(versionString)).arg(sysVersion).arg(userLevel) + "\n"; text += QString("My RetroShare Configuration is: (%1, %2, 0x60%3)").arg(Rshare::retroshareVersion(true)).arg(sysVersion).arg(userLevel) + "\n";
text += "\n"; text += "\n";
text += QString("I am having trouble with RetroShare."); text += QString("I am having trouble with RetroShare.");

View File

@ -200,7 +200,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
nameAndLocation = QString("%1 (%2)").arg(QString::fromUtf8(pd.name.c_str())).arg(QString::fromUtf8(pd.location.c_str())); nameAndLocation = QString("%1 (%2)").arg(QString::fromUtf8(pd.name.c_str())).arg(QString::fromUtf8(pd.location.c_str()));
} }
setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(Rshare::retroshareVersion()) + " - " + nameAndLocation); setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(Rshare::retroshareVersion(false)) + " - " + nameAndLocation);
/* add url handler for RetroShare links */ /* add url handler for RetroShare links */
QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "retroshareLinkActivated"); QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "retroshareLinkActivated");

View File

@ -139,16 +139,9 @@ NetworkDialog::NetworkDialog(QWidget *parent)
// ui.networkTab->addTab(new TrustView(),QString(tr("Authentication matrix"))); // ui.networkTab->addTab(new TrustView(),QString(tr("Authentication matrix")));
// ui.networkTab->addTab(networkview = new NetworkView(),QString(tr("Network View"))); // ui.networkTab->addTab(networkview = new NetworkView(),QString(tr("Network View")));
ui.onlyTrustedKeys->setMinimumWidth(20); ui.onlyTrustedKeys->setMinimumWidth(20);
QString version = "-";
std::string rsversion;
if (rsDisc->getPeerVersion(rsPeers->getOwnId(), rsversion))
{
version = QString::fromStdString(rsversion);
}
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
//menu->addAction(ui.actionAddFriend); //menu->addAction(ui.actionAddFriend);
//menu->addAction(ui.actionCopyKey); //menu->addAction(ui.actionCopyKey);

View File

@ -50,6 +50,9 @@ ProfileWidget::ProfileWidget(QWidget *parent, Qt::WindowFlags flags)
void ProfileWidget::showEvent ( QShowEvent * /*event*/ ) void ProfileWidget::showEvent ( QShowEvent * /*event*/ )
{ {
/* set retroshare version */
ui.version->setText(Rshare::retroshareVersion(true));
RsPeerDetails detail; RsPeerDetails detail;
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail)) if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
{ {
@ -58,11 +61,6 @@ void ProfileWidget::showEvent ( QShowEvent * /*event*/ )
ui.peerid->setText(QString::fromStdString(detail.id.toStdString())); ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
/* set retroshare version */
std::string version;
rsDisc->getPeerVersion(detail.id, version);
ui.version->setText(QString::fromStdString(version));
ui.ipAddressList->clear(); ui.ipAddressList->clear();
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
ui.ipAddressList->addItem(QString::fromStdString(*it)); ui.ipAddressList->addItem(QString::fromStdString(*it));

View File

@ -77,9 +77,7 @@ void CryptoPage::showEvent ( QShowEvent * /*event*/ )
ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString()))); ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString())));
/* set retroshare version */ /* set retroshare version */
std::string version; ui.version->setText(Rshare::retroshareVersion(true));
rsDisc->getPeerVersion(detail.id, version);
ui.version->setText(QString::fromStdString(version));
std::list<RsPgpId> ids; std::list<RsPgpId> ids;
ids.clear(); ids.clear();

View File

@ -163,9 +163,14 @@ Rshare::~Rshare()
} }
QString Rshare::retroshareVersion() QString Rshare::retroshareVersion(bool withRevision)
{ {
return QString("%1.%2.%3%4").arg(RS_MAJOR_VERSION).arg(RS_MINOR_VERSION).arg(RS_BUILD_NUMBER).arg(RS_BUILD_NUMBER_ADD); QString version = QString("%1.%2.%3%4").arg(RS_MAJOR_VERSION).arg(RS_MINOR_VERSION).arg(RS_BUILD_NUMBER).arg(RS_BUILD_NUMBER_ADD);
if (withRevision) {
version += QString(" %1 %2").arg(tr("Revision")).arg(RS_REVISION_NUMBER);
}
return version;
} }
/** Enters the main event loop and waits until exit() is called. The signal /** Enters the main event loop and waits until exit() is called. The signal

View File

@ -38,9 +38,6 @@
#include "util/log.h" #include "util/log.h"
#include "retroshare/rstypes.h" #include "retroshare/rstypes.h"
/** Rshare's version string */
#define RSHARE_VERSION "0.7"
/** Pointer to this RetroShare application instance. */ /** Pointer to this RetroShare application instance. */
#define rApp ((Rshare *)qApp) #define rApp ((Rshare *)qApp)
@ -62,7 +59,7 @@ public:
~Rshare(); ~Rshare();
/** Return the version info */ /** Return the version info */
static QString retroshareVersion(); static QString retroshareVersion(bool withRevision);
/** Return the map of command-line arguments and values. */ /** Return the map of command-line arguments and values. */
static QMap<QString, QString> arguments() { return _args; } static QMap<QString, QString> arguments() { return _args; }
@ -110,8 +107,6 @@ public:
static QString style() { return _style; } static QString style() { return _style; }
/** Returns the current GUI stylesheet. */ /** Returns the current GUI stylesheet. */
static QString stylesheet() { return _stylesheet; } static QString stylesheet() { return _stylesheet; }
/** Returns Rshare's application version. */
static QString version() { return RSHARE_VERSION; }
/** Returns Rshare's application startup time. */ /** Returns Rshare's application startup time. */
static QDateTime startupTime(); static QDateTime startupTime();