[PC-BSD Commits] r686 - pcbsd/trunk/XGUISource

svn at pcbsd.org svn at pcbsd.org
Mon Sep 10 09:14:44 PDT 2007


Author: kris
Date: 2007-09-10 09:14:44 -0700 (Mon, 10 Sep 2007)
New Revision: 686

Modified:
   pcbsd/trunk/XGUISource/xgui.ui
   pcbsd/trunk/XGUISource/xgui.ui.h
Log:

Add checkbox to XGUI tool which makes monitor horz /vert rates optional.

If they are not specified, then it'll let X detect and use its own rate.

Used duplicate string for checkbox so that no re-translation is needed



Modified: pcbsd/trunk/XGUISource/xgui.ui
===================================================================
--- pcbsd/trunk/XGUISource/xgui.ui	2007-09-10 14:37:24 UTC (rev 685)
+++ pcbsd/trunk/XGUISource/xgui.ui	2007-09-10 16:14:44 UTC (rev 686)
@@ -428,7 +428,7 @@
                             <property name="name">
                                 <cstring>unnamed</cstring>
                             </property>
-                            <spacer row="1" column="0">
+                            <spacer row="2" column="0">
                                 <property name="name">
                                     <cstring>spacer9</cstring>
                                 </property>
@@ -441,17 +441,25 @@
                                 <property name="sizeHint">
                                     <size>
                                         <width>20</width>
-                                        <height>130</height>
+                                        <height>100</height>
                                     </size>
                                 </property>
                             </spacer>
-                            <widget class="QGroupBox" row="0" column="0">
+                            <widget class="QCheckBox" row="0" column="0">
                                 <property name="name">
-                                    <cstring>groupBox2</cstring>
+                                    <cstring>checkMonitorSync</cstring>
                                 </property>
-                                <property name="title">
+                                <property name="text">
                                     <string>Monitor Settings</string>
                                 </property>
+                            </widget>
+                            <widget class="QGroupBox" row="1" column="0">
+                                <property name="name">
+                                    <cstring>groupMonitor</cstring>
+                                </property>
+                                <property name="title">
+                                    <string></string>
+                                </property>
                                 <grid>
                                     <property name="name">
                                         <cstring>unnamed</cstring>
@@ -668,6 +676,12 @@
         <receiver>XGUI</receiver>
         <slot>closeSlot()</slot>
     </connection>
+    <connection>
+        <sender>checkMonitorSync</sender>
+        <signal>clicked()</signal>
+        <receiver>XGUI</receiver>
+        <slot>monitorChangedSlot()</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in declaration">qfile.h</include>
@@ -677,6 +691,7 @@
 <slots>
     <slot access="private">closeSlot()</slot>
     <slot access="private">applySlot()</slot>
+    <slot access="private">monitorChangedSlot()</slot>
 </slots>
 <functions>
     <function>ProgramInit()</function>

Modified: pcbsd/trunk/XGUISource/xgui.ui.h
===================================================================
--- pcbsd/trunk/XGUISource/xgui.ui.h	2007-09-10 14:37:24 UTC (rev 685)
+++ pcbsd/trunk/XGUISource/xgui.ui.h	2007-09-10 16:14:44 UTC (rev 686)
@@ -27,6 +27,8 @@
     // Load the Depth
     loadDepth();
 
+    // Disable the monitor advanced group box
+    monitorChangedSlot();
 
 }
 
@@ -167,8 +169,14 @@
 	     	tmp = comboDepth->currentText();
 		tmp.truncate(tmp.find("bit"));
 	    stream << "DEPTH=\"" + tmp + "\"; export DEPTH\n";
-	    stream << "HORIZSYNC=\"" +lineHorz->text() + "\"; export HORIZSYNC\n" ;
-	    stream << "VERTREFRESH=\"" +lineVertRefresh->text() + "\"; export VERTREFRESH\n" ;
+   	    if ( checkMonitorSync->isChecked() )
+    	    {
+  	    	stream << "HORIZSYNC=\"" +lineHorz->text() + "\"; export HORIZSYNC\n" ;
+	    	stream << "VERTREFRESH=\"" +lineVertRefresh->text() + "\"; export VERTREFRESH\n" ;
+	    } else {
+		stream << "HORIZSYNC=\"OFF\"; export HORIZSYNC\n" ;
+	    	stream << "VERTREFRESH=\"OFF\"; export VERTREFRESH\n" ;
+	    }
 	    file.close();
     	}
 
@@ -179,3 +187,16 @@
 	// Message box, letting user know that we will test this resolution
 	exit(0);
 }
+
+
+void XGUI::monitorChangedSlot()
+{
+
+    if ( checkMonitorSync->isChecked() )
+    {
+	groupMonitor->setEnabled(TRUE);
+    } else {
+	groupMonitor->setEnabled(FALSE);
+    }
+    
+}



More information about the Commits mailing list