From 83272d7900884e2656cf78264a5fb8787dba4a65 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 11 Apr 2010 15:10:47 +0000 Subject: [PATCH] show rs version on WindowTitle for About Dialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2706 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/AboutDialog.cpp | 27 ++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/AboutDialog.cpp b/retroshare-gui/src/gui/AboutDialog.cpp index d076c5d1c..89dbe5fe7 100644 --- a/retroshare-gui/src/gui/AboutDialog.cpp +++ b/retroshare-gui/src/gui/AboutDialog.cpp @@ -48,6 +48,17 @@ AboutDialog::AboutDialog(QWidget* parent) frame->setLayout(l); tWidget = NULL; installAWidget(); + + /* get libretroshare version */ + std::map::iterator vit; + std::map versions; + const RsConfig &conf = rsiface->getConfig(); + bool retv = rsDisc->getDiscVersions(versions); + if (retv && versions.end() != (vit = versions.find(conf.ownId))) + { + QString version = QString::fromStdString(vit->second); + setWindowTitle(tr("About RetroShare %1").arg(version)); + } #ifdef Q_OS_WIN setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint); @@ -124,8 +135,20 @@ void AboutDialog::sl_levelChanged(int level) { void AboutDialog::updateTitle() { if (tWidget == NULL) { - setWindowTitle(tr("About RetroShare")); - } else { + + /* get libretroshare version */ + std::map::iterator vit; + std::map versions; + const RsConfig &conf = rsiface->getConfig(); + bool retv = rsDisc->getDiscVersions(versions); + if (retv && versions.end() != (vit = versions.find(conf.ownId))) + { + + QString version = QString::fromStdString(vit->second); + setWindowTitle(tr("About RetroShare %1").arg(version)); + + } + } else { setWindowTitle(tr("Have fun ;-)")); } }