[PC-BSD Commits] r15372 - pcbsd/current/src-qt4/pc-xgui

svn at pcbsd.org svn at pcbsd.org
Wed Feb 15 11:19:25 PST 2012


Author: kris
Date: 2012-02-15 19:19:25 +0000 (Wed, 15 Feb 2012)
New Revision: 15372

Modified:
   pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp
   pcbsd/current/src-qt4/pc-xgui/dialogconfirm.h
   pcbsd/current/src-qt4/pc-xgui/dialogconfirm.ui
   pcbsd/current/src-qt4/pc-xgui/main.cpp
Log:

Add some new dialogs to the xgui setup wizard



Modified: pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp	2012-02-15 19:17:17 UTC (rev 15371)
+++ pcbsd/current/src-qt4/pc-xgui/dialogconfirm.cpp	2012-02-15 19:19:25 UTC (rev 15372)
@@ -12,11 +12,20 @@
 #include "dialogconfirm.h"
 
 
-void dialogConfirm::ProgramInit()
+void dialogConfirm::ProgramInit(QString txt, bool ac, bool yesno) 
 {
-   timeLeft = 10;
-   textAutoClose->setText(tr("Auto-close in 10 seconds...") );
-   QTimer::singleShot( 2000, this, SLOT(checkTime()) );
+   labelText->setText(txt);
+  
+   if ( ! yesno ) {
+     pushNo->setEnabled(false);
+     pushNo->setVisible(false);
+   }
+
+   if ( ac ) {
+     timeLeft = 10;
+     textAutoClose->setText(tr("Auto-close in 10 seconds...") );
+     QTimer::singleShot( 2000, this, SLOT(checkTime()) );
+   }
 }
 
 

Modified: pcbsd/current/src-qt4/pc-xgui/dialogconfirm.h
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/dialogconfirm.h	2012-02-15 19:17:17 UTC (rev 15371)
+++ pcbsd/current/src-qt4/pc-xgui/dialogconfirm.h	2012-02-15 19:19:25 UTC (rev 15372)
@@ -16,7 +16,7 @@
           setupUi(this);
         }
 
-    void ProgramInit();
+    void ProgramInit(QString txt, bool ac, bool yesno);
 
 public slots:
 

Modified: pcbsd/current/src-qt4/pc-xgui/dialogconfirm.ui
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/dialogconfirm.ui	2012-02-15 19:17:17 UTC (rev 15371)
+++ pcbsd/current/src-qt4/pc-xgui/dialogconfirm.ui	2012-02-15 19:19:25 UTC (rev 15372)
@@ -1,119 +1,138 @@
-<ui version="4.0" stdsetdef="1" >
-  <author></author>
-  <comment></comment>
-  <exportmacro></exportmacro>
-  <class>dialogConfirm</class>
-  <widget class="QDialog" name="dialogConfirm" >
-    <property name="geometry" >
-      <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>315</width>
-        <height>111</height>
-      </rect>
-    </property>
-    <property name="windowTitle" >
-      <string>Confirm Resolution</string>
-    </property>
-    <property name="windowIconText" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>dialogConfirm</class>
+ <widget class="QDialog" name="dialogConfirm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>315</width>
+    <height>111</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Confirm Resolution</string>
+  </property>
+  <property name="windowIconText">
+   <string/>
+  </property>
+  <layout class="QGridLayout">
+   <item row="0" column="0" colspan="4">
+    <widget class="QLabel" name="labelText">
+     <property name="text">
+      <string>Do you wish to use this resolution?</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" colspan="4">
+    <widget class="QLabel" name="textAutoClose">
+     <property name="text">
       <string/>
-    </property>
-    <layout class="QGridLayout" >
-      <item rowspan="1" row="0" column="0" colspan="4" >
-        <widget class="QLabel" name="textLabel1" >
-          <property name="text" >
-            <string>Do you wish to use this resolution?</string>
-          </property>
-          <property name="alignment" >
-            <set>Qt::AlignCenter</set>
-          </property>
-          <property name="wordWrap" >
-            <bool>false</bool>
-          </property>
-        </widget>
-      </item>
-      <item rowspan="1" row="1" column="0" colspan="4" >
-        <widget class="QLabel" name="textAutoClose" >
-          <property name="text" >
-            <string/>
-          </property>
-          <property name="alignment" >
-            <set>Qt::AlignCenter</set>
-          </property>
-          <property name="wordWrap" >
-            <bool>false</bool>
-          </property>
-        </widget>
-      </item>
-      <item row="2" column="1" >
-        <widget class="QPushButton" name="pushYes" >
-          <property name="text" >
-            <string>Yes</string>
-          </property>
-        </widget>
-      </item>
-      <item row="2" column="2" >
-        <widget class="QPushButton" name="pushNo" >
-          <property name="text" >
-            <string>No</string>
-          </property>
-        </widget>
-      </item>
-      <item row="2" column="0" >
-        <spacer name="spacer1" >
-          <property name="sizeHint" >
-            <size>
-              <width>71</width>
-              <height>21</height>
-            </size>
-          </property>
-          <property name="sizeType" >
-            <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-          </property>
-        </spacer>
-      </item>
-      <item row="2" column="3" >
-        <spacer name="spacer2" >
-          <property name="sizeHint" >
-            <size>
-              <width>61</width>
-              <height>20</height>
-            </size>
-          </property>
-          <property name="sizeType" >
-            <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-          </property>
-        </spacer>
-      </item>
-    </layout>
-  </widget>
-  <layoutdefault spacing="6" margin="11" />
-  <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
-  <tabstops>
-    <tabstop>pushNo</tabstop>
-    <tabstop>pushYes</tabstop>
-  </tabstops>
-  <includes>
-    <include location="local" >qtimer.h</include>
-  </includes>
-  <connections>
-    <connection>
-      <sender>pushYes</sender>
-      <signal>clicked()</signal>
-      <receiver>dialogConfirm</receiver>
-      <slot>slotYes()</slot>
-    </connection>
-    <connection>
-      <sender>pushNo</sender>
-      <signal>clicked()</signal>
-      <receiver>dialogConfirm</receiver>
-      <slot>slotNo()</slot>
-    </connection>
-  </connections>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+     <property name="wordWrap">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="pushYes">
+     <property name="text">
+      <string>Yes</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="pushNo">
+     <property name="text">
+      <string>No</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <spacer name="spacer1">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Expanding</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>71</width>
+       <height>21</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="3">
+    <spacer name="spacer2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Expanding</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>61</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <tabstops>
+  <tabstop>pushNo</tabstop>
+  <tabstop>pushYes</tabstop>
+ </tabstops>
+ <includes>
+  <include location="local">qtimer.h</include>
+ </includes>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>pushYes</sender>
+   <signal>clicked()</signal>
+   <receiver>dialogConfirm</receiver>
+   <slot>slotYes()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>20</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>20</x>
+     <y>20</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>pushNo</sender>
+   <signal>clicked()</signal>
+   <receiver>dialogConfirm</receiver>
+   <slot>slotNo()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>20</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>20</x>
+     <y>20</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
 </ui>

Modified: pcbsd/current/src-qt4/pc-xgui/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/main.cpp	2012-02-15 19:17:17 UTC (rev 15371)
+++ pcbsd/current/src-qt4/pc-xgui/main.cpp	2012-02-15 19:19:25 UTC (rev 15372)
@@ -4,6 +4,7 @@
 #include <qstylefactory.h>
 #include <qdesktopwidget.h>
 #include <QDebug>
+#include <QObject>
 #include "xgui.h"
 #include "dialogconfirm.h"
 #include "../config.h"
@@ -43,21 +44,46 @@
         QString flag = argv[1];
 	if ( flag == "-test" )
 	{
-
-        XGUI w;
-	dialogConfirm d;
-        QDesktopWidget *desk = a.desktop();
-        QRect dimensions = desk->screenGeometry();
-        int wid = dimensions.width();     // returns desktop width
-        int hig = dimensions.height();    // returns desktop height
-        d.setGeometry((wid/2) - (315/2), (hig/2) - (111/2), 315, 111);
-
-        d.ProgramInit();
-        d.setStyle(QStyleFactory::create( "Plastik" ));
-        d.show();
-        a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
-        return a.exec();
+	  dialogConfirm d;
+          QDesktopWidget *desk = a.desktop();
+          QRect dimensions = desk->screenGeometry();
+          int wid = dimensions.width();     // returns desktop width
+          int hig = dimensions.height();    // returns desktop height
+          d.setGeometry((wid/2) - (315/2), (hig/2) - (111/2), 315, 111);
+          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();
         }
+	if ( flag == "-failed" )
+	{
+	  dialogConfirm d;
+          QDesktopWidget *desk = a.desktop();
+          QRect dimensions = desk->screenGeometry();
+          int wid = dimensions.width();     // returns desktop width
+          int hig = dimensions.height();    // returns desktop height
+          d.setGeometry((wid/2) - (315/2), (hig/2) - (111/2), 315, 111);
+          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();
+        }
+	if ( flag == "-firstprompt" )
+	{
+	  dialogConfirm d;
+          QDesktopWidget *desk = a.desktop();
+          QRect dimensions = desk->screenGeometry();
+          int wid = dimensions.width();     // returns desktop width
+          int hig = dimensions.height();    // returns desktop height
+          d.setGeometry((wid/2) - (315/2), (hig/2) - (111/2), 315, 111);
+          d.ProgramInit(QObject::tr("Your display has been automatically configured. Keep these settings?"), false, true);
+          //d.setStyle(QStyleFactory::create( "Plastik" ));
+          d.show();
+          a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
+          return a.exec();
+        }
     } 
 
     XGUI w;



More information about the Commits mailing list