diff --git a/TODO.txt b/TODO.txt index 0097156da..da67c449d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -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 [ ] 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 [ ] 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! Messages diff --git a/retroshare-gui/src/gui/AboutDialog.cpp b/retroshare-gui/src/gui/AboutDialog.cpp index 8b122de4e..57305c161 100644 --- a/retroshare-gui/src/gui/AboutDialog.cpp +++ b/retroshare-gui/src/gui/AboutDialog.cpp @@ -22,6 +22,7 @@ #include "AboutDialog.h" #include "HelpDialog.h" +#include "rshare.h" #include #include @@ -47,17 +48,9 @@ AboutDialog::AboutDialog(QWidget* parent) frame->setLayout(l); tWidget = NULL; installAWidget(); - - QString title = tr("About RetroShare "); - - /* get libretroshare version */ - std::string version; - if (rsDisc->getPeerVersion(rsPeers->getOwnId(), version)) - { - title += QString::fromStdString(version); - } - setWindowTitle(title); - + + updateTitle(); + #ifdef Q_OS_WIN setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint); #endif @@ -130,22 +123,14 @@ void AboutDialog::sl_levelChanged(int level) { emit si_levelChanged(tr("Level: %1").arg(level)); } - -void AboutDialog::updateTitle() { +void AboutDialog::updateTitle() +{ if (tWidget == NULL) - { - QString title = tr("About RetroShare "); - - /* get libretroshare version */ - std::string version; - if (rsDisc->getPeerVersion(rsPeers->getOwnId(), version)) - { - title += QString::fromStdString(version); - } - setWindowTitle(title); - } - else - { + { + setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), Rshare::retroshareVersion(true))); + } + else + { setWindowTitle(tr("Have fun ;-)")); } } @@ -182,25 +167,17 @@ AWidget::AWidget() { p.setPen(Qt::black); QFont font = p.font(); font.setBold(true); - font.setPointSizeF(11); + font.setPointSizeF(font.pointSizeF() + 2); p.setFont(font); - QString title = tr("About RetroShare "); - - /* 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 RetroShare version */ + p.drawText(QRect(10, 10, width()-10, 60), QString("%1 : \n%2").arg(tr("RetroShare version"), Rshare::retroshareVersion(true))); /* 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.end(); - + image1 = image2 = image; setFixedSize(image1.size()); diff --git a/retroshare-gui/src/gui/GetStartedDialog.cpp b/retroshare-gui/src/gui/GetStartedDialog.cpp index 0598a9b77..cecd56c24 100644 --- a/retroshare-gui/src/gui/GetStartedDialog.cpp +++ b/retroshare-gui/src/gui/GetStartedDialog.cpp @@ -26,6 +26,7 @@ #include "retroshare/rsconfig.h" #include "retroshare-gui/RsAutoUpdatePage.h" +#include "rshare.h" #include @@ -330,12 +331,10 @@ void GetStartedDialog::emailSupport() return; } - std::string versionString; uint32_t userLevel; { RsAutoUpdatePage::lockAllEvents(); - rsDisc->getPeerVersion(rsPeers->getOwnId(), versionString); userLevel = rsConfig->getUserLevel(); RsAutoUpdatePage::unlockAllEvents() ; @@ -434,7 +433,7 @@ void GetStartedDialog::emailSupport() sysVersion = "Linux"; #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 += QString("I am having trouble with RetroShare."); diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 6c4ebdb0e..bd28b332a 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -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())); } - 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 */ QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "retroshareLinkActivated"); diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index ced755360..9a5dd481a 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -139,16 +139,9 @@ NetworkDialog::NetworkDialog(QWidget *parent) // ui.networkTab->addTab(new TrustView(),QString(tr("Authentication matrix"))); // ui.networkTab->addTab(networkview = new NetworkView(),QString(tr("Network View"))); - + ui.onlyTrustedKeys->setMinimumWidth(20); - - QString version = "-"; - std::string rsversion; - if (rsDisc->getPeerVersion(rsPeers->getOwnId(), rsversion)) - { - version = QString::fromStdString(rsversion); - } - + QMenu *menu = new QMenu(); //menu->addAction(ui.actionAddFriend); //menu->addAction(ui.actionCopyKey); diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.cpp b/retroshare-gui/src/gui/profile/ProfileWidget.cpp index 8cb77dcfd..cf238c7c0 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.cpp +++ b/retroshare-gui/src/gui/profile/ProfileWidget.cpp @@ -50,6 +50,9 @@ ProfileWidget::ProfileWidget(QWidget *parent, Qt::WindowFlags flags) void ProfileWidget::showEvent ( QShowEvent * /*event*/ ) { + /* set retroshare version */ + ui.version->setText(Rshare::retroshareVersion(true)); + RsPeerDetails detail; if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail)) { @@ -58,11 +61,6 @@ void ProfileWidget::showEvent ( QShowEvent * /*event*/ ) 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(); for(std::list::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) ui.ipAddressList->addItem(QString::fromStdString(*it)); diff --git a/retroshare-gui/src/gui/settings/CryptoPage.cpp b/retroshare-gui/src/gui/settings/CryptoPage.cpp index c70c70e9e..f704519cf 100755 --- a/retroshare-gui/src/gui/settings/CryptoPage.cpp +++ b/retroshare-gui/src/gui/settings/CryptoPage.cpp @@ -77,9 +77,7 @@ void CryptoPage::showEvent ( QShowEvent * /*event*/ ) ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString()))); /* set retroshare version */ - std::string version; - rsDisc->getPeerVersion(detail.id, version); - ui.version->setText(QString::fromStdString(version)); + ui.version->setText(Rshare::retroshareVersion(true)); std::list ids; ids.clear(); diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index 990057d7d..d1c0e012c 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -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 diff --git a/retroshare-gui/src/rshare.h b/retroshare-gui/src/rshare.h index 3bfafac06..3b5dff78a 100644 --- a/retroshare-gui/src/rshare.h +++ b/retroshare-gui/src/rshare.h @@ -38,9 +38,6 @@ #include "util/log.h" #include "retroshare/rstypes.h" -/** Rshare's version string */ -#define RSHARE_VERSION "0.7" - /** Pointer to this RetroShare application instance. */ #define rApp ((Rshare *)qApp) @@ -62,7 +59,7 @@ public: ~Rshare(); /** Return the version info */ - static QString retroshareVersion(); + static QString retroshareVersion(bool withRevision); /** Return the map of command-line arguments and values. */ static QMap arguments() { return _args; } @@ -110,8 +107,6 @@ public: static QString style() { return _style; } /** Returns the current GUI stylesheet. */ static QString stylesheet() { return _stylesheet; } - /** Returns Rshare's application version. */ - static QString version() { return RSHARE_VERSION; } /** Returns Rshare's application startup time. */ static QDateTime startupTime();