Sophie

Sophie

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

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: alertDialog.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>alertDialog.cpp</h1><a href="alertDialog_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;qdialog.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;qlayout.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;qlabel.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;qtextedit.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;qfont.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;qpushbutton.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;qpixmap.h&gt;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="comment">//Projectwide includes</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="alertDialog_8h.html">alertDialog.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "../../config.h"</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="comment">//==============================================</span>
<a name="l00025"></a><a class="code" href="classAlertDialog.html#b7aea99441443423111a042693519644">00025</a> <a class="code" href="classAlertDialog.html#b7aea99441443423111a042693519644" title="Basic constructor.">AlertDialog::AlertDialog</a>( QString message,
<a name="l00026"></a>00026                                   QString description,
<a name="l00027"></a>00027                                   QString alertIconName,
<a name="l00028"></a>00028                                   <a class="code" href="classQWidget.html">QWidget</a>* parent,
<a name="l00029"></a>00029                                   <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) :
<a name="l00030"></a>00030                                   <a class="code" href="classQDialog.html">QDialog</a>(parent, name, true )
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032   <span class="comment">//-------------------------------</span>
<a name="l00033"></a>00033   <span class="comment">//create widgets</span>
<a name="l00034"></a>00034   <a class="code" href="classAlertDialog.html#55fa42eed5e59028bc37621e50845e30" title="Top and bottom frames.">topFrame</a> = <span class="keyword">new</span> <a class="code" href="classQFrame.html">QFrame</a>( <span class="keyword">this</span> );
<a name="l00035"></a>00035 
<a name="l00036"></a>00036   <a class="code" href="classAlertDialog.html#d339d7b13e67d13a17081acb3a0199c0" title="Message displayed in window.">alertText</a> = <span class="keyword">new</span> <a class="code" href="classQLabel.html">QLabel</a>( <a class="code" href="classAlertDialog.html#55fa42eed5e59028bc37621e50845e30" title="Top and bottom frames.">topFrame</a> );
<a name="l00037"></a>00037   <a class="code" href="classAlertDialog.html#d339d7b13e67d13a17081acb3a0199c0" title="Message displayed in window.">alertText</a>-&gt;setText( message );
<a name="l00038"></a>00038   
<a name="l00039"></a>00039   QFont alertFont = <a class="code" href="classAlertDialog.html#d339d7b13e67d13a17081acb3a0199c0" title="Message displayed in window.">alertText</a>-&gt;font();
<a name="l00040"></a>00040   alertFont.setWeight(QFont::Bold);
<a name="l00041"></a>00041   <a class="code" href="classAlertDialog.html#d339d7b13e67d13a17081acb3a0199c0" title="Message displayed in window.">alertText</a>-&gt;setFont( alertFont );
<a name="l00042"></a>00042 
<a name="l00043"></a>00043   <a class="code" href="classAlertDialog.html#e67fea12ccbc008bb58b6a50ffd5a34a" title="Alert icon.">alertIcon</a> = <span class="keyword">new</span> QPixmap(QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+alertIconName);
<a name="l00044"></a>00044   <a class="code" href="classAlertDialog.html#7e81fc1c47cde96ca54033cded01d749" title="Label which shows alert icon.">alertIconLabel</a> = <span class="keyword">new</span> <a class="code" href="classQLabel.html">QLabel</a>( <a class="code" href="classAlertDialog.html#55fa42eed5e59028bc37621e50845e30" title="Top and bottom frames.">topFrame</a> );
<a name="l00045"></a>00045   <a class="code" href="classAlertDialog.html#7e81fc1c47cde96ca54033cded01d749" title="Label which shows alert icon.">alertIconLabel</a>-&gt;setPixmap( *<a class="code" href="classAlertDialog.html#e67fea12ccbc008bb58b6a50ffd5a34a" title="Alert icon.">alertIcon</a> );
<a name="l00046"></a>00046 
<a name="l00047"></a>00047   <a class="code" href="classAlertDialog.html#eed97a15a81fdf31bd6158dc09be45f2" title="Description displayed in window.">descriptionText</a> = <span class="keyword">new</span> <a class="code" href="classQTextEdit.html">QTextEdit</a>( <span class="keyword">this</span> );
<a name="l00048"></a>00048   <a class="code" href="classAlertDialog.html#eed97a15a81fdf31bd6158dc09be45f2" title="Description displayed in window.">descriptionText</a>-&gt;setReadOnly(<span class="keyword">true</span>);
<a name="l00049"></a>00049   <a class="code" href="classAlertDialog.html#eed97a15a81fdf31bd6158dc09be45f2" title="Description displayed in window.">descriptionText</a>-&gt;setText( description );
<a name="l00050"></a>00050 
<a name="l00051"></a>00051   <a class="code" href="classAlertDialog.html#8fd835bc05b07fd4fb34a8d4179493e4">bottomFrame</a> = <span class="keyword">new</span> <a class="code" href="classQFrame.html">QFrame</a>( <span class="keyword">this</span> );
<a name="l00052"></a>00052   <a class="code" href="classAlertDialog.html#d9869083a0e1c6cf511d20af4491f494" title="Ok button.">okButton</a> = <span class="keyword">new</span> QPushButton( tr(<span class="stringliteral">"OK"</span>), <a class="code" href="classAlertDialog.html#8fd835bc05b07fd4fb34a8d4179493e4">bottomFrame</a> );
<a name="l00053"></a>00053   <a class="code" href="classAlertDialog.html#d9869083a0e1c6cf511d20af4491f494" title="Ok button.">okButton</a>-&gt;setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
<a name="l00054"></a>00054   <a class="code" href="classAlertDialog.html#d9869083a0e1c6cf511d20af4491f494" title="Ok button.">okButton</a>-&gt;setDefault(<span class="keyword">true</span>);
<a name="l00055"></a>00055   <a class="code" href="classAlertDialog.html#d9869083a0e1c6cf511d20af4491f494" title="Ok button.">okButton</a>-&gt;setFocus();
<a name="l00056"></a>00056 
<a name="l00057"></a>00057   connect( <a class="code" href="classAlertDialog.html#d9869083a0e1c6cf511d20af4491f494" title="Ok button.">okButton</a>, SIGNAL(clicked()), SLOT(accept()) );
<a name="l00058"></a>00058   <span class="comment">//-------------------------------</span>
<a name="l00059"></a>00059   <span class="comment">//create grid and place widgets</span>
<a name="l00060"></a>00060   <a class="code" href="classAlertDialog.html#c8df4978addd21fe813e3848d647920e" title="Grids objects placed in.">gridTop</a>     = <span class="keyword">new</span> QGridLayout( <a class="code" href="classAlertDialog.html#55fa42eed5e59028bc37621e50845e30" title="Top and bottom frames.">topFrame</a>, 1, 2, 0);
<a name="l00061"></a>00061   <a class="code" href="classAlertDialog.html#c8df4978addd21fe813e3848d647920e" title="Grids objects placed in.">gridTop</a>-&gt;addWidget( <a class="code" href="classAlertDialog.html#d339d7b13e67d13a17081acb3a0199c0" title="Message displayed in window.">alertText</a>, 0, 0 );
<a name="l00062"></a>00062   <a class="code" href="classAlertDialog.html#c8df4978addd21fe813e3848d647920e" title="Grids objects placed in.">gridTop</a>-&gt;addWidget( <a class="code" href="classAlertDialog.html#7e81fc1c47cde96ca54033cded01d749" title="Label which shows alert icon.">alertIconLabel</a>, 0, 1, Qt::AlignRight );
<a name="l00063"></a>00063 
<a name="l00064"></a>00064   <a class="code" href="classAlertDialog.html#adf46bd7937fc62fcef201f284d4fdca">gridBottom</a>  = <span class="keyword">new</span> QGridLayout( <a class="code" href="classAlertDialog.html#8fd835bc05b07fd4fb34a8d4179493e4">bottomFrame</a>, 1, 1, 0);
<a name="l00065"></a>00065   <a class="code" href="classAlertDialog.html#adf46bd7937fc62fcef201f284d4fdca">gridBottom</a>-&gt;addWidget( <a class="code" href="classAlertDialog.html#d9869083a0e1c6cf511d20af4491f494" title="Ok button.">okButton</a>, 0, 0 );
<a name="l00066"></a>00066 
<a name="l00067"></a>00067   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>    = <span class="keyword">new</span> QGridLayout( <span class="keyword">this</span>, 3, 1, 0);
<a name="l00068"></a>00068   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;addWidget( <a class="code" href="classAlertDialog.html#55fa42eed5e59028bc37621e50845e30" title="Top and bottom frames.">topFrame</a>, 0, 0);
<a name="l00069"></a>00069   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;addWidget( <a class="code" href="classAlertDialog.html#eed97a15a81fdf31bd6158dc09be45f2" title="Description displayed in window.">descriptionText</a>, 1, 0);
<a name="l00070"></a>00070   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;addWidget( <a class="code" href="classAlertDialog.html#8fd835bc05b07fd4fb34a8d4179493e4">bottomFrame</a>, 2, 0);
<a name="l00071"></a>00071 
<a name="l00072"></a>00072   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;setRowStretch( 1, 1 );
<a name="l00073"></a>00073   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;setResizeMode( QLayout::FreeResize );
<a name="l00074"></a>00074   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;setMargin(<a class="code" href="config_8h.html#07d364596a27705c900f07340515d5db">WIDGET_SPACING</a>);
<a name="l00075"></a>00075   <a class="code" href="classAlertDialog.html#b698c37a23a4466f30be6a10a682bb1e">gridFull</a>-&gt;setSpacing(<a class="code" href="config_8h.html#07d364596a27705c900f07340515d5db">WIDGET_SPACING</a>);
<a name="l00076"></a>00076 
<a name="l00077"></a>00077   setMinimumWidth(300);
<a name="l00078"></a>00078   setMaximumWidth(300);
<a name="l00079"></a>00079   <span class="comment">//-------------------------------</span>
<a name="l00080"></a>00080   <span class="comment">//setup window title bar</span>
<a name="l00081"></a>00081   setCaption( message );
<a name="l00082"></a>00082   <span class="comment">//-------------------------------</span>
<a name="l00083"></a>00083   <span class="comment">//set window to not be resizeable</span>
<a name="l00084"></a>00084   this-&gt;show();
<a name="l00085"></a>00085   setFixedSize(size());
<a name="l00086"></a>00086   <span class="comment">//-------------------------------</span>
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088 <span class="comment">//==============================================</span>
<a name="l00089"></a><a class="code" href="classAlertDialog.html#5ea8838b691df53710d053c592ce2c7c">00089</a> <a class="code" href="classAlertDialog.html#5ea8838b691df53710d053c592ce2c7c" title="Destructor.">AlertDialog::~AlertDialog</a>()
<a name="l00090"></a>00090 {
<a name="l00091"></a>00091   <span class="keyword">delete</span> <a class="code" href="classAlertDialog.html#e67fea12ccbc008bb58b6a50ffd5a34a" title="Alert icon.">alertIcon</a>;
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 <span class="comment">//==============================================</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:25 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>