Screen will turn black after 30 min
[chessclock] / www / html / chessclockwindow_8cpp_source.html
index e47d27d..a446726 100644 (file)
@@ -69,129 +69,151 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
 <a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="chessclockwidget_8h.html">classes/chessclockwidget.h</a>&quot;</span>
 <a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="startwidget_8h.html">classes/startwidget.h</a>&quot;</span>
 <a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="timecontrol_8h.html">classes/timecontrol.h</a>&quot;</span>
-<a name="l00028"></a>00028 
-<a name="l00029"></a>00029 <span class="comment">// Time controls</span>
-<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="notimecontrol_8h.html">classes/timecontrol/notimecontrol.h</a>&quot;</span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="fischertimecontrol_8h.html">classes/timecontrol/fischertimecontrol.h</a>&quot;</span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="fischeraftertimecontrol_8h.html">classes/timecontrol/fischeraftertimecontrol.h</a>&quot;</span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="delaytimecontrol_8h.html">classes/timecontrol/delaytimecontrol.h</a>&quot;</span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="delayaftertimecontrol_8h.html">classes/timecontrol/delayaftertimecontrol.h</a>&quot;</span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="hourglasstimecontrol_8h.html">classes/timecontrol/hourglasstimecontrol.h</a>&quot;</span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;QIcon&gt;</span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;QApplication&gt;</span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;QMenuBar&gt;</span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;QMessageBox&gt;</span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;QStackedWidget&gt;</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;QProcess&gt;</span>
-<a name="l00043"></a>00043 
+<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="turninformation_8h.html">classes/turninformation.h</a>&quot;</span>
+<a name="l00029"></a>00029 
+<a name="l00030"></a>00030 <span class="comment">// Time controls</span>
+<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="notimecontrol_8h.html">classes/timecontrol/notimecontrol.h</a>&quot;</span>
+<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="fischertimecontrol_8h.html">classes/timecontrol/fischertimecontrol.h</a>&quot;</span>
+<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="fischeraftertimecontrol_8h.html">classes/timecontrol/fischeraftertimecontrol.h</a>&quot;</span>
+<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="delaytimecontrol_8h.html">classes/timecontrol/delaytimecontrol.h</a>&quot;</span>
+<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="delayaftertimecontrol_8h.html">classes/timecontrol/delayaftertimecontrol.h</a>&quot;</span>
+<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="hourglasstimecontrol_8h.html">classes/timecontrol/hourglasstimecontrol.h</a>&quot;</span>
+<a name="l00037"></a>00037 
+<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;QIcon&gt;</span>
+<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;QApplication&gt;</span>
+<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;QMenuBar&gt;</span>
+<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;QMessageBox&gt;</span>
+<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;QStackedWidget&gt;</span>
+<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;QProcess&gt;</span>
 <a name="l00044"></a>00044 
-<a name="l00045"></a><a class="code" href="class_chess_clock_window.html#a570589223bfda26e9818d3f2955e55f8">00045</a> <a class="code" href="class_chess_clock_window.html#a570589223bfda26e9818d3f2955e55f8">ChessClockWindow::ChessClockWindow</a>(QWidget *parent)
-<a name="l00046"></a>00046     : QMainWindow(parent)
-<a name="l00047"></a>00047 {
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049     setWindowIcon( QIcon(<span class="stringliteral">&quot;:/rc/pic/chessclock.png&quot;</span>));
-<a name="l00050"></a>00050     setWindowTitle( QString(<span class="stringliteral">&quot;%1 %2&quot;</span>).arg(qApp-&gt;applicationName()).arg(qApp-&gt;applicationVersion()) );
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052     <span class="comment">// Start widget to select time control</span>
-<a name="l00053"></a>00053     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a> = <span class="keyword">new</span> <a class="code" href="class_start_widget.html" title="Start widget to ask for Time control.">StartWidget</a>;
-<a name="l00054"></a>00054     <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> = 0;
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056     <a class="code" href="class_chess_clock_window.html#ac19fabe171848c0b02c533c6b4a9e2ab">initTimeControls</a>();
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058     <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a> = <span class="keyword">new</span> QStackedWidget;
-<a name="l00059"></a>00059     <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;addWidget(<a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>);
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061     setCentralWidget( <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a> );
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063     connect( <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>, SIGNAL(selected(<a class="code" href="class_time_control.html" title="Base class of virtual controls.">TimeControl</a>*)), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#ad41259afb866585197ca82404f3ca8a2">startGame</a>(<a class="code" href="class_time_control.html" title="Base class of virtual controls.">TimeControl</a>*)));
-<a name="l00064"></a>00064 
+<a name="l00045"></a>00045 
+<a name="l00046"></a><a class="code" href="class_chess_clock_window.html#a570589223bfda26e9818d3f2955e55f8">00046</a> <a class="code" href="class_chess_clock_window.html#a570589223bfda26e9818d3f2955e55f8">ChessClockWindow::ChessClockWindow</a>(QWidget *parent)
+<a name="l00047"></a>00047     : QMainWindow(parent)
+<a name="l00048"></a>00048 {
+<a name="l00049"></a>00049 
+<a name="l00050"></a>00050     setWindowIcon( QIcon(<span class="stringliteral">&quot;:/rc/pic/chessclock.png&quot;</span>));
+<a name="l00051"></a>00051     setWindowTitle( QString(<span class="stringliteral">&quot;%1 %2&quot;</span>).arg(qApp-&gt;applicationName()).arg(qApp-&gt;applicationVersion()) );
+<a name="l00052"></a>00052 
+<a name="l00053"></a>00053     <span class="comment">// Start widget to select time control</span>
+<a name="l00054"></a>00054     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a> = <span class="keyword">new</span> <a class="code" href="class_start_widget.html" title="Start widget to ask for Time control.">StartWidget</a>;
+<a name="l00055"></a>00055     <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> = 0;
+<a name="l00056"></a>00056 
+<a name="l00057"></a>00057     <a class="code" href="class_chess_clock_window.html#ac19fabe171848c0b02c533c6b4a9e2ab">initTimeControls</a>();
+<a name="l00058"></a>00058 
+<a name="l00059"></a>00059     <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a> = <span class="keyword">new</span> QStackedWidget;
+<a name="l00060"></a>00060     <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;addWidget(<a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>);
+<a name="l00061"></a>00061 
+<a name="l00062"></a>00062     setCentralWidget( <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a> );
+<a name="l00063"></a>00063 
+<a name="l00064"></a>00064     connect( <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>, SIGNAL(selected(<a class="code" href="class_time_control.html" title="Base class of virtual controls.">TimeControl</a>*)), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#ad41259afb866585197ca82404f3ca8a2">startGame</a>(<a class="code" href="class_time_control.html" title="Base class of virtual controls.">TimeControl</a>*)));
 <a name="l00065"></a>00065 
-<a name="l00066"></a>00066     <span class="comment">// Set up menu</span>
-<a name="l00067"></a>00067 <span class="comment">//    menuBar()-&gt;addAction( tr(&quot;Pause&quot;), this, SLOT(pause()));   // UNUSED - Pause button</span>
-<a name="l00068"></a>00068     menuBar()-&gt;addAction( tr(<span class="stringliteral">&quot;New game&quot;</span>), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a03f2ad27ab2c6bbece256ee418931a91">newGame</a>()));
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070     menuBar()-&gt;addAction( tr(<span class="stringliteral">&quot;Visit web page&quot;</span>), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a15c6808b2409afbd724118bf6f229742" title="Visit ChessClock web page.">visitWeb</a>()));
-<a name="l00071"></a>00071     menuBar()-&gt;addAction( tr(<span class="stringliteral">&quot;About&quot;</span>),<span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">about</a>()));
-<a name="l00072"></a>00072     menuBar()-&gt;addAction(tr(<span class="stringliteral">&quot;About Qt&quot;</span>), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a75b6f84823e87340bce8e11b2055cfdd">aboutQt</a>()));
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074 }
-<a name="l00075"></a>00075 
-<a name="l00076"></a><a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">00076</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">ChessClockWindow::pause</a>()
-<a name="l00077"></a>00077 {
-<a name="l00078"></a>00078     <span class="keywordflow">if</span>( <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> )
-<a name="l00079"></a>00079         <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>-&gt;<a class="code" href="class_clocks_widget.html#a609a11fc15904a1700f5b82ae2b63228" title="Pause game.">pause</a>();
-<a name="l00080"></a>00080 }
-<a name="l00081"></a>00081 
-<a name="l00082"></a><a class="code" href="class_chess_clock_window.html#a03f2ad27ab2c6bbece256ee418931a91">00082</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a03f2ad27ab2c6bbece256ee418931a91">ChessClockWindow::newGame</a>()
-<a name="l00083"></a>00083 {
-<a name="l00084"></a>00084     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
-<a name="l00085"></a>00085     <span class="keywordflow">if</span>(  <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> == 0 ||  !<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>-&gt;<a class="code" href="class_clocks_widget.html#ae2e2df5f16ea85a5f35b58d8c7e78e33">isPlayStarted</a>()  || QMessageBox::question(<span class="keyword">this</span>, tr(<span class="stringliteral">&quot;Start new game&quot;</span>),
-<a name="l00086"></a>00086                               tr(<span class="stringliteral">&quot;Really quit the current game and start a new one?&quot;</span>),
-<a name="l00087"></a>00087                               QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
-<a name="l00088"></a>00088     {
-<a name="l00089"></a>00089         <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;setCurrentWidget(<a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>);
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091         <span class="keywordflow">if</span>( <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> )
-<a name="l00092"></a>00092         {   <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;removeWidget(<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>);
-<a name="l00093"></a>00093             <span class="keyword">delete</span> <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>;
-<a name="l00094"></a>00094         }
-<a name="l00095"></a>00095         <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>=0;
-<a name="l00096"></a>00096     }
-<a name="l00097"></a>00097 }
-<a name="l00098"></a>00098 
-<a name="l00099"></a><a class="code" href="class_chess_clock_window.html#a15c6808b2409afbd724118bf6f229742">00099</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a15c6808b2409afbd724118bf6f229742" title="Visit ChessClock web page.">ChessClockWindow::visitWeb</a>()
-<a name="l00100"></a>00100 {
-<a name="l00101"></a>00101     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
-<a name="l00102"></a>00102     QProcess* process = <span class="keyword">new</span> QProcess(<span class="keyword">this</span>);
-<a name="l00103"></a>00103     process-&gt;start(QString(<span class="stringliteral">&quot;browser --url=chessclock.garage.maemo.org&quot;</span>));
-<a name="l00104"></a>00104 }
-<a name="l00105"></a>00105 
-<a name="l00106"></a><a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">00106</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">ChessClockWindow::about</a>()
-<a name="l00107"></a>00107 {
-<a name="l00108"></a>00108     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
-<a name="l00109"></a>00109     <a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">QMessageBox::about</a>(<span class="keyword">this</span>, tr(<span class="stringliteral">&quot;About ChessClock&quot;</span>),
-<a name="l00110"></a>00110                        tr(<span class="stringliteral">&quot;&lt;h1&gt;Chess Clock %1&lt;/h1&gt;&quot;</span>
-<a name="l00111"></a>00111                           <span class="stringliteral">&quot;&amp;copy;Arto Hyv&amp;auml;ttinen 2010&quot;</span>
-<a name="l00112"></a>00112                           <span class="stringliteral">&quot;&lt;p&gt;Chess Clock is free software under the terms of GNU General Public License 3&quot;</span>
-<a name="l00113"></a>00113                           <span class="stringliteral">&quot;&lt;p&gt;Bugtracker and instructions at &lt;a&gt;http://chessclock.garage.maemo.org&lt;/a&gt;&quot;</span>
-<a name="l00114"></a>00114                           ).arg(qApp-&gt;applicationVersion())) ;
-<a name="l00115"></a>00115 }
-<a name="l00116"></a>00116 
-<a name="l00117"></a><a class="code" href="class_chess_clock_window.html#a75b6f84823e87340bce8e11b2055cfdd">00117</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a75b6f84823e87340bce8e11b2055cfdd">ChessClockWindow::aboutQt</a>()
-<a name="l00118"></a>00118 {
-<a name="l00119"></a>00119     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
-<a name="l00120"></a>00120     qApp-&gt;aboutQt();
-<a name="l00121"></a>00121 }
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123 
-<a name="l00124"></a><a class="code" href="class_chess_clock_window.html#ac19fabe171848c0b02c533c6b4a9e2ab">00124</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#ac19fabe171848c0b02c533c6b4a9e2ab">ChessClockWindow::initTimeControls</a>()
-<a name="l00125"></a>00125 {
-<a name="l00126"></a>00126     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_no_time_control.html">NoTimeControl</a> );
-<a name="l00127"></a>00127     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_fischer_time_control.html">FischerTimeControl</a>);
-<a name="l00128"></a>00128     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_fischer_after_time_control.html">FischerAfterTimeControl</a>);
-<a name="l00129"></a>00129     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_delay_time_control.html">DelayTimeControl</a> );
-<a name="l00130"></a>00130     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_delay_after_time_control.html">DelayAfterTimeControl</a>);
-<a name="l00131"></a>00131     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_hour_glass_time_control.html">HourGlassTimeControl</a>);
-<a name="l00132"></a>00132 }
-<a name="l00133"></a>00133 
-<a name="l00134"></a><a class="code" href="class_chess_clock_window.html#ad41259afb866585197ca82404f3ca8a2">00134</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#ad41259afb866585197ca82404f3ca8a2">ChessClockWindow::startGame</a>(<a class="code" href="class_time_control.html" title="Base class of virtual controls.">TimeControl</a> *timecontrol)
-<a name="l00135"></a>00135 {
-<a name="l00136"></a>00136     <a class="code" href="class_clocks_widget.html" title="Widget with two clocks.">ClocksWidget</a>* newWidget = timecontrol-&gt;<a class="code" href="class_time_control.html#a2e56bcba84d74b8aa4108ae4ba9f33b1" title="Init new game.">initGame</a>(<span class="keyword">false</span>);
-<a name="l00137"></a>00137     <span class="keywordflow">if</span>( newWidget )
-<a name="l00138"></a>00138     {
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140         <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> = newWidget;
-<a name="l00141"></a>00141         <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;addWidget(<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>);
-<a name="l00142"></a>00142         <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;setCurrentWidget(<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>);
-<a name="l00143"></a>00143     }
-<a name="l00144"></a>00144 }
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146 
-<a name="l00147"></a><a class="code" href="class_chess_clock_window.html#a7007da9dea854b3aab86fb36a4cb8c44">00147</a> <a class="code" href="class_chess_clock_window.html#a7007da9dea854b3aab86fb36a4cb8c44">ChessClockWindow::~ChessClockWindow</a>()
-<a name="l00148"></a>00148 {
-<a name="l00149"></a>00149 
+<a name="l00066"></a>00066 
+<a name="l00067"></a>00067     <span class="comment">// Set up menu</span>
+<a name="l00068"></a>00068 <span class="comment">//    menuBar()-&gt;addAction( tr(&quot;Pause&quot;), this, SLOT(pause()));   // UNUSED - Pause button</span>
+<a name="l00069"></a>00069     menuBar()-&gt;addAction( tr(<span class="stringliteral">&quot;New game&quot;</span>), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a03f2ad27ab2c6bbece256ee418931a91">newGame</a>()));
+<a name="l00070"></a>00070 
+<a name="l00071"></a>00071     menuBar()-&gt;addAction( tr(<span class="stringliteral">&quot;Visit web page&quot;</span>), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a15c6808b2409afbd724118bf6f229742" title="Visit ChessClock web page.">visitWeb</a>()));
+<a name="l00072"></a>00072     menuBar()-&gt;addAction( tr(<span class="stringliteral">&quot;About&quot;</span>),<span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">about</a>()));
+<a name="l00073"></a>00073     menuBar()-&gt;addAction(tr(<span class="stringliteral">&quot;About Qt&quot;</span>), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a75b6f84823e87340bce8e11b2055cfdd">aboutQt</a>()));
+<a name="l00074"></a>00074 
+<a name="l00075"></a>00075     <span class="comment">//set the event filter to grap window deactivate</span>
+<a name="l00076"></a>00076 
+<a name="l00077"></a>00077     installEventFilter(<span class="keyword">this</span>);
+<a name="l00078"></a>00078 
+<a name="l00079"></a>00079 }
+<a name="l00080"></a>00080 
+<a name="l00081"></a><a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">00081</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">ChessClockWindow::pause</a>()
+<a name="l00082"></a>00082 {
+<a name="l00083"></a>00083     <span class="keywordflow">if</span>( <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> )
+<a name="l00084"></a>00084         <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>-&gt;<a class="code" href="class_clocks_widget.html#a609a11fc15904a1700f5b82ae2b63228" title="Pause game.">pause</a>();
+<a name="l00085"></a>00085 }
+<a name="l00086"></a>00086 
+<a name="l00087"></a><a class="code" href="class_chess_clock_window.html#a03f2ad27ab2c6bbece256ee418931a91">00087</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a03f2ad27ab2c6bbece256ee418931a91">ChessClockWindow::newGame</a>()
+<a name="l00088"></a>00088 {
+<a name="l00089"></a>00089     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
+<a name="l00090"></a>00090     <span class="keywordflow">if</span>(  <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> == 0 ||  !<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>-&gt;<a class="code" href="class_clocks_widget.html#ae2e2df5f16ea85a5f35b58d8c7e78e33">isPlayStarted</a>()  || QMessageBox::question(<span class="keyword">this</span>, tr(<span class="stringliteral">&quot;Start new game&quot;</span>),
+<a name="l00091"></a>00091                               tr(<span class="stringliteral">&quot;Really quit the current game and start a new one?&quot;</span>),
+<a name="l00092"></a>00092                               QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
+<a name="l00093"></a>00093     {
+<a name="l00094"></a>00094         <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;setCurrentWidget(<a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>);
+<a name="l00095"></a>00095 
+<a name="l00096"></a>00096         <span class="keywordflow">if</span>( <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> )
+<a name="l00097"></a>00097         {   <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;removeWidget(<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>);
+<a name="l00098"></a>00098             <span class="keyword">delete</span> <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>;
+<a name="l00099"></a>00099         }
+<a name="l00100"></a>00100         <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>=0;
+<a name="l00101"></a>00101     }
+<a name="l00102"></a>00102 }
+<a name="l00103"></a>00103 
+<a name="l00104"></a><a class="code" href="class_chess_clock_window.html#a15c6808b2409afbd724118bf6f229742">00104</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a15c6808b2409afbd724118bf6f229742" title="Visit ChessClock web page.">ChessClockWindow::visitWeb</a>()
+<a name="l00105"></a>00105 {
+<a name="l00106"></a>00106     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
+<a name="l00107"></a>00107     QProcess* process = <span class="keyword">new</span> QProcess(<span class="keyword">this</span>);
+<a name="l00108"></a>00108     process-&gt;start(QString(<span class="stringliteral">&quot;browser --url=chessclock.garage.maemo.org&quot;</span>));
+<a name="l00109"></a>00109 }
+<a name="l00110"></a>00110 
+<a name="l00111"></a><a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">00111</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">ChessClockWindow::about</a>()
+<a name="l00112"></a>00112 {
+<a name="l00113"></a>00113     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
+<a name="l00114"></a>00114     <a class="code" href="class_chess_clock_window.html#ad89b82909aa0d0e36267f63dda7037ff">QMessageBox::about</a>(<span class="keyword">this</span>, tr(<span class="stringliteral">&quot;About ChessClock&quot;</span>),
+<a name="l00115"></a>00115                        tr(<span class="stringliteral">&quot;&lt;h1&gt;Chess Clock %1&lt;/h1&gt;&quot;</span>
+<a name="l00116"></a>00116                           <span class="stringliteral">&quot;&amp;copy;Arto Hyv&amp;auml;ttinen 2010&quot;</span>
+<a name="l00117"></a>00117                           <span class="stringliteral">&quot;&lt;p&gt;Chess Clock is free software under the terms of GNU General Public License 3&quot;</span>
+<a name="l00118"></a>00118                           <span class="stringliteral">&quot;&lt;p&gt;Bugtracker and instructions at &lt;a&gt;http://chessclock.garage.maemo.org&lt;/a&gt;&quot;</span>
+<a name="l00119"></a>00119                           ).arg(qApp-&gt;applicationVersion())) ;
+<a name="l00120"></a>00120 }
+<a name="l00121"></a>00121 
+<a name="l00122"></a><a class="code" href="class_chess_clock_window.html#a75b6f84823e87340bce8e11b2055cfdd">00122</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a75b6f84823e87340bce8e11b2055cfdd">ChessClockWindow::aboutQt</a>()
+<a name="l00123"></a>00123 {
+<a name="l00124"></a>00124     <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
+<a name="l00125"></a>00125     qApp-&gt;aboutQt();
+<a name="l00126"></a>00126 }
+<a name="l00127"></a>00127 
+<a name="l00128"></a>00128 
+<a name="l00129"></a><a class="code" href="class_chess_clock_window.html#ac19fabe171848c0b02c533c6b4a9e2ab">00129</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#ac19fabe171848c0b02c533c6b4a9e2ab">ChessClockWindow::initTimeControls</a>()
+<a name="l00130"></a>00130 {
+<a name="l00131"></a>00131     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_no_time_control.html">NoTimeControl</a> );
+<a name="l00132"></a>00132     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_fischer_time_control.html">FischerTimeControl</a>);
+<a name="l00133"></a>00133     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_fischer_after_time_control.html">FischerAfterTimeControl</a>);
+<a name="l00134"></a>00134     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_delay_time_control.html">DelayTimeControl</a> );
+<a name="l00135"></a>00135     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_delay_after_time_control.html">DelayAfterTimeControl</a>);
+<a name="l00136"></a>00136     <a class="code" href="class_chess_clock_window.html#ad65c7b41fc1e1755af16476f2bda3309">start_</a>-&gt;<a class="code" href="class_start_widget.html#aeeec8c14527bf673673f727010ad5811">addTimeControl</a>( <span class="keyword">new</span> <a class="code" href="class_hour_glass_time_control.html">HourGlassTimeControl</a>);
+<a name="l00137"></a>00137 }
+<a name="l00138"></a>00138 
+<a name="l00139"></a><a class="code" href="class_chess_clock_window.html#ad41259afb866585197ca82404f3ca8a2">00139</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#ad41259afb866585197ca82404f3ca8a2">ChessClockWindow::startGame</a>(<a class="code" href="class_time_control.html" title="Base class of virtual controls.">TimeControl</a> *timecontrol)
+<a name="l00140"></a>00140 {
+<a name="l00141"></a>00141     <a class="code" href="class_clocks_widget.html" title="Widget with two clocks.">ClocksWidget</a>* newWidget = timecontrol-&gt;<a class="code" href="class_time_control.html#a2e56bcba84d74b8aa4108ae4ba9f33b1" title="Init new game.">initGame</a>(<span class="keyword">false</span>);
+<a name="l00142"></a>00142     <span class="keywordflow">if</span>( newWidget )
+<a name="l00143"></a>00143     {
+<a name="l00144"></a>00144 
+<a name="l00145"></a>00145         <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a> = newWidget;
+<a name="l00146"></a>00146         <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;addWidget(<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>);
+<a name="l00147"></a>00147         <a class="code" href="class_chess_clock_window.html#a058f37db2e25aa05fe87725e232a5133">stack_</a>-&gt;setCurrentWidget(<a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>);
+<a name="l00148"></a>00148         connect( <a class="code" href="class_chess_clock_window.html#a30333fd439f58a235ef14629466bffd3">clocks_</a>, SIGNAL(TurnFinished(<a class="code" href="class_turn_information.html" title="Turn information class.">TurnInformation</a>*)), <span class="keyword">this</span>, SLOT(<a class="code" href="class_chess_clock_window.html#a03405591ce4c5fc328805c8daea46529" title="Delete turn information to avoid memory leaks.">dontEatMemory</a>(<a class="code" href="class_turn_information.html" title="Turn information class.">TurnInformation</a>*)));
+<a name="l00149"></a>00149     }
 <a name="l00150"></a>00150 }
+<a name="l00151"></a>00151 
+<a name="l00152"></a>00152 
+<a name="l00153"></a><a class="code" href="class_chess_clock_window.html#a7007da9dea854b3aab86fb36a4cb8c44">00153</a> <a class="code" href="class_chess_clock_window.html#a7007da9dea854b3aab86fb36a4cb8c44">ChessClockWindow::~ChessClockWindow</a>()
+<a name="l00154"></a>00154 {
+<a name="l00155"></a>00155 
+<a name="l00156"></a>00156 }
+<a name="l00157"></a>00157 
+<a name="l00158"></a><a class="code" href="class_chess_clock_window.html#ad3b7644c66f9abda7d26a4d8846d4a52">00158</a> <span class="keywordtype">bool</span> <a class="code" href="class_chess_clock_window.html#ad3b7644c66f9abda7d26a4d8846d4a52" title="Pauses the game if the application main window is not active e.g.">ChessClockWindow::eventFilter</a>(QObject *obj, QEvent *event)
+<a name="l00159"></a>00159 {
+<a name="l00160"></a>00160     <span class="keywordflow">if</span> (event-&gt;type() == QEvent::WindowDeactivate) {
+<a name="l00161"></a>00161         <a class="code" href="class_chess_clock_window.html#a4d8078d15e55c8382592fb077f6f7f0a">pause</a>();
+<a name="l00162"></a>00162         <span class="keywordflow">return</span> <a class="code" href="class_chess_clock_window.html#ad3b7644c66f9abda7d26a4d8846d4a52" title="Pauses the game if the application main window is not active e.g.">QObject::eventFilter</a>(obj,event);
+<a name="l00163"></a>00163     } <span class="keywordflow">else</span> {
+<a name="l00164"></a>00164         <span class="comment">// standard event processing</span>
+<a name="l00165"></a>00165         <span class="keywordflow">return</span> <a class="code" href="class_chess_clock_window.html#ad3b7644c66f9abda7d26a4d8846d4a52" title="Pauses the game if the application main window is not active e.g.">QObject::eventFilter</a>(obj, event);
+<a name="l00166"></a>00166     }
+<a name="l00167"></a>00167 }
+<a name="l00168"></a>00168 
+<a name="l00169"></a><a class="code" href="class_chess_clock_window.html#a03405591ce4c5fc328805c8daea46529">00169</a> <span class="keywordtype">void</span> <a class="code" href="class_chess_clock_window.html#a03405591ce4c5fc328805c8daea46529" title="Delete turn information to avoid memory leaks.">ChessClockWindow::dontEatMemory</a>(<a class="code" href="class_turn_information.html" title="Turn information class.">TurnInformation</a> *turnInformation)
+<a name="l00170"></a>00170 {
+<a name="l00171"></a>00171     <span class="keyword">delete</span> turnInformation; <span class="comment">// hopefully don&#39;t cause Segematation Fault</span>
+<a name="l00172"></a>00172 }
 </pre></div></div>
 <!--- window showing the filter options -->
 <div id="MSearchSelectWindow"
@@ -207,7 +229,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
 </iframe>
 </div>
 
-<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Sep 27 18:30:33 2010 for Chess Clock by&nbsp;
+<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Oct 12 20:52:59 2010 for Chess Clock by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
 </body>