[PC-BSD Commits] r17576 - pcbsd/current/src-qt4/pc-xgui
svn at pcbsd.org
svn at pcbsd.org
Mon Jul 2 12:02:05 PDT 2012
Author: kris
Date: 2012-07-02 19:02:02 +0000 (Mon, 02 Jul 2012)
New Revision: 17576
Modified:
pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp
pcbsd/current/src-qt4/pc-xgui/main.cpp
Log:
Display the detected resolution when asking the user if they want to
take the default
Modified: pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp 2012-07-02 18:50:56 UTC (rev 17575)
+++ pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp 2012-07-02 19:02:02 UTC (rev 17576)
@@ -9,6 +9,7 @@
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
+#include <QProcess>
#include "dialogconfirm.h"
@@ -20,6 +21,28 @@
pushNo->setEnabled(false);
pushNo->setVisible(false);
pushYes->setText(tr("&Ok"));
+ } else {
+
+ // If we are not auto-closing, Display the X resolution
+ if ( ! ac ) {
+ QString tmp, res;
+ QProcess d;
+ d.start(QString("xdpyinfo"), QStringList());
+ while(d.state() == QProcess::Starting || d.state() == QProcess::Running) {
+ d.waitForFinished(200);
+ QCoreApplication::processEvents();
+ }
+
+ while (d.canReadLine()) {
+ tmp = d.readLine().simplified();
+ if ( tmp.indexOf("dimensions:") != -1 ) {
+ res = tmp.section(" ", 1, 1);
+ break;
+ }
+ }
+
+ textAutoClose->setText(tr("Current Resolution:") + " " + res );
+ }
}
if ( ac ) {
Modified: pcbsd/current/src-qt4/pc-xgui/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/main.cpp 2012-07-02 18:50:56 UTC (rev 17575)
+++ pcbsd/current/src-qt4/pc-xgui/main.cpp 2012-07-02 19:02:02 UTC (rev 17576)
@@ -51,7 +51,6 @@
int hig = dimensions.height(); // returns desktop height
d.setGeometry((wid/2) - (355/2), (hig/2) - (151/2), 355, 151);
d.ProgramInit(QObject::tr("Keep these display settings?"), true, true);
- //d.setStyle(QStyleFactory::create( "Plastik" ));
d.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
@@ -65,7 +64,6 @@
int hig = dimensions.height(); // returns desktop height
d.setGeometry((wid/2) - (355/2), (hig/2) - (160/2), 355, 160);
d.ProgramInit(QObject::tr("The previous attempt failed, please check your settings and try again."), false, false);
- //d.setStyle(QStyleFactory::create( "Plastik" ));
d.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
@@ -77,9 +75,8 @@
QRect dimensions = desk->screenGeometry();
int wid = dimensions.width(); // returns desktop width
int hig = dimensions.height(); // returns desktop height
- d.setGeometry((wid/2) - (355/2), (hig/2) - (160/2), 355, 160);
- d.ProgramInit(QObject::tr("Your display has been automatically configured. Keep these settings?"), false, true);
- //d.setStyle(QStyleFactory::create( "Plastik" ));
+ d.setGeometry((wid/2) - (385/2), (hig/2) - (180/2), 385, 180);
+ d.ProgramInit(QObject::tr("Your display has been configured.\nKeep these settings?"), false, true);
d.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
More information about the Commits
mailing list