mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Merge pull request #205 from shenlebantongying/staged
Add two basic "copy info" buttons to about dialog for easier bug reporting
This commit is contained in:
commit
892dab0410
42
about.cc
42
about.cc
|
@ -2,12 +2,13 @@
|
|||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||
|
||||
#include "about.hh"
|
||||
#include <QPushButton>
|
||||
#include <QtGui>
|
||||
#include <QSysInfo>
|
||||
|
||||
#include "utils.hh"
|
||||
|
||||
About::About( QWidget * parent ): QDialog( parent )
|
||||
About::About( QWidget * parent, std::vector< sptr< Dictionary::Class > > * dictonaries ): QDialog( parent )
|
||||
{
|
||||
ui.setupUi( this );
|
||||
|
||||
|
@ -40,6 +41,45 @@ 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"
|
||||
+ "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
|
||||
);
|
||||
});
|
||||
|
||||
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 ) )
|
||||
|
|
6
about.hh
6
about.hh
|
@ -5,14 +5,16 @@
|
|||
#define ABOUT_HH
|
||||
|
||||
#include "ui_about.h"
|
||||
#include "sptr.hh"
|
||||
#include "dictionary.hh"
|
||||
#include <QDialog>
|
||||
#include <vector>
|
||||
|
||||
class About: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
About( QWidget * parent = 0 );
|
||||
About( QWidget * parent, std::vector< sptr< Dictionary::Class > > * dictonaries);
|
||||
|
||||
private:
|
||||
|
||||
|
|
43
about.ui
43
about.ui
|
@ -115,6 +115,49 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="copyInfoBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy version info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="copyDictListBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy dictionaries list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -3226,7 +3226,7 @@ void MainWindow::visitForum()
|
|||
|
||||
void MainWindow::showAbout()
|
||||
{
|
||||
About about( this );
|
||||
About about(this, &dictionaries);
|
||||
|
||||
about.show();
|
||||
about.exec();
|
||||
|
|
Loading…
Reference in a new issue