Commit 493755c5 authored by Jan Möbius's avatar Jan Möbius

Output lsb and kernel version in about dialog



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10644 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7c69efaa
......@@ -263,7 +263,69 @@ void CoreWidget::showAboutWidget( ) {
#elif defined ARCH_DARWIN
aboutWidget_->OpenFlipperAbout->append(tr("Not available for this platform (MacOS)"));
#else
aboutWidget_->OpenFlipperAbout->append(tr("Not available for this platform (Linux)"));
QFile versionInfo("/proc/version");
if (! versionInfo.exists() )
aboutWidget_->OpenFlipperAbout->append(tr("Unable to retrieve Kernel information"));
else {
versionInfo.open(QFile::ReadOnly);
QTextStream versionStream(&versionInfo);
aboutWidget_->OpenFlipperAbout->append(tr("Kernel Version:\t\t ") + versionStream.readAll().simplified());
QString program = "/usr/bin/lsb_release";
QFile lsb(program);
if ( lsb.exists() ) {
QStringList arguments;
arguments << "-a";
QProcess myProcess;
myProcess.start(program, arguments);
if ( myProcess.waitForFinished ( 4000 ) ) {
QStringList outputLSB = QString(myProcess.readAllStandardOutput()).split('\n');
int position = outputLSB.indexOf ( QRegExp("^Distributor ID.*") );
if ( position != -1 ){
QString distributorID = outputLSB[position].section(':', -1).simplified();
aboutWidget_->OpenFlipperAbout->append(tr("Distributor ID:\t\t ") + distributorID );
} else {
aboutWidget_->OpenFlipperAbout->append(tr("Distributor ID:\t\t Unknown"));
}
position = outputLSB.indexOf ( QRegExp("^Description.*") );
if ( position != -1 ){
QString description = outputLSB[position].section(':', -1).simplified();
aboutWidget_->OpenFlipperAbout->append(tr("Description:\t\t ") + description );
} else {
aboutWidget_->OpenFlipperAbout->append(tr("Description:\t\t Unknown"));
}
position = outputLSB.indexOf ( QRegExp("^Release.*") );
if ( position != -1 ){
QString release = outputLSB[position].section(':', -1).simplified();
aboutWidget_->OpenFlipperAbout->append(tr("Release number:\t\t ") + release );
} else {
aboutWidget_->OpenFlipperAbout->append(tr("Release number:\t\t Unknown"));
}
position = outputLSB.indexOf ( QRegExp("^Codename.*") );
if ( position != -1 ){
QString codename = outputLSB[position].section(':', -1).simplified();
aboutWidget_->OpenFlipperAbout->append(tr("Codename:\t\t ") + codename );
} else {
aboutWidget_->OpenFlipperAbout->append(tr("Codename:\t\t Unknown"));
}
} else {
aboutWidget_->OpenFlipperAbout->append(tr("Unable to get LSB info"));
}
} else {
aboutWidget_->OpenFlipperAbout->append(tr("No additional information. Unable to get info via LSB."));
}
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment