Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4f45e7bdfd4a5ff17f5f8eaab90d017f > files > 1603

albumshaper-2.1-6mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AlbumShaper: statusWidget.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>statusWidget.cpp</h1><a href="statusWidget_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==============================================</span>
<a name="l00002"></a>00002 <span class="comment">//  copyright            : (C) 2003-2005 by Will Stokes</span>
<a name="l00003"></a>00003 <span class="comment">//==============================================</span>
<a name="l00004"></a>00004 <span class="comment">//  This program is free software; you can redistribute it</span>
<a name="l00005"></a>00005 <span class="comment">//  and/or modify it under the terms of the GNU General</span>
<a name="l00006"></a>00006 <span class="comment">//  Public License as published by the Free Software</span>
<a name="l00007"></a>00007 <span class="comment">//  Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">//  (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">//==============================================</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">//Systemwide includes</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;qlayout.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;qlabel.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;qfont.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;qframe.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;qprogressbar.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;qfile.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;qdom.h&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;qstringlist.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;qtooltip.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;qpixmap.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;qdir.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;qmovie.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;qtimer.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;qsizegrip.h&gt;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="comment">//Projectwide includes</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="clickableLabel_8h.html">clickableLabel.h</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="statusWidget_8h.html">statusWidget.h</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="titleWidget_8h.html">titleWidget.h</a>"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="window_8h.html">window.h</a>"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "../config.h"</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "../configuration/configuration.h"</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="comment">//==============================================</span>
<a name="l00036"></a><a class="code" href="classStatusWidget.html#d86d9791b8d93c175275269f8a19a13a">00036</a> <a class="code" href="classStatusWidget.html#d86d9791b8d93c175275269f8a19a13a" title="Creates layout.">StatusWidget::StatusWidget</a>(<a class="code" href="classQWidget.html">QWidget</a> *parent,
<a name="l00037"></a>00037                          <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) : <a class="code" href="classQWidget.html">QWidget</a>(parent,name)
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039  <span class="comment">//create status message</span>
<a name="l00040"></a>00040   <a class="code" href="classStatusWidget.html#2dec5d4cb267fba6a94bfc58abbcb2ce">message</a> = <span class="keyword">new</span> <a class="code" href="classQLabel.html">QLabel</a>( <span class="keyword">this</span> );
<a name="l00041"></a>00041   <a class="code" href="classStatusWidget.html#2dec5d4cb267fba6a94bfc58abbcb2ce">message</a>-&gt;setText( <span class="stringliteral">""</span> );
<a name="l00042"></a>00042   
<a name="l00043"></a>00043   <span class="comment">//create timer object and setup signals</span>
<a name="l00044"></a>00044   <a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a> = <span class="keyword">new</span> QTimer();
<a name="l00045"></a>00045   connect(<a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a>, SIGNAL(timeout()), <span class="keyword">this</span>, SLOT(<a class="code" href="classStatusWidget.html#dad879b5dc3cc0395b956b348f9f2495" title="Unset message.">removeStatus</a>()) );
<a name="l00046"></a>00046 
<a name="l00047"></a>00047   <span class="comment">//create progress message and bar</span>
<a name="l00048"></a>00048   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a> = <span class="keyword">new</span> QProgressBar( <span class="keyword">this</span> );
<a name="l00049"></a>00049   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;setCenterIndicator(<span class="keyword">true</span>);
<a name="l00050"></a>00050   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;hide();
<a name="l00051"></a>00051   <a class="code" href="classStatusWidget.html#e44ccc58975325fdc62596ff4718a2f9">curStep</a> = 0;
<a name="l00052"></a>00052 
<a name="l00053"></a>00053   <span class="comment">//-----------------------------------------------------------------</span>
<a name="l00054"></a>00054   <span class="comment">//setup http object to check for updates, only check for updates if they are enabled</span>
<a name="l00055"></a>00055   <a class="code" href="classStatusWidget.html#3508a3c0d24b2f3787e41e0921e750fb" title="Update available label.">updateAvailable</a> = NULL;
<a name="l00056"></a>00056   <a class="code" href="classStatusWidget.html#ca83dff6acb221e6094aac82be41c401" title="http object for fetching releases file, used to check to see if installed copy is...">http</a>.setHost( <span class="stringliteral">"albumshaper.sourceforge.net"</span> );
<a name="l00057"></a>00057   connect( &amp;<a class="code" href="classStatusWidget.html#ca83dff6acb221e6094aac82be41c401" title="http object for fetching releases file, used to check to see if installed copy is...">http</a>, SIGNAL(done(<span class="keywordtype">bool</span>)), <span class="keyword">this</span>, SLOT(<a class="code" href="classStatusWidget.html#80e418a800324a24b6e4c447a3178576" title="called once a file is fetched from the network">fileFetched</a>(<span class="keywordtype">bool</span>)) );
<a name="l00058"></a>00058   <span class="keywordflow">if</span>(((<a class="code" href="classWindow.html" title="Top level widget, encapsulates the title widget, the layout widget, and the toolbar...">Window</a>*)parentWidget())-&gt;getConfig()-&gt;getBool( <span class="stringliteral">"alerts"</span>, <span class="stringliteral">"showSoftwareUpdateAlerts"</span>))
<a name="l00059"></a>00059   {
<a name="l00060"></a>00060     <a class="code" href="classStatusWidget.html#006dd272317ce936bfd1748ed02ba081" title="Check for updates.">checkForUpdates</a>();
<a name="l00061"></a>00061   }
<a name="l00062"></a>00062   <span class="comment">//-----------------------------------------------------------------</span>
<a name="l00063"></a>00063   <span class="comment">//place progress frame and status message in main grid</span>
<a name="l00064"></a>00064   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a> = <span class="keyword">new</span> QGridLayout( <span class="keyword">this</span>, 1, 6, 0 );
<a name="l00065"></a>00065   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;setSpacing(<a class="code" href="config_8h.html#07d364596a27705c900f07340515d5db">WIDGET_SPACING</a>);
<a name="l00066"></a>00066   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;setColSpacing( 0, <a class="code" href="config_8h.html#07d364596a27705c900f07340515d5db">WIDGET_SPACING</a> );
<a name="l00067"></a>00067   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;addWidget( <a class="code" href="classStatusWidget.html#2dec5d4cb267fba6a94bfc58abbcb2ce">message</a>, 0, 1, Qt::AlignVCenter );
<a name="l00068"></a>00068   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;addWidget( <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>, 0, 2, Qt::AlignVCenter );
<a name="l00069"></a>00069   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;setColStretch( 3, 1 );
<a name="l00070"></a>00070 
<a name="l00071"></a>00071   <span class="comment">//PLATFORM_SPECIFIC_CODE</span>
<a name="l00072"></a>00072   <span class="comment">//mac os x puts in a size grip that can interfere with the updates icon, in order</span>
<a name="l00073"></a>00073   <span class="comment">//to avoid this we manually place the size grip ourselves</span>
<a name="l00074"></a>00074   <span class="comment">//windows users expect a grip too, but qt doesn't put one in by default. we'll add</span>
<a name="l00075"></a>00075   <span class="comment">//it for them too. :-)</span>
<a name="l00076"></a>00076 <span class="preprocessor">  #if defined(Q_OS_MACX) || defined(Q_OS_WIN)</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>  QSizeGrip* sizeGrip = <span class="keyword">new</span> QSizeGrip( <span class="keyword">this</span> );
<a name="l00078"></a>00078   <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;addWidget( sizeGrip, 0, 5, Qt::AlignBottom );
<a name="l00079"></a>00079 <span class="preprocessor">  #endif</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span>
<a name="l00081"></a>00081 }
<a name="l00082"></a>00082 <span class="comment">//==============================================</span>
<a name="l00083"></a><a class="code" href="classStatusWidget.html#0991157916d0e53285dd00ff27f4a1c5">00083</a> <a class="code" href="classStatusWidget.html#0991157916d0e53285dd00ff27f4a1c5" title="Deletes all objects.">StatusWidget::~StatusWidget</a>()
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085   <span class="keyword">delete</span> <a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a>;
<a name="l00086"></a>00086   <a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a> = NULL;
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088 <span class="comment">//==============================================</span>
<a name="l00089"></a><a class="code" href="classStatusWidget.html#57d461014070b9d651c36bd157cab9c1">00089</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#57d461014070b9d651c36bd157cab9c1" title="Initializes the progress bar.">StatusWidget::showProgressBar</a>(QString message, <span class="keywordtype">int</span> numSteps)
<a name="l00090"></a>00090 {
<a name="l00091"></a>00091   <span class="comment">//make sure timer is stopped so progress mess is never hidden</span>
<a name="l00092"></a>00092   <span class="comment">//this can occur if a new event is begun before the previous events message is removed after default delay</span>
<a name="l00093"></a>00093   <a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a>-&gt;stop();
<a name="l00094"></a>00094   
<a name="l00095"></a>00095   <span class="comment">//setup progress bar and show it</span>
<a name="l00096"></a>00096   this-&gt;message-&gt;setText( message );
<a name="l00097"></a>00097   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;setProgress( 0, numSteps );
<a name="l00098"></a>00098   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;show();
<a name="l00099"></a>00099   <a class="code" href="classStatusWidget.html#e44ccc58975325fdc62596ff4718a2f9">curStep</a> = 0;
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101 <span class="comment">//==============================================</span>
<a name="l00102"></a><a class="code" href="classStatusWidget.html#b3e94c61124e13cfa1d3465bd0018076">00102</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#b3e94c61124e13cfa1d3465bd0018076" title="Updates the progress bar.">StatusWidget::updateProgress</a>(<span class="keywordtype">int</span> progress, QString newMessage)
<a name="l00103"></a>00103 {
<a name="l00104"></a>00104   <a class="code" href="classStatusWidget.html#e44ccc58975325fdc62596ff4718a2f9">curStep</a> = progress;
<a name="l00105"></a>00105   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;setProgress( progress );
<a name="l00106"></a>00106 
<a name="l00107"></a>00107   <span class="comment">//update message if provided</span>
<a name="l00108"></a>00108   <span class="keywordflow">if</span>(newMessage != QString::null)
<a name="l00109"></a>00109   {
<a name="l00110"></a>00110     this-&gt;<a class="code" href="classStatusWidget.html#2dec5d4cb267fba6a94bfc58abbcb2ce">message</a>-&gt;setText( newMessage );
<a name="l00111"></a>00111   }
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113 <span class="comment">//==============================================</span>
<a name="l00114"></a><a class="code" href="classStatusWidget.html#d6f09469554ece6887b68267927b6bb7">00114</a> <span class="keywordtype">int</span> <a class="code" href="classStatusWidget.html#d6f09469554ece6887b68267927b6bb7" title="Returns current progress in steps.">StatusWidget::currentProgress</a>()
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116   <span class="keywordflow">return</span> <a class="code" href="classStatusWidget.html#e44ccc58975325fdc62596ff4718a2f9">curStep</a>;
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118 <span class="comment">//==============================================</span>
<a name="l00119"></a><a class="code" href="classStatusWidget.html#de18735223ae40506c32c96b9c9c5476">00119</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#de18735223ae40506c32c96b9c9c5476" title="Updates the progress bar by one step.">StatusWidget::incrementProgress</a>()
<a name="l00120"></a>00120 {
<a name="l00121"></a>00121   <a class="code" href="classStatusWidget.html#e44ccc58975325fdc62596ff4718a2f9">curStep</a>++;
<a name="l00122"></a>00122   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;setProgress( <a class="code" href="classStatusWidget.html#e44ccc58975325fdc62596ff4718a2f9">curStep</a> );
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="comment">//==============================================</span>
<a name="l00125"></a><a class="code" href="classStatusWidget.html#02084869ff1c15dab4bc922a49b31808">00125</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#02084869ff1c15dab4bc922a49b31808" title="Update message.">StatusWidget::setStatus</a>( QString message )
<a name="l00126"></a>00126 {
<a name="l00127"></a>00127   <a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a>-&gt;stop();
<a name="l00128"></a>00128 
<a name="l00129"></a>00129   <span class="comment">//hide progress bar</span>
<a name="l00130"></a>00130   <a class="code" href="classStatusWidget.html#d11bc9fe92d21e73f912d8d1d0f9a3c7">progressBar</a>-&gt;hide();
<a name="l00131"></a>00131 
<a name="l00132"></a>00132   <span class="comment">//update status message</span>
<a name="l00133"></a>00133   this-&gt;message-&gt;setText( message );
<a name="l00134"></a>00134 
<a name="l00135"></a>00135   <a class="code" href="classStatusWidget.html#b0efda9970f9b25ef14351f60409816d">timer</a>-&gt;start( 2000, TRUE );
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137 <span class="comment">//==============================================</span>
<a name="l00138"></a><a class="code" href="classStatusWidget.html#dad879b5dc3cc0395b956b348f9f2495">00138</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#dad879b5dc3cc0395b956b348f9f2495" title="Unset message.">StatusWidget::removeStatus</a>()
<a name="l00139"></a>00139 {
<a name="l00140"></a>00140   <span class="comment">//set status message to empty string</span>
<a name="l00141"></a>00141   <a class="code" href="classStatusWidget.html#2dec5d4cb267fba6a94bfc58abbcb2ce">message</a>-&gt;setText( <span class="stringliteral">""</span> );
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143 <span class="comment">//==============================================</span>
<a name="l00144"></a><a class="code" href="classStatusWidget.html#80e418a800324a24b6e4c447a3178576">00144</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#80e418a800324a24b6e4c447a3178576" title="called once a file is fetched from the network">StatusWidget::fileFetched</a>(<span class="keywordtype">bool</span> error)
<a name="l00145"></a>00145 {
<a name="l00146"></a>00146   <span class="comment">//------------------------------------------------------------</span>
<a name="l00147"></a>00147   <span class="comment">//if unable to get file bail</span>
<a name="l00148"></a>00148   <span class="keywordflow">if</span>(error)
<a name="l00149"></a>00149   {
<a name="l00150"></a>00150     <span class="keywordflow">return</span>;
<a name="l00151"></a>00151   }
<a name="l00152"></a>00152   <span class="comment">//------------------------------------------------------------</span>
<a name="l00153"></a>00153   <span class="comment">//write releases to temp file</span>
<a name="l00154"></a>00154   QFile fetchedDoc( <a class="code" href="config_8cpp.html#8e603096352908a187b5364096a8d581">TEMP_DIR</a> + QString(<span class="stringliteral">"/releases.xml"</span>) );
<a name="l00155"></a>00155   <span class="keywordflow">if</span>(fetchedDoc.open(IO_WriteOnly))
<a name="l00156"></a>00156   {
<a name="l00157"></a>00157     <span class="comment">//----------------------------</span>
<a name="l00158"></a>00158     <span class="comment">//write to file</span>
<a name="l00159"></a>00159     QTextStream stream( &amp;fetchedDoc );
<a name="l00160"></a>00160     stream.setEncoding( QTextStream::UnicodeUTF8 );
<a name="l00161"></a>00161     stream &lt;&lt; QString( <a class="code" href="classStatusWidget.html#ca83dff6acb221e6094aac82be41c401" title="http object for fetching releases file, used to check to see if installed copy is...">http</a>.readAll() );
<a name="l00162"></a>00162     fetchedDoc.close();
<a name="l00163"></a>00163     <span class="comment">//----------------------------</span>
<a name="l00164"></a>00164     <span class="comment">//parse xml file, construct string list of releases</span>
<a name="l00165"></a>00165     <span class="comment">//open file, bail if unable to</span>
<a name="l00166"></a>00166     <span class="keywordflow">if</span>( !fetchedDoc.open( IO_ReadOnly ) )
<a name="l00167"></a>00167     {
<a name="l00168"></a>00168       <span class="keywordflow">return</span>;
<a name="l00169"></a>00169     }
<a name="l00170"></a>00170 
<a name="l00171"></a>00171     <span class="comment">//parse dom</span>
<a name="l00172"></a>00172     QDomDocument xmlDom;
<a name="l00173"></a>00173     <span class="keywordflow">if</span>( !xmlDom.setContent( &amp;fetchedDoc ) )
<a name="l00174"></a>00174     {
<a name="l00175"></a>00175       fetchedDoc.close();
<a name="l00176"></a>00176       <span class="keywordflow">return</span>;
<a name="l00177"></a>00177     }
<a name="l00178"></a>00178 
<a name="l00179"></a>00179     <span class="comment">//close file</span>
<a name="l00180"></a>00180     fetchedDoc.close();
<a name="l00181"></a>00181 
<a name="l00182"></a>00182     <span class="comment">//construct stringlist of releases</span>
<a name="l00183"></a>00183     <span class="comment">//actually, only get the first release since we don't need the others to determine if we</span>
<a name="l00184"></a>00184     <span class="comment">//are out of date</span>
<a name="l00185"></a>00185 
<a name="l00186"></a>00186     QStringList releases;
<a name="l00187"></a>00187     QDomElement root = xmlDom.documentElement();
<a name="l00188"></a>00188     QDomNode node = root.firstChild();
<a name="l00189"></a>00189     QDomText val;
<a name="l00190"></a>00190     <span class="keywordtype">bool</span> thisVersionFound = <span class="keyword">false</span>;
<a name="l00191"></a>00191     <span class="keywordflow">while</span>( !node.isNull() )
<a name="l00192"></a>00192     {
<a name="l00193"></a>00193       <span class="keywordflow">if</span>( node.isElement() &amp;&amp; node.nodeName() == <span class="stringliteral">"release"</span> )
<a name="l00194"></a>00194       {
<a name="l00195"></a>00195         val = node.firstChild().toText();
<a name="l00196"></a>00196         <span class="keywordflow">if</span>(!val.isNull())
<a name="l00197"></a>00197         {
<a name="l00198"></a>00198           <span class="comment">//append release #</span>
<a name="l00199"></a>00199           releases.append( QString(val.nodeValue()) );
<a name="l00200"></a>00200 
<a name="l00201"></a>00201           <span class="comment">//is release this version?</span>
<a name="l00202"></a>00202           <span class="keywordflow">if</span>( QString(val.nodeValue()).compare( QString(<a class="code" href="config_8h.html#bb92ba64f4db628dfcc469f96f3af746">ALBUMSHAPER_VERSION</a>) ) == 0 )
<a name="l00203"></a>00203             thisVersionFound = <span class="keyword">true</span>;
<a name="l00204"></a>00204         }
<a name="l00205"></a>00205       }
<a name="l00206"></a>00206       node = node.nextSibling();
<a name="l00207"></a>00207     }
<a name="l00208"></a>00208 
<a name="l00209"></a>00209     <span class="comment">//compare first release to this release, if strings not equal then we're outdated,</span>
<a name="l00210"></a>00210     <span class="comment">//update album shaper icon and start grabbing changelogs</span>
<a name="l00211"></a>00211     <span class="keywordflow">if</span>(thisVersionFound &amp;&amp; releases.first().compare( QString(<a class="code" href="config_8h.html#bb92ba64f4db628dfcc469f96f3af746">ALBUMSHAPER_VERSION</a>) ) != 0)
<a name="l00212"></a>00212     {
<a name="l00213"></a>00213       <a class="code" href="classClickableLabel.html" title="A clickable label.">ClickableLabel</a>* uA = <span class="keyword">new</span> <a class="code" href="classClickableLabel.html" title="A clickable label.">ClickableLabel</a>( <span class="keyword">this</span> );
<a name="l00214"></a>00214       uA-&gt;setMovie( QMovie( QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"miscImages/updateAvailable.mng"</span>) );
<a name="l00215"></a>00215       QToolTip::add( uA, tr(<span class="stringliteral">"Your copy of Album Shaper is not up to date! Click here for details"</span>) );
<a name="l00216"></a>00216       <a class="code" href="classStatusWidget.html#c57c152e8b66c13fc8a25cf86688ce35" title="Layout widgets placed in.">grid</a>-&gt;addWidget( uA, 0, 4, Qt::AlignVCenter );
<a name="l00217"></a>00217       connect( uA, SIGNAL(clicked()),
<a name="l00218"></a>00218                     ((<a class="code" href="classWindow.html" title="Top level widget, encapsulates the title widget, the layout widget, and the toolbar...">Window</a>*)parentWidget())-&gt;getTitle(), SLOT(aboutProgram()) );
<a name="l00219"></a>00219       uA-&gt;show();\
<a name="l00220"></a>00220       <a class="code" href="classStatusWidget.html#3508a3c0d24b2f3787e41e0921e750fb" title="Update available label.">updateAvailable</a> = uA;
<a name="l00221"></a>00221     }
<a name="l00222"></a>00222   }
<a name="l00223"></a>00223   <span class="comment">//------------------------------------------------------------</span>
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225 <span class="comment">//==============================================</span>
<a name="l00226"></a><a class="code" href="classStatusWidget.html#006dd272317ce936bfd1748ed02ba081">00226</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#006dd272317ce936bfd1748ed02ba081" title="Check for updates.">StatusWidget::checkForUpdates</a>()
<a name="l00227"></a>00227 {
<a name="l00228"></a>00228   <span class="keywordflow">if</span>(<a class="code" href="classStatusWidget.html#3508a3c0d24b2f3787e41e0921e750fb" title="Update available label.">updateAvailable</a> != NULL)
<a name="l00229"></a>00229     <span class="keywordflow">return</span>;
<a name="l00230"></a>00230 
<a name="l00231"></a>00231   <span class="comment">//attempt to get releases list from website. this lets us find out if this</span>
<a name="l00232"></a>00232   <span class="comment">//copy of Album Shaper is outdated</span>
<a name="l00233"></a>00233   <a class="code" href="classStatusWidget.html#ca83dff6acb221e6094aac82be41c401" title="http object for fetching releases file, used to check to see if installed copy is...">http</a>.get( <span class="stringliteral">"/webService/releases.xml"</span>);
<a name="l00234"></a>00234 }
<a name="l00235"></a>00235 <span class="comment">//==============================================</span>
<a name="l00236"></a><a class="code" href="classStatusWidget.html#946425f382015f9f3e371666dfc1aea2">00236</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#946425f382015f9f3e371666dfc1aea2" title="Remove program updates icon.">StatusWidget::removeUpdatesIcon</a>()
<a name="l00237"></a>00237 {
<a name="l00238"></a>00238   <span class="keyword">delete</span> <a class="code" href="classStatusWidget.html#3508a3c0d24b2f3787e41e0921e750fb" title="Update available label.">updateAvailable</a>;
<a name="l00239"></a>00239   <a class="code" href="classStatusWidget.html#3508a3c0d24b2f3787e41e0921e750fb" title="Update available label.">updateAvailable</a> = NULL;
<a name="l00240"></a>00240 }
<a name="l00241"></a>00241 <span class="comment">//==============================================</span>
<a name="l00242"></a><a class="code" href="classStatusWidget.html#b9b7a539b643bbd3efade444a9f63b58">00242</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#b9b7a539b643bbd3efade444a9f63b58">StatusWidget::grabInput</a>()
<a name="l00243"></a>00243 {
<a name="l00244"></a>00244   grabKeyboard();
<a name="l00245"></a>00245   grabMouse(); 
<a name="l00246"></a>00246 }
<a name="l00247"></a>00247 <span class="comment">//==============================================</span>
<a name="l00248"></a><a class="code" href="classStatusWidget.html#286c1c7b47ba6b0727f5480bb47275bb">00248</a> <span class="keywordtype">void</span> <a class="code" href="classStatusWidget.html#286c1c7b47ba6b0727f5480bb47275bb">StatusWidget::releaseInput</a>()
<a name="l00249"></a>00249 {
<a name="l00250"></a>00250   releaseKeyboard();
<a name="l00251"></a>00251   releaseMouse();
<a name="l00252"></a>00252 }
<a name="l00253"></a>00253 <span class="comment">//==============================================</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:27 2009 for AlbumShaper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>