mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Rename class Machine_info to MachinInfo
Rename to follow the code style of QElectroTech
This commit is contained in:
parent
04226a5dee
commit
fc870e7afc
@ -35,7 +35,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
// liste des pages
|
||||
pages_list = new QListWidget();
|
||||
pages_list -> setViewMode(QListView::IconMode);
|
||||
if(Machine_info::i_max_screen_height()<1000){
|
||||
if(MachineInfo::i_max_screen_height()<1000){
|
||||
pages_list -> setIconSize(QSize(64, 64));
|
||||
} else {
|
||||
pages_list -> setIconSize(QSize(128, 128));
|
||||
@ -79,7 +79,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
connect(pages_list, SIGNAL(currentRowChanged(int)),
|
||||
pages_widget, SLOT(setCurrentIndex(int)));
|
||||
|
||||
setMaximumSize(Machine_info::i_max_screen_width(), Machine_info::i_max_screen_height());
|
||||
setMaximumSize(MachineInfo::i_max_screen_width(), MachineInfo::i_max_screen_height());
|
||||
resize(1400,1000);
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
|
@ -30,19 +30,19 @@
|
||||
#include "qet.h"
|
||||
|
||||
/**
|
||||
@brief Machine_info::Machine_info
|
||||
@brief MachineInfo::MachineInfo
|
||||
@param parent
|
||||
*/
|
||||
Machine_info::Machine_info(QObject *parent) : QObject(parent)
|
||||
MachineInfo::MachineInfo()
|
||||
{
|
||||
init_get_Screen_info();
|
||||
init_get_cpu_info();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::send_info_to_debug
|
||||
@brief MachineInfo::send_info_to_debug
|
||||
*/
|
||||
void Machine_info::send_info_to_debug()
|
||||
void MachineInfo::send_info_to_debug()
|
||||
{
|
||||
qInfo()<<"debugging enabled:"
|
||||
<< QLibraryInfo::isDebugBuild();
|
||||
@ -120,7 +120,7 @@ void Machine_info::send_info_to_debug()
|
||||
#endif
|
||||
qInfo() << "GitRevision " + QString(GIT_COMMIT_SHA);
|
||||
qInfo()<< "QElectroTech V " + QET::displayedVersion;
|
||||
qInfo()<< tr("Compilation : ") + pc.built.version;
|
||||
qInfo()<< QObject::tr("Compilation : ") + pc.built.version;
|
||||
qInfo()<< "Built with Qt " + pc.built.QT
|
||||
+ " - Date : " + pc.built.date
|
||||
+ " : " + pc.built.time;
|
||||
@ -151,10 +151,10 @@ void Machine_info::send_info_to_debug()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::init_get_Screen_info
|
||||
@brief MachineInfo::init_get_Screen_info
|
||||
Finds the largest screen and saves the values
|
||||
*/
|
||||
void Machine_info::init_get_Screen_info()
|
||||
void MachineInfo::init_get_Screen_info()
|
||||
{
|
||||
const auto screens = qApp->screens();
|
||||
pc.screen.count=screens.count();
|
||||
@ -174,9 +174,9 @@ void Machine_info::init_get_Screen_info()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::init_get_cpu_info
|
||||
@brief MachineInfo::init_get_cpu_info
|
||||
*/
|
||||
void Machine_info::init_get_cpu_info()
|
||||
void MachineInfo::init_get_cpu_info()
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
#ifdef __APPLE_CC__
|
||||
@ -191,9 +191,9 @@ void Machine_info::init_get_cpu_info()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::init_get_cpu_info_linux
|
||||
@brief MachineInfo::init_get_cpu_info_linux
|
||||
*/
|
||||
void Machine_info::init_get_cpu_info_linux()
|
||||
void MachineInfo::init_get_cpu_info_linux()
|
||||
{
|
||||
QProcess linuxcpuinfo;
|
||||
linuxcpuinfo.start("bash", QStringList()
|
||||
@ -237,9 +237,9 @@ void Machine_info::init_get_cpu_info_linux()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::init_get_cpu_info_winnt
|
||||
@brief MachineInfo::init_get_cpu_info_winnt
|
||||
*/
|
||||
void Machine_info::init_get_cpu_info_winnt()
|
||||
void MachineInfo::init_get_cpu_info_winnt()
|
||||
{
|
||||
QProcess wincpuinfo;
|
||||
wincpuinfo.start("wmic",
|
||||
@ -291,9 +291,9 @@ void Machine_info::init_get_cpu_info_winnt()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::init_get_cpu_info_macos
|
||||
@brief MachineInfo::init_get_cpu_info_macos
|
||||
*/
|
||||
void Machine_info::init_get_cpu_info_macos()
|
||||
void MachineInfo::init_get_cpu_info_macos()
|
||||
{
|
||||
QProcess macoscpuinfo;
|
||||
macoscpuinfo.start("bash",
|
||||
@ -317,10 +317,10 @@ void Machine_info::init_get_cpu_info_macos()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::i_max_screen_width
|
||||
@brief MachineInfo::i_max_screen_width
|
||||
@return max screen width
|
||||
*/
|
||||
int32_t Machine_info::i_max_screen_width()
|
||||
int32_t MachineInfo::i_max_screen_width()
|
||||
{
|
||||
const auto screens = qApp->screens();
|
||||
auto screen_count = screens.count();
|
||||
@ -341,10 +341,10 @@ int32_t Machine_info::i_max_screen_width()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::i_max_screen_height
|
||||
@brief MachineInfo::i_max_screen_height
|
||||
@return max screen height
|
||||
*/
|
||||
int32_t Machine_info::i_max_screen_height()
|
||||
int32_t MachineInfo::i_max_screen_height()
|
||||
{
|
||||
const auto screens = qApp->screens();
|
||||
auto screen_count = screens.count();
|
||||
@ -365,12 +365,12 @@ int32_t Machine_info::i_max_screen_height()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Machine_info::compilation_info
|
||||
@brief MachineInfo::compilation_info
|
||||
@return compilation_info
|
||||
*/
|
||||
QString Machine_info::compilation_info()
|
||||
QString MachineInfo::compilation_info()
|
||||
{
|
||||
QString compilation_info = "<br />" + tr("Compilation : ");
|
||||
QString compilation_info = "<br />" + QObject::tr("Compilation : ");
|
||||
compilation_info +=pc.built.version;
|
||||
compilation_info += "<br>Built with Qt " + pc.built.QT;
|
||||
compilation_info += " - Date : " + pc.built.date;
|
||||
|
@ -18,31 +18,27 @@
|
||||
#ifndef MACHINE_INFO_H
|
||||
#define MACHINE_INFO_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
|
||||
/**
|
||||
@brief The Machine_info class
|
||||
@brief The MachineInfo class
|
||||
This class hold information from your PC.
|
||||
*/
|
||||
class Machine_info : public QObject
|
||||
class MachineInfo
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Machine_info(QObject *parent = nullptr);
|
||||
static int32_t i_max_screen_width();
|
||||
static int32_t i_max_screen_height();
|
||||
QString compilation_info();
|
||||
void send_info_to_debug();
|
||||
public:
|
||||
explicit MachineInfo();
|
||||
static int32_t i_max_screen_width();
|
||||
static int32_t i_max_screen_height();
|
||||
QString compilation_info();
|
||||
void send_info_to_debug();
|
||||
|
||||
signals:
|
||||
|
||||
private:
|
||||
void init_get_Screen_info();
|
||||
void init_get_cpu_info();
|
||||
void init_get_cpu_info_linux();
|
||||
void init_get_cpu_info_winnt();
|
||||
void init_get_cpu_info_macos();
|
||||
private:
|
||||
void init_get_Screen_info();
|
||||
void init_get_cpu_info();
|
||||
void init_get_cpu_info_linux();
|
||||
void init_get_cpu_info_winnt();
|
||||
void init_get_cpu_info_macos();
|
||||
struct Pc
|
||||
{
|
||||
struct Screen
|
||||
|
@ -208,7 +208,7 @@ int main(int argc, char **argv)
|
||||
qInfo("Start-up");
|
||||
// delete old log files of max 7 days old.
|
||||
delete_old_log_files(7);
|
||||
Machine_info ma;
|
||||
MachineInfo ma;
|
||||
ma.send_info_to_debug();
|
||||
});
|
||||
return app.exec();
|
||||
|
@ -152,8 +152,8 @@ void AboutQETDialog::setVersion()
|
||||
QString str = "<span style=\"font-weight:bold;font-size:16pt;\">QElectroTech V "
|
||||
+ QET::displayedVersion
|
||||
+ "</span>";
|
||||
Machine_info *my_ma =new Machine_info(this);
|
||||
ui->m_version_label->setText(str + my_ma->compilation_info());
|
||||
MachineInfo mi_;
|
||||
ui->m_version_label->setText(str + mi_.compilation_info());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user