mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add some system info to the help/about dialog
I'll see what other info can be useful.
This commit is contained in:
parent
be684514e3
commit
c948ee70cb
@ -1,5 +1,6 @@
|
|||||||
#include "help_about_dialog.h"
|
#include "help_about_dialog.h"
|
||||||
|
|
||||||
|
#include <QtCore>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
@ -26,6 +27,8 @@ HelpAboutDialog::HelpAboutDialog(QWidget *parent)
|
|||||||
// aboutText->setFont(QFont("Comic Sans MS", 10)); //purisa
|
// aboutText->setFont(QFont("Comic Sans MS", 10)); //purisa
|
||||||
tabWidget->addTab(helpText = new QTextBrowser(), tr("Help"));
|
tabWidget->addTab(helpText = new QTextBrowser(), tr("Help"));
|
||||||
helpText->setOpenExternalLinks(true);
|
helpText->setOpenExternalLinks(true);
|
||||||
|
|
||||||
|
tabWidget->addTab(systemInfoText = new QTextBrowser(), tr("System info"));
|
||||||
// helpText->setFont(QFont("Comic Sans MS", 10));
|
// helpText->setFont(QFont("Comic Sans MS", 10));
|
||||||
// helpText->setDisabled(true);
|
// helpText->setDisabled(true);
|
||||||
// tabWidget->addTab(,"About Qt");
|
// tabWidget->addTab(,"About Qt");
|
||||||
@ -43,13 +46,8 @@ HelpAboutDialog::HelpAboutDialog(QWidget *parent)
|
|||||||
int heightDesktopResolution = screen != nullptr ? screen->size().height() : 600;
|
int heightDesktopResolution = screen != nullptr ? screen->size().height() : 600;
|
||||||
|
|
||||||
resize(500, heightDesktopResolution * 0.83);
|
resize(500, heightDesktopResolution * 0.83);
|
||||||
}
|
|
||||||
|
|
||||||
HelpAboutDialog::~HelpAboutDialog()
|
loadSystemInfo();
|
||||||
{
|
|
||||||
delete aboutText;
|
|
||||||
delete helpText;
|
|
||||||
delete tabWidget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HelpAboutDialog::HelpAboutDialog(const QString &pathAbout, const QString &pathHelp, QWidget *parent)
|
HelpAboutDialog::HelpAboutDialog(const QString &pathAbout, const QString &pathHelp, QWidget *parent)
|
||||||
@ -94,3 +92,54 @@ QString HelpAboutDialog::fileToString(const QString &path)
|
|||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HelpAboutDialog::loadSystemInfo()
|
||||||
|
{
|
||||||
|
QString text;
|
||||||
|
|
||||||
|
text.append("SYSTEM INFORMATION\n");
|
||||||
|
text.append(QString("Build ABI: %1\n").arg(QSysInfo::buildAbi()));
|
||||||
|
text.append(QString("build CPU architecture: %1\n").arg(QSysInfo::buildCpuArchitecture()));
|
||||||
|
text.append(QString("CPU architecture: %1\n").arg(QSysInfo::currentCpuArchitecture()));
|
||||||
|
text.append(QString("Kernel type: %1\n").arg(QSysInfo::kernelType()));
|
||||||
|
text.append(QString("Kernel version: %1\n").arg(QSysInfo::kernelVersion()));
|
||||||
|
text.append(QString("Product info: %1\n").arg(QSysInfo::prettyProductName()));
|
||||||
|
|
||||||
|
// QProcess systemInfoProcess;
|
||||||
|
// QString tempOutput;
|
||||||
|
|
||||||
|
// if (QSysInfo::kernelType() == "winnt") {
|
||||||
|
// QString cpuname = "wmic cpu get name";
|
||||||
|
// systemInfoProcess.start("cmd", QList<QString>() << "/C" << cpuname);
|
||||||
|
// systemInfoProcess.waitForFinished();
|
||||||
|
// tempOutput = QString(systemInfoProcess.readAllStandardOutput()).replace("\n", " ");
|
||||||
|
// text.append(QString("CPU: %1\n").arg(tempOutput));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (QSysInfo::kernelType() == "linux") {
|
||||||
|
// QString cpuname = "cat /proc/cpuinfo | grep 'model name' | uniq";
|
||||||
|
// systemInfoProcess.start("bash", QList<QString>() << "-c" << cpuname);
|
||||||
|
// systemInfoProcess.waitForFinished();
|
||||||
|
// tempOutput = systemInfoProcess.readAllStandardOutput();
|
||||||
|
// text.append(QString("CPU: %1\n").arg(tempOutput));
|
||||||
|
// }
|
||||||
|
|
||||||
|
text.append("\nGRAPHIC INFORMATION\n");
|
||||||
|
text.append(QString("Screen pixel ratio: %1\n").arg(devicePixelRatioF()));
|
||||||
|
|
||||||
|
// if (QSysInfo::kernelType() == "winnt") {
|
||||||
|
// QString gpu = "wmic PATH Win32_videocontroller get VideoProcessor";
|
||||||
|
// systemInfoProcess.start("cmd", QList<QString>() << "/C" << gpu);
|
||||||
|
// systemInfoProcess.waitForFinished();
|
||||||
|
// tempOutput = systemInfoProcess.readAllStandardOutput();
|
||||||
|
// text.append(QString("GPU: %1\n").arg(tempOutput));
|
||||||
|
|
||||||
|
// QString gpuram = "wmic PATH Win32_VideoController get AdapterRAM";
|
||||||
|
// systemInfoProcess.start("cmd", QList<QString>() << "/C" << gpuram);
|
||||||
|
// systemInfoProcess.waitForFinished();
|
||||||
|
// tempOutput = systemInfoProcess.readAllStandardOutput();
|
||||||
|
// text.append(QString("GPU RAM: %1\n").arg(tempOutput));
|
||||||
|
// }
|
||||||
|
|
||||||
|
systemInfoText->setText(text);
|
||||||
|
}
|
||||||
|
@ -12,7 +12,6 @@ class HelpAboutDialog : public QDialog
|
|||||||
public:
|
public:
|
||||||
HelpAboutDialog(QWidget *parent = 0);
|
HelpAboutDialog(QWidget *parent = 0);
|
||||||
HelpAboutDialog(const QString &pathAbout, const QString &pathHelp, QWidget *parent = 0);
|
HelpAboutDialog(const QString &pathAbout, const QString &pathHelp, QWidget *parent = 0);
|
||||||
~HelpAboutDialog();
|
|
||||||
public slots:
|
public slots:
|
||||||
void loadAboutInformation(const QString &path);
|
void loadAboutInformation(const QString &path);
|
||||||
void loadHelp(const QString &path);
|
void loadHelp(const QString &path);
|
||||||
@ -21,7 +20,9 @@ private:
|
|||||||
QTabWidget *tabWidget;
|
QTabWidget *tabWidget;
|
||||||
QTextBrowser *aboutText;
|
QTextBrowser *aboutText;
|
||||||
QTextBrowser *helpText;
|
QTextBrowser *helpText;
|
||||||
|
QTextBrowser *systemInfoText;
|
||||||
QString fileToString(const QString &path);
|
QString fileToString(const QString &path);
|
||||||
|
void loadSystemInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HELP_ABOUT_DIALOG_H
|
#endif // HELP_ABOUT_DIALOG_H
|
Loading…
Reference in New Issue
Block a user