diff --git a/retroshare-gui/src/gui/AboutDialog.cpp b/retroshare-gui/src/gui/AboutDialog.cpp index 26170558d..003253443 100644 --- a/retroshare-gui/src/gui/AboutDialog.cpp +++ b/retroshare-gui/src/gui/AboutDialog.cpp @@ -24,10 +24,15 @@ #include "HelpDialog.h" #include "rshare.h" +#include +#include #include #include #include "settings/rsharesettings.h" +#include +#include +#include #include #include #include @@ -721,3 +726,79 @@ NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent) setAlignment(Qt::AlignCenter); setAutoFillBackground(true); } + +static QString addLibraries(const std::string &name, const std::list &libraries) +{ + QString mTextEdit; + mTextEdit+=QString::fromUtf8(name.c_str()); + mTextEdit+="\n"; + + std::list::const_iterator libraryIt; + for (libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt) { + + mTextEdit+=" - "; + mTextEdit+=QString::fromUtf8(libraryIt->mName.c_str()); + mTextEdit+=": "; + mTextEdit+=QString::fromUtf8(libraryIt->mVersion.c_str()); + mTextEdit+="\n"; + } + mTextEdit+="\n"; + return mTextEdit; +} + + +void AboutDialog::on_copy_button_clicked() +{ + QString verInfo; + QString rsVerString = "RetroShare Version: "; + rsVerString+=Rshare::retroshareVersion(true); + verInfo+=rsVerString; + verInfo+="\n"; + + +#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) + #if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0) + verInfo+=QSysInfo::prettyProductName(); + #endif +#else + #ifdef Q_WS_X11 + verInfo+="Linux"; + #endif + #ifdef Q_WS_WIN + verInfo+="Windows"; + #endif + #ifdef Q_WS_MACX + verInfo+="Mac"; + #endif +#endif + verInfo+=" "; + QString qtver = QString("QT ")+QT_VERSION_STR; + verInfo+=qtver; + verInfo+="\n\n"; + + /* Add version numbers of libretroshare */ + std::list libraries; + RsControl::instance()->getLibraries(libraries); + verInfo+=addLibraries("libretroshare", libraries); + + /* Add version numbers of RetroShare */ + // Add versions here. Find a better place. + libraries.clear(); + libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version())); + verInfo+=addLibraries("RetroShare", libraries); + + /* Add version numbers of plugins */ + if (rsPlugins) { + for (int i = 0; i < rsPlugins->nbPlugins(); ++i) { + RsPlugin *plugin = rsPlugins->plugin(i); + if (plugin) { + libraries.clear(); + plugin->getLibraries(libraries); + verInfo+=addLibraries(plugin->getPluginName(), libraries); + } + } + } + + + QApplication::clipboard()->setText(verInfo); +} diff --git a/retroshare-gui/src/gui/AboutDialog.h b/retroshare-gui/src/gui/AboutDialog.h index d179d5959..c0095699b 100644 --- a/retroshare-gui/src/gui/AboutDialog.h +++ b/retroshare-gui/src/gui/AboutDialog.h @@ -50,6 +50,8 @@ private slots: void sl_levelChanged(int); void on_help_button_clicked(); + void on_copy_button_clicked(); + signals: void si_scoreChanged(QString); void si_maxScoreChanged(QString); diff --git a/retroshare-gui/src/gui/AboutDialog.ui b/retroshare-gui/src/gui/AboutDialog.ui index d43e9c110..d279f801c 100644 --- a/retroshare-gui/src/gui/AboutDialog.ui +++ b/retroshare-gui/src/gui/AboutDialog.ui @@ -23,7 +23,16 @@ true - + + 9 + + + 9 + + + 9 + + 9 @@ -52,6 +61,17 @@ + + + + Copy Info + + + + :/images/copy.png:/images/copy.png + + + @@ -76,7 +96,9 @@ - + + + close_button