diff --git a/about.cc b/about.cc index bd9973db..6d998b73 100644 --- a/about.cc +++ b/about.cc @@ -2,12 +2,13 @@ * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ #include "about.hh" +#include #include #include #include "utils.hh" -About::About( QWidget * parent ): QDialog( parent ) +About::About(std::vector< sptr< Dictionary::Class > > * dictonaries, QWidget * parent ): QDialog( parent ) { ui.setupUi( this ); @@ -40,6 +41,50 @@ About::About( QWidget * parent ): QDialog( parent ) #endif ); + // copy basic debug info to clipboard + connect(ui.copyInfoBtn, &QPushButton::clicked, [=]{ + QGuiApplication::clipboard()->setText( + "Goldendict " + version + "\n" + + QSysInfo::productType() + " " + QSysInfo::kernelType() + " " + QSysInfo::kernelVersion() + " " + + "Qt " + QLatin1String(qVersion()) + " " + + QSysInfo::buildAbi() + "\n" + + compilerVersion + "\n" + +#ifdef Q_OS_LINUX + + "Flags:" + + #ifdef USE_XAPIAN + +" USE_XAPIAN " + #endif + + #ifdef MAKE_ZIM_SUPPORT + +" MAKE_ZIM_SUPPORT" + #endif + + #ifdef MAKE_EXTRA_TIFF_HANDLER + +" MAKE_EXTRA_TIFF_HANDLER" + #endif + + #ifdef NO_EPWING_SUPPORT + +" NO_EPWING_SUPPORT" + #endif + + #ifdef MAKE_CHINESE_CONVERSION_SUPPORT + +" MAKE_CHINESE_CONVERSION_SUPPORT" + #endif +#endif + + ); + }); + + connect(ui.copyDictListBtn, &QPushButton::clicked, [=]{ + QString tempDictList{}; + for (auto dict : *dictonaries) { + tempDictList.append(QString::fromStdString(dict->getName() + "\n")); + } + QGuiApplication::clipboard()->setText(tempDictList); + }); + QFile creditsFile( ":/CREDITS.txt" ); if ( creditsFile.open( QFile::ReadOnly ) ) diff --git a/about.hh b/about.hh index 0356403c..5096119c 100644 --- a/about.hh +++ b/about.hh @@ -5,14 +5,16 @@ #define ABOUT_HH #include "ui_about.h" +#include "sptr.hh" +#include "dictionary.hh" #include +#include class About: public QDialog { Q_OBJECT public: - - About( QWidget * parent = 0 ); + About(std::vector< sptr< Dictionary::Class > > * dictonaries, QWidget * parent = 0 ); private: diff --git a/about.ui b/about.ui index 627aaa66..c433d3ca 100644 --- a/about.ui +++ b/about.ui @@ -115,6 +115,49 @@ + + + + + + + 0 + 0 + + + + Copy version info + + + + + + + + 0 + 0 + + + + Copy dictionaries list + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + diff --git a/mainwindow.cc b/mainwindow.cc index 1bd6dfa0..5a1eec75 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -3224,7 +3224,7 @@ void MainWindow::visitForum() void MainWindow::showAbout() { - About about( this ); + About about(&dictionaries, this); about.show(); about.exec();