[PC-BSD Commits] r17593 - pcbsd/current/src-qt4/pc-xgui
svn at pcbsd.org
svn at pcbsd.org
Tue Jul 3 08:55:05 PDT 2012
Author: kris
Date: 2012-07-03 15:55:04 +0000 (Tue, 03 Jul 2012)
New Revision: 17593
Modified:
pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp
pcbsd/current/src-qt4/pc-xgui/main.cpp
Log:
Display the xorg driver being used, along with resolution when asking user to
confirm settings
Modified: pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp 2012-07-03 14:28:48 UTC (rev 17592)
+++ pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp 2012-07-03 15:55:04 UTC (rev 17593)
@@ -9,7 +9,9 @@
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
+#include <QFileInfo>
#include <QProcess>
+#include <QTextStream>
#include "dialogconfirm.h"
@@ -25,7 +27,7 @@
// If we are not auto-closing, Display the X resolution
if ( ! ac ) {
- QString tmp, res;
+ QString tmp, res, driver;
QProcess d;
d.start(QString("xdpyinfo"), QStringList());
while(d.state() == QProcess::Starting || d.state() == QProcess::Running) {
@@ -41,7 +43,23 @@
}
}
- textAutoClose->setText(tr("Current Resolution:") + " " + res );
+ // Figure out the driver
+ QFile file("/var/log/Xorg.0.log");
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QTextStream in(&file);
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+ if ( line.indexOf("Loading /usr/local/lib/xorg/modules/drivers/") != -1 ) {
+ QFileInfo fi(line);
+ driver = fi.fileName();
+ driver = driver.section("_", 0, 0);
+ break;
+ }
+ }
+ file.close();
+ }
+
+ textAutoClose->setText(tr("Resolution:") + " " + res + "\n" + tr("Driver:") + " " + driver );
}
}
Modified: pcbsd/current/src-qt4/pc-xgui/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/main.cpp 2012-07-03 14:28:48 UTC (rev 17592)
+++ pcbsd/current/src-qt4/pc-xgui/main.cpp 2012-07-03 15:55:04 UTC (rev 17593)
@@ -75,7 +75,7 @@
QRect dimensions = desk->screenGeometry();
int wid = dimensions.width(); // returns desktop width
int hig = dimensions.height(); // returns desktop height
- d.setGeometry((wid/2) - (385/2), (hig/2) - (180/2), 385, 180);
+ d.setGeometry((wid/2) - (385/2), (hig/2) - (190/2), 385, 190);
d.ProgramInit(QObject::tr("Your display has been configured.\nKeep these settings?"), false, true);
d.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
More information about the Commits
mailing list